Compare commits
50 Commits
Author | SHA1 | Date | |
---|---|---|---|
5ef2ec3205 | |||
4b730b235f | |||
b52b170375 | |||
2e504f4d9a | |||
8cae504492 | |||
0784d16634 | |||
cc356b587e | |||
6046915770 | |||
408aeedb0f | |||
50f401315b | |||
5a80fd1ae3 | |||
4624961c90 | |||
4348bb6304 | |||
62e5c00d5d | |||
43e6bca89e | |||
2384cc0d6b | |||
d99ee0e9a2 | |||
deb40f8da2 | |||
1e36d67c02 | |||
7e13e80f86 | |||
f125468c95 | |||
90013f697b | |||
6dee6bd875 | |||
5dfcce73bc | |||
388d673c86 | |||
109eaae501 | |||
baa657798d | |||
4a6930bf48 | |||
54cdbef779 | |||
22f4beb642 | |||
74116ef38b | |||
46e8d0bd68 | |||
ff98608d49 | |||
c95cc735ff | |||
ffcee73017 | |||
f618948db1 | |||
afa29f9b69 | |||
9d731daac6 | |||
fca6e7bd84 | |||
93670d7261 | |||
0766c9cb64 | |||
f00987a123 | |||
4be28945b5 | |||
cccc3e6852 | |||
3694aec33b | |||
22a32fb1d3 | |||
f88a332dce | |||
cc2862fe92 | |||
72441407f3 | |||
623a99ea5e |
1
.gitignore
vendored
1
.gitignore
vendored
@ -20,4 +20,3 @@ build
|
||||
# other
|
||||
eclipse
|
||||
run
|
||||
rundir
|
||||
|
23
README.md
23
README.md
@ -1,10 +1,19 @@
|
||||
# ORBITAL SATELLITE mod for Minecraft
|
||||
# ORBITAL SATELLITE - Pig Striker !!!
|
||||
[](https://ci.jcsmith.fr/job/OrbitalSatellite/)
|
||||
|
||||
Une reprise du mod (mort) ORBITAL BOMBARDMENT de la 1.6.4. Celui ci permet d'ajouter
|
||||
au jeu de nouveaux blocs et items pour tirer de puissantes salves destructrices sur
|
||||
vos fuc***** cochons !
|
||||
## Description
|
||||
Ce mod est une reprise du mod Orbital Bombardment de la 1.6.4.
|
||||
|
||||
Bien sûr pour le moment je compte seulement porter le mod sur la 1.7.10/1.10.2.
|
||||
Après peut être je continuerai à ajouter des élèments pour agrandir ces fonctionnalités.
|
||||
Il permet d'ajouter à vos mondes minecraft ~~de la pollution spatiale~~ des satellites orbitaux assurant le support, la défense ou de la puissance offensive au joueur les utilisant.
|
||||
|
||||
En attente de plus détails...
|
||||
## Contenu
|
||||
*A DEV...*
|
||||
- Defender
|
||||
- Plateforme de lancement
|
||||
- Satellites
|
||||
- Super-calculateur
|
||||
- Plateforme de contrĂ´le
|
||||
|
||||
## Crédits
|
||||
Created by JackCarterSmith
|
||||
Inspired by Thaumcraft, Draconic Evolution and Immersive Engineering
|
||||
|
@ -1 +0,0 @@
|
||||
theme: jekyll-theme-slate
|
212
build.gradle
212
build.gradle
@ -1,82 +1,132 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = "forge"
|
||||
url = "http://files.minecraftforge.net/maven"
|
||||
}
|
||||
maven {
|
||||
name = "sonatype"
|
||||
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "0.1.8"
|
||||
group= "fr.jackcartersmith.orbsat" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "OrbitalSatellite"
|
||||
|
||||
apply plugin: 'java'
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
|
||||
minecraft {
|
||||
version = "1.7.10-10.13.4.1558-1.7.10"
|
||||
replace '${version}', project.version
|
||||
runDir = "eclipse"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// you may put jars on which you depend on in ./libs
|
||||
// or you may define them like so..
|
||||
//compile "some.group:artifact:version:classifier"
|
||||
//compile "some.group:artifact:version"
|
||||
|
||||
// real examples
|
||||
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
|
||||
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
|
||||
|
||||
// for more info...
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||
|
||||
compile fileTree(dir: 'externalLibs', include: '*.jar')
|
||||
|
||||
}
|
||||
|
||||
processResources
|
||||
{
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include 'mcmod.info'
|
||||
|
||||
// replace version and mcversion
|
||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude 'mcmod.info'
|
||||
}
|
||||
}
|
||||
|
||||
task deobfJar(type: Jar) {
|
||||
from sourceSets.main.output
|
||||
classifier = 'deobf'
|
||||
manifest {
|
||||
attributes 'FMLAT': 'OrbitalSatellite_dc.cfg'
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives deobfJar
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url = "http://files.minecraftforge.net/maven" }
|
||||
}
|
||||
dependencies {
|
||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
||||
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
name = "JEI"
|
||||
url "http://dvs1.progwml6.com/files/maven"
|
||||
}
|
||||
maven { // HWYLA
|
||||
name "TehNuts WAILA fork"
|
||||
url "http://tehnut.info/maven"
|
||||
}
|
||||
maven { // OpenComputers
|
||||
name "OpenComputers"
|
||||
url "http://maven.cil.li/"
|
||||
}
|
||||
repositories {//Curseforge maven, in case some other maven goes offline
|
||||
maven {
|
||||
name = "CurseForge"
|
||||
url = "https://minecraft.curseforge.com/api/maven/"
|
||||
}
|
||||
}
|
||||
/*maven { //IC2
|
||||
name = "ic2"
|
||||
url = "http://maven.ic2.player.to/"
|
||||
}*/
|
||||
maven {
|
||||
name = "CoFH Maven"
|
||||
url = "http://maven.covers1624.net"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
|
||||
ext.buildNumber = "0"
|
||||
if (System.getenv("BUILD_NUMBER") != null) {
|
||||
buildNumber = System.getenv("BUILD_NUMBER")
|
||||
|
||||
}
|
||||
|
||||
version = "$baseVersion.$buildNumber"
|
||||
group = "fr.jackcartersmith.orbsat"
|
||||
archivesBaseName = "OrbitalSatellite-$project.minecraftVersion"
|
||||
|
||||
sourceCompatibility = targetCompatibility = 1.8
|
||||
compileJava {
|
||||
sourceCompatibility = targetCompatibility = 1.8
|
||||
}
|
||||
|
||||
minecraft {
|
||||
version = "$project.minecraftVersion-$project.forgeVersion"
|
||||
runDir = "eclipse"
|
||||
|
||||
mappings = "stable_39"
|
||||
//mappings = "snapshot_20171003"
|
||||
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// you may put jars on which you depend on in ./libs
|
||||
// or you may define them like so..
|
||||
//compile "some.group:artifact:version:classifier"
|
||||
//compile "some.group:artifact:version"
|
||||
|
||||
// real examples
|
||||
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
|
||||
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
|
||||
|
||||
// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
|
||||
//provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
|
||||
// the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
|
||||
// except that these dependencies get remapped to your current MCP mappings
|
||||
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
//deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
||||
|
||||
// for more info...
|
||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
||||
|
||||
compile "mezz.jei:jei_1.12.2:4.10.+:api"
|
||||
deobfCompile "cofh:RedstoneFlux:1.12-2.1.0.6:universal"
|
||||
compile "li.cil.oc:OpenComputers:MC1.12.2-1.7.+:api"
|
||||
compile "mcp.mobius.waila:Hwyla:1.8.26-B41_1.12.2:api"
|
||||
//compileOnly 'industrial-craft:industrialcraft-2:release:ex112'//'net.industrial-craft:industrialcraft-2:2.8.+'
|
||||
//compileOnly 'baubles:Baubles:1.12:1.5.2'
|
||||
}
|
||||
|
||||
task signJar(type: SignJar, dependsOn: reobfJar) {
|
||||
onlyIf { // Skip the task if our secret data isn't available
|
||||
project.hasProperty('keyStore')
|
||||
}
|
||||
dependsOn reobfJar
|
||||
if (project.hasProperty('keyStore')) { // This needs to be a path to the keystore file
|
||||
keyStore = project.keyStore
|
||||
alias = project.keyStoreAlias
|
||||
storePass = project.keyStorePass
|
||||
keyPass = project.keyStoreKeyPass
|
||||
inputFile = jar.archivePath
|
||||
outputFile = jar.archivePath
|
||||
}
|
||||
}
|
||||
build.dependsOn signJar
|
||||
|
||||
processResources {
|
||||
// this will ensure that this task is redone when the versions change.
|
||||
inputs.property "version", project.version
|
||||
inputs.property "mcversion", project.minecraft.version
|
||||
|
||||
// replace stuff in mcmod.info, nothing else
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
include "mcmod.info"
|
||||
|
||||
// replace version and mcversion
|
||||
expand "version": project.version, "mcversion": "1.12.2"
|
||||
}
|
||||
|
||||
// copy everything else, thats not the mcmod.info
|
||||
from(sourceSets.main.resources.srcDirs) {
|
||||
exclude "mcmod.info"
|
||||
}
|
||||
}
|
Binary file not shown.
@ -1,4 +0,0 @@
|
||||
#Sun Jun 05 18:58:07 CEST 2011
|
||||
version=1
|
||||
eclipse.preferences.version=1
|
||||
refresh.enabled=true
|
@ -1,7 +0,0 @@
|
||||
#Sun Jun 05 19:03:53 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.debug.ui.UseContextualLaunch=false
|
||||
Console.highWaterMark=88000
|
||||
org.eclipse.debug.ui.PREF_LAUNCH_PERSPECTIVES=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<launchPerspectives/>\r\n
|
||||
org.eclipse.debug.ui.user_view_bindings=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?>\r\n<viewBindings>\r\n<view id\="org.eclipse.ui.console.ConsoleView">\r\n<perspective id\="org.eclipse.jdt.ui.JavaPerspective" userAction\="opened"/>\r\n</view>\r\n</viewBindings>\r\n
|
||||
StringVariablePreferencePage=130,107,107,86,
|
@ -1,3 +0,0 @@
|
||||
#Sun Jun 05 18:58:07 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.epp.usagedata.gathering.enabled=false
|
@ -1,14 +0,0 @@
|
||||
#Sun Sep 18 16:44:39 NZST 2011
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.deprecation=ignore
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedLocal=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedImport=ignore
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
@ -1,4 +0,0 @@
|
||||
#Sun Jun 05 18:58:05 CEST 2011
|
||||
spacesForTabs=true
|
||||
eclipse.preferences.version=1
|
||||
overviewRuler_migration=migrated_3.1
|
@ -1,9 +0,0 @@
|
||||
#Sun Jun 05 18:58:07 CEST 2011
|
||||
IMPORT_FILES_AND_FOLDERS_MODE=prompt
|
||||
IMPORT_FILES_AND_FOLDERS_VIRTUAL_FOLDER_MODE=prompt
|
||||
SAVE_ALL_BEFORE_BUILD=true
|
||||
eclipse.preferences.version=1
|
||||
tipsAndTricks=true
|
||||
platformState=1287081747687
|
||||
quickStart=false
|
||||
PROBLEMS_FILTERS_MIGRATE=true
|
@ -1,3 +0,0 @@
|
||||
#Sun Jun 05 18:50:08 CEST 2011
|
||||
eclipse.preferences.version=1
|
||||
showIntro=false
|
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Minecraft/lib/net/minecraft/launchwrapper/1.8/launchwrapper-1.8.jar"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="GradleStart"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Minecraft"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xincgc -Xmx1024M -Xms1024M"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
|
||||
</launchConfiguration>
|
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Minecraft/src/net/minecraft/server/MinecraftServer.java"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="GradleStartServer"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Minecraft"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xincgc -Xmx1024M -Xms1024M"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}"/>
|
||||
</launchConfiguration>
|
@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchHistory>
|
||||
<launchGroup id="org.eclipse.ui.externaltools.launchGroup">
|
||||
<mruHistory/>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.debug.ui.launchGroup.profile">
|
||||
<mruHistory/>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.debug.ui.launchGroup.debug">
|
||||
<mruHistory>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Client"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Server"/> "/>
|
||||
</mruHistory>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
<launchGroup id="org.eclipse.debug.ui.launchGroup.run">
|
||||
<mruHistory>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Client"/> "/>
|
||||
<launch memento="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration local="true" path="Server"/> "/>
|
||||
</mruHistory>
|
||||
<favorites/>
|
||||
</launchGroup>
|
||||
</launchHistory>
|
7
gradle.properties
Normal file
7
gradle.properties
Normal file
@ -0,0 +1,7 @@
|
||||
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
|
||||
# This is required to provide enough memory for the Minecraft decompilation process.
|
||||
baseVersion=1.0
|
||||
minecraftVersion=1.12.2
|
||||
forgeVersion=14.23.5.2838
|
||||
org.gradle.jvmargs=-Xmx4G
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,5 @@
|
||||
#Wed Jul 02 15:54:47 CDT 2014
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
|
||||
|
110
gradlew
vendored
110
gradlew
vendored
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
@ -6,47 +6,6 @@
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn ( ) {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die ( ) {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
@ -61,9 +20,49 @@ while [ -h "$PRG" ] ; do
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS=""
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
@ -90,7 +89,7 @@ location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
@ -114,6 +113,7 @@ fi
|
||||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
@ -154,11 +154,19 @@ if $cygwin ; then
|
||||
esac
|
||||
fi
|
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||
function splitJvmOpts() {
|
||||
JVM_OPTS=("$@")
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
|
174
gradlew.bat
vendored
174
gradlew.bat
vendored
@ -1,90 +1,84 @@
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windowz variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
goto execute
|
||||
|
||||
:4NT_args
|
||||
@rem Get arguments from the 4NT Shell from JP Software
|
||||
set CMD_LINE_ARGS=%$
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS=
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
|
@ -1,35 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import fr.jackcartersmith.ob.entities.MeteorEntity;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
public class OBNetwork$1 extends Thread
|
||||
{
|
||||
final Random val$random;
|
||||
final EntityPlayerMP val$playerMP;
|
||||
final int val$fx;
|
||||
final int val$fy;
|
||||
final int val$fz;
|
||||
|
||||
OBNetwork$1(Random var2, EntityPlayerMP var3, int var4, int var5, int var6){
|
||||
this.val$random = var2;
|
||||
this.val$playerMP = var3;
|
||||
this.val$fx = var4;
|
||||
this.val$fy = var5;
|
||||
this.val$fz = var6;
|
||||
}
|
||||
|
||||
public void run(){
|
||||
try{
|
||||
Thread.sleep((long)this.val$random.nextInt(2000));
|
||||
this.val$playerMP.worldObj.playSoundAtEntity(this.val$playerMP, "ob:reentry", 5.0F, 1.0F);
|
||||
this.val$playerMP.worldObj.playSoundAtEntity(this.val$playerMP, "ob:booming", 8.0F, 2.0F);
|
||||
this.val$playerMP.worldObj.spawnEntityInWorld(new MeteorEntity(this.val$playerMP.worldObj, this.val$fx, this.val$fy, this.val$fz));
|
||||
}
|
||||
catch (InterruptedException var2){
|
||||
var2.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,232 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class OBNetwork implements IMessage
|
||||
{
|
||||
private List<Integer> dataArray = new ArrayList<Integer>();
|
||||
|
||||
public OBNetwork() {}
|
||||
|
||||
public OBNetwork(List<Integer> dataArray) {
|
||||
this.dataArray = dataArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf){
|
||||
for (int i = 0; i < 5; i++){
|
||||
this.dataArray.add(buf.readInt());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf){
|
||||
for (int i = 0; i < 5; i++){
|
||||
buf.writeInt(this.dataArray.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<OBNetwork, IMessage>{
|
||||
int function;
|
||||
int xCoord;
|
||||
int yCoord;
|
||||
int zCoord;
|
||||
int data_value;
|
||||
|
||||
public void sendChangeToClient(int xCoord, int yCoord, int zCoord, int chargeLevel)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(5);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(chargeLevel);
|
||||
|
||||
/*
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
packet.channel = "OB";
|
||||
packet.data = bos.toByteArray();
|
||||
packet.length = bos.size();
|
||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
||||
*/
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(OBNetwork message, MessageContext ctx){
|
||||
EntityPlayer sender = ctx.getServerHandler().playerEntity;
|
||||
EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
|
||||
try{
|
||||
this.function = message.dataArray.get(0);
|
||||
}catch(Exception var22){
|
||||
var22.printStackTrace();
|
||||
}
|
||||
|
||||
try{
|
||||
|
||||
|
||||
if (this.function == 2){
|
||||
this.xCoord = message.dataArray.get(1);
|
||||
this.yCoord = message.dataArray.get(2);
|
||||
this.zCoord = message.dataArray.get(3);
|
||||
this.data_value = message.dataArray.get(4);
|
||||
|
||||
try{
|
||||
List charge1 = player.worldObj.getEntitiesWithinAABB(EntityLiving.class,
|
||||
AxisAlignedBB.getBoundingBox((double)(this.xCoord - this.data_value / 3),
|
||||
(double)(this.yCoord - this.data_value / 3), (double)(this.zCoord - this.data_value / 3),
|
||||
(double)(this.xCoord + this.data_value / 3), (double)(this.yCoord + this.data_value / 3),
|
||||
(double)(this.zCoord + this.data_value / 3)));
|
||||
|
||||
if (charge1.size() > 0){
|
||||
for(int y = 0; y <= charge1.size() - 1; y++){
|
||||
Random next = new Random();
|
||||
EntityLiving e1 = (EntityLiving)charge1.get(y);
|
||||
e1.setHealth(0.5F);
|
||||
e1.motionY = (double)(this.data_value / 5);
|
||||
e1.motionX = next.nextGaussian() * 5.0D;
|
||||
e1.motionZ = next.nextGaussian() * 5.0D;
|
||||
}
|
||||
}
|
||||
}catch(Exception var27){
|
||||
var27.printStackTrace();
|
||||
}
|
||||
|
||||
if (this.data_value <= 10){
|
||||
player.worldObj.playSoundAtEntity(player, "ob:explode", 0.3F, 5.0F);
|
||||
}
|
||||
|
||||
if (this.data_value > 10 && this.data_value <= 40){
|
||||
player.worldObj.playSoundAtEntity(player, "ob:explode", 0.3F, 1.5F);
|
||||
}
|
||||
|
||||
if (this.data_value > 40){
|
||||
player.worldObj.playSoundAtEntity(player, "ob:explode", 0.4F, 0.3F);
|
||||
}
|
||||
|
||||
player.worldObj.createExplosion((Entity)null, (double)this.xCoord, (double)this.yCoord, (double)this.zCoord, (float)this.data_value, true);
|
||||
}
|
||||
|
||||
if (this.function == 5 && message != null){
|
||||
this.xCoord = message.dataArray.get(1);
|
||||
this.yCoord = message.dataArray.get(2);
|
||||
this.zCoord = message.dataArray.get(3);
|
||||
Random rand = new Random();
|
||||
OBNetwork$1 obNetworkServerThread = new OBNetwork$1(rand, player,this.xCoord, this.yCoord, this.zCoord);
|
||||
obNetworkServerThread.start();
|
||||
}
|
||||
|
||||
if (this.function == 9){
|
||||
this.xCoord = message.dataArray.get(1);
|
||||
this.yCoord = message.dataArray.get(2);
|
||||
this.zCoord = message.dataArray.get(3);
|
||||
player.worldObj.spawnEntityInWorld(new EntityLightningBolt(player.worldObj, (double)this.xCoord, (double)this.yCoord, (double)this.zCoord));
|
||||
}
|
||||
|
||||
if (this.function == 12){
|
||||
synchronized (sender){
|
||||
this.xCoord = message.dataArray.get(1);
|
||||
this.yCoord = message.dataArray.get(2);
|
||||
this.zCoord = message.dataArray.get(3);
|
||||
this.data_value = message.dataArray.get(4);
|
||||
World world = player.worldObj;
|
||||
boolean var35 = false;
|
||||
int var36 = this.yCoord + 1;
|
||||
world.playSoundAtEntity(player, "ob:digging", 0.7F, 0.3F);
|
||||
|
||||
do{
|
||||
--var36;
|
||||
|
||||
try{
|
||||
Block found = world.getBlock(this.xCoord, var36, this.zCoord);
|
||||
ItemStack itemBlock = new ItemStack(found);
|
||||
new Random();
|
||||
EntityItem droppedItem = new EntityItem(world, (double)this.xCoord, (double)this.yCoord, (double)this.zCoord, itemBlock);
|
||||
Random rand = new Random();
|
||||
droppedItem.motionX = rand.nextGaussian() / 10.0D;
|
||||
droppedItem.motionY = 0.8D;
|
||||
droppedItem.motionZ = rand.nextGaussian() / 10.0D;
|
||||
world.spawnEntityInWorld(droppedItem);
|
||||
world.setBlockToAir(this.xCoord, var36, this.zCoord);
|
||||
Thread.sleep(5L);
|
||||
}catch(NullPointerException var23){
|
||||
}catch(ConcurrentModificationException var24){
|
||||
break;
|
||||
}catch(Exception var25){}
|
||||
}while(world.getBlock(this.xCoord, var36 - 1, this.zCoord) != Blocks.bedrock
|
||||
&& world.getBlock(this.xCoord, var36 - 1, this.zCoord) != Blocks.flowing_lava
|
||||
&& world.getBlock(this.xCoord, var36 - 1, this.zCoord) != Blocks.lava
|
||||
&& world.getBlock(this.xCoord, var36 - 1, this.zCoord) != Blocks.flowing_water
|
||||
&& world.getBlock(this.xCoord, var36 - 1, this.zCoord) != Blocks.water);
|
||||
|
||||
world.setBlockToAir(this.xCoord, this.yCoord + 1, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 15){
|
||||
this.xCoord = message.dataArray.get(1);
|
||||
this.yCoord = message.dataArray.get(2);
|
||||
this.zCoord = message.dataArray.get(3);
|
||||
this.data_value = message.dataArray.get(4);
|
||||
OverriderBlockTileEntity overrider = (OverriderBlockTileEntity)player.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
||||
overrider.currentCharge -= this.data_value;
|
||||
--overrider.shotsLeft;
|
||||
}
|
||||
|
||||
if (this.function == 18){
|
||||
this.xCoord = message.dataArray.get(1);
|
||||
this.yCoord = message.dataArray.get(2);
|
||||
this.zCoord = message.dataArray.get(3);
|
||||
this.data_value = message.dataArray.get(4);
|
||||
player.worldObj.playSoundAtEntity(player, "ob:satelliteLaunch", 1.0F, 1.0F);
|
||||
OverriderBlockTileEntity overrider = (OverriderBlockTileEntity)player.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
||||
overrider.shotsLeft += this.data_value;
|
||||
overrider.currentCharge -= OSConstants.SateliteLaunchPUCost;
|
||||
this.sendChangeToClient(this.xCoord, this.yCoord, this.zCoord, this.data_value);
|
||||
}
|
||||
|
||||
if (this.function == 21){
|
||||
this.xCoord = message.dataArray.get(1);
|
||||
this.yCoord = message.dataArray.get(2);
|
||||
this.zCoord = message.dataArray.get(3);
|
||||
this.data_value = message.dataArray.get(4);
|
||||
player.worldObj.removeTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
||||
player.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
if (this.function == 24){
|
||||
player.worldObj.playSoundAtEntity(player, "ob:start", 1.0F, 1.0F);
|
||||
player.worldObj.playSoundAtEntity(player, "ob:middle", 1.0F, 0.7F);
|
||||
}
|
||||
|
||||
}catch(Exception var28){}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,177 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import fr.jackcartersmith.ob.blocks.ExtenderTileEntity;
|
||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
||||
import fr.jackcartersmith.ob.interfaces.PhotonRecieving;
|
||||
import fr.jackcartersmith.ob.interfaces.PhotonSending;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
public class OBNetworkClient implements IMessage
|
||||
{
|
||||
private List<Integer> dataArray = new ArrayList<Integer>();
|
||||
|
||||
public OBNetworkClient() {}
|
||||
|
||||
public OBNetworkClient(List<Integer> dataArray) {
|
||||
this.dataArray = dataArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf){
|
||||
for (int i = 0; i < 5; i++){
|
||||
this.dataArray.add(buf.readInt());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf){
|
||||
for (int i = 0; i < 5; i++){
|
||||
buf.writeInt(this.dataArray.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<OBNetworkClient, IMessage>{
|
||||
int function;
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int data_value;
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(OBNetworkClient message, MessageContext ctx){
|
||||
try{
|
||||
this.function = message.dataArray.get(0);
|
||||
this.x = message.dataArray.get(1);
|
||||
this.y = message.dataArray.get(2);
|
||||
this.z = message.dataArray.get(3);
|
||||
this.data_value = message.dataArray.get(4);
|
||||
}catch(Exception var8){
|
||||
var8.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
System.out.println(this.function);
|
||||
System.out.println(this.x);
|
||||
System.out.println(this.y);
|
||||
System.out.println(this.z);
|
||||
System.out.println(this.data_value);
|
||||
*/
|
||||
|
||||
try{
|
||||
if (this.function == 1){
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
OverriderBlockTileEntity overrider = (OverriderBlockTileEntity)player.worldObj.getTileEntity(this.x, this.y, this.z);
|
||||
|
||||
if (overrider != null && overrider instanceof OverriderBlockTileEntity){
|
||||
overrider.currentCharge = this.data_value;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 3){
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
ExtenderTileEntity extender = (ExtenderTileEntity)player.worldObj.getTileEntity(this.x, this.y, this.z);
|
||||
|
||||
if (extender instanceof ExtenderTileEntity){
|
||||
extender.currentCharge = this.data_value;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 5){
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
OverriderBlockTileEntity overrider = (OverriderBlockTileEntity)player.worldObj.getTileEntity(this.x, this.y, this.z);
|
||||
|
||||
if (overrider instanceof OverriderBlockTileEntity){
|
||||
overrider.shotsLeft = this.data_value;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 7)
|
||||
{
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
PhotonSending ext2 = (PhotonSending)player.worldObj.getTileEntity(this.x, this.y, this.z);
|
||||
|
||||
if (ext2 instanceof PhotonSending)
|
||||
{
|
||||
ext2.setOutputRate(this.data_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 9)
|
||||
{
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
PhotonSending ext2 = (PhotonSending)player.worldObj.getTileEntity(this.x, this.y, this.z);
|
||||
|
||||
if (ext2 instanceof PhotonSending)
|
||||
{
|
||||
ext2.setScaledOutput(this.data_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 11)
|
||||
{
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
PhotonSending ext2 = (PhotonSending)player.worldObj.getTileEntity(this.x, this.y, this.z);
|
||||
|
||||
if (ext2 instanceof PhotonSending)
|
||||
{
|
||||
ext2.setListSize(this.data_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 13)
|
||||
{
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
PhotonRecieving ext3 = (PhotonRecieving)player.worldObj.getTileEntity(this.x, this.y, this.z);
|
||||
|
||||
if (ext3 instanceof PhotonRecieving)
|
||||
{
|
||||
ext3.setScaledOutput(this.data_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 15)
|
||||
{
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
PhotonRecieving ext3 = (PhotonRecieving)player.worldObj.getTileEntity(this.x, this.y, this.z);
|
||||
|
||||
if (ext3 instanceof PhotonRecieving)
|
||||
{
|
||||
ext3.setPowerIncoming(this.data_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 17)
|
||||
{
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
PhotonRecieving ext3 = (PhotonRecieving)player.worldObj.getTileEntity(this.x, this.y, this.z);
|
||||
|
||||
if (ext3 instanceof PhotonRecieving)
|
||||
{
|
||||
ext3.setCurrentCharge(this.data_value);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.function == 19)
|
||||
{
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
player.worldObj.playSoundEffect((double)this.x, (double)this.y, (double)this.z, "ob:defender_strike", 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
return null;
|
||||
}catch (Exception var7){
|
||||
//var7.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DefLasBlock extends BlockContainer
|
||||
{
|
||||
public DefLasBlock(Material par2Material)
|
||||
{
|
||||
super(par2Material);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 1000.0F, 0.0F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
||||
* is the only chance you get to register icons.
|
||||
*/
|
||||
public void registerIcons(IIconRegister icon) {}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
||||
return new DefenderLaserTileEntity();
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
||||
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
||||
* metadata
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6)
|
||||
{
|
||||
par1World.removeTileEntity(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of render function that is called for this block
|
||||
*/
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return ClientProxy.tesrRenderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DefenderBlock extends BlockContainer
|
||||
{
|
||||
public DefenderBlock(Material par2Material)
|
||||
{
|
||||
super(par2Material);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
||||
* is the only chance you get to register icons.
|
||||
*/
|
||||
public void registerIcons(IIconRegister icon) {}
|
||||
|
||||
/**
|
||||
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
||||
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
||||
* metadata
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6)
|
||||
{
|
||||
par1World.removeTileEntity(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
||||
return new DefenderTileEntity();
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of render function that is called for this block
|
||||
*/
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return ClientProxy.tesrRenderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
|
||||
{
|
||||
int rotation = MathHelper.floor_double((double)(entityliving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
|
||||
world.setBlockMetadataWithNotify(i, j, k, rotation - 1, rotation - 1);
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import fr.jackcartersmith.ob.interfaces.PhotonRecieving;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
||||
|
||||
public class DefenderLaserTileEntity extends PhotonRecieving
|
||||
{
|
||||
int ticksCount = 0;
|
||||
|
||||
/**
|
||||
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
|
||||
* ticks and creates a new spawn inside its implementation.
|
||||
*/
|
||||
public void updateEntity()
|
||||
{
|
||||
this.rotate += 1.0E-6F * (float)this.getCurrentCharge();
|
||||
|
||||
if ((double)this.rotate >= 3.141D)
|
||||
{
|
||||
this.rotate = -3.141F;
|
||||
}
|
||||
|
||||
if (this.ticksCount == 15)
|
||||
{
|
||||
List damages = this.getNearByEntitiesForDamage(this.xCoord, this.yCoord, this.zCoord);
|
||||
Iterator i$ = damages.iterator();
|
||||
|
||||
while (i$.hasNext())
|
||||
{
|
||||
EntityMob damage = (EntityMob)i$.next();
|
||||
DamageSource source = DamageSource.anvil;
|
||||
damage.attackEntityFrom(source, 10.0F);
|
||||
}
|
||||
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.worldObj.removeTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
||||
|
||||
if (!(this.worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord) instanceof DefenderTileEntity))
|
||||
{
|
||||
this.worldObj.createExplosion((Entity)null, (double)this.xCoord, (double)this.yCoord, (double)this.zCoord, 0.1F, true);
|
||||
}
|
||||
}
|
||||
|
||||
++this.ticksCount;
|
||||
}
|
||||
|
||||
public List getNearByEntitiesForDamage(int x, int y, int z)
|
||||
{
|
||||
int radius = OSConstants.DefenderRadius;
|
||||
List entities = this.worldObj.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getBoundingBox((double)(x - 5), (double)(y - 5), (double)(z - 5), (double)(x + 5), (double)(y + 5), (double)(z + 5)));
|
||||
return entities;
|
||||
}
|
||||
}
|
@ -1,104 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import fr.jackcartersmith.ob.interfaces.PhotonRecieving;
|
||||
import fr.jackcartersmith.orbsat.OBNetworkClient;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class DefenderTileEntity extends PhotonRecieving
|
||||
{
|
||||
int ticksCount = 0;
|
||||
|
||||
/**
|
||||
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
|
||||
* ticks and creates a new spawn inside its implementation.
|
||||
*/
|
||||
public void updateEntity()
|
||||
{
|
||||
this.rotate += 1.0E-6F * (float)this.getCurrentCharge();
|
||||
|
||||
if ((double)this.rotate >= 3.141D)
|
||||
{
|
||||
this.rotate = -3.141F;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote && this.getCurrentCharge() > 500)
|
||||
{
|
||||
++this.ticksCount;
|
||||
|
||||
if (this.ticksCount > 35)
|
||||
{
|
||||
this.sendChangeToClient17();
|
||||
this.ticksCount = 0;
|
||||
List entities = this.getNearByEntities();
|
||||
int thisX = this.xCoord;
|
||||
int thisY = this.yCoord;
|
||||
int thisZ = this.zCoord;
|
||||
Random random = new Random();
|
||||
|
||||
if (entities.size() > 0)
|
||||
{
|
||||
this.worldObj.playSoundEffect((double)thisX, (double)thisY, (double)thisZ, "ob:defenderLock", 1.0F, 1.0F);
|
||||
EntityMob mob = (EntityMob)entities.get(random.nextInt(entities.size()));
|
||||
|
||||
if (this.getCurrentCharge() > 500)
|
||||
{
|
||||
this.removeCharge(500);
|
||||
int x = (int)mob.lastTickPosX;
|
||||
int y = (int)mob.lastTickPosY;
|
||||
int z = (int)mob.lastTickPosZ;
|
||||
this.worldObj.setBlock(x, y, z, OSBlocks.laserDef);
|
||||
this.worldObj.setBlock(thisX, thisY + 1, thisZ, OSBlocks.laserDef);
|
||||
this.removeCharge(500);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getCurrentCharge() > 5000)
|
||||
{
|
||||
this.setCurrentCharge(5000);
|
||||
}
|
||||
}
|
||||
|
||||
public List getNearByEntities()
|
||||
{
|
||||
int radius = OSConstants.DefenderRadius;
|
||||
List entities = this.worldObj.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getBoundingBox((double)(this.xCoord - radius), (double)(this.yCoord - radius), (double)(this.zCoord - radius), (double)(this.xCoord + radius), (double)(this.yCoord + radius), (double)(this.zCoord + radius)));
|
||||
return entities;
|
||||
}
|
||||
|
||||
public void sendChangeToClient17()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(17);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(this.getCurrentCharge());
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToClient19()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(19);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(0);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ExtenderBlock extends BlockContainer
|
||||
{
|
||||
public ExtenderBlock(Material par2Material)
|
||||
{
|
||||
super(par2Material);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
||||
* is the only chance you get to register icons.
|
||||
*/
|
||||
public void registerIcons(IIconRegister icon)
|
||||
{
|
||||
this.blockIcon = icon.registerIcon("OB".toLowerCase() + ":extender");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called upon block activation (right click on the block.)
|
||||
*/
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
OrbitalSatellite.instance.lastExtenderX = par2;
|
||||
OrbitalSatellite.instance.lastExtenderY = par3;
|
||||
OrbitalSatellite.instance.lastExtenderZ = par4;
|
||||
par5EntityPlayer.openGui(OrbitalSatellite.instance, 3, par1World, par2, par3, par4);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
||||
return new ExtenderTileEntity();
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
||||
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
||||
* metadata
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6)
|
||||
{
|
||||
par1World.removeTileEntity(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of render function that is called for this block
|
||||
*/
|
||||
public int getRenderType()
|
||||
{
|
||||
return ClientProxy.tesrRenderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,202 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import fr.jackcartersmith.orbsat.OBNetworkClient;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ExtenderTileEntity extends TileEntity
|
||||
{
|
||||
int tick;
|
||||
final int takeGiveRate = 50;
|
||||
public int currentCharge;
|
||||
public final int maxCharge;
|
||||
|
||||
public ExtenderTileEntity()
|
||||
{
|
||||
this.maxCharge = OSConstants.ExtenderMaxCharge;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a tile entity to NBT.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.writeToNBT(par1);
|
||||
par1.setInteger("currentChargeExtender", this.currentCharge);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a tile entity from NBT.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.readFromNBT(par1);
|
||||
this.currentCharge = par1.getInteger("currentChargeExtender");
|
||||
this.sendChangeToClient();
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
|
||||
* ticks and creates a new spawn inside its implementation.
|
||||
*/
|
||||
public void updateEntity()
|
||||
{
|
||||
++this.tick;
|
||||
World par1world = this.worldObj;
|
||||
|
||||
if (!par1world.isRemote)
|
||||
{
|
||||
Block north = par1world.getBlock(this.xCoord + 1, this.yCoord, this.zCoord);
|
||||
Block south = par1world.getBlock(this.xCoord - 1, this.yCoord, this.zCoord);
|
||||
Block east = par1world.getBlock(this.xCoord, this.yCoord, this.zCoord + 1);
|
||||
Block west = par1world.getBlock(this.xCoord, this.yCoord, this.zCoord - 1);
|
||||
Block top = par1world.getBlock(this.xCoord, this.yCoord + 1, this.zCoord);
|
||||
Block bottom = par1world.getBlock(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
OverriderBlockTileEntity entity;
|
||||
int overriderCharge;
|
||||
int overriderMax;
|
||||
|
||||
if (north == OSBlocks.overrider)
|
||||
{
|
||||
entity = (OverriderBlockTileEntity)par1world.getTileEntity(this.xCoord + 1, this.yCoord, this.zCoord);
|
||||
overriderCharge = entity.getCurrentCharge();
|
||||
overriderMax = entity.maxCharge;
|
||||
|
||||
if (overriderCharge >= overriderMax && this.currentCharge <= this.maxCharge)
|
||||
{
|
||||
entity.currentCharge -= 50;
|
||||
this.currentCharge += 50;
|
||||
}
|
||||
|
||||
if (overriderCharge + 50 < overriderMax && this.currentCharge >= 50)
|
||||
{
|
||||
entity.currentCharge += 50;
|
||||
this.currentCharge -= 50;
|
||||
}
|
||||
}
|
||||
|
||||
if (south == OSBlocks.overrider)
|
||||
{
|
||||
entity = (OverriderBlockTileEntity)par1world.getTileEntity(this.xCoord - 1, this.yCoord, this.zCoord);
|
||||
overriderCharge = entity.currentCharge;
|
||||
overriderMax = entity.maxCharge;
|
||||
|
||||
if (overriderCharge >= overriderMax && this.currentCharge <= this.maxCharge)
|
||||
{
|
||||
entity.currentCharge -= 50;
|
||||
this.currentCharge += 50;
|
||||
}
|
||||
|
||||
if (overriderCharge + 50 < overriderMax && this.currentCharge >= 50)
|
||||
{
|
||||
entity.currentCharge += 50;
|
||||
this.currentCharge -= 50;
|
||||
}
|
||||
}
|
||||
|
||||
if (east == OSBlocks.overrider)
|
||||
{
|
||||
entity = (OverriderBlockTileEntity)par1world.getTileEntity(this.xCoord, this.yCoord, this.zCoord + 1);
|
||||
overriderCharge = entity.currentCharge;
|
||||
overriderMax = entity.maxCharge;
|
||||
|
||||
if (overriderCharge >= overriderMax && this.currentCharge <= this.maxCharge)
|
||||
{
|
||||
entity.currentCharge -= 50;
|
||||
this.currentCharge += 50;
|
||||
}
|
||||
|
||||
if (overriderCharge + 1000 < overriderMax && this.currentCharge >= 50)
|
||||
{
|
||||
entity.currentCharge += 50;
|
||||
this.currentCharge -= 50;
|
||||
}
|
||||
}
|
||||
|
||||
if (west == OSBlocks.overrider)
|
||||
{
|
||||
entity = (OverriderBlockTileEntity)par1world.getTileEntity(this.xCoord, this.yCoord, this.zCoord - 1);
|
||||
overriderCharge = entity.currentCharge;
|
||||
overriderMax = entity.maxCharge;
|
||||
|
||||
if (overriderCharge >= overriderMax && this.currentCharge <= this.maxCharge)
|
||||
{
|
||||
entity.currentCharge -= 50;
|
||||
this.currentCharge += 50;
|
||||
}
|
||||
|
||||
if (overriderCharge + 50 < overriderMax && this.currentCharge >= 50)
|
||||
{
|
||||
entity.currentCharge += 50;
|
||||
this.currentCharge -= 50;
|
||||
}
|
||||
}
|
||||
|
||||
if (top == OSBlocks.overrider)
|
||||
{
|
||||
entity = (OverriderBlockTileEntity)par1world.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord);
|
||||
overriderCharge = entity.currentCharge;
|
||||
overriderMax = entity.maxCharge;
|
||||
|
||||
if (overriderCharge >= overriderMax && this.currentCharge <= this.maxCharge)
|
||||
{
|
||||
entity.currentCharge -= 50;
|
||||
this.currentCharge += 50;
|
||||
}
|
||||
|
||||
if (overriderCharge + 50 < overriderMax && this.currentCharge >= 50)
|
||||
{
|
||||
entity.currentCharge += 50;
|
||||
this.currentCharge -= 50;
|
||||
}
|
||||
}
|
||||
|
||||
if (bottom == OSBlocks.overrider)
|
||||
{
|
||||
entity = (OverriderBlockTileEntity)par1world.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
|
||||
overriderCharge = entity.currentCharge;
|
||||
overriderMax = entity.maxCharge;
|
||||
|
||||
if (overriderCharge >= overriderMax && this.currentCharge <= this.maxCharge)
|
||||
{
|
||||
entity.currentCharge -= 50;
|
||||
this.currentCharge += 50;
|
||||
}
|
||||
|
||||
if (overriderCharge + 50 < overriderMax && this.currentCharge >= 50)
|
||||
{
|
||||
entity.currentCharge += 50;
|
||||
this.currentCharge -= 50;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.tick == 20 && !this.worldObj.isRemote)
|
||||
{
|
||||
this.tick = 0;
|
||||
this.sendChangeToClient();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void sendChangeToClient()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(3);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(this.currentCharge);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import fr.jackcartersmith.ob.interfaces.PhotonProducing;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class InverterAdvTileEntity extends PhotonProducing
|
||||
{
|
||||
public InverterAdvTileEntity()
|
||||
{
|
||||
this.setChargeRate(OSConstants.AdvPhotonInvChargeRate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a tile entity to NBT.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.writeToNBT(par1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a tile entity from NBT.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.readFromNBT(par1);
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import fr.jackcartersmith.ob.interfaces.PhotonProducing;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class InverterTileEntity extends PhotonProducing
|
||||
{
|
||||
public InverterTileEntity()
|
||||
{
|
||||
this.setChargeRate(OSConstants.PhotonInvChargeRate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a tile entity to NBT.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.writeToNBT(par1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a tile entity from NBT.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.readFromNBT(par1);
|
||||
}
|
||||
}
|
@ -1,126 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||
import fr.jackcartersmith.orbsat.common.OSItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class LaserLowBlock extends BlockContainer
|
||||
{
|
||||
public LaserLowBlock(Material par2Material)
|
||||
{
|
||||
super(par2Material);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 200.0F, 0.0F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
||||
* is the only chance you get to register icons.
|
||||
*/
|
||||
public void registerIcons(IIconRegister icon)
|
||||
{
|
||||
this.blockIcon = icon.registerIcon("OB".toLowerCase() + ":laserLow");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the quantity of items to drop on block destruction.
|
||||
*/
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of render function that is called for this block
|
||||
*/
|
||||
public int getRenderType()
|
||||
{
|
||||
return ClientProxy.tesrRenderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1)
|
||||
{
|
||||
String color = "";
|
||||
|
||||
try
|
||||
{
|
||||
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getUnlocalizedName().equals(OSItems.laserGunHighItem.getUnlocalizedName()))
|
||||
{
|
||||
color = "red";
|
||||
}
|
||||
|
||||
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getUnlocalizedName().equals(OSItems.laserGunMedItem.getUnlocalizedName()))
|
||||
{
|
||||
color = "orange";
|
||||
}
|
||||
|
||||
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getUnlocalizedName().equals(OSItems.laserGunLowItem.getUnlocalizedName()))
|
||||
{
|
||||
color = "blue";
|
||||
}
|
||||
|
||||
return new LaserLowTileEntity(color);
|
||||
}
|
||||
catch (Exception var4)
|
||||
{
|
||||
return new LaserLowTileEntity("blue");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
||||
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
||||
* metadata
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6)
|
||||
{
|
||||
par1World.removeTileEntity(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ticks the block if it's been scheduled
|
||||
*/
|
||||
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {}
|
||||
}
|
@ -1,110 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class LaserLowTileEntity extends TileEntity
|
||||
{
|
||||
public float rotate = -3.141F;
|
||||
public float insideCounter = 8.0F;
|
||||
public float color = 0.0F;
|
||||
public float grow = 1.0F;
|
||||
public boolean low = false;
|
||||
public boolean med = false;
|
||||
public boolean high = false;
|
||||
public double speed;
|
||||
boolean down = true;
|
||||
|
||||
public LaserLowTileEntity(String color)
|
||||
{
|
||||
if (color == "blue")
|
||||
{
|
||||
this.low = true;
|
||||
}
|
||||
|
||||
if (color == "orange")
|
||||
{
|
||||
this.med = true;
|
||||
}
|
||||
|
||||
if (color == "red")
|
||||
{
|
||||
this.high = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a tile entity to NBT.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.writeToNBT(par1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a tile entity from NBT.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.readFromNBT(par1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
|
||||
* ticks and creates a new spawn inside its implementation.
|
||||
*/
|
||||
public void updateEntity()
|
||||
{
|
||||
this.speed += 0.5D;
|
||||
Random random = new Random();
|
||||
float f1 = (float)this.xCoord + 0.5F;
|
||||
float f2 = (float)this.yCoord + 1.0F;
|
||||
float f3 = (float)this.zCoord + 0.5F;
|
||||
int id;
|
||||
|
||||
if (this.low)
|
||||
{
|
||||
for (id = 0; id <= 150; ++id)
|
||||
{
|
||||
this.worldObj.spawnParticle("reddust", (double)f1 + random.nextDouble() + 0.3D - 0.6D, (double)f2 + random.nextDouble() + 0.3D - 0.6D + (double)id, (double)f3 + random.nextDouble() + 0.3D - 0.6D, 20.0D - this.speed, 20.0D - this.speed, 20.0D + this.speed);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.med)
|
||||
{
|
||||
for (id = 0; id <= 300; ++id)
|
||||
{
|
||||
this.worldObj.spawnParticle("reddust", (double)f1 + random.nextDouble() + 0.3D - 0.6D, (double)f2 + random.nextDouble() + 0.3D - 0.6D + (double)id, (double)f3 + random.nextDouble() + 0.3D - 0.6D, 20.0D + this.speed, 20.0D + this.speed, 20.0D - this.speed);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.high)
|
||||
{
|
||||
for (id = 0; id <= 600; ++id)
|
||||
{
|
||||
this.worldObj.spawnParticle("reddust", (double)f1 + random.nextDouble() + 0.3D - 0.6D, (double)f2 + random.nextDouble() + 0.3D - 0.6D + (double)id, (double)f3 + random.nextDouble() + 0.3D - 0.6D, 20.0D + this.speed, 20.0D - this.speed, 20.0D - this.speed);
|
||||
}
|
||||
}
|
||||
|
||||
this.rotate += 0.05F;
|
||||
|
||||
if (this.rotate > 3.141F)
|
||||
{
|
||||
this.rotate = -3.141F;
|
||||
}
|
||||
|
||||
if (this.insideCounter > 0.5F)
|
||||
{
|
||||
this.insideCounter -= 0.1F;
|
||||
}
|
||||
|
||||
++this.color;
|
||||
|
||||
if (this.insideCounter < 0.5F)
|
||||
{
|
||||
this.grow += 0.05F;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class OverriderBlock extends BlockContainer
|
||||
{
|
||||
public OverriderBlock(Material par2Material)
|
||||
{
|
||||
super(par2Material);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8F, 1.0F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
||||
* is the only chance you get to register icons.
|
||||
*/
|
||||
public void registerIcons(IIconRegister icon)
|
||||
{
|
||||
this.blockIcon = icon.registerIcon("OB".toLowerCase() + ":satelite");
|
||||
}
|
||||
|
||||
public void onNeighborTileChange(World world, int x, int y, int z, int tileX, int tileY, int tileZ)
|
||||
{
|
||||
OverriderBlockTileEntity entity = (OverriderBlockTileEntity)world.getTileEntity(x, y, z);
|
||||
|
||||
if (entity.isCharging())
|
||||
{
|
||||
world.playSoundEffect((double)x, (double)y, (double)z, "ob:startCharging", 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
||||
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
||||
* metadata
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6)
|
||||
{
|
||||
if (par1World.getBlock(par2, par3 + 1, par4) == OSBlocks.satelite)
|
||||
{
|
||||
par1World.removeTileEntity(par2, par3 + 1, par4);
|
||||
par1World.setBlockToAir(par2, par3 + 1, par4);
|
||||
}
|
||||
par1World.removeTileEntity(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called upon block activation (right click on the block.)
|
||||
*/
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float a, float b, float c)
|
||||
{
|
||||
OverriderBlockTileEntity entity = (OverriderBlockTileEntity)world.getTileEntity(x, y, z);
|
||||
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
OrbitalSatellite.instance.lastChargerX = x;
|
||||
OrbitalSatellite.instance.lastChargerY = y;
|
||||
OrbitalSatellite.instance.lastChargerZ = z;
|
||||
player.openGui(OrbitalSatellite.instance, 0, world, (int)player.posX, (int)player.posY, (int)player.posZ);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* A randomly called display update to be able to add particles or other items for display
|
||||
*/
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
OverriderBlockTileEntity entity = (OverriderBlockTileEntity)par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
if (entity.currentCharge > 0)
|
||||
{
|
||||
float f1 = (float)par2 + 0.5F;
|
||||
float f2 = (float)par3 + 1.0F;
|
||||
float f3 = (float)par4 + 0.5F;
|
||||
|
||||
if (!(par1World.getTileEntity(par2, par3 + 1, par4) instanceof LaserLowTileEntity))
|
||||
{
|
||||
for (int i = 0; i <= 50; ++i)
|
||||
{
|
||||
par1World.spawnParticle("reddust", (double)f1 + par5Random.nextDouble() + 0.3D - 0.6D, (double)f2 + par5Random.nextDouble() + 0.3D - 0.6D + (double)i, (double)f3 + par5Random.nextDouble() + 0.3D - 0.6D, 250.0D, 250.0D, 250.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
||||
return new OverriderBlockTileEntity();
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of render function that is called for this block
|
||||
*/
|
||||
public int getRenderType()
|
||||
{
|
||||
return ClientProxy.tesrRenderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
|
||||
{
|
||||
int rotation = MathHelper.floor_double((double)(entityliving.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
|
||||
world.setBlockMetadataWithNotify(i, j, k, rotation - 1, rotation - 1);
|
||||
}
|
||||
}
|
@ -1,152 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import fr.jackcartersmith.ob.interfaces.PhotonConsuming;
|
||||
import fr.jackcartersmith.orbsat.OBNetwork;
|
||||
import fr.jackcartersmith.orbsat.OBNetworkClient;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class OverriderBlockTileEntity extends PhotonConsuming
|
||||
{
|
||||
public boolean charging;
|
||||
public HashMap amountOfGuns = new HashMap();
|
||||
public int lightlevel;
|
||||
public int tickCount = 0;
|
||||
public float rotate;
|
||||
public boolean hasSatelite;
|
||||
public boolean hasSateliteLaunched;
|
||||
public int shotsLeft = 0;
|
||||
public int satTicksAlive = 0;
|
||||
|
||||
/**
|
||||
* Writes a tile entity to NBT.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.writeToNBT(par1);
|
||||
par1.setInteger("currentCharge", this.getCurrentCharge());
|
||||
par1.setInteger("shotsLeft", this.shotsLeft);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a tile entity from NBT.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.readFromNBT(par1);
|
||||
this.currentCharge = par1.getInteger("currentCharge");
|
||||
this.shotsLeft = par1.getInteger("shotsLeft");
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
|
||||
* ticks and creates a new spawn inside its implementation.
|
||||
*/
|
||||
public void updateEntity()
|
||||
{
|
||||
this.maxCharge = OSConstants.OverriderMaxCharge;
|
||||
|
||||
if (this.currentCharge > this.maxCharge)
|
||||
{
|
||||
this.currentCharge = this.maxCharge;
|
||||
}
|
||||
|
||||
if (this.hasSateliteLaunched && this.worldObj.isRemote)
|
||||
{
|
||||
++this.satTicksAlive;
|
||||
|
||||
if (this.satTicksAlive >= 100)
|
||||
{
|
||||
this.hasSateliteLaunched = false;
|
||||
this.satTicksAlive = 0;
|
||||
this.sendChangeToServer21(this.xCoord, this.yCoord + 1, this.zCoord, 0, Minecraft.getMinecraft().thePlayer);
|
||||
this.worldObj.removeTileEntity(this.xCoord, this.yCoord + 1, this.zCoord);
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.yCoord + 1, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord) instanceof SateliteTileEntity)
|
||||
{
|
||||
this.hasSatelite = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.hasSatelite = false;
|
||||
}
|
||||
|
||||
if (this.tickCount == 2)
|
||||
{
|
||||
this.sendChangeToClient();
|
||||
this.sendChangeToClient5();
|
||||
this.tickCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
++this.tickCount;
|
||||
}
|
||||
|
||||
this.rotate += 0.05F;
|
||||
|
||||
if ((double)this.rotate >= 180.0D)
|
||||
{
|
||||
this.rotate = -180.0F;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCharging()
|
||||
{
|
||||
return this.charging;
|
||||
}
|
||||
|
||||
public void setCharging(boolean charging)
|
||||
{
|
||||
this.charging = charging;
|
||||
}
|
||||
|
||||
public void sendChangeToClient()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(1);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(this.getCurrentCharge());
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToClient5()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(5);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(this.shotsLeft);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer21(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(21);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import fr.jackcartersmith.ob.interfaces.PhotonSending;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class PhotonAcceleratorTileEntity extends PhotonSending
|
||||
{
|
||||
/**
|
||||
* Writes a tile entity to NBT.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.writeToNBT(par1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a tile entity from NBT.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.readFromNBT(par1);
|
||||
}
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class PhotonDeceleratorBlock extends BlockContainer
|
||||
{
|
||||
public PhotonDeceleratorBlock(Material par2Material)
|
||||
{
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called upon block activation (right click on the block.)
|
||||
*/
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float a, float b, float c)
|
||||
{
|
||||
PhotonDeceleratorTileEntity entity = (PhotonDeceleratorTileEntity)world.getTileEntity(x, y, z);
|
||||
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
OrbitalSatellite.instance.lastGeneralX = x;
|
||||
OrbitalSatellite.instance.lastGeneralY = y;
|
||||
OrbitalSatellite.instance.lastGeneralZ = z;
|
||||
player.openGui(OrbitalSatellite.instance, 5, world, (int)player.posX, (int)player.posY, (int)player.posZ);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* A randomly called display update to be able to add particles or other items for display
|
||||
*/
|
||||
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
||||
{
|
||||
PhotonDeceleratorTileEntity entity = (PhotonDeceleratorTileEntity)par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
if (entity.getPowerIncoming() > 0)
|
||||
{
|
||||
this.setLightLevel(1.0F);
|
||||
//par1World.updateAllLightTypes(par2, par3, par4);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.setLightLevel(0.0F);
|
||||
//par1World.updateAllLightTypes(par2, par3, par4);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
||||
return new PhotonDeceleratorTileEntity();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
||||
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
||||
* metadata
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6)
|
||||
{
|
||||
par1World.removeTileEntity(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of render function that is called for this block
|
||||
*/
|
||||
public int getRenderType()
|
||||
{
|
||||
return ClientProxy.tesrRenderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import fr.jackcartersmith.ob.interfaces.PhotonRecieving;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class PhotonDeceleratorTileEntity extends PhotonRecieving
|
||||
{
|
||||
/**
|
||||
* Writes a tile entity to NBT.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.writeToNBT(par1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a tile entity from NBT.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.readFromNBT(par1);
|
||||
}
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
public class PhotonInverterAdvBlock extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon sideIcon;
|
||||
|
||||
public PhotonInverterAdvBlock(Material par2Material)
|
||||
{
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
||||
* is the only chance you get to register icons.
|
||||
*/
|
||||
public void registerIcons(IIconRegister icon)
|
||||
{
|
||||
topIcon = icon.registerIcon("OB".toLowerCase() + ":solarPanelAdvTop");
|
||||
sideIcon = icon.registerIcon("OB".toLowerCase() + ":solarPanelAdvSides");
|
||||
}
|
||||
|
||||
/**
|
||||
* Called upon block activation (right click on the block.)
|
||||
*/
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
par5EntityPlayer.openGui(OrbitalSatellite.instance, 2, par1World, par2, par3, par4);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
||||
return new InverterAdvTileEntity();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
||||
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
||||
* metadata
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6)
|
||||
{
|
||||
par1World.removeTileEntity(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of render function that is called for this block
|
||||
*/
|
||||
public int getRenderType()
|
||||
{
|
||||
return ClientProxy.tesrRenderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
||||
public class PhotonInverterBlock extends BlockContainer
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon topIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon sideIcon;
|
||||
|
||||
public PhotonInverterBlock(Material par2Material)
|
||||
{
|
||||
super(Material.rock);
|
||||
}
|
||||
|
||||
/**
|
||||
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
||||
* is the only chance you get to register icons.
|
||||
*/
|
||||
public void registerBlockIcons(IIconRegister icon)
|
||||
{
|
||||
this.topIcon = icon.registerIcon(OrbitalSatellite.MODID + ":solarPanelTop");
|
||||
this.sideIcon = icon.registerIcon(OrbitalSatellite.MODID + ":solarPanelSides");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
||||
*/
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
//return side == 0 ? sideIcon : (side == 1 ? topIcon : sideIcon);
|
||||
if(side == 1)
|
||||
return this.topIcon;
|
||||
return this.sideIcon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called upon block activation (right click on the block.)
|
||||
*/
|
||||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
||||
{
|
||||
par5EntityPlayer.openGui(OrbitalSatellite.instance, 1, par1World, par2, par3, par4);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
||||
return new InverterTileEntity();
|
||||
}
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class SateliteBlock extends BlockContainer
|
||||
{
|
||||
public SateliteBlock(Material par2Material)
|
||||
{
|
||||
super(par2Material);
|
||||
OrbitalSatellite var10001 = OrbitalSatellite.instance;
|
||||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
||||
* is the only chance you get to register icons.
|
||||
*/
|
||||
public void registerIcons(IIconRegister icon) {}
|
||||
|
||||
/**
|
||||
* Called whenever the block is added into the world. Args: world, x, y, z
|
||||
*/
|
||||
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
||||
{
|
||||
if (!(par1World.getTileEntity(par2, par3 - 1, par4) instanceof OverriderBlockTileEntity))
|
||||
{
|
||||
this.breakBlock(par1World, par2, par3, par4, this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
||||
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
||||
* metadata
|
||||
*/
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block block, int par6)
|
||||
{
|
||||
par1World.removeTileEntity(par2, par3, par4);
|
||||
par1World.setBlockToAir(par2, par3, par4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
||||
*/
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
||||
return new SateliteTileEntity();
|
||||
}
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of render function that is called for this block
|
||||
*/
|
||||
public int getRenderType()
|
||||
{
|
||||
return ClientProxy.tesrRenderId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
||||
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
||||
*/
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
||||
*/
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
package fr.jackcartersmith.ob.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class SateliteTileEntity extends TileEntity
|
||||
{
|
||||
public float height = 0.0F;
|
||||
public float speed = 0.01F;
|
||||
public boolean shouldLaunch = false;
|
||||
public int ticksAlive = 0;
|
||||
public Boolean startedTicking = Boolean.valueOf(false);
|
||||
|
||||
/**
|
||||
* Writes a tile entity to NBT.
|
||||
*/
|
||||
public void writeToNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.writeToNBT(par1);
|
||||
par1.setBoolean("shouldLaunch", this.shouldLaunch);
|
||||
par1.setBoolean("startedTicking", this.startedTicking.booleanValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a tile entity from NBT.
|
||||
*/
|
||||
public void readFromNBT(NBTTagCompound par1)
|
||||
{
|
||||
super.readFromNBT(par1);
|
||||
this.shouldLaunch = par1.getBoolean("shouldLaunch");
|
||||
this.startedTicking = Boolean.valueOf(par1.getBoolean("startedTicking"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
|
||||
* ticks and creates a new spawn inside its implementation.
|
||||
*/
|
||||
public void updateEntity()
|
||||
{
|
||||
if (this.startedTicking.booleanValue())
|
||||
{
|
||||
++this.ticksAlive;
|
||||
}
|
||||
|
||||
if (this.shouldLaunch)
|
||||
{
|
||||
this.height += this.speed;
|
||||
this.speed *= 1.1F;
|
||||
Random random = new Random();
|
||||
this.startedTicking = Boolean.valueOf(true);
|
||||
|
||||
for (int i = 0; i <= 25; ++i)
|
||||
{
|
||||
this.worldObj.spawnParticle("cloud", (double)this.xCoord + random.nextDouble() + 0.3D - 0.6D, (double)((float)this.yCoord + this.height) + random.nextDouble() + 0.3D - 0.6D, (double)this.zCoord + random.nextDouble() + 0.3D - 0.6D, 0.0D, -2.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.ticksAlive >= 160)
|
||||
{
|
||||
this.worldObj.setBlockToAir(this.xCoord, this.xCoord, this.xCoord);
|
||||
this.worldObj.removeTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package fr.jackcartersmith.ob.entities;
|
||||
|
||||
import net.minecraft.entity.monster.EntitySlime;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class LaserLightEntity extends EntitySlime
|
||||
{
|
||||
int ticksAlive;
|
||||
double renderSize;
|
||||
double angleZ;
|
||||
double angleY;
|
||||
|
||||
public LaserLightEntity(World par1World, double xH, double yH, double zH, double xT, double yT, double zT)
|
||||
{
|
||||
super(par1World);
|
||||
System.out.println("SPAWNED");
|
||||
double dx = xH - xT;
|
||||
double dy = yH - yT;
|
||||
double dz = zH - zT;
|
||||
this.renderSize = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
||||
this.angleZ = 360.0D - (Math.atan2(dz, dx) * 180.0D / Math.PI + 180.0D);
|
||||
dx = Math.sqrt(this.renderSize * this.renderSize - dy * dy);
|
||||
this.angleY = -Math.atan2(dy, dx) * 180.0D / Math.PI;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
||||
* posY, posZ, yaw, pitch
|
||||
*/
|
||||
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) {}
|
||||
|
||||
/**
|
||||
* Sets the entity's position and rotation. Args: posX, posY, posZ, yaw, pitch
|
||||
*/
|
||||
public void setPositionAndRotation(double par1, double par3, double par5, float par7, float par8) {}
|
||||
|
||||
protected void entityInit() {}
|
||||
|
||||
/**
|
||||
* Called to update the entity's position/logic.
|
||||
*/
|
||||
public void onUpdate()
|
||||
{
|
||||
++this.ticksAlive;
|
||||
|
||||
if (this.ticksAlive > 20)
|
||||
{
|
||||
this.kill();
|
||||
this.ticksAlive = 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
package fr.jackcartersmith.ob.entities;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.models.ModelLaserLight;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class LaserLightEntityRenderer extends RenderLiving
|
||||
{
|
||||
ModelLaserLight model = new ModelLaserLight();
|
||||
private static final ResourceLocation Your_Texture = new ResourceLocation("ob", "textures/entity/laserLight.png");
|
||||
|
||||
public LaserLightEntityRenderer(ModelBase par1ModelBase, float par2)
|
||||
{
|
||||
super(par1ModelBase, par2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(Entity entity)
|
||||
{
|
||||
return Your_Texture;
|
||||
}
|
||||
|
||||
/**
|
||||
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
|
||||
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
|
||||
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
|
||||
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
|
||||
*/
|
||||
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
|
||||
{
|
||||
LaserLightEntity entity = (LaserLightEntity)par1Entity;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(par2, par4, par6);
|
||||
GL11.glRotatef((float)entity.angleZ, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef((float)entity.angleY, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glScalef((float)entity.renderSize, 1.0F, 1.0F);
|
||||
this.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
package fr.jackcartersmith.ob.entities;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.orbsat.OBNetwork;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.monster.EntitySlime;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class MeteorEntity extends EntitySlime
|
||||
{
|
||||
int ticksAlive;
|
||||
|
||||
public MeteorEntity(World par1World)
|
||||
{
|
||||
super(par1World);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to write subclass entity data to NBT.
|
||||
*/
|
||||
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.writeEntityToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
/**
|
||||
* (abstract) Protected helper method to read subclass entity data from NBT.
|
||||
*/
|
||||
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
super.readEntityFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
public MeteorEntity(World par1World, int x, int y, int z)
|
||||
{
|
||||
super(par1World);
|
||||
this.setPosition((double)x, (double)y, (double)z);
|
||||
this.setHealth(1.0F);
|
||||
this.setSize(1.0F, 0.5F);
|
||||
Random veloRan = new Random();
|
||||
float choose = veloRan.nextFloat();
|
||||
float veloX;
|
||||
float veloY;
|
||||
float veloZ;
|
||||
|
||||
if (choose > 0.5F)
|
||||
{
|
||||
veloX = veloRan.nextFloat() * -2.0F;
|
||||
veloY = veloRan.nextFloat() * 2.0F;
|
||||
veloZ = veloRan.nextFloat() * 2.0F;
|
||||
this.motionX = (double)veloX;
|
||||
this.motionY = (double)veloY;
|
||||
this.motionZ = (double)veloZ;
|
||||
}
|
||||
|
||||
if (choose < 0.5F)
|
||||
{
|
||||
veloX = veloRan.nextFloat() * 2.0F;
|
||||
veloY = veloRan.nextFloat() * -2.0F;
|
||||
veloZ = veloRan.nextFloat() * -2.0F;
|
||||
this.motionX = (double)veloX;
|
||||
this.motionY = (double)veloY;
|
||||
this.motionZ = (double)veloZ;
|
||||
}
|
||||
|
||||
this.renderDistanceWeight = 1.0D;
|
||||
super.setSlimeSize(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the mob's health reaches 0.
|
||||
*/
|
||||
public void onDeath(DamageSource par1DamageSource)
|
||||
{
|
||||
if (this.worldObj.isRemote)
|
||||
{
|
||||
this.sendChangeToServer((int)this.posX, (int)this.posY, (int)this.posZ, 8, Minecraft.getMinecraft().thePlayer);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the mob is falling. Calculates and applies fall damage.
|
||||
*/
|
||||
protected void fall(float par1)
|
||||
{
|
||||
if (this.worldObj.isRemote)
|
||||
{
|
||||
this.sendChangeToServer((int)this.posX, (int)this.posY, (int)this.posZ, 8, Minecraft.getMinecraft().thePlayer);
|
||||
this.kill();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
||||
* posY, posZ, yaw, pitch
|
||||
*/
|
||||
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) {}
|
||||
|
||||
/**
|
||||
* Sets the entity's position and rotation. Args: posX, posY, posZ, yaw, pitch
|
||||
*/
|
||||
public void setPositionAndRotation(double par1, double par3, double par5, float par7, float par8) {}
|
||||
|
||||
/**
|
||||
* Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
|
||||
* use this to react to sunlight and start to burn.
|
||||
*/
|
||||
public void onLivingUpdate()
|
||||
{
|
||||
++this.ticksAlive;
|
||||
float f1 = (float)this.posX + 0.5F;
|
||||
float f2 = (float)this.posY + 1.0F;
|
||||
float f3 = (float)this.posZ + 0.5F;
|
||||
Random par5Random = new Random();
|
||||
this.worldObj.spawnParticle("largeexplode", (double)f1 + par5Random.nextDouble() + 0.3D - 0.6D, (double)f2 + par5Random.nextDouble() + 0.3D - 0.6D, (double)f3 + par5Random.nextDouble() + 0.3D - 0.6D, 0.0D, 0.0D, 0.0D);
|
||||
this.worldObj.spawnParticle("largeexplode", (double)f1 + par5Random.nextDouble() + 0.3D - 0.6D, (double)f2 + par5Random.nextDouble() + 0.3D - 0.6D, (double)f3 + par5Random.nextDouble() + 0.3D - 0.6D, 0.0D, 0.0D, 0.0D);
|
||||
this.worldObj.spawnParticle("largeexplode", (double)f1 + par5Random.nextDouble() + 0.3D - 0.6D, (double)f2 + par5Random.nextDouble() + 0.3D - 0.6D, (double)f3 + par5Random.nextDouble() + 0.3D - 0.6D, 0.0D, 0.0D, 0.0D);
|
||||
this.worldObj.spawnParticle("largeexplode", (double)f1 + par5Random.nextDouble() + 0.3D - 0.6D, (double)f2 + par5Random.nextDouble() + 0.3D - 0.6D, (double)f3 + par5Random.nextDouble() + 0.3D - 0.6D, 0.0D, 0.0D, 0.0D);
|
||||
//this.worldObj.getWorldVec3Pool().getVecFromPool(0.0D, 0.0D, 0.5D);
|
||||
Vec3.createVectorHelper(0.0D, 0.0D, 0.5D);
|
||||
|
||||
if (this.ticksAlive >= 120)
|
||||
{
|
||||
this.kill();
|
||||
}
|
||||
|
||||
super.onLivingUpdate();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void sendChangeToServer(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(2);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package fr.jackcartersmith.ob.entities;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class MeteorRenderer extends RenderLiving
|
||||
{
|
||||
private static final ResourceLocation meteor_texture = new ResourceLocation("ob", "textures/entity/meteor.png");
|
||||
|
||||
public MeteorRenderer(ModelBase par1ModelBase, float par2)
|
||||
{
|
||||
super(par1ModelBase, par2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
|
||||
*/
|
||||
protected ResourceLocation getEntityTexture(Entity entity)
|
||||
{
|
||||
return meteor_texture;
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
package fr.jackcartersmith.ob.entities;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelMeteor extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
|
||||
public ModelMeteor()
|
||||
{
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 32;
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(-3.0F, 0.0F, -3.0F, 6, 6, 6);
|
||||
this.Shape1.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.Shape1.setTextureSize(64, 32);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
this.Shape1.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, (Entity)null);
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Shape1.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat.client.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.ob.blocks.ExtenderTileEntity;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ExtenderGui extends GuiScreen
|
||||
{
|
||||
ResourceLocation texture = new ResourceLocation("OB".toLowerCase(), "textures/gui/extender.png");
|
||||
public final int xSize = 200;
|
||||
public final int ySize = 120;
|
||||
EntityPlayer entity2;
|
||||
|
||||
public ExtenderGui(EntityPlayer entity)
|
||||
{
|
||||
this.entity2 = entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen(int x, int y, float f1)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(this.texture);
|
||||
int posX = (this.width - 200) / 2;
|
||||
int posY = (this.height - 120) / 2;
|
||||
this.drawTexturedModalRect(posX, posY, 0, 0, 200, 120);
|
||||
super.drawScreen(x, y, f1);
|
||||
int xC = OrbitalSatellite.instance.lastExtenderX;
|
||||
int yC = OrbitalSatellite.instance.lastExtenderY;
|
||||
int zC = OrbitalSatellite.instance.lastExtenderZ;
|
||||
World world = this.entity2.worldObj;
|
||||
ExtenderTileEntity entity = (ExtenderTileEntity)world.getTileEntity(xC, yC, zC);
|
||||
String chargingString = "";
|
||||
this.fontRendererObj.drawStringWithShadow("Photon Charge: " + entity.currentCharge + " PU", posX + 30, posY + 40, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this GUI should pause the game when it is displayed in single-player
|
||||
*/
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
||||
*/
|
||||
public void actionPerformed(GuiButton button)
|
||||
{
|
||||
switch (button.id)
|
||||
{
|
||||
case 0:
|
||||
int xC = OrbitalSatellite.instance.lastChargerX;
|
||||
int yC = OrbitalSatellite.instance.lastChargerY;
|
||||
int zC = OrbitalSatellite.instance.lastChargerZ;
|
||||
World world = this.entity2.worldObj;
|
||||
OverriderBlockTileEntity entity = (OverriderBlockTileEntity)world.getTileEntity(xC, yC, zC);
|
||||
entity.setCurrentCharge(entity.getCurrentCharge() - 30000);
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat.client.gui;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GuiHandlerForOb implements IGuiHandler
|
||||
{
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
switch (ID)
|
||||
{
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
switch (ID)
|
||||
{
|
||||
case 0:
|
||||
return new OverriderBlockGui(player);
|
||||
|
||||
case 1:
|
||||
return new PhotonInverterGui(player);
|
||||
|
||||
case 2:
|
||||
return new PhotonInverterAdvGui(player);
|
||||
|
||||
case 3:
|
||||
return new ExtenderGui(player);
|
||||
|
||||
case 4:
|
||||
return new PhotonAcceleratorGui(player);
|
||||
|
||||
case 5:
|
||||
return new PhotonDeceleratorGui(player);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat.client.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
||||
import fr.jackcartersmith.ob.blocks.SateliteTileEntity;
|
||||
import fr.jackcartersmith.orbsat.OBNetwork;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class OverriderBlockGui extends GuiScreen
|
||||
{
|
||||
ResourceLocation texture = new ResourceLocation("OB".toLowerCase(), "textures/gui/gui.png");
|
||||
public final int xSize = 200;
|
||||
public final int ySize = 120;
|
||||
EntityPlayer entity2;
|
||||
|
||||
public OverriderBlockGui(EntityPlayer entity)
|
||||
{
|
||||
this.entity2 = entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen(int x, int y, float f1)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(this.texture);
|
||||
int posX = (this.width - 200) / 2;
|
||||
int posY = (this.height - 120) / 2;
|
||||
this.drawTexturedModalRect(posX, posY, 0, 0, 200, 120);
|
||||
super.drawScreen(x, y, f1);
|
||||
World world = this.entity2.worldObj;
|
||||
int xC = OrbitalSatellite.instance.lastChargerX;
|
||||
int yC = OrbitalSatellite.instance.lastChargerY;
|
||||
int zC = OrbitalSatellite.instance.lastChargerZ;
|
||||
OverriderBlockTileEntity entity = (OverriderBlockTileEntity)world.getTileEntity(xC, yC, zC);
|
||||
|
||||
if (entity.hasSatelite)
|
||||
{
|
||||
this.buttonList.add(new GuiButton(0, posX + 38, posY + 60, 100, 20, "Launch Satelite"));
|
||||
this.fontRendererObj.drawStringWithShadow("Photon Charge: " + entity.getCurrentCharge() + " PU", posX + 30, posY + 35, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.buttonList.removeAll(this.buttonList);
|
||||
String chargingString = "";
|
||||
|
||||
if (entity.isCharging())
|
||||
{
|
||||
chargingString = "Yes";
|
||||
}
|
||||
|
||||
if (!entity.isCharging())
|
||||
{
|
||||
chargingString = "No";
|
||||
}
|
||||
|
||||
this.fontRendererObj.drawStringWithShadow("Photon Charge: " + entity.getCurrentCharge() + " PU", posX + 30, posY + 30, -1);
|
||||
|
||||
if (entity.amountOfGuns == null)
|
||||
{
|
||||
this.fontRendererObj.drawStringWithShadow("# Designators: 0", posX + 30, posY + 40, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.fontRendererObj.drawStringWithShadow("# Designators: " + entity.amountOfGuns.size(), posX + 30, posY + 40, -1);
|
||||
}
|
||||
|
||||
this.fontRendererObj.drawStringWithShadow("Satelite uses left: " + entity.shotsLeft, posX + 30, posY + 50, -1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this GUI should pause the game when it is displayed in single-player
|
||||
*/
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
||||
*/
|
||||
public void actionPerformed(GuiButton button)
|
||||
{
|
||||
switch (button.id)
|
||||
{
|
||||
case 0:
|
||||
World world = this.entity2.worldObj;
|
||||
int xC = OrbitalSatellite.instance.lastChargerX;
|
||||
int yC = OrbitalSatellite.instance.lastChargerY + 1;
|
||||
int zC = OrbitalSatellite.instance.lastChargerZ;
|
||||
OverriderBlockTileEntity entity = (OverriderBlockTileEntity)world.getTileEntity(xC, yC - 1, zC);
|
||||
SateliteTileEntity sat = (SateliteTileEntity)world.getTileEntity(xC, yC, zC);
|
||||
|
||||
if (entity.hasSatelite && entity.getCurrentCharge() > 25000 && !sat.shouldLaunch)
|
||||
{
|
||||
EntityClientPlayerMP mp = (EntityClientPlayerMP)this.entity2;
|
||||
this.sendChangeToServer18(xC, yC - 1, zC, entity.shotsLeft + 150, mp);
|
||||
sat.shouldLaunch = true;
|
||||
entity.hasSateliteLaunched = true;
|
||||
entity.hasSatelite = false;
|
||||
}
|
||||
else if (entity.hasSatelite)
|
||||
{
|
||||
this.entity2.addChatMessage(new ChatComponentText("Cannot launch satelite. Need 25000PU to launch."));
|
||||
entity.hasSatelite = false;
|
||||
}
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
public void sendChangeToServer18(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(18);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat.client.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.PhotonAcceleratorTileEntity;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PhotonAcceleratorGui extends GuiScreen
|
||||
{
|
||||
ResourceLocation texture = new ResourceLocation("OB".toLowerCase(), "textures/gui/photonAccelerator.png");
|
||||
public final int xSize = 200;
|
||||
public final int ySize = 120;
|
||||
EntityPlayer entity2;
|
||||
|
||||
public PhotonAcceleratorGui(EntityPlayer entity)
|
||||
{
|
||||
this.entity2 = entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen(int x, int y, float f1)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(this.texture);
|
||||
int posX = (this.width - 200) / 2;
|
||||
int posY = (this.height - 120) / 2;
|
||||
this.drawTexturedModalRect(posX, posY, 0, 0, 200, 120);
|
||||
super.drawScreen(x, y, f1);
|
||||
PhotonAcceleratorTileEntity acceleratorTileEntity = (PhotonAcceleratorTileEntity)this.entity2.worldObj.getTileEntity(OrbitalSatellite.instance.lastGeneralX, OrbitalSatellite.instance.lastGeneralY, OrbitalSatellite.instance.lastGeneralZ);
|
||||
this.fontRendererObj.drawStringWithShadow("# Decelerators: " + acceleratorTileEntity.getListSize(), posX + 30, posY + 25, -1);
|
||||
this.fontRendererObj.drawStringWithShadow("Total output rate: " + acceleratorTileEntity.getOutputRate(), posX + 30, posY + 35, -1);
|
||||
this.fontRendererObj.drawStringWithShadow("Scaled output rate: " + acceleratorTileEntity.getScaledOutput(), posX + 30, posY + 45, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this GUI should pause the game when it is displayed in single-player
|
||||
*/
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat.client.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.PhotonDeceleratorTileEntity;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PhotonDeceleratorGui extends GuiScreen
|
||||
{
|
||||
ResourceLocation texture = new ResourceLocation("OB".toLowerCase(), "textures/gui/photonDecelerator.png");
|
||||
public final int xSize = 200;
|
||||
public final int ySize = 120;
|
||||
EntityPlayer entity2;
|
||||
|
||||
public PhotonDeceleratorGui(EntityPlayer entity)
|
||||
{
|
||||
this.entity2 = entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen(int x, int y, float f1)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(this.texture);
|
||||
int posX = (this.width - 200) / 2;
|
||||
int posY = (this.height - 120) / 2;
|
||||
this.drawTexturedModalRect(posX, posY, 0, 0, 200, 120);
|
||||
super.drawScreen(x, y, f1);
|
||||
PhotonDeceleratorTileEntity acceleratorTileEntity = (PhotonDeceleratorTileEntity)this.entity2.worldObj.getTileEntity(OrbitalSatellite.instance.lastGeneralX, OrbitalSatellite.instance.lastGeneralY, OrbitalSatellite.instance.lastGeneralZ);
|
||||
this.fontRendererObj.drawStringWithShadow("Incoming Rate: " + acceleratorTileEntity.getPowerIncoming(), posX + 30, posY + 35, -1);
|
||||
this.fontRendererObj.drawStringWithShadow("Scaled Power Output: " + acceleratorTileEntity.getScaledOutput(), posX + 30, posY + 45, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this GUI should pause the game when it is displayed in single-player
|
||||
*/
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat.client.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class PhotonInverterAdvGui extends GuiScreen
|
||||
{
|
||||
ResourceLocation texture = new ResourceLocation("OB".toLowerCase(), "textures/gui/photonInverterAdv.png");
|
||||
public final int xSize = 200;
|
||||
public final int ySize = 120;
|
||||
EntityPlayer entity2;
|
||||
|
||||
public PhotonInverterAdvGui(EntityPlayer entity)
|
||||
{
|
||||
this.entity2 = entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen(int x, int y, float f1)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(this.texture);
|
||||
int posX = (this.width - 200) / 2;
|
||||
int posY = (this.height - 120) / 2;
|
||||
this.drawTexturedModalRect(posX, posY, 0, 0, 200, 120);
|
||||
super.drawScreen(x, y, f1);
|
||||
this.fontRendererObj.drawStringWithShadow("Production Rate: " + OSConstants.AdvPhotonInvChargeRate + "PU/t", posX + 30, posY + 40, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this GUI should pause the game when it is displayed in single-player
|
||||
*/
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
|
||||
*/
|
||||
public void actionPerformed(GuiButton button)
|
||||
{
|
||||
switch (button.id)
|
||||
{
|
||||
case 0:
|
||||
int xC = OrbitalSatellite.instance.lastChargerX;
|
||||
int yC = OrbitalSatellite.instance.lastChargerY;
|
||||
int zC = OrbitalSatellite.instance.lastChargerZ;
|
||||
World world = this.entity2.worldObj;
|
||||
OverriderBlockTileEntity entity = (OverriderBlockTileEntity)world.getTileEntity(xC, yC, zC);
|
||||
entity.setCurrentCharge(0);
|
||||
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package fr.jackcartersmith.orbsat.client.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PhotonInverterGui extends GuiScreen
|
||||
{
|
||||
ResourceLocation texture = new ResourceLocation("OB".toLowerCase(), "textures/gui/photonInverter.png");
|
||||
public final int xSize = 200;
|
||||
public final int ySize = 120;
|
||||
EntityPlayer entity2;
|
||||
|
||||
public PhotonInverterGui(EntityPlayer entity)
|
||||
{
|
||||
this.entity2 = entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws the screen and all the components in it.
|
||||
*/
|
||||
public void drawScreen(int x, int y, float f1)
|
||||
{
|
||||
this.drawDefaultBackground();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(this.texture);
|
||||
int posX = (this.width - 200) / 2;
|
||||
int posY = (this.height - 120) / 2;
|
||||
this.drawTexturedModalRect(posX, posY, 0, 0, 200, 120);
|
||||
super.drawScreen(x, y, f1);
|
||||
this.fontRendererObj.drawStringWithShadow("Production Rate: " + OSConstants.PhotonInvChargeRate + "PU/t", posX + 30, posY + 40, -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this GUI should pause the game when it is displayed in single-player
|
||||
*/
|
||||
public boolean doesGuiPauseGame()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package fr.jackcartersmith.ob.interfaces;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class PhotonConsuming extends TileEntity{
|
||||
public int currentCharge = 0;
|
||||
public int maxCharge = 0;
|
||||
|
||||
public void addCharge(int incomingCharge){
|
||||
this.currentCharge += incomingCharge;
|
||||
}
|
||||
|
||||
public void removeCharge(int outgoingCharge){
|
||||
this.currentCharge -= outgoingCharge;
|
||||
}
|
||||
|
||||
public int getCurrentCharge() {
|
||||
return this.currentCharge;
|
||||
}
|
||||
|
||||
public void setCurrentCharge(int currentCharge){
|
||||
this.currentCharge = currentCharge;
|
||||
}
|
||||
|
||||
public int getMaxCharge(){
|
||||
return this.maxCharge;
|
||||
}
|
||||
|
||||
public void setMaxCharge(int maxCharge) {
|
||||
this.maxCharge = maxCharge;
|
||||
}
|
||||
}
|
@ -1,233 +0,0 @@
|
||||
package fr.jackcartersmith.ob.interfaces;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.InverterAdvTileEntity;
|
||||
import fr.jackcartersmith.orbsat.OBNetworkClient;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class PhotonProducing extends TileEntity
|
||||
{
|
||||
int chargeRate = 0;
|
||||
int currentCharge = 0;
|
||||
public long time = 0L;
|
||||
public int powerIncoming;
|
||||
public int scaledOutput;
|
||||
private int tickCount = 0;
|
||||
public float rotate = -3.141F;
|
||||
|
||||
public List<PhotonConsuming> getSurroundingPhotonConsumers()
|
||||
{
|
||||
ArrayList surroundingConsumers = new ArrayList();
|
||||
|
||||
try
|
||||
{
|
||||
if (this.worldObj.getTileEntity(this.xCoord + 1, this.yCoord, this.zCoord) instanceof PhotonConsuming)
|
||||
{
|
||||
surroundingConsumers.add((PhotonConsuming)this.worldObj.getTileEntity(this.xCoord + 1, this.yCoord, this.zCoord));
|
||||
}
|
||||
|
||||
if (this.worldObj.getTileEntity(this.xCoord - 1, this.yCoord, this.zCoord) instanceof PhotonConsuming)
|
||||
{
|
||||
surroundingConsumers.add((PhotonConsuming)this.worldObj.getTileEntity(this.xCoord - 1, this.yCoord, this.zCoord));
|
||||
}
|
||||
|
||||
if (this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord) instanceof PhotonConsuming)
|
||||
{
|
||||
surroundingConsumers.add((PhotonConsuming)this.worldObj.getTileEntity(this.xCoord, this.yCoord + 1, this.zCoord));
|
||||
}
|
||||
|
||||
if (this.worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord) instanceof PhotonConsuming)
|
||||
{
|
||||
surroundingConsumers.add((PhotonConsuming)this.worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord));
|
||||
}
|
||||
|
||||
if (this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord + 1) instanceof PhotonConsuming)
|
||||
{
|
||||
surroundingConsumers.add((PhotonConsuming)this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord + 1));
|
||||
}
|
||||
|
||||
if (this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord - 1) instanceof PhotonConsuming)
|
||||
{
|
||||
surroundingConsumers.add((PhotonConsuming)this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord - 1));
|
||||
}
|
||||
}
|
||||
catch (Exception var3)
|
||||
{
|
||||
System.out.println("ORBITAL BOMBARDMENT::Cannot cast entity into PhotonConsuming");
|
||||
var3.printStackTrace();
|
||||
}
|
||||
|
||||
return surroundingConsumers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
|
||||
* ticks and creates a new spawn inside its implementation.
|
||||
*/
|
||||
public void updateEntity()
|
||||
{
|
||||
if (this.getPowerIncoming() > 0)
|
||||
{
|
||||
this.rotate += 1.0E-4F * (float)this.getPowerIncoming();
|
||||
}
|
||||
|
||||
if (this.rotate >= 3.141F)
|
||||
{
|
||||
this.rotate = -3.141F;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
List surroundingPhotonConsumers = this.getSurroundingPhotonConsumers();
|
||||
this.addCharge(this.getChargeRate());
|
||||
int howMany = surroundingPhotonConsumers.size();
|
||||
boolean scaledPowerOutput = false;
|
||||
int var8;
|
||||
|
||||
if (howMany == 0)
|
||||
{
|
||||
howMany = 1;
|
||||
var8 = this.getCurrentCharge() / howMany;
|
||||
}
|
||||
else
|
||||
{
|
||||
var8 = this.getCurrentCharge() / howMany;
|
||||
}
|
||||
|
||||
if (this.tickCount == 10)
|
||||
{
|
||||
this.sendChangeToClient13();
|
||||
this.sendChangeToClient15();
|
||||
|
||||
this.tickCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
++this.tickCount;
|
||||
}
|
||||
|
||||
this.setScaledOutput(var8);
|
||||
this.setPowerIncoming(this.getCurrentCharge());
|
||||
|
||||
if (var8 > 0)
|
||||
{
|
||||
Iterator i$ = surroundingPhotonConsumers.iterator();
|
||||
|
||||
while (i$.hasNext())
|
||||
{
|
||||
PhotonConsuming entity = (PhotonConsuming)i$.next();
|
||||
|
||||
try
|
||||
{
|
||||
if (entity.getCurrentCharge() < entity.getMaxCharge())
|
||||
{
|
||||
entity.addCharge(var8);
|
||||
}
|
||||
|
||||
var8 = this.getCurrentCharge() / howMany;
|
||||
entity.currentCharge += var8;
|
||||
}
|
||||
catch (Exception var7)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
this.removeCharge(this.getCurrentCharge());
|
||||
}
|
||||
}
|
||||
|
||||
this.time = this.worldObj.getWorldTime();
|
||||
this.time %= 24000L;
|
||||
}
|
||||
|
||||
public void addCharge(int incomingCharge)
|
||||
{
|
||||
this.currentCharge += incomingCharge;
|
||||
}
|
||||
|
||||
public void removeCharge(int outgoingCharge)
|
||||
{
|
||||
this.currentCharge -= outgoingCharge;
|
||||
}
|
||||
|
||||
public int getChargeRate()
|
||||
{
|
||||
return this.chargeRate;
|
||||
}
|
||||
|
||||
public void setChargeRate(int chargeRate)
|
||||
{
|
||||
this.chargeRate = chargeRate;
|
||||
}
|
||||
|
||||
public int getCurrentCharge()
|
||||
{
|
||||
return this.currentCharge;
|
||||
}
|
||||
|
||||
public void setCurrentCharge(int currentCharge)
|
||||
{
|
||||
this.currentCharge = currentCharge;
|
||||
}
|
||||
|
||||
public long getTime()
|
||||
{
|
||||
return this.time;
|
||||
}
|
||||
|
||||
public void setTime(long time)
|
||||
{
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public int getPowerIncoming()
|
||||
{
|
||||
return this.powerIncoming;
|
||||
}
|
||||
|
||||
public void setPowerIncoming(int powerIncoming)
|
||||
{
|
||||
this.powerIncoming = powerIncoming;
|
||||
}
|
||||
|
||||
public int getScaledOutput()
|
||||
{
|
||||
return this.scaledOutput;
|
||||
}
|
||||
|
||||
public void setScaledOutput(int scaledOutput)
|
||||
{
|
||||
this.scaledOutput = scaledOutput;
|
||||
}
|
||||
|
||||
public void sendChangeToClient13()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(13);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(this.getScaledOutput());
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToClient15()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(15);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(this.getPowerIncoming());
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package fr.jackcartersmith.ob.interfaces;
|
||||
|
||||
public class PhotonRecieving extends PhotonProducing
|
||||
{
|
||||
public void recievePhotons(int power)
|
||||
{
|
||||
this.currentCharge += power;
|
||||
}
|
||||
}
|
@ -1,207 +0,0 @@
|
||||
package fr.jackcartersmith.ob.interfaces;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import fr.jackcartersmith.orbsat.OBNetworkClient;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.network.play.client.C17PacketCustomPayload;
|
||||
|
||||
public class PhotonSending extends PhotonConsuming
|
||||
{
|
||||
public int outputRate;
|
||||
public int listSize;
|
||||
public int scaledOutput;
|
||||
private int tickCount = 0;
|
||||
public float rotate = -3.141F;
|
||||
|
||||
public List<PhotonRecieving> getNearbyPhotonRecievingEntities()
|
||||
{
|
||||
int radius = OSConstants.PhotonSendingRadius;
|
||||
ArrayList entities = new ArrayList();
|
||||
int xC = this.xCoord;
|
||||
int yC = this.yCoord;
|
||||
int zC = this.zCoord;
|
||||
|
||||
for (int x = radius / 2 * -1; x <= radius / 2; ++x)
|
||||
{
|
||||
for (int y = radius / 2 * -1; y <= radius / 2; ++y)
|
||||
{
|
||||
for (int z = radius / 2 * -1; z <= radius / 2; ++z)
|
||||
{
|
||||
if (this.worldObj.getTileEntity(xC + x, yC + y, zC + z) instanceof PhotonRecieving && entities.size() <= 3)
|
||||
{
|
||||
entities.add((PhotonRecieving)this.worldObj.getTileEntity(xC + x, yC + y, zC + z));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return entities;
|
||||
}
|
||||
|
||||
public void sendPhotonsTo(PhotonRecieving entity, int power)
|
||||
{
|
||||
PhotonRecieving photonRecievingEntity = (PhotonRecieving)this.worldObj.getTileEntity(entity.xCoord, entity.yCoord, entity.zCoord);
|
||||
|
||||
if (photonRecievingEntity != null)
|
||||
{
|
||||
photonRecievingEntity.recievePhotons(power);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
|
||||
* ticks and creates a new spawn inside its implementation.
|
||||
*/
|
||||
public void updateEntity()
|
||||
{
|
||||
this.rotate += 0.01F;
|
||||
|
||||
if (this.rotate >= 3.141F)
|
||||
{
|
||||
this.rotate = -3.141F;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
List entitiesForPowerRecieving = this.getNearbyPhotonRecievingEntities();
|
||||
int scaledPowerOutput = 0;
|
||||
int howMany = entitiesForPowerRecieving.size();
|
||||
|
||||
if (howMany != 0)
|
||||
{
|
||||
scaledPowerOutput = this.getCurrentCharge() / howMany;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.scaledOutput = this.getCurrentCharge();
|
||||
}
|
||||
|
||||
if (entitiesForPowerRecieving.size() > 0 && this.getCurrentCharge() > 0)
|
||||
{
|
||||
Iterator i$ = entitiesForPowerRecieving.iterator();
|
||||
|
||||
while (i$.hasNext())
|
||||
{
|
||||
PhotonRecieving entity = (PhotonRecieving)i$.next();
|
||||
this.sendPhotonsTo(entity, scaledPowerOutput);
|
||||
}
|
||||
}
|
||||
|
||||
this.setScaledOutput(scaledPowerOutput);
|
||||
this.setOutputRate(scaledPowerOutput * howMany);
|
||||
this.setListSize(howMany);
|
||||
|
||||
if (this.tickCount == 10)
|
||||
{
|
||||
this.sendChangeToClient7();
|
||||
this.sendChangeToClient9();
|
||||
this.sendChangeToClient11();
|
||||
this.tickCount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
++this.tickCount;
|
||||
}
|
||||
|
||||
this.setCurrentCharge(this.getCurrentCharge() - scaledPowerOutput * howMany);
|
||||
}
|
||||
}
|
||||
|
||||
public int getOutputRate()
|
||||
{
|
||||
return this.outputRate;
|
||||
}
|
||||
|
||||
public void setOutputRate(int outputRate)
|
||||
{
|
||||
this.outputRate = outputRate;
|
||||
}
|
||||
|
||||
public int getListSize()
|
||||
{
|
||||
return this.listSize;
|
||||
}
|
||||
|
||||
public void setListSize(int listSize)
|
||||
{
|
||||
this.listSize = listSize;
|
||||
}
|
||||
|
||||
public int getScaledOutput()
|
||||
{
|
||||
return this.scaledOutput;
|
||||
}
|
||||
|
||||
public void setScaledOutput(int scaledOutput)
|
||||
{
|
||||
this.scaledOutput = scaledOutput;
|
||||
}
|
||||
|
||||
public void sendChangeToClient7()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(7);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(this.getOutputRate());
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToClient9()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(9);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(this.getScaledOutput());
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToClient11()
|
||||
{
|
||||
/*
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream(8);
|
||||
DataOutputStream outputStream = new DataOutputStream(bos);
|
||||
|
||||
try
|
||||
{
|
||||
outputStream.writeInt(11);
|
||||
outputStream.writeInt(this.xCoord);
|
||||
outputStream.writeInt(this.yCoord);
|
||||
outputStream.writeInt(this.zCoord);
|
||||
outputStream.writeInt(this.getListSize());
|
||||
}
|
||||
catch (Exception var4)
|
||||
{
|
||||
var4.printStackTrace();
|
||||
}
|
||||
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
packet.channel = "OB";
|
||||
packet.data = bos.toByteArray();
|
||||
packet.length = bos.size();
|
||||
PacketDispatcher.sendPacketToAllPlayers(packet);
|
||||
*/
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(11);
|
||||
bos.add(this.xCoord);
|
||||
bos.add(this.yCoord);
|
||||
bos.add(this.zCoord);
|
||||
bos.add(this.getListSize());
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToAll(new OBNetworkClient(bos));
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class DesignatorHighItem extends Item {
|
||||
public DesignatorHighItem(){
|
||||
this.setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||
this.setTextureName(OrbitalSatellite.MODID + ":item_ob_designatorHigh");
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class DesignatorLowItem extends Item {
|
||||
public DesignatorLowItem(){
|
||||
this.setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||
this.setTextureName(OrbitalSatellite.MODID + ":item_ob_designatorLow");
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class DesignatorMedItem extends Item {
|
||||
public DesignatorMedItem(){
|
||||
this.setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||
this.setTextureName(OrbitalSatellite.MODID + ":item_ob_designatorMed");
|
||||
}
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunHighItem$1 extends Thread
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunHighItem this$0;
|
||||
|
||||
LaserGunHighItem$1(LaserGunHighItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (int e = 250; e >= 1; --e)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + e, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + e, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
this.this$0.sendChangeToServer12(this.val$par4, this.val$par5, this.val$par6, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4 + 1, this.val$par5, this.val$par6, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4 - 1, this.val$par5, this.val$par6, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4, this.val$par5, this.val$par6 + 1, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4, this.val$par5, this.val$par6 - 1, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4 + 1, this.val$par5, this.val$par6 + 1, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4 - 1, this.val$par5, this.val$par6 + 1, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4 - 1, this.val$par5, this.val$par6 - 1, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4 + 1, this.val$par5, this.val$par6 - 1, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
catch (InterruptedException var2)
|
||||
{
|
||||
var2.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunHighItem$2 extends Thread
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunHighItem this$0;
|
||||
|
||||
LaserGunHighItem$2(LaserGunHighItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 250; i >= 1; --i)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + i, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + i, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
}
|
||||
catch (InterruptedException var2)
|
||||
{
|
||||
var2.printStackTrace();
|
||||
}
|
||||
|
||||
this.val$par2EntityPlayer.worldObj.playSoundAtEntity(this.val$par2EntityPlayer, "ob:reentry", 1.0F, 1.0F);
|
||||
this.val$par2EntityPlayer.worldObj.playSoundAtEntity(this.val$par2EntityPlayer, "ob:booming", 1.0F, 1.0F);
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
|
||||
if (this.val$par6 != 0)
|
||||
{
|
||||
for (i = 0; i < OSConstants.DesignatorHighMeteorAmount; ++i)
|
||||
{
|
||||
this.this$0.sendChangeToServer2(this.val$par4, this.val$par5 + 100, this.val$par6, OSConstants.DesignatorHighMeteorDamage, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunHighItem$3 extends Thread
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunHighItem this$0;
|
||||
|
||||
LaserGunHighItem$3(LaserGunHighItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (int mp = 250; mp >= 1; --mp)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + mp, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + mp, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
}
|
||||
catch (InterruptedException var2)
|
||||
{
|
||||
var2.printStackTrace();
|
||||
}
|
||||
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
EntityClientPlayerMP var3 = (EntityClientPlayerMP)this.val$par2EntityPlayer;
|
||||
this.this$0.sendChangeToServer(this.val$par4, this.val$par5, this.val$par6, OSConstants.DesignatorHighPhotonStrikePower, var3);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunHighItem$4 implements Runnable
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunHighItem this$0;
|
||||
|
||||
LaserGunHighItem$4(LaserGunHighItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (int mp = 1000; mp >= 1; --mp)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + mp, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + mp, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
}
|
||||
catch (InterruptedException var3)
|
||||
{
|
||||
var3.printStackTrace();
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (!this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par2EntityPlayer.addChatMessage(new ChatComponentText("Firing..."));
|
||||
}
|
||||
|
||||
EntityClientPlayerMP var4 = (EntityClientPlayerMP)this.val$par2EntityPlayer;
|
||||
|
||||
for (int i = 0; i < OSConstants.DesignatorHighLightning; ++i)
|
||||
{
|
||||
this.this$0.sendChangeToServer3(this.val$par4, this.val$par5, this.val$par6, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)this.val$par4, (double)this.val$par5, (double)this.val$par6));
|
||||
this.this$0.sendChangeToServer3(this.val$par4 + 1, this.val$par5, this.val$par6, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)(this.val$par4 + 1), (double)this.val$par5, (double)this.val$par6));
|
||||
this.this$0.sendChangeToServer3(this.val$par4 - 1, this.val$par5, this.val$par6, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)(this.val$par4 - 1), (double)this.val$par5, (double)this.val$par6));
|
||||
this.this$0.sendChangeToServer3(this.val$par4, this.val$par5, this.val$par6 + 1, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)this.val$par4, (double)this.val$par5, (double)(this.val$par6 + 1)));
|
||||
this.this$0.sendChangeToServer3(this.val$par4, this.val$par5, this.val$par6 - 1, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)this.val$par4, (double)this.val$par5, (double)(this.val$par6 - 1)));
|
||||
this.this$0.sendChangeToServer3(this.val$par4 + 1, this.val$par5, this.val$par6 + 1, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)(this.val$par4 + 1), (double)this.val$par5, (double)this.val$par6));
|
||||
this.this$0.sendChangeToServer3(this.val$par4 - 1, this.val$par5, this.val$par6 + 1, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)(this.val$par4 - 1), (double)this.val$par5, (double)this.val$par6));
|
||||
this.this$0.sendChangeToServer3(this.val$par4 - 1, this.val$par5, this.val$par6 - 1, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)this.val$par4, (double)this.val$par5, (double)(this.val$par6 + 1)));
|
||||
this.this$0.sendChangeToServer3(this.val$par4 + 1, this.val$par5, this.val$par6 - 1, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)this.val$par4, (double)this.val$par5, (double)(this.val$par6 - 1)));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,371 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
||||
import fr.jackcartersmith.orbsat.OBNetwork;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class LaserGunHighItem extends Item
|
||||
{
|
||||
public OverriderBlockTileEntity linkedSatelite;
|
||||
public int mode = 0;
|
||||
public String currentMode = "Photon Strike";
|
||||
public MovingObjectPosition pos;
|
||||
|
||||
public LaserGunHighItem()
|
||||
{
|
||||
this.setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||
this.setTextureName(OrbitalSatellite.MODID + ":item_ob_laserGunHigh");
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
|
||||
* update it's contents.
|
||||
*/
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.linkedSatelite == null)
|
||||
{
|
||||
int x = par1ItemStack.stackTagCompound.getInteger("xCoord");
|
||||
int y = par1ItemStack.stackTagCompound.getInteger("xCoord");
|
||||
int z = par1ItemStack.stackTagCompound.getInteger("xCoord");
|
||||
OverriderBlockTileEntity newEntity = (OverriderBlockTileEntity)par2World.getTileEntity(x, y, z);
|
||||
|
||||
if (newEntity != null)
|
||||
{
|
||||
this.linkedSatelite = newEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void saveNBT(ItemStack par1ItemStack, World par2World, OverriderBlockTileEntity entity)
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
par1ItemStack.stackTagCompound.setInteger("xCoord", entity.xCoord);
|
||||
par1ItemStack.stackTagCompound.setInteger("yCoord", entity.yCoord);
|
||||
par1ItemStack.stackTagCompound.setInteger("zCoord", entity.zCoord);
|
||||
}
|
||||
|
||||
/*
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister icon)
|
||||
{
|
||||
this.itemIcon = icon.registerIcon("OB".toLowerCase() + ":laserGunHighItem");
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
this.pos = par3EntityPlayer.rayTrace((double)OSConstants.DesignatorCommitRange, 1.0F);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
MovingObjectPosition e = par3EntityPlayer.rayTrace(5.0D, 1.0F);
|
||||
|
||||
if (e == null)
|
||||
{
|
||||
this.onItemUse(par1ItemStack, par3EntityPlayer, par2World, this.pos.blockX, this.pos.blockY, this.pos.blockZ, 0, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception var5)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
|
||||
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
|
||||
*/
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (par9 != 1.0F && !par2EntityPlayer.isSneaking() && par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Target too close!"));
|
||||
}
|
||||
|
||||
if (par9 == 1.0F || par2EntityPlayer.isSneaking())
|
||||
{
|
||||
if (par3World.getTileEntity(par4, par5, par6) instanceof OverriderBlockTileEntity)
|
||||
{
|
||||
this.linkedSatelite = (OverriderBlockTileEntity)par3World.getTileEntity(par4, par5, par6);
|
||||
this.linkedSatelite.amountOfGuns.put(this.toString(), this);
|
||||
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Overrider set for this designator."));
|
||||
this.saveNBT(par1ItemStack, par3World, this.linkedSatelite);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par2EntityPlayer.isSneaking() && par3World.getTileEntity(par4, par5, par6) == null)
|
||||
{
|
||||
if (this.mode == 4)
|
||||
{
|
||||
this.mode = 0;
|
||||
}
|
||||
|
||||
if (par3World.isRemote && this.linkedSatelite != null)
|
||||
{
|
||||
++this.mode;
|
||||
|
||||
if (this.mode == 1)
|
||||
{
|
||||
this.currentMode = "Photon Strike";
|
||||
}
|
||||
|
||||
if (this.mode == 2)
|
||||
{
|
||||
this.currentMode = "Lightning";
|
||||
}
|
||||
|
||||
if (this.mode == 3)
|
||||
{
|
||||
this.currentMode = "Meteor Shower";
|
||||
}
|
||||
|
||||
if (this.mode == 4)
|
||||
{
|
||||
this.currentMode = "Penetrating Strike";
|
||||
}
|
||||
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Mode set to: " + this.currentMode));
|
||||
}
|
||||
}
|
||||
|
||||
if (this.linkedSatelite != null && this.linkedSatelite.getWorldObj().provider.dimensionId == par2EntityPlayer.dimension)
|
||||
{
|
||||
if (this.linkedSatelite.getCurrentCharge() >= OSConstants.DesignatorHighStrikePUUsage && this.linkedSatelite.shotsLeft > 0)
|
||||
{
|
||||
EntityClientPlayerMP mp;
|
||||
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode != "Penetrating Strike")
|
||||
{
|
||||
mp = (EntityClientPlayerMP)par2EntityPlayer;
|
||||
this.sendChangeToServer15(this.linkedSatelite.xCoord, this.linkedSatelite.yCoord, this.linkedSatelite.zCoord, OSConstants.DesignatorHighStrikePUUsage, mp);
|
||||
--this.linkedSatelite.shotsLeft;
|
||||
}
|
||||
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode == "Penetrating Strike")
|
||||
{
|
||||
mp = (EntityClientPlayerMP)par2EntityPlayer;
|
||||
this.sendChangeToServer15(this.linkedSatelite.xCoord, this.linkedSatelite.yCoord, this.linkedSatelite.zCoord, OSConstants.DesignatorHighStrikePUUsage, mp);
|
||||
--this.linkedSatelite.shotsLeft;
|
||||
}
|
||||
|
||||
if (!par2EntityPlayer.isSneaking())
|
||||
{
|
||||
if (this.currentMode == "Photon Strike")
|
||||
{
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Low Focus Photon strike inbound. Vacate the area!"));
|
||||
}
|
||||
|
||||
this.doAnimationsPhoton(par1ItemStack, par2EntityPlayer, par3World, this.pos.blockX, this.pos.blockY, this.pos.blockZ, par10);
|
||||
}
|
||||
|
||||
if (this.currentMode == "Lightning")
|
||||
{
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Lightning Strike inbound. Vacate the area!"));
|
||||
}
|
||||
|
||||
this.doAnimationsLightning(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
|
||||
if (this.currentMode == "Meteor Shower" && par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Meteor Shower inbound. Vacate the area!"));
|
||||
this.doAnimationsMeteor(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
|
||||
if (this.currentMode == "Penetrating Strike" && par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Penetrating strike inbound!"));
|
||||
this.doAnimationsPenetrate(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par3World.isRemote && this.linkedSatelite.getCurrentCharge() < OSConstants.DesignatorHighStrikePUUsage)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Not enough photon charge on overrider. Needs " + OSConstants.DesignatorHighStrikePUUsage + "PU and only has " + this.linkedSatelite.getCurrentCharge()));
|
||||
}
|
||||
|
||||
if (par3World.isRemote && this.linkedSatelite.shotsLeft < 1)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("No more uses left on the linked satelite in orbit. Launch a new one."));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode != "Penetrating Strike" && this.linkedSatelite == null)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Designator not linked to any overrider."));
|
||||
}
|
||||
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode == "Penetrating Strike" && this.linkedSatelite == null)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Designator not linked to any overrider."));
|
||||
}
|
||||
|
||||
if (this.linkedSatelite != null && this.linkedSatelite.getWorldObj().provider.dimensionId != par2EntityPlayer.dimension)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Linked Overrider not in the same dimension as you! Cannot call strike!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void doAnimationsPenetrate(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
par3World.playSoundAtEntity(par2EntityPlayer, "ob:digging", 0.7F, 0.8F);
|
||||
boolean y = false;
|
||||
LaserGunHighItem$1 buildThread = new LaserGunHighItem$1(this, par3World, par4, par5, par6, par2EntityPlayer);
|
||||
buildThread.start();
|
||||
}
|
||||
|
||||
private void doAnimationsMeteor(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
LaserGunHighItem$2 buildThread = new LaserGunHighItem$2(this, par3World, par4, par5, par6, par2EntityPlayer);
|
||||
buildThread.start();
|
||||
}
|
||||
|
||||
public synchronized void doAnimationsPhoton(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
LaserGunHighItem$3 buildThread = new LaserGunHighItem$3(this, par3World, par4, par5, par6, par2EntityPlayer);
|
||||
buildThread.start();
|
||||
}
|
||||
|
||||
public void doAnimationsLightning(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
(new Thread(new LaserGunHighItem$4(this, par3World, par4, par5, par6, par2EntityPlayer))).start();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void sendChangeToServer(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(2);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void sendChangeToServer2(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(5);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer3(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(9);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer12(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(12);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(1);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer15(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(15);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer24()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(24);
|
||||
bos.add(1);
|
||||
bos.add(1);
|
||||
bos.add(1);
|
||||
bos.add(1);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunLowItem$1 extends Thread
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunLowItem this$0;
|
||||
|
||||
LaserGunLowItem$1(LaserGunLowItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (int e = 1000; e >= 1; --e)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + e, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + e, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
this.this$0.sendChangeToServer12(this.val$par4, this.val$par5, this.val$par6, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
catch (InterruptedException var2)
|
||||
{
|
||||
var2.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunLowItem$2 extends Thread
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunLowItem this$0;
|
||||
|
||||
LaserGunLowItem$2(LaserGunLowItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 1000; i >= 1; --i)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + i, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + i, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
}
|
||||
catch (InterruptedException var2)
|
||||
{
|
||||
var2.printStackTrace();
|
||||
}
|
||||
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
|
||||
if (this.val$par6 != 0)
|
||||
{
|
||||
for (i = 0; i < OSConstants.DesignatorLowMeteorAmount; ++i)
|
||||
{
|
||||
this.this$0.sendChangeToServer2(this.val$par4, this.val$par5 + 100, this.val$par6, OSConstants.DesignatorLowMeteorDamage, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunLowItem$3 extends Thread
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunLowItem this$0;
|
||||
|
||||
LaserGunLowItem$3(LaserGunLowItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (int mp = 1000; mp >= 1; --mp)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + mp, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + mp, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
}
|
||||
catch (InterruptedException var2)
|
||||
{
|
||||
var2.printStackTrace();
|
||||
}
|
||||
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
EntityClientPlayerMP var3 = (EntityClientPlayerMP)this.val$par2EntityPlayer;
|
||||
this.this$0.sendChangeToServer(this.val$par4, this.val$par5, this.val$par6, OSConstants.DesignatorLowPhotonStrikePower, var3);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunLowItem$4 implements Runnable
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunLowItem this$0;
|
||||
|
||||
LaserGunLowItem$4(LaserGunLowItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (int mp = 1000; mp >= 1; --mp)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + mp, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + mp, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
}
|
||||
catch (InterruptedException var3)
|
||||
{
|
||||
var3.printStackTrace();
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (!this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par2EntityPlayer.addChatMessage(new ChatComponentText("Firing..."));
|
||||
}
|
||||
|
||||
EntityClientPlayerMP var4 = (EntityClientPlayerMP)this.val$par2EntityPlayer;
|
||||
|
||||
for (int i = 0; i < OSConstants.DesignatorLowLightning; ++i)
|
||||
{
|
||||
this.this$0.sendChangeToServer3(this.val$par4, this.val$par5, this.val$par6, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)this.val$par4, (double)this.val$par5, (double)this.val$par6));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,372 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
||||
import fr.jackcartersmith.orbsat.OBNetwork;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class LaserGunLowItem extends Item {
|
||||
public OverriderBlockTileEntity linkedSatelite;
|
||||
public int mode = 0;
|
||||
public String currentMode = "Photon Strike";
|
||||
public MovingObjectPosition pos;
|
||||
|
||||
public LaserGunLowItem(){
|
||||
this.setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||
this.setTextureName(OrbitalSatellite.MODID + ":item_ob_laserGunLow");
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
|
||||
* update it's contents.
|
||||
*/
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.linkedSatelite == null)
|
||||
{
|
||||
int x = par1ItemStack.stackTagCompound.getInteger("xCoord");
|
||||
int y = par1ItemStack.stackTagCompound.getInteger("xCoord");
|
||||
int z = par1ItemStack.stackTagCompound.getInteger("xCoord");
|
||||
OverriderBlockTileEntity newEntity = (OverriderBlockTileEntity)par2World.getTileEntity(x, y, z);
|
||||
|
||||
if (newEntity != null)
|
||||
{
|
||||
this.linkedSatelite = newEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void saveNBT(ItemStack par1ItemStack, World par2World, OverriderBlockTileEntity entity)
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
par1ItemStack.stackTagCompound.setInteger("xCoord", entity.xCoord);
|
||||
par1ItemStack.stackTagCompound.setInteger("yCoord", entity.yCoord);
|
||||
par1ItemStack.stackTagCompound.setInteger("zCoord", entity.zCoord);
|
||||
}
|
||||
|
||||
/*
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister icon)
|
||||
{
|
||||
this.itemIcon = icon.registerIcon("OB".toLowerCase() + ":laserGunLowItem");
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
this.pos = par3EntityPlayer.rayTrace((double)OSConstants.DesignatorCommitRange, 1.0F);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
MovingObjectPosition e = par3EntityPlayer.rayTrace(5.0D, 1.0F);
|
||||
|
||||
if (e == null)
|
||||
{
|
||||
this.onItemUse(par1ItemStack, par3EntityPlayer, par2World, this.pos.blockX, this.pos.blockY, this.pos.blockZ, 0, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception var5)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
|
||||
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
|
||||
*/
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
//System.out.print(par8 + "|-|" + par9 + "|-|" + par10);
|
||||
//if (par10 != 1.0F && !par2EntityPlayer.isSneaking() && par3World.isRemote)
|
||||
if (par9 != 1.0F && !par2EntityPlayer.isSneaking() && par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Target too close!"));
|
||||
}
|
||||
|
||||
if (par9 == 1.0F || par2EntityPlayer.isSneaking())
|
||||
{
|
||||
if (par3World.getTileEntity(par4, par5, par6) instanceof OverriderBlockTileEntity)
|
||||
{
|
||||
this.linkedSatelite = (OverriderBlockTileEntity)par3World.getTileEntity(par4, par5, par6);
|
||||
this.linkedSatelite.amountOfGuns.put(this.toString(), this);
|
||||
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Overrider set for this designator."));
|
||||
this.saveNBT(par1ItemStack, par3World, this.linkedSatelite);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par2EntityPlayer.isSneaking() && par3World.getTileEntity(par4, par5, par6) == null)
|
||||
{
|
||||
if (this.mode == 4)
|
||||
{
|
||||
this.mode = 0;
|
||||
}
|
||||
|
||||
if (par3World.isRemote && this.linkedSatelite != null)
|
||||
{
|
||||
++this.mode;
|
||||
|
||||
if (this.mode == 1)
|
||||
{
|
||||
this.currentMode = "Photon Strike";
|
||||
}
|
||||
|
||||
if (this.mode == 2)
|
||||
{
|
||||
this.currentMode = "Lightning";
|
||||
}
|
||||
|
||||
if (this.mode == 3)
|
||||
{
|
||||
this.currentMode = "Meteor Shower";
|
||||
}
|
||||
|
||||
if (this.mode == 4)
|
||||
{
|
||||
this.currentMode = "Penetrating Strike";
|
||||
}
|
||||
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Mode set to: " + this.currentMode));
|
||||
}
|
||||
}
|
||||
|
||||
if (this.linkedSatelite != null && this.linkedSatelite.getWorldObj().provider.dimensionId == par2EntityPlayer.dimension)
|
||||
{
|
||||
if (this.linkedSatelite.getCurrentCharge() >= OSConstants.DesignatorLowStrikePUUsage && this.linkedSatelite.shotsLeft > 0)
|
||||
{
|
||||
EntityClientPlayerMP mp;
|
||||
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode != "Penetrating Strike")
|
||||
{
|
||||
mp = (EntityClientPlayerMP)par2EntityPlayer;
|
||||
this.sendChangeToServer15(this.linkedSatelite.xCoord, this.linkedSatelite.yCoord, this.linkedSatelite.zCoord, OSConstants.DesignatorLowStrikePUUsage, mp);
|
||||
--this.linkedSatelite.shotsLeft;
|
||||
}
|
||||
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode == "Penetrating Strike")
|
||||
{
|
||||
mp = (EntityClientPlayerMP)par2EntityPlayer;
|
||||
this.sendChangeToServer15(this.linkedSatelite.xCoord, this.linkedSatelite.yCoord, this.linkedSatelite.zCoord, OSConstants.DesignatorLowStrikePUUsage, mp);
|
||||
--this.linkedSatelite.shotsLeft;
|
||||
}
|
||||
|
||||
if (!par2EntityPlayer.isSneaking())
|
||||
{
|
||||
if (this.currentMode == "Photon Strike")
|
||||
{
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Low Focus Photon strike inbound. Vacate the area!"));
|
||||
}
|
||||
|
||||
this.doAnimationsPhoton(par1ItemStack, par2EntityPlayer, par3World, this.pos.blockX, this.pos.blockY, this.pos.blockZ, par10);
|
||||
}
|
||||
|
||||
if (this.currentMode == "Lightning")
|
||||
{
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Lightning Strike inbound. Vacate the area!"));
|
||||
}
|
||||
|
||||
this.doAnimationsLightning(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
|
||||
if (this.currentMode == "Meteor Shower" && par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Meteor Shower inbound. Vacate the area!"));
|
||||
this.doAnimationsMeteor(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
|
||||
if (this.currentMode == "Penetrating Strike" && par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Penetrating strike inbound!"));
|
||||
this.doAnimationsPenetrate(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par3World.isRemote && this.linkedSatelite.getCurrentCharge() < OSConstants.DesignatorLowStrikePUUsage)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Not enough photon charge on overrider. Needs " + OSConstants.DesignatorLowStrikePUUsage + "PU and only has " + this.linkedSatelite.getCurrentCharge()));
|
||||
}
|
||||
|
||||
if (par3World.isRemote && this.linkedSatelite.shotsLeft < 1)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("No more uses left on the linked satelite in orbit. Launch a new one."));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode != "Penetrating Strike" && this.linkedSatelite == null)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Designator not linked to any overrider."));
|
||||
}
|
||||
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode == "Penetrating Strike" && this.linkedSatelite == null)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Designator not linked to any overrider."));
|
||||
}
|
||||
|
||||
if (this.linkedSatelite != null && this.linkedSatelite.getWorldObj().provider.dimensionId != par2EntityPlayer.dimension)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Linked Overrider not in the same dimension as you! Cannot call strike!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void doAnimationsPenetrate(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
par3World.playSoundAtEntity(par2EntityPlayer, "ob:digging", 0.7F, 0.8F);
|
||||
boolean y = false;
|
||||
LaserGunLowItem$1 buildThread = new LaserGunLowItem$1(this, par3World, par4, par5, par6, par2EntityPlayer);
|
||||
buildThread.start();
|
||||
}
|
||||
|
||||
private void doAnimationsMeteor(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
LaserGunLowItem$2 buildThread = new LaserGunLowItem$2(this, par3World, par4, par5, par6, par2EntityPlayer);
|
||||
buildThread.start();
|
||||
}
|
||||
|
||||
public synchronized void doAnimationsPhoton(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
LaserGunLowItem$3 buildThread = new LaserGunLowItem$3(this, par3World, par4, par5, par6, par2EntityPlayer);
|
||||
buildThread.start();
|
||||
}
|
||||
|
||||
public void doAnimationsLightning(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
(new Thread(new LaserGunLowItem$4(this, par3World, par4, par5, par6, par2EntityPlayer))).start();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void sendChangeToServer(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(2);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void sendChangeToServer2(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(5);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer3(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(9);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer12(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(12);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(1);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer15(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(15);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer24()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(24);
|
||||
bos.add(1);
|
||||
bos.add(1);
|
||||
bos.add(1);
|
||||
bos.add(1);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunMedItem$1 extends Thread
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunMedItem this$0;
|
||||
|
||||
LaserGunMedItem$1(LaserGunMedItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (int e = 1000; e >= 1; --e)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + e, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + e, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
this.this$0.sendChangeToServer12(this.val$par4, this.val$par5, this.val$par6, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4 + 1, this.val$par5, this.val$par6, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4 - 1, this.val$par5, this.val$par6, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4, this.val$par5, this.val$par6 + 1, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.this$0.sendChangeToServer12(this.val$par4, this.val$par5, this.val$par6 - 1, 0, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
catch (InterruptedException var2)
|
||||
{
|
||||
var2.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunMedItem$2 extends Thread
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunMedItem this$0;
|
||||
|
||||
LaserGunMedItem$2(LaserGunMedItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 1000; i >= 1; --i)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + i, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + i, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
}
|
||||
catch (InterruptedException var2)
|
||||
{
|
||||
var2.printStackTrace();
|
||||
}
|
||||
|
||||
this.val$par2EntityPlayer.worldObj.playSoundAtEntity(this.val$par2EntityPlayer, "ob:reentry", 1.0F, 1.0F);
|
||||
this.val$par2EntityPlayer.worldObj.playSoundAtEntity(this.val$par2EntityPlayer, "ob:booming", 1.0F, 1.0F);
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
|
||||
if (this.val$par6 != 0)
|
||||
{
|
||||
for (i = 0; i < OSConstants.DesignatorMedMeteorAmount; ++i)
|
||||
{
|
||||
this.this$0.sendChangeToServer2(this.val$par4, this.val$par5 + 100, this.val$par6, OSConstants.DesignatorMedMeteorDamage, (EntityClientPlayerMP)this.val$par2EntityPlayer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunMedItem$3 extends Thread
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunMedItem this$0;
|
||||
|
||||
LaserGunMedItem$3(LaserGunMedItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (int mp = 1000; mp >= 1; --mp)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + mp, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + mp, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
}
|
||||
catch (InterruptedException var2)
|
||||
{
|
||||
var2.printStackTrace();
|
||||
}
|
||||
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
EntityClientPlayerMP var3 = (EntityClientPlayerMP)this.val$par2EntityPlayer;
|
||||
this.this$0.sendChangeToServer(this.val$par4, this.val$par5, this.val$par6, OSConstants.DesignatorMedPhotonStrikePower, var3);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
class LaserGunMedItem$4 implements Runnable
|
||||
{
|
||||
final World val$par3World;
|
||||
|
||||
final int val$par4;
|
||||
|
||||
final int val$par5;
|
||||
|
||||
final int val$par6;
|
||||
|
||||
final EntityPlayer val$par2EntityPlayer;
|
||||
|
||||
final LaserGunMedItem this$0;
|
||||
|
||||
LaserGunMedItem$4(LaserGunMedItem var1, World var2, int var3, int var4, int var5, EntityPlayer var6)
|
||||
{
|
||||
this.this$0 = var1;
|
||||
this.val$par3World = var2;
|
||||
this.val$par4 = var3;
|
||||
this.val$par5 = var4;
|
||||
this.val$par6 = var5;
|
||||
this.val$par2EntityPlayer = var6;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
for (int mp = 1000; mp >= 1; --mp)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + mp, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + mp, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlock(this.val$par4, this.val$par5 + 1, this.val$par6, OSBlocks.laserLow);
|
||||
this.val$par3World.setBlock(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord, OSBlocks.laserLow);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Thread.sleep(5000L);
|
||||
}
|
||||
catch (InterruptedException var3)
|
||||
{
|
||||
var3.printStackTrace();
|
||||
}
|
||||
|
||||
if (this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par3World.setBlockToAir(this.val$par4, this.val$par5 + 1, this.val$par6);
|
||||
this.val$par3World.setBlockToAir(this.this$0.linkedSatelite.xCoord, this.this$0.linkedSatelite.yCoord + 1, this.this$0.linkedSatelite.zCoord);
|
||||
}
|
||||
|
||||
if (!this.val$par3World.isRemote)
|
||||
{
|
||||
this.val$par2EntityPlayer.addChatMessage(new ChatComponentText("Firing..."));
|
||||
}
|
||||
|
||||
EntityClientPlayerMP var4 = (EntityClientPlayerMP)this.val$par2EntityPlayer;
|
||||
|
||||
for (int i = 0; i < OSConstants.DesignatorMedLightning; ++i)
|
||||
{
|
||||
this.this$0.sendChangeToServer3(this.val$par4, this.val$par5, this.val$par6, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)this.val$par4, (double)this.val$par5, (double)this.val$par6));
|
||||
this.this$0.sendChangeToServer3(this.val$par4 + 1, this.val$par5, this.val$par6, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)(this.val$par4 + 1), (double)this.val$par5, (double)this.val$par6));
|
||||
this.this$0.sendChangeToServer3(this.val$par4 - 1, this.val$par5, this.val$par6, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)(this.val$par4 - 1), (double)this.val$par5, (double)this.val$par6));
|
||||
this.this$0.sendChangeToServer3(this.val$par4, this.val$par5, this.val$par6 + 1, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)this.val$par4, (double)this.val$par5, (double)(this.val$par6 + 1)));
|
||||
this.this$0.sendChangeToServer3(this.val$par4, this.val$par5, this.val$par6 - 1, 1, var4);
|
||||
this.val$par3World.spawnEntityInWorld(new EntityLightningBolt(this.val$par3World, (double)this.val$par4, (double)this.val$par5, (double)(this.val$par6 - 1)));
|
||||
}
|
||||
}
|
||||
}
|
@ -1,370 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
||||
import fr.jackcartersmith.orbsat.OBNetwork;
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class LaserGunMedItem extends Item
|
||||
{
|
||||
public OverriderBlockTileEntity linkedSatelite;
|
||||
public int mode = 0;
|
||||
public String currentMode = "Photon Strike";
|
||||
public MovingObjectPosition pos;
|
||||
|
||||
public LaserGunMedItem()
|
||||
{
|
||||
this.setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||
this.setTextureName(OrbitalSatellite.MODID + ":item_ob_laserGunMed");
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
|
||||
* update it's contents.
|
||||
*/
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if (this.linkedSatelite == null)
|
||||
{
|
||||
int x = par1ItemStack.stackTagCompound.getInteger("xCoord");
|
||||
int y = par1ItemStack.stackTagCompound.getInteger("xCoord");
|
||||
int z = par1ItemStack.stackTagCompound.getInteger("xCoord");
|
||||
OverriderBlockTileEntity newEntity = (OverriderBlockTileEntity)par2World.getTileEntity(x, y, z);
|
||||
|
||||
if (newEntity != null)
|
||||
{
|
||||
this.linkedSatelite = newEntity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void saveNBT(ItemStack par1ItemStack, World par2World, OverriderBlockTileEntity entity)
|
||||
{
|
||||
if (par1ItemStack.stackTagCompound == null)
|
||||
{
|
||||
par1ItemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
par1ItemStack.stackTagCompound.setInteger("xCoord", entity.xCoord);
|
||||
par1ItemStack.stackTagCompound.setInteger("yCoord", entity.yCoord);
|
||||
par1ItemStack.stackTagCompound.setInteger("zCoord", entity.zCoord);
|
||||
}
|
||||
|
||||
/*
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister icon)
|
||||
{
|
||||
this.itemIcon = icon.registerIcon("OB".toLowerCase() + ":laserGunMedItem");
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
||||
*/
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
this.pos = par3EntityPlayer.rayTrace((double)OSConstants.DesignatorCommitRange, 1.0F);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (par2World.isRemote)
|
||||
{
|
||||
MovingObjectPosition e = par3EntityPlayer.rayTrace(5.0D, 1.0F);
|
||||
|
||||
if (e == null)
|
||||
{
|
||||
this.onItemUse(par1ItemStack, par3EntityPlayer, par2World, this.pos.blockX, this.pos.blockY, this.pos.blockZ, 0, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception var5)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
|
||||
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
|
||||
*/
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
if (par9 != 1.0F && !par2EntityPlayer.isSneaking() && par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Target too close!"));
|
||||
}
|
||||
|
||||
if (par9 == 1.0F || par2EntityPlayer.isSneaking())
|
||||
{
|
||||
if (par3World.getTileEntity(par4, par5, par6) instanceof OverriderBlockTileEntity)
|
||||
{
|
||||
this.linkedSatelite = (OverriderBlockTileEntity)par3World.getTileEntity(par4, par5, par6);
|
||||
this.linkedSatelite.amountOfGuns.put(this.toString(), this);
|
||||
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Overrider set for this designator."));
|
||||
this.saveNBT(par1ItemStack, par3World, this.linkedSatelite);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par2EntityPlayer.isSneaking() && par3World.getTileEntity(par4, par5, par6) == null)
|
||||
{
|
||||
if (this.mode == 4)
|
||||
{
|
||||
this.mode = 0;
|
||||
}
|
||||
|
||||
if (par3World.isRemote && this.linkedSatelite != null)
|
||||
{
|
||||
++this.mode;
|
||||
|
||||
if (this.mode == 1)
|
||||
{
|
||||
this.currentMode = "Photon Strike";
|
||||
}
|
||||
|
||||
if (this.mode == 2)
|
||||
{
|
||||
this.currentMode = "Lightning";
|
||||
}
|
||||
|
||||
if (this.mode == 3)
|
||||
{
|
||||
this.currentMode = "Meteor Shower";
|
||||
}
|
||||
|
||||
if (this.mode == 4)
|
||||
{
|
||||
this.currentMode = "Penetrating Strike";
|
||||
}
|
||||
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Mode set to: " + this.currentMode));
|
||||
}
|
||||
}
|
||||
|
||||
if (this.linkedSatelite != null && this.linkedSatelite.getWorldObj().provider.dimensionId == par2EntityPlayer.dimension)
|
||||
{
|
||||
if (this.linkedSatelite.getCurrentCharge() >= OSConstants.DesignatorMedStrikePUUsage && this.linkedSatelite.shotsLeft > 0)
|
||||
{
|
||||
EntityClientPlayerMP mp;
|
||||
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode != "Penetrating Strike")
|
||||
{
|
||||
mp = (EntityClientPlayerMP)par2EntityPlayer;
|
||||
this.sendChangeToServer15(this.linkedSatelite.xCoord, this.linkedSatelite.yCoord, this.linkedSatelite.zCoord, OSConstants.DesignatorMedStrikePUUsage, mp);
|
||||
--this.linkedSatelite.shotsLeft;
|
||||
}
|
||||
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode == "Penetrating Strike")
|
||||
{
|
||||
mp = (EntityClientPlayerMP)par2EntityPlayer;
|
||||
this.sendChangeToServer15(this.linkedSatelite.xCoord, this.linkedSatelite.yCoord, this.linkedSatelite.zCoord, OSConstants.DesignatorMedStrikePUUsage, mp);
|
||||
--this.linkedSatelite.shotsLeft;
|
||||
}
|
||||
|
||||
if (!par2EntityPlayer.isSneaking())
|
||||
{
|
||||
if (this.currentMode == "Photon Strike")
|
||||
{
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Low Focus Photon strike inbound. Vacate the area!"));
|
||||
}
|
||||
|
||||
this.doAnimationsPhoton(par1ItemStack, par2EntityPlayer, par3World, this.pos.blockX, this.pos.blockY, this.pos.blockZ, par10);
|
||||
}
|
||||
|
||||
if (this.currentMode == "Lightning")
|
||||
{
|
||||
if (!par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Lightning Strike inbound. Vacate the area!"));
|
||||
}
|
||||
|
||||
this.doAnimationsLightning(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
|
||||
if (this.currentMode == "Meteor Shower" && par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Meteor Shower inbound. Vacate the area!"));
|
||||
this.doAnimationsMeteor(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
|
||||
if (this.currentMode == "Penetrating Strike" && par3World.isRemote)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Penetrating strike inbound!"));
|
||||
this.doAnimationsPenetrate(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par3World.isRemote && this.linkedSatelite.getCurrentCharge() < OSConstants.DesignatorMedStrikePUUsage)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Not enough photon charge on overrider. Needs " + OSConstants.DesignatorMedStrikePUUsage + "PU and only has " + this.linkedSatelite.getCurrentCharge()));
|
||||
}
|
||||
|
||||
if (par3World.isRemote && this.linkedSatelite.shotsLeft < 1)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("No more uses left on the linked satelite in orbit. Launch a new one."));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode != "Penetrating Strike" && this.linkedSatelite == null)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Designator not linked to any overrider."));
|
||||
}
|
||||
|
||||
if (par3World.isRemote && !par2EntityPlayer.isSneaking() && this.currentMode == "Penetrating Strike" && this.linkedSatelite == null)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Designator not linked to any overrider."));
|
||||
}
|
||||
|
||||
if (this.linkedSatelite != null && this.linkedSatelite.getWorldObj().provider.dimensionId != par2EntityPlayer.dimension)
|
||||
{
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentText("Linked Overrider not in the same dimension as you! Cannot call strike!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void doAnimationsPenetrate(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
boolean y = false;
|
||||
LaserGunMedItem$1 buildThread = new LaserGunMedItem$1(this, par3World, par4, par5, par6, par2EntityPlayer);
|
||||
buildThread.start();
|
||||
}
|
||||
|
||||
private void doAnimationsMeteor(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
LaserGunMedItem$2 buildThread = new LaserGunMedItem$2(this, par3World, par4, par5, par6, par2EntityPlayer);
|
||||
buildThread.start();
|
||||
}
|
||||
|
||||
public synchronized void doAnimationsPhoton(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
LaserGunMedItem$3 buildThread = new LaserGunMedItem$3(this, par3World, par4, par5, par6, par2EntityPlayer);
|
||||
buildThread.start();
|
||||
}
|
||||
|
||||
public void doAnimationsLightning(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
||||
{
|
||||
this.sendChangeToServer24();
|
||||
(new Thread(new LaserGunMedItem$4(this, par3World, par4, par5, par6, par2EntityPlayer))).start();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void sendChangeToServer(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(2);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void sendChangeToServer2(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(5);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer3(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(9);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer12(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(12);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(1);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer15(int xCoord, int yCoord, int zCoord, int power, EntityClientPlayerMP mp)
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(15);
|
||||
bos.add(xCoord);
|
||||
bos.add(yCoord);
|
||||
bos.add(zCoord);
|
||||
bos.add(power);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
|
||||
public void sendChangeToServer24()
|
||||
{
|
||||
List<Integer> bos = new ArrayList<Integer>();
|
||||
|
||||
bos.add(24);
|
||||
bos.add(1);
|
||||
bos.add(1);
|
||||
bos.add(1);
|
||||
bos.add(1);
|
||||
|
||||
OrbitalSatellite.obNetwork.sendToServer(new OBNetwork(bos));
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class LenseItem extends Item{
|
||||
public LenseItem(){
|
||||
this.setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||
this.setTextureName(OrbitalSatellite.MODID + ":item_ob_lense");
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class PhotonCapacitorItem extends Item{
|
||||
public PhotonCapacitorItem(){
|
||||
this.setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||
this.setTextureName(OrbitalSatellite.MODID + ":item_ob_capacitor");
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package fr.jackcartersmith.ob.items;
|
||||
|
||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class PhotonCondenserItem extends Item {
|
||||
public PhotonCondenserItem(){
|
||||
this.setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||
this.setTextureName(OrbitalSatellite.MODID + ":item_ob_condenser");
|
||||
}
|
||||
}
|
@ -1,109 +0,0 @@
|
||||
package fr.jackcartersmith.ob.libs;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import fr.jackcartersmith.ob.models.SateliteRenderer;
|
||||
import fr.jackcartersmith.ob.models.TileEntityDefenderRenderer;
|
||||
import fr.jackcartersmith.ob.models.TileEntityExtenderRenderer;
|
||||
import fr.jackcartersmith.ob.models.TileEntityInverterAdvRenderer;
|
||||
import fr.jackcartersmith.ob.models.TileEntityOverriderRenderer;
|
||||
import fr.jackcartersmith.ob.models.TileEntityPhotonAcceleratorRenderer;
|
||||
import fr.jackcartersmith.ob.models.TileEntityPhotonDeceleratorRenderer;
|
||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class TESRInventoryRenderer implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public int getRenderId()
|
||||
{
|
||||
return ClientProxy.tesrRenderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block arg0, int arg1, int arg2, RenderBlocks arg3)
|
||||
{
|
||||
if(arg0 == OSBlocks.defender && arg1 == 0)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityDefenderRenderer.location);
|
||||
TileEntityDefenderRenderer.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if(arg0 == OSBlocks.photonAccelerator && arg1 == 0)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityPhotonAcceleratorRenderer.location);
|
||||
TileEntityPhotonAcceleratorRenderer.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if(arg0 == OSBlocks.photonDecelerator && arg1 == 0)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityPhotonDeceleratorRenderer.location);
|
||||
TileEntityPhotonDeceleratorRenderer.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if(arg0 == OSBlocks.photonInverterAdv && arg1 == 0)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityInverterAdvRenderer.location);
|
||||
TileEntityInverterAdvRenderer.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if(arg0 == OSBlocks.extender && arg1 == 0)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityExtenderRenderer.location);
|
||||
TileEntityExtenderRenderer.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if(arg0 == OSBlocks.overrider && arg1 == 0)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TileEntityOverriderRenderer.location);
|
||||
TileEntityOverriderRenderer.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if(arg0 == OSBlocks.satelite && arg1 == 0)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(SateliteRenderer.location);
|
||||
SateliteRenderer.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess arg0, int arg1, int arg2, int arg3, Block arg4, int arg5, RenderBlocks arg6)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int arg0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.*;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.DefenderLaserTileEntity;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class DefenderLaserRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
public ModelDefenderLaserEvo model = new ModelDefenderLaserEvo();
|
||||
public static ResourceLocation location = new ResourceLocation("ob", "textures/blocks/defenderLaserEvo.png");
|
||||
float comeIn = 0.0F;
|
||||
float counter = 0.0F;
|
||||
String color = "";
|
||||
|
||||
public DefenderLaserRenderer()
|
||||
{
|
||||
this.func_147497_a(TileEntityRendererDispatcher.instance);
|
||||
}
|
||||
|
||||
public void renderAModelAt(DefenderLaserTileEntity tile, double d, double d1, double d2, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
float scale = (1F / 16F);
|
||||
//float coreRotation = tile.coreRotation + (partialTick * tile.coreSpeed);
|
||||
//float ringRotation = tile.ringRotation + (partialTick * tile.ringSpeed);
|
||||
/*
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, 1.0F);
|
||||
//GL11.glRotatef(rotation * 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glColor3d(0.5, 0.0, 0.5);
|
||||
//GL11.glColor4d(1.0D, 0.0D, 10.0D, 200.0D);
|
||||
//this.model.Shape1.rotateAngleY = rotation;
|
||||
//this.model.renderSpecific(this.model.Shape1);
|
||||
*/
|
||||
this.bindTexture(location);
|
||||
//GL11.glRotated(90, 1, 0, 0);
|
||||
//GL11.glTranslated(0, -0.58, 0);
|
||||
//GL11.glScaled(0.95, 0.95, 0.95);
|
||||
//GL11.glEnable(GL11.GL_BLEND);
|
||||
//GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
//GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, 1.0F);
|
||||
//GL11.glRotatef(rotation * 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
model.render(null, -70F, 30F, 0F, 0F, 0F, scale);
|
||||
//GL11.glDisable(GL11.GL_BLEND);
|
||||
//GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
this.renderAModelAt((DefenderLaserTileEntity)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
@ -1,92 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.LaserLowTileEntity;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class LaserLowRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
//public ModelLaser model = new ModelLaser();
|
||||
public static ModelLaser model = new ModelLaser();
|
||||
public static ResourceLocation location = new ResourceLocation("ob", "textures/blocks/laserLow.png");
|
||||
float comeIn = 0.0F;
|
||||
float counter = 0.0F;
|
||||
String color = "";
|
||||
|
||||
public LaserLowRenderer()
|
||||
{
|
||||
this.func_147497_a(TileEntityRendererDispatcher.instance);
|
||||
}
|
||||
|
||||
public void renderAModelAt(LaserLowTileEntity tile, double d, double d1, double d2, float f)
|
||||
{
|
||||
if (tile.getWorldObj() != null)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
float rotation = tile.rotate;
|
||||
this.comeIn = tile.insideCounter;
|
||||
float counter = tile.color;
|
||||
//float grow = tile.grow;
|
||||
int r = (int)(50.0F - counter);
|
||||
int g = (int)(50.0F - counter);
|
||||
int b = (int)(50.0F - counter);
|
||||
this.bindTexture(location);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, -1.0F);
|
||||
GL11.glRotatef(rotation * 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
|
||||
if (tile.low)
|
||||
{
|
||||
GL11.glColor4d((double)r, (double)g, 255.0D, 200.0D);
|
||||
}
|
||||
|
||||
if (tile.med)
|
||||
{
|
||||
GL11.glColor4d(255.0D, (double)(255 + g), (double)b, 200.0D);
|
||||
}
|
||||
|
||||
if (tile.high)
|
||||
{
|
||||
GL11.glColor4d(255.0D, (double)g, (double)b, 200.0D);
|
||||
}
|
||||
|
||||
ModelRenderer shape1 = this.model.Shape1;
|
||||
this.model.renderSpecific(shape1);
|
||||
GL11.glColor4d(1000.0D, 0.0D, 0.0D, 255.0D);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
this.model.Shape2.offsetX = this.comeIn * -1.0F;
|
||||
this.model.Shape2.offsetZ = this.comeIn * -1.0F;
|
||||
ModelRenderer shape2 = this.model.Shape2;
|
||||
this.model.renderSpecific(shape2);
|
||||
this.model.Shape3.offsetX = this.comeIn;
|
||||
this.model.Shape3.offsetZ = this.comeIn * -1.0F;
|
||||
ModelRenderer shape3 = this.model.Shape3;
|
||||
this.model.renderSpecific(shape3);
|
||||
this.model.Shape4.offsetX = this.comeIn * -1.0F;
|
||||
this.model.Shape4.offsetZ = this.comeIn;
|
||||
ModelRenderer shape4 = this.model.Shape4;
|
||||
this.model.renderSpecific(shape4);
|
||||
this.model.Shape5.offsetX = this.comeIn;
|
||||
this.model.Shape5.offsetZ = this.comeIn;
|
||||
ModelRenderer shape5 = this.model.Shape5;
|
||||
this.model.renderSpecific(shape5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
this.renderAModelAt((LaserLowTileEntity)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelDefender extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
ModelRenderer Shape7;
|
||||
ModelRenderer Shape8;
|
||||
|
||||
public ModelDefender()
|
||||
{
|
||||
this.textureWidth = 128;
|
||||
this.textureHeight = 128;
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(-8.0F, 0.0F, -8.0F, 16, 1, 16);
|
||||
this.Shape1.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.Shape1.setTextureSize(128, 128);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape2 = new ModelRenderer(this, 64, 0);
|
||||
this.Shape2.addBox(0.0F, 0.0F, -4.0F, 1, 7, 8);
|
||||
this.Shape2.setRotationPoint(0.0F, 16.0F, -7.0F);
|
||||
this.Shape2.setTextureSize(128, 128);
|
||||
this.Shape2.mirror = true;
|
||||
this.setRotation(this.Shape2, 0.0F, ((float)Math.PI / 2F), 0.0F);
|
||||
this.Shape3 = new ModelRenderer(this, 64, 0);
|
||||
this.Shape3.addBox(0.0F, 0.0F, -4.0F, 1, 7, 8);
|
||||
this.Shape3.setRotationPoint(-7.0F, 16.0F, 0.0F);
|
||||
this.Shape3.setTextureSize(128, 128);
|
||||
this.Shape3.mirror = true;
|
||||
this.setRotation(this.Shape3, 0.0F, (float)Math.PI, 0.0F);
|
||||
this.Shape4 = new ModelRenderer(this, 64, 0);
|
||||
this.Shape4.addBox(0.0F, 0.0F, -4.0F, 1, 7, 8);
|
||||
this.Shape4.setRotationPoint(0.0F, 16.0F, 7.0F);
|
||||
this.Shape4.setTextureSize(128, 128);
|
||||
this.Shape4.mirror = true;
|
||||
this.setRotation(this.Shape4, 0.0F, -((float)Math.PI / 2F), 0.0F);
|
||||
this.Shape5 = new ModelRenderer(this, 64, 0);
|
||||
this.Shape5.addBox(0.0F, 0.0F, -4.0F, 1, 7, 8);
|
||||
this.Shape5.setRotationPoint(7.0F, 16.0F, 0.0F);
|
||||
this.Shape5.setTextureSize(128, 128);
|
||||
this.Shape5.mirror = true;
|
||||
this.setRotation(this.Shape5, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape6 = new ModelRenderer(this, 0, 21);
|
||||
this.Shape6.addBox(-1.0F, 0.0F, -1.0F, 2, 22, 2);
|
||||
this.Shape6.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.Shape6.setTextureSize(128, 128);
|
||||
this.Shape6.mirror = true;
|
||||
this.setRotation(this.Shape6, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape7 = new ModelRenderer(this, 85, 0);
|
||||
this.Shape7.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6);
|
||||
this.Shape7.setRotationPoint(0.0F, -3.0F, 0.0F);
|
||||
this.Shape7.setTextureSize(128, 128);
|
||||
this.Shape7.mirror = true;
|
||||
this.setRotation(this.Shape7, ((float)Math.PI / 4F), 0.0F, ((float)Math.PI / 4F));
|
||||
this.Shape8 = new ModelRenderer(this, 10, 26);
|
||||
this.Shape8.addBox(-3.0F, 0.0F, -3.0F, 6, 2, 6);
|
||||
this.Shape8.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.Shape8.setTextureSize(128, 128);
|
||||
this.Shape8.mirror = true;
|
||||
this.setRotation(this.Shape8, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
this.Shape1.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape4.render(f5);
|
||||
this.Shape5.render(f5);
|
||||
this.Shape6.render(f5);
|
||||
this.Shape7.render(f5);
|
||||
this.Shape8.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Shape1.render(0.0625F);
|
||||
this.Shape2.render(0.0625F);
|
||||
this.Shape3.render(0.0625F);
|
||||
this.Shape4.render(0.0625F);
|
||||
this.Shape5.render(0.0625F);
|
||||
this.Shape6.render(0.0625F);
|
||||
this.Shape8.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelExtender extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
|
||||
public ModelExtender()
|
||||
{
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(-7.0F, 0.0F, -7.0F, 14, 15, 14);
|
||||
this.Shape1.setRotationPoint(0.0F, 9.0F, 0.0F);
|
||||
this.Shape1.setTextureSize(64, 64);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape2 = new ModelRenderer(this, 30, 30);
|
||||
this.Shape2.addBox(-8.0F, 1.0F, -6.0F, 1, 13, 12);
|
||||
this.Shape2.setRotationPoint(0.0F, 9.0F, 0.0F);
|
||||
this.Shape2.setTextureSize(64, 64);
|
||||
this.Shape2.mirror = true;
|
||||
this.setRotation(this.Shape2, 0.0F, (float)Math.PI, 0.0F);
|
||||
this.Shape3 = new ModelRenderer(this, 30, 30);
|
||||
this.Shape3.addBox(-8.0F, 1.0F, -6.0F, 1, 13, 12);
|
||||
this.Shape3.setRotationPoint(0.0F, 9.0F, 0.0F);
|
||||
this.Shape3.setTextureSize(64, 64);
|
||||
this.Shape3.mirror = true;
|
||||
this.setRotation(this.Shape3, 0.0F, 1.573082F, 0.0F);
|
||||
this.Shape4 = new ModelRenderer(this, 30, 30);
|
||||
this.Shape4.addBox(-8.0F, 1.0F, -6.0F, 1, 13, 12);
|
||||
this.Shape4.setRotationPoint(0.0F, 9.0F, 0.0F);
|
||||
this.Shape4.setTextureSize(64, 64);
|
||||
this.Shape4.mirror = true;
|
||||
this.setRotation(this.Shape4, 0.0F, -((float)Math.PI / 2F), 0.0F);
|
||||
this.Shape5 = new ModelRenderer(this, 30, 31);
|
||||
this.Shape5.addBox(-2.0F, -6.0F, -6.0F, 1, 12, 12);
|
||||
this.Shape5.setRotationPoint(0.0F, 10.0F, 0.0F);
|
||||
this.Shape5.setTextureSize(64, 64);
|
||||
this.Shape5.mirror = true;
|
||||
this.setRotation(this.Shape5, 1.59868F, -0.0F, 1.563774F);
|
||||
this.Shape6 = new ModelRenderer(this, 30, 30);
|
||||
this.Shape6.addBox(-8.0F, 1.0F, -6.0F, 1, 13, 12);
|
||||
this.Shape6.setRotationPoint(0.0F, 9.0F, 0.0F);
|
||||
this.Shape6.setTextureSize(64, 64);
|
||||
this.Shape6.mirror = true;
|
||||
this.setRotation(this.Shape6, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
this.Shape1.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape4.render(f5);
|
||||
this.Shape5.render(f5);
|
||||
this.Shape6.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Shape1.render(0.0625F);
|
||||
this.Shape2.render(0.0625F);
|
||||
this.Shape3.render(0.0625F);
|
||||
this.Shape4.render(0.0625F);
|
||||
this.Shape5.render(0.0625F);
|
||||
this.Shape6.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelLaser extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
|
||||
public ModelLaser()
|
||||
{
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 32;
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(-2.0F, -19000.0F, -2.0F, 4, 20000, 4);
|
||||
this.Shape1.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.Shape1.setTextureSize(32, 32);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape2 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape2.addBox(8.0F, -19000.0F, 8.0F, 1, 20000, 1);
|
||||
this.Shape2.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.Shape2.setTextureSize(32, 32);
|
||||
this.Shape2.mirror = true;
|
||||
this.setRotation(this.Shape2, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape3 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape3.addBox(-8.0F, -19000.0F, 8.0F, 1, 20000, 1);
|
||||
this.Shape3.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.Shape3.setTextureSize(32, 32);
|
||||
this.Shape3.mirror = true;
|
||||
this.setRotation(this.Shape3, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape4 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape4.addBox(8.0F, -19000.0F, -8.0F, 1, 20000, 1);
|
||||
this.Shape4.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.Shape4.setTextureSize(32, 32);
|
||||
this.Shape4.mirror = true;
|
||||
this.setRotation(this.Shape4, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape5 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape5.addBox(-8.0F, -19000.0F, -8.0F, 1, 20000, 1);
|
||||
this.Shape5.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.Shape5.setTextureSize(32, 32);
|
||||
this.Shape5.mirror = true;
|
||||
this.setRotation(this.Shape5, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void renderSpecific(ModelRenderer model)
|
||||
{
|
||||
model.render(0.0625F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
this.Shape1.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape4.render(f5);
|
||||
this.Shape5.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Shape1.render(0.0625F);
|
||||
this.Shape2.render(0.0625F);
|
||||
this.Shape3.render(0.0625F);
|
||||
this.Shape4.render(0.0625F);
|
||||
this.Shape5.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelLaserLight extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
|
||||
public ModelLaserLight()
|
||||
{
|
||||
this.textureWidth = 32;
|
||||
this.textureHeight = 32;
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(-1.0F, 0.0F, -1.0F, 2, 10, 2);
|
||||
this.Shape1.setRotationPoint(0.0F, -7.0F, 0.0F);
|
||||
this.Shape1.setTextureSize(32, 32);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
this.Shape1.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Shape1.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelLaunchingSatelite extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
|
||||
public ModelLaunchingSatelite()
|
||||
{
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 64;
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(-4.0F, 0.0F, -4.0F, 8, 10, 8);
|
||||
this.Shape1.setRotationPoint(0.0F, 14.0F, 0.0F);
|
||||
this.Shape1.setTextureSize(64, 64);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape2 = new ModelRenderer(this, 32, 0);
|
||||
this.Shape2.addBox(8.0F, -7.0F, 0.0F, 9, 14, 1);
|
||||
this.Shape2.setRotationPoint(0.0F, 19.0F, 0.0F);
|
||||
this.Shape2.setTextureSize(64, 64);
|
||||
this.Shape2.mirror = true;
|
||||
this.setRotation(this.Shape2, -0.4363323F, 0.0F, 0.0F);
|
||||
this.Shape3 = new ModelRenderer(this, 32, 0);
|
||||
this.Shape3.addBox(-17.0F, -7.0F, 0.0F, 9, 14, 1);
|
||||
this.Shape3.setRotationPoint(0.0F, 19.0F, 0.0F);
|
||||
this.Shape3.setTextureSize(64, 64);
|
||||
this.Shape3.mirror = true;
|
||||
this.setRotation(this.Shape3, -0.4363323F, 0.0F, 0.0F);
|
||||
this.Shape4 = new ModelRenderer(this, 0, 18);
|
||||
this.Shape4.addBox(0.0F, 0.0F, 0.0F, 8, 1, 1);
|
||||
this.Shape4.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.Shape4.setTextureSize(64, 64);
|
||||
this.Shape4.mirror = true;
|
||||
this.setRotation(this.Shape4, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape5 = new ModelRenderer(this, 0, 18);
|
||||
this.Shape5.addBox(-8.0F, 0.0F, 0.0F, 8, 1, 1);
|
||||
this.Shape5.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.Shape5.setTextureSize(64, 64);
|
||||
this.Shape5.mirror = true;
|
||||
this.setRotation(this.Shape5, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape6 = new ModelRenderer(this, 0, 20);
|
||||
this.Shape6.addBox(-1.0F, 0.0F, -1.0F, 2, 6, 2);
|
||||
this.Shape6.setRotationPoint(0.0F, 8.0F, 0.0F);
|
||||
this.Shape6.setTextureSize(64, 64);
|
||||
this.Shape6.mirror = true;
|
||||
this.setRotation(this.Shape6, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
this.Shape1.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape4.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Shape1.render(0.0625F);
|
||||
this.Shape2.render(0.0625F);
|
||||
this.Shape3.render(0.0625F);
|
||||
this.Shape4.render(0.0625F);
|
||||
this.Shape5.render(0.0625F);
|
||||
this.Shape6.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,135 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelOverrider extends ModelBase
|
||||
{
|
||||
ModelRenderer Base;
|
||||
ModelRenderer base2;
|
||||
ModelRenderer base3;
|
||||
ModelRenderer pole;
|
||||
ModelRenderer crystal;
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
|
||||
public ModelOverrider()
|
||||
{
|
||||
this.textureWidth = 256;
|
||||
this.textureHeight = 256;
|
||||
this.Base = new ModelRenderer(this, 5, 0);
|
||||
this.Base.addBox(0.0F, 0.0F, 0.0F, 16, 10, 16);
|
||||
this.Base.setRotationPoint(-8.0F, 14.0F, -8.0F);
|
||||
this.Base.setTextureSize(256, 256);
|
||||
this.Base.mirror = true;
|
||||
this.setRotation(this.Base, 0.0F, 0.0F, 0.0F);
|
||||
this.base2 = new ModelRenderer(this, 76, 0);
|
||||
this.base2.addBox(0.0F, 0.0F, 0.0F, 14, 1, 14);
|
||||
this.base2.setRotationPoint(-7.0F, 13.0F, -7.0F);
|
||||
this.base2.setTextureSize(256, 256);
|
||||
this.base2.mirror = true;
|
||||
this.setRotation(this.base2, 0.0F, 0.0F, 0.0F);
|
||||
this.base3 = new ModelRenderer(this, 146, 0);
|
||||
this.base3.addBox(0.0F, 0.0F, 0.0F, 12, 1, 12);
|
||||
this.base3.setRotationPoint(-6.0F, 12.0F, -6.0F);
|
||||
this.base3.setTextureSize(256, 256);
|
||||
this.base3.mirror = true;
|
||||
this.setRotation(this.base3, 0.0F, 0.0F, 0.0F);
|
||||
this.pole = new ModelRenderer(this, 199, 0);
|
||||
this.pole.addBox(0.0F, 0.0F, 0.0F, 2, 25, 2);
|
||||
this.pole.setRotationPoint(-1.0F, -13.0F, -1.0F);
|
||||
this.pole.setTextureSize(256, 256);
|
||||
this.pole.mirror = true;
|
||||
this.setRotation(this.pole, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape1 = new ModelRenderer(this, 0, 60);
|
||||
this.Shape1.addBox(0.0F, 0.0F, 0.0F, 6, 1, 6);
|
||||
this.Shape1.setRotationPoint(-3.0F, -11.0F, -3.0F);
|
||||
this.Shape1.setTextureSize(256, 256);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape2 = new ModelRenderer(this, 0, 72);
|
||||
this.Shape2.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4);
|
||||
this.Shape2.setRotationPoint(-2.0F, -9.0F, -2.0F);
|
||||
this.Shape2.setTextureSize(256, 256);
|
||||
this.Shape2.mirror = true;
|
||||
this.setRotation(this.Shape2, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape3 = new ModelRenderer(this, 0, 82);
|
||||
this.Shape3.addBox(0.0F, 0.0F, 0.0F, 1, 12, 1);
|
||||
this.Shape3.setRotationPoint(4.0F, 0.0F, 4.0F);
|
||||
this.Shape3.setTextureSize(256, 256);
|
||||
this.Shape3.mirror = true;
|
||||
this.setRotation(this.Shape3, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape4 = new ModelRenderer(this, 10, 82);
|
||||
this.Shape4.addBox(0.0F, 0.0F, 0.0F, 1, 12, 1);
|
||||
this.Shape4.setRotationPoint(4.0F, 0.0F, -5.0F);
|
||||
this.Shape4.setTextureSize(256, 256);
|
||||
this.Shape4.mirror = true;
|
||||
this.setRotation(this.Shape4, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape5 = new ModelRenderer(this, 20, 81);
|
||||
this.Shape5.addBox(0.0F, 0.0F, 0.0F, 1, 13, 1);
|
||||
this.Shape5.setRotationPoint(-5.0F, 0.0F, -5.0F);
|
||||
this.Shape5.setTextureSize(256, 256);
|
||||
this.Shape5.mirror = true;
|
||||
this.setRotation(this.Shape5, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape6 = new ModelRenderer(this, 30, 80);
|
||||
this.Shape6.addBox(0.0F, 0.0F, 0.0F, 1, 13, 1);
|
||||
this.Shape6.setRotationPoint(-5.0F, 0.0F, 4.0F);
|
||||
this.Shape6.setTextureSize(256, 256);
|
||||
this.Shape6.mirror = true;
|
||||
this.setRotation(this.Shape6, 0.0F, 0.0F, 0.0F);
|
||||
this.crystal = new ModelRenderer(this, 0, 37);
|
||||
this.crystal.addBox(-3.5F, -3.5F, -3.5F, 7, 7, 7);
|
||||
this.crystal.setRotationPoint(0F, -20.0F, 0F);
|
||||
this.crystal.setTextureSize(256, 256);
|
||||
this.crystal.mirror = true;
|
||||
GL11.glColor4d(255.0D, 255.0D, 255.0D, 255.0D);
|
||||
this.setRotation(this.crystal, 0.54F, 0F, 0.54F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.Base.render(f5);
|
||||
this.base2.render(f5);
|
||||
this.base3.render(f5);
|
||||
this.pole.render(f5);
|
||||
this.crystal.render(f5);
|
||||
this.Shape1.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape4.render(f5);
|
||||
this.Shape5.render(f5);
|
||||
this.Shape6.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Base.render(0.0625F);
|
||||
this.base2.render(0.0625F);
|
||||
this.base3.render(0.0625F);
|
||||
this.pole.render(0.0625F);
|
||||
this.Shape1.render(0.0625F);
|
||||
this.Shape2.render(0.0625F);
|
||||
this.Shape3.render(0.0625F);
|
||||
this.Shape4.render(0.0625F);
|
||||
this.Shape5.render(0.0625F);
|
||||
this.Shape6.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,143 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelPhotonAccelerator extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
ModelRenderer Shape7;
|
||||
ModelRenderer Shape8;
|
||||
ModelRenderer Shape9;
|
||||
ModelRenderer Shape10;
|
||||
ModelRenderer Shape11;
|
||||
ModelRenderer Shape12;
|
||||
|
||||
public ModelPhotonAccelerator()
|
||||
{
|
||||
this.textureWidth = 128;
|
||||
this.textureHeight = 32;
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(-8.0F, -10.0F, -8.0F, 16, 11, 16);
|
||||
this.Shape1.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.Shape1.setTextureSize(128, 32);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape2 = new ModelRenderer(this, 64, 0);
|
||||
this.Shape2.addBox(-7.0F, 0.0F, -7.0F, 14, 1, 14);
|
||||
this.Shape2.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.Shape2.setTextureSize(128, 32);
|
||||
this.Shape2.mirror = true;
|
||||
this.setRotation(this.Shape2, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape3 = new ModelRenderer(this, 85, 15);
|
||||
this.Shape3.addBox(0.0F, 0.0F, -1.0F, 1, 12, 2);
|
||||
this.Shape3.setRotationPoint(-2.0F, 2.0F, 0.0F);
|
||||
this.Shape3.setTextureSize(128, 32);
|
||||
this.Shape3.mirror = true;
|
||||
this.setRotation(this.Shape3, 0.0F, 0.0F, 0.4014257F);
|
||||
this.Shape4 = new ModelRenderer(this, 85, 15);
|
||||
this.Shape4.addBox(0.0F, 0.0F, 0.0F, 1, 12, 2);
|
||||
this.Shape4.setRotationPoint(1.0F, 2.0F, -1.0F);
|
||||
this.Shape4.setTextureSize(128, 32);
|
||||
this.Shape4.mirror = true;
|
||||
this.setRotation(this.Shape4, 0.0F, 0.0F, -0.4120629F);
|
||||
this.Shape5 = new ModelRenderer(this, 97, 15);
|
||||
this.Shape5.addBox(-1.0F, -12.0F, -1.0F, 4, 13, 4);
|
||||
this.Shape5.setRotationPoint(-1.0F, 2.066667F, -1.0F);
|
||||
this.Shape5.setTextureSize(128, 32);
|
||||
this.Shape5.mirror = true;
|
||||
this.setRotation(this.Shape5, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape6 = new ModelRenderer(this, 85, 16);
|
||||
this.Shape6.addBox(-1.0F, 0.0F, 2.0F, 2, 12, 1);
|
||||
this.Shape6.setRotationPoint(0.0F, 2.0F, -1.0F);
|
||||
this.Shape6.setTextureSize(128, 32);
|
||||
this.Shape6.mirror = true;
|
||||
this.setRotation(this.Shape6, 0.3839724F, 0.0F, 0.0F);
|
||||
this.Shape7 = new ModelRenderer(this, 85, 16);
|
||||
this.Shape7.addBox(0.0F, 0.0F, 0.0F, 2, 12, 1);
|
||||
this.Shape7.setRotationPoint(-1.0F, 1.5F, -2.0F);
|
||||
this.Shape7.setTextureSize(128, 32);
|
||||
this.Shape7.mirror = true;
|
||||
this.setRotation(this.Shape7, -0.3839724F, 0.0F, 0.0F);
|
||||
this.Shape8 = new ModelRenderer(this, 51, 0);
|
||||
this.Shape8.addBox(-3.0F, -3.0F, -3.0F, 6, 1, 6);
|
||||
this.Shape8.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.Shape8.setTextureSize(128, 32);
|
||||
this.Shape8.mirror = true;
|
||||
this.setRotation(this.Shape8, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape9 = new ModelRenderer(this, 51, 0);
|
||||
this.Shape9.addBox(-3.0F, -1.0F, -3.0F, 6, 1, 6);
|
||||
this.Shape9.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.Shape9.setTextureSize(128, 32);
|
||||
this.Shape9.mirror = true;
|
||||
this.setRotation(this.Shape9, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape10 = new ModelRenderer(this, 51, 0);
|
||||
this.Shape10.addBox(0.0F, 0.0F, 0.0F, 6, 1, 6);
|
||||
this.Shape10.setRotationPoint(-3.0F, -5.0F, -3.0F);
|
||||
this.Shape10.setTextureSize(128, 32);
|
||||
this.Shape10.mirror = true;
|
||||
this.setRotation(this.Shape10, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape11 = new ModelRenderer(this, 51, 0);
|
||||
this.Shape11.addBox(0.0F, 0.0F, 0.0F, 6, 1, 6);
|
||||
this.Shape11.setRotationPoint(-3.0F, -7.0F, -3.0F);
|
||||
this.Shape11.setTextureSize(128, 32);
|
||||
this.Shape11.mirror = true;
|
||||
this.setRotation(this.Shape11, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape12 = new ModelRenderer(this, 51, 0);
|
||||
this.Shape12.addBox(0.0F, 0.0F, 0.0F, 6, 1, 6);
|
||||
this.Shape12.setRotationPoint(-3.0F, -9.0F, -3.0F);
|
||||
this.Shape12.setTextureSize(128, 32);
|
||||
this.Shape12.mirror = true;
|
||||
this.setRotation(this.Shape12, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
this.Shape1.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape4.render(f5);
|
||||
this.Shape5.render(f5);
|
||||
this.Shape6.render(f5);
|
||||
this.Shape7.render(f5);
|
||||
this.Shape8.render(f5);
|
||||
this.Shape9.render(f5);
|
||||
this.Shape10.render(f5);
|
||||
this.Shape11.render(f5);
|
||||
this.Shape12.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Shape1.render(0.0625F);
|
||||
this.Shape2.render(0.0625F);
|
||||
this.Shape3.render(0.0625F);
|
||||
this.Shape4.render(0.0625F);
|
||||
this.Shape5.render(0.0625F);
|
||||
this.Shape6.render(0.0625F);
|
||||
this.Shape7.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelPhotonDecelerator extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
ModelRenderer Shape7;
|
||||
|
||||
public ModelPhotonDecelerator()
|
||||
{
|
||||
this.textureWidth = 128;
|
||||
this.textureHeight = 32;
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(-8.0F, -10.0F, -8.0F, 16, 11, 16);
|
||||
this.Shape1.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.Shape1.setTextureSize(128, 32);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape2 = new ModelRenderer(this, 64, 0);
|
||||
this.Shape2.addBox(-7.0F, 0.0F, -7.0F, 14, 1, 14);
|
||||
this.Shape2.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.Shape2.setTextureSize(128, 32);
|
||||
this.Shape2.mirror = true;
|
||||
this.setRotation(this.Shape2, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape3 = new ModelRenderer(this, 85, 15);
|
||||
this.Shape3.addBox(0.0F, 0.0F, -1.0F, 1, 12, 2);
|
||||
this.Shape3.setRotationPoint(-2.0F, 2.0F, 0.0F);
|
||||
this.Shape3.setTextureSize(128, 32);
|
||||
this.Shape3.mirror = true;
|
||||
this.setRotation(this.Shape3, 0.0F, 0.0F, 0.4014257F);
|
||||
this.Shape4 = new ModelRenderer(this, 85, 15);
|
||||
this.Shape4.addBox(0.0F, 0.0F, 0.0F, 1, 12, 2);
|
||||
this.Shape4.setRotationPoint(1.0F, 2.0F, -1.0F);
|
||||
this.Shape4.setTextureSize(128, 32);
|
||||
this.Shape4.mirror = true;
|
||||
this.setRotation(this.Shape4, 0.0F, 0.0F, -0.4120629F);
|
||||
this.Shape5 = new ModelRenderer(this, 97, 15);
|
||||
this.Shape5.addBox(-2.0F, -13.0F, -2.0F, 4, 13, 4);
|
||||
this.Shape5.setRotationPoint(0.0F, 2.066667F, 0.0F);
|
||||
this.Shape5.setTextureSize(128, 32);
|
||||
this.Shape5.mirror = true;
|
||||
this.setRotation(this.Shape5, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape6 = new ModelRenderer(this, 85, 16);
|
||||
this.Shape6.addBox(-1.0F, 0.0F, 2.0F, 2, 12, 1);
|
||||
this.Shape6.setRotationPoint(0.0F, 2.0F, -1.0F);
|
||||
this.Shape6.setTextureSize(128, 32);
|
||||
this.Shape6.mirror = true;
|
||||
this.setRotation(this.Shape6, 0.3839724F, 0.0F, 0.0F);
|
||||
this.Shape7 = new ModelRenderer(this, 85, 16);
|
||||
this.Shape7.addBox(0.0F, 0.0F, 0.0F, 2, 12, 1);
|
||||
this.Shape7.setRotationPoint(-1.0F, 1.5F, -2.0F);
|
||||
this.Shape7.setTextureSize(128, 32);
|
||||
this.Shape7.mirror = true;
|
||||
this.setRotation(this.Shape7, -0.3839724F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
this.Shape1.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape4.render(f5);
|
||||
this.Shape5.render(f5);
|
||||
this.Shape6.render(f5);
|
||||
this.Shape7.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Shape1.render(0.0625F);
|
||||
this.Shape2.render(0.0625F);
|
||||
this.Shape3.render(0.0625F);
|
||||
this.Shape4.render(0.0625F);
|
||||
this.Shape6.render(0.0625F);
|
||||
this.Shape7.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,103 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelPhotonInverter extends ModelBase
|
||||
{
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
ModelRenderer Shape7;
|
||||
|
||||
public ModelPhotonInverter()
|
||||
{
|
||||
this.textureWidth = 128;
|
||||
this.textureHeight = 128;
|
||||
this.Shape1 = new ModelRenderer(this, 0, 0);
|
||||
this.Shape1.addBox(-7.0F, 0.0F, -7.0F, 14, 12, 14);
|
||||
this.Shape1.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.Shape1.setTextureSize(128, 128);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape2 = new ModelRenderer(this, 56, 0);
|
||||
this.Shape2.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2);
|
||||
this.Shape2.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.Shape2.setTextureSize(128, 128);
|
||||
this.Shape2.mirror = true;
|
||||
this.setRotation(this.Shape2, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape3 = new ModelRenderer(this, 0, 26);
|
||||
this.Shape3.addBox(-8.0F, -1.0F, -8.0F, 16, 2, 16);
|
||||
this.Shape3.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
this.Shape3.setTextureSize(128, 128);
|
||||
this.Shape3.mirror = true;
|
||||
this.setRotation(this.Shape3, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape4 = new ModelRenderer(this, 60, 60);
|
||||
this.Shape4.addBox(-6.0F, 0.0F, 7.0F, 12, 10, 1);
|
||||
this.Shape4.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.Shape4.setTextureSize(128, 128);
|
||||
this.Shape4.mirror = true;
|
||||
this.setRotation(this.Shape4, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape5 = new ModelRenderer(this, 60, 60);
|
||||
this.Shape5.addBox(-6.0F, 0.0F, 7.0F, 12, 10, 1);
|
||||
this.Shape5.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.Shape5.setTextureSize(128, 128);
|
||||
this.Shape5.mirror = true;
|
||||
this.setRotation(this.Shape5, 0.0F, ((float)Math.PI / 2F), 0.0F);
|
||||
this.Shape6 = new ModelRenderer(this, 60, 60);
|
||||
this.Shape6.addBox(-6.0F, 0.0F, 7.0F, 12, 10, 1);
|
||||
this.Shape6.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.Shape6.setTextureSize(128, 128);
|
||||
this.Shape6.mirror = true;
|
||||
this.setRotation(this.Shape6, 0.0F, -(float)Math.PI, 0.0F);
|
||||
this.Shape7 = new ModelRenderer(this, 60, 60);
|
||||
this.Shape7.addBox(-6.0F, 0.0F, 7.0F, 12, 10, 1);
|
||||
this.Shape7.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.Shape7.setTextureSize(128, 128);
|
||||
this.Shape7.mirror = true;
|
||||
this.setRotation(this.Shape7, 0.0F, -((float)Math.PI / 2F), 0.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the models various rotation angles then renders the model.
|
||||
*/
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
this.Shape1.render(f5);
|
||||
this.Shape2.render(f5);
|
||||
this.Shape3.render(f5);
|
||||
this.Shape4.render(f5);
|
||||
this.Shape5.render(f5);
|
||||
this.Shape6.render(f5);
|
||||
this.Shape7.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
|
||||
{
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5);
|
||||
}
|
||||
|
||||
public void renderAll()
|
||||
{
|
||||
this.Shape1.render(0.0625F);
|
||||
this.Shape2.render(0.0625F);
|
||||
this.Shape3.render(0.0625F);
|
||||
this.Shape4.render(0.0625F);
|
||||
this.Shape5.render(0.0625F);
|
||||
this.Shape6.render(0.0625F);
|
||||
this.Shape7.render(0.0625F);
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.SateliteTileEntity;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class SateliteRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
public static ModelLaunchingSatelite model = new ModelLaunchingSatelite();
|
||||
public static ResourceLocation location = new ResourceLocation("ob", "textures/blocks/satelite.png");
|
||||
int rotation;
|
||||
|
||||
public SateliteRenderer()
|
||||
{
|
||||
this.func_147497_a(TileEntityRendererDispatcher.instance);
|
||||
}
|
||||
|
||||
public void renderAModelAt(SateliteTileEntity tile, double d, double d1, double d2, float f)
|
||||
{
|
||||
float height = tile.height;
|
||||
|
||||
if (tile.getWorldObj() != null)
|
||||
{
|
||||
this.rotation = tile.getBlockMetadata();
|
||||
}
|
||||
|
||||
this.bindTexture(location);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, -1.0F);
|
||||
GL11.glRotatef((float)(this.rotation * 90), 0.0F, 1.0F, 0.0F);
|
||||
this.model.Shape1.offsetY = height * -1.0F;
|
||||
this.model.Shape2.offsetY = height * -1.0F;
|
||||
this.model.Shape3.offsetY = height * -1.0F;
|
||||
this.model.Shape4.offsetY = height * -1.0F;
|
||||
this.model.Shape5.offsetY = height * -1.0F;
|
||||
this.model.Shape6.offsetY = height * -1.0F;
|
||||
this.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
this.renderAModelAt((SateliteTileEntity)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.DefenderTileEntity;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TileEntityDefenderRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
public static ModelDefender model = new ModelDefender();
|
||||
public static ResourceLocation location = new ResourceLocation("ob", "textures/blocks/defender.png");
|
||||
int rotation;
|
||||
|
||||
public TileEntityDefenderRenderer()
|
||||
{
|
||||
this.func_147497_a(TileEntityRendererDispatcher.instance);
|
||||
}
|
||||
|
||||
public void renderAModelAt(DefenderTileEntity tile, double d, double d1, double d2, float f)
|
||||
{
|
||||
if (tile.getWorldObj() != null)
|
||||
{
|
||||
this.rotation = tile.getBlockMetadata();
|
||||
}
|
||||
|
||||
this.bindTexture(location);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, -1.0F);
|
||||
GL11.glRotatef((float)(this.rotation * 90), 0.0F, 1.0F, 0.0F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
this.model.Shape7.rotateAngleY = tile.rotate * 90.0F;
|
||||
this.model.Shape7.rotateAngleZ = tile.rotate * 90.0F;
|
||||
this.model.Shape7.rotateAngleZ = tile.rotate * 90.0F;
|
||||
|
||||
if (tile.getCurrentCharge() > 0)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
this.model.Shape7.render(0.0625F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
this.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
this.renderAModelAt((DefenderTileEntity)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.ExtenderTileEntity;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TileEntityExtenderRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
public static ModelExtender model = new ModelExtender();
|
||||
public static ResourceLocation location = new ResourceLocation("ob", "textures/blocks/extender.png");
|
||||
int rotation;
|
||||
|
||||
public TileEntityExtenderRenderer()
|
||||
{
|
||||
this.func_147497_a(TileEntityRendererDispatcher.instance);
|
||||
}
|
||||
|
||||
public void renderAModelAt(ExtenderTileEntity tile, double d, double d1, double d2, float f)
|
||||
{
|
||||
if (tile.getWorldObj() != null)
|
||||
{
|
||||
this.rotation = tile.getBlockMetadata();
|
||||
}
|
||||
|
||||
this.bindTexture(location);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, -1.0F);
|
||||
GL11.glRotatef((float)(this.rotation * 90), 0.0F, 1.0F, 0.0F);
|
||||
this.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
this.renderAModelAt((ExtenderTileEntity)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.InverterAdvTileEntity;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TileEntityInverterAdvRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
public static ModelPhotonInverter model = new ModelPhotonInverter();
|
||||
public static ResourceLocation location = new ResourceLocation("ob", "textures/blocks/solarPanel.png");
|
||||
long rotation;
|
||||
|
||||
public void renderAModelAt(InverterAdvTileEntity tile, double d, double d1, double d2, float f)
|
||||
{
|
||||
if (tile.getWorldObj() != null)
|
||||
{
|
||||
this.rotation = tile.time;
|
||||
|
||||
if (this.rotation < 6000L)
|
||||
{
|
||||
this.rotation -= 6000L;
|
||||
}
|
||||
|
||||
if (this.rotation >= 6000L)
|
||||
{
|
||||
this.rotation -= 6000L;
|
||||
}
|
||||
|
||||
if (tile.time > 12000L)
|
||||
{
|
||||
this.rotation = 0L;
|
||||
}
|
||||
}
|
||||
|
||||
this.bindTexture(location);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, -1.0F);
|
||||
this.model.Shape3.rotateAngleX = (float)this.rotation / 15280.0F * 2.0F;
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
this.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
this.renderAModelAt((InverterAdvTileEntity)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TileEntityOverriderRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
public static ModelOverrider model = new ModelOverrider();
|
||||
public static ResourceLocation location = new ResourceLocation("ob", "textures/blocks/overrider.png");
|
||||
|
||||
public TileEntityOverriderRenderer()
|
||||
{
|
||||
this.func_147497_a(TileEntityRendererDispatcher.instance);
|
||||
}
|
||||
|
||||
public void renderAModelAt(OverriderBlockTileEntity tile, double d, double d1, double d2, float f)
|
||||
{
|
||||
int rotation = 0;
|
||||
|
||||
if (tile.getWorldObj() != null)
|
||||
{
|
||||
rotation = tile.getBlockMetadata();
|
||||
}
|
||||
|
||||
this.bindTexture(location);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, -1.0F);
|
||||
GL11.glRotatef((float)(rotation * 90), 0.0F, 1.0F, 0.0F);
|
||||
//this.model.crystal.setRotationPoint(Math.abs(tile.rotate) - 5.0F, Math.abs(tile.rotate) - 23.0F, Math.abs(tile.rotate) - 3.0F);
|
||||
//this.model.crystal.rotateAngleZ = tile.rotate;
|
||||
//this.model.crystal.rotateAngleX = tile.rotate;
|
||||
this.model.crystal.rotateAngleY = tile.rotate;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
|
||||
if (tile.getCurrentCharge() > 0)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
this.model.crystal.render(0.0625F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
this.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
this.renderAModelAt((OverriderBlockTileEntity)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.PhotonAcceleratorTileEntity;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TileEntityPhotonAcceleratorRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
public static ModelPhotonAccelerator model = new ModelPhotonAccelerator();
|
||||
public static ResourceLocation location = new ResourceLocation("ob", "textures/blocks/photonAccelerator.png");
|
||||
int rotation;
|
||||
|
||||
public TileEntityPhotonAcceleratorRenderer()
|
||||
{
|
||||
this.func_147497_a(TileEntityRendererDispatcher.instance);
|
||||
}
|
||||
|
||||
public void renderAModelAt(PhotonAcceleratorTileEntity tile, double d, double d1, double d2, float f)
|
||||
{
|
||||
float rotate = tile.rotate * 90.0F;
|
||||
|
||||
if (tile.getWorldObj() != null)
|
||||
{
|
||||
this.rotation = tile.getBlockMetadata();
|
||||
}
|
||||
|
||||
this.bindTexture(location);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, -1.0F);
|
||||
GL11.glRotatef((float)(this.rotation * 90), 0.0F, 1.0F, 0.0F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
|
||||
if (tile.getOutputRate() > 0)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
this.model.Shape12.render(0.0625F);
|
||||
this.model.Shape11.render(0.0625F);
|
||||
this.model.Shape10.render(0.0625F);
|
||||
this.model.Shape9.render(0.0625F);
|
||||
this.model.Shape8.render(0.0625F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
this.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
this.renderAModelAt((PhotonAcceleratorTileEntity)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
package fr.jackcartersmith.ob.models;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import fr.jackcartersmith.ob.blocks.PhotonDeceleratorTileEntity;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class TileEntityPhotonDeceleratorRenderer extends TileEntitySpecialRenderer
|
||||
{
|
||||
public static ModelPhotonDecelerator model = new ModelPhotonDecelerator();
|
||||
public static ResourceLocation location = new ResourceLocation("ob", "textures/blocks/photonDecelerator.png");
|
||||
int rotation;
|
||||
|
||||
public TileEntityPhotonDeceleratorRenderer()
|
||||
{
|
||||
this.func_147497_a(TileEntityRendererDispatcher.instance);
|
||||
}
|
||||
|
||||
public void renderAModelAt(PhotonDeceleratorTileEntity tile, double d, double d1, double d2, float f)
|
||||
{
|
||||
if (tile.getWorldObj() != null)
|
||||
{
|
||||
this.rotation = tile.getBlockMetadata();
|
||||
}
|
||||
|
||||
this.bindTexture(location);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
|
||||
GL11.glScalef(1.0F, -1.0F, -1.0F);
|
||||
GL11.glRotatef((float)(this.rotation * 90), 0.0F, 1.0F, 0.0F);
|
||||
this.model.Shape5.rotateAngleY = tile.rotate * 90.0F;
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
|
||||
if (tile.getPowerIncoming() > 0)
|
||||
{
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
this.model.Shape5.render(0.0625F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
this.model.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
|
||||
{
|
||||
this.renderAModelAt((PhotonDeceleratorTileEntity)par1TileEntity, par2, par4, par6, par8);
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
package fr.jackcartersmith.ob.rendering;
|
||||
|
||||
public class AccelPositionsDto
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
|
||||
public int getX()
|
||||
{
|
||||
return this.x;
|
||||
}
|
||||
|
||||
public void setX(int x)
|
||||
{
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public int getY()
|
||||
{
|
||||
return this.y;
|
||||
}
|
||||
|
||||
public void setY(int y)
|
||||
{
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public int getZ()
|
||||
{
|
||||
return this.z;
|
||||
}
|
||||
|
||||
public void setZ(int z)
|
||||
{
|
||||
this.z = z;
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
package fr.jackcartersmith.ob.rendering;
|
||||
|
||||
public class LineDto
|
||||
{
|
||||
public static AccelPositionsDto from;
|
||||
public static AccelPositionsDto to;
|
||||
|
||||
public static AccelPositionsDto getFrom()
|
||||
{
|
||||
return from;
|
||||
}
|
||||
|
||||
public static void setFrom(AccelPositionsDto from_in)
|
||||
{
|
||||
from = from_in;
|
||||
}
|
||||
|
||||
public static AccelPositionsDto getTo()
|
||||
{
|
||||
return to;
|
||||
}
|
||||
|
||||
public static void setTo(AccelPositionsDto to_in)
|
||||
{
|
||||
to = to_in;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user