Compare commits

..

50 Commits

Author SHA1 Message Date
5ef2ec3205 Removed old compat module 2019-06-02 22:40:46 +02:00
4b730b235f Fix file merge error 2019-06-02 22:38:08 +02:00
b52b170375 Merge branch '1.12.2' 2019-06-02 22:29:40 +02:00
2e504f4d9a Forget infos file 2019-06-02 22:29:32 +02:00
8cae504492 Merge branch '1.12.2' 2019-06-02 22:26:43 +02:00
0784d16634 Jar file have mc version 2019-06-02 22:24:23 +02:00
cc356b587e Updated sign infos 2019-06-02 22:14:59 +02:00
6046915770 Change config option in build.gradle 2019-06-02 21:43:40 +02:00
408aeedb0f Update forge version
Updated maven repo
2019-06-02 21:25:42 +02:00
50f401315b
Update README.md 2019-04-27 23:32:56 +02:00
5a80fd1ae3 Remove useless file and fix albeno maven repo 2019-02-26 13:44:32 +01:00
4624961c90 Docker with signJar function 2018-11-15 14:43:13 +01:00
4348bb6304 Container compilation 2018-11-15 14:08:50 +01:00
62e5c00d5d Merge branch 'CI-exp' 2018-11-09 19:14:35 +01:00
43e6bca89e Added Jenkinsfile 2018-11-09 19:10:39 +01:00
2384cc0d6b SignTest 2018-11-09 19:04:31 +01:00
d99ee0e9a2 Create very basic form 2018-11-08 11:57:41 +01:00
deb40f8da2
Merge pull request #3 from JackCarterSmith/CI-exp
Ci exp
2018-11-06 15:27:51 +01:00
1e36d67c02 Added Jenkinsfile 2018-11-06 15:20:36 +01:00
7e13e80f86 Added Jenkinsfile 2018-11-06 15:17:05 +01:00
f125468c95 Added Jenkinsfile 2018-11-06 15:08:37 +01:00
90013f697b Added Jenkinsfile 2018-11-06 15:06:44 +01:00
6dee6bd875 Fixed code 2018-11-06 14:52:14 +01:00
5dfcce73bc Added Jenkinsfile 2018-11-06 14:45:17 +01:00
388d673c86 Added Jenkinsfile 2018-11-06 14:42:12 +01:00
109eaae501 Added Jenkinsfile 2018-11-06 14:16:45 +01:00
baa657798d Added Jenkinsfile 2018-11-06 14:15:12 +01:00
4a6930bf48 Added Jenkinsfile 2018-11-06 13:54:32 +01:00
54cdbef779 Added Jenkinsfile 2018-11-06 13:52:53 +01:00
22f4beb642
Merge pull request #2 from JackCarterSmith/1.12.2
Updated gradle and wrapper
2018-11-06 13:45:03 +01:00
74116ef38b Merge branch '1.12.2' 2018-11-06 13:19:44 +01:00
46e8d0bd68 Updated gradle and wrapper 2018-11-06 13:19:14 +01:00
ff98608d49 test #2 2018-11-05 22:46:33 +01:00
c95cc735ff Experimental CI 2018-11-05 14:38:51 +01:00
ffcee73017 Clean Step #2 2018-11-04 15:27:03 +01:00
f618948db1 Merge branch '1.12.2' 2018-11-04 15:23:07 +01:00
afa29f9b69 New base, cleaned code 2018-11-04 15:15:13 +01:00
9d731daac6 Prepare for 1.12.2 support, lose 1.10.2 2018-09-16 14:15:17 +02:00
fca6e7bd84 Delete old eclipse files from repo 2018-04-07 18:18:10 +02:00
93670d7261
Update README.md 2018-04-06 11:23:31 +02:00
0766c9cb64
Update README.md 2018-04-06 11:22:33 +02:00
f00987a123 And again OBJ test model renderer 2017-06-22 08:46:51 +02:00
4be28945b5 Updated TODO.md file 2017-06-18 11:45:28 +02:00
cccc3e6852 Testing OBJ renderer
Attempt to integrate OBJ render to world, very difficult with blockstate to understand, code failure commit
2017-06-18 11:03:00 +02:00
3694aec33b Added bloc manager 2017-06-17 17:24:48 +02:00
22a32fb1d3 Successfully added basic item class 2017-06-17 15:20:12 +02:00
f88a332dce Updated README.md 2017-06-17 14:31:45 +02:00
cc2862fe92 Cleaning workspace 2017-06-17 14:28:11 +02:00
72441407f3 Rewrite/review of items management 2017-06-17 12:39:23 +02:00
623a99ea5e Updated files for 1.10.2 2017-06-13 15:16:00 +02:00
204 changed files with 2824 additions and 11779 deletions

1
.gitignore vendored
View File

@ -20,4 +20,3 @@ build
# other
eclipse
run
rundir

View File

@ -1,10 +1,19 @@
# ORBITAL SATELLITE mod for Minecraft
# ORBITAL SATELLITE - Pig Striker !!!
[![Build Status](https://ci.jcsmith.fr/job/OrbitalSatellite/badge/icon)](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

View File

@ -1,91 +1,132 @@
buildscript {
repositories {
maven {
name = "forge"
url = 'https://maven.minecraftforge.net/'
}
mavenCentral()
}
dependencies {
classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.1.+') {
changing = true
}
}
}
apply plugin: 'forge'
version = "0.1.8"
group= "fr.jackcartersmith.orbsat" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "OrbitalSatellite"
targetCompatibility = sourceCompatibility = JavaVersion.VERSION_1_8
minecraft {
version = "1.7.10-10.13.4.1614-1.7.10"
runDir = "rundir"
}
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
filesMatching('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'
}
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
task devJar(type: Jar) {
classifier = "dev"
from sourceSets.main.output
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier = 'deobf'
manifest {
attributes 'FMLAT': 'OrbitalSatellite_dc.cfg'
}
}
artifacts {
archives sourcesJar
archives devJar
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"
}
}

7
gradle.properties Normal file
View 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

Binary file not shown.

View File

@ -1,6 +1,5 @@
#Tue May 12 10:11:53 CEST 2020
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-4.4.1-bin.zip

110
gradlew vendored
View File

@ -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
View File

@ -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

View File

@ -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();
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -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));
}
}

View File

@ -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;
}
}

View File

@ -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));
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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) {}
}

View File

@ -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;
}
}
}

View File

@ -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);
}
}

View File

@ -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));
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -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();
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}
}

View File

@ -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;
}
}
}

View File

@ -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();
}
}

View File

@ -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));
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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:
}
}
}

View File

@ -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;
}
}
}

View File

@ -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));
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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:
}
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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));
}
}

View File

@ -1,9 +0,0 @@
package fr.jackcartersmith.ob.interfaces;
public class PhotonRecieving extends PhotonProducing
{
public void recievePhotons(int power)
{
this.currentCharge += power;
}
}

View File

@ -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));
}
}

View File

@ -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");
}
}

View File

@ -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");
}
}

View File

@ -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");
}
}

View File

@ -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();
}
}
}

View File

@ -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);
}
}
}
}

View File

@ -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);
}
}
}

View File

@ -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)));
}
}
}

View File

@ -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));
}
}

View File

@ -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();
}
}
}

View File

@ -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);
}
}
}
}

View File

@ -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);
}
}
}

View File

@ -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));
}
}
}

View File

@ -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));
}
}

View File

@ -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();
}
}
}

View File

@ -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);
}
}
}
}

View File

@ -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);
}
}
}

View File

@ -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)));
}
}
}

View File

@ -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));
}
}

View File

@ -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");
}
}

View File

@ -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");
}
}

View File

@ -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");
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -1,81 +0,0 @@
package fr.jackcartersmith.orbsat;
import net.minecraft.creativetab.CreativeTabs;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import fr.jackcartersmith.orbsat.client.creativetabs.OSCreativeTabs;
import fr.jackcartersmith.orbsat.common.CommonProxy;
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
import fr.jackcartersmith.orbsat.common.utils.OSLogHelper;
@Mod(modid = OSRefs.MODID, name = OSRefs.MODNAME, version = OSRefs.VERSION, canBeDeactivated = false)
public class OrbitalSatellite
{
//============== DEBUG MODE ===============//
public static boolean debug = true;
//=========================================//
@Mod.Instance(OSRefs.MODID)
public static OrbitalSatellite instance;
@SidedProxy(clientSide = OSRefs.CLIENTPROXYLOCATION, serverSide = OSRefs.SERVERPROXYLOCATION)
public static CommonProxy proxy;
public static CreativeTabs OSCreaTab = new OSCreativeTabs(CreativeTabs.getNextID(),OSRefs.MODID);
public static final String networkChannelName = OSRefs.MODID;
public static SimpleNetworkWrapper network;
//private GuiHandlerForOb guiHandlerForOb = new GuiHandlerForOb();
/*
public static int sateliteModelId;
public int lastChargerX;
public int lastChargerY;
public int lastChargerZ;
public int lastExtenderX;
public int lastExtenderY;
public int lastExtenderZ;
public int lastGeneralX;
public int lastGeneralY;
public int lastGeneralZ;
public static int mobid = 0;
public DraconicEvolution() {
LogHelper.info("Hello Minecraft!!!");
}
*/
public OrbitalSatellite() {
OSLogHelper.info("Starting OB.sys ...");
}
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
if (debug) OSLogHelper.info("PreInit FML");
proxy.preInit(event);
}
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
if (debug) System.out.println("init()");
proxy.init(event);
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event)
{
if (debug) System.out.println("postInit()");
proxy.postInit(event);
}
}

View File

@ -1,287 +0,0 @@
package fr.jackcartersmith.orbsat.client;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import fr.jackcartersmith.orbsat.OrbitalSatellite;
import fr.jackcartersmith.orbsat.client.handler.ClientEventHandler;
import fr.jackcartersmith.orbsat.client.handler.ParticleHandler;
import fr.jackcartersmith.orbsat.client.handler.ResourceHandler;
import fr.jackcartersmith.orbsat.client.render.block.RenderDefender;
import fr.jackcartersmith.orbsat.client.render.particle.ParticleLaserBeam;
import fr.jackcartersmith.orbsat.client.render.tile.RenderTileDefender;
import fr.jackcartersmith.orbsat.common.CommonProxy;
import fr.jackcartersmith.orbsat.common.OSBlocks;
import fr.jackcartersmith.orbsat.common.tileentities.TileDefender;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.item.Item;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.MinecraftForge;
public class ClientProxy extends CommonProxy {
private final static boolean debug = OrbitalSatellite.debug;
@Override
public void preInit(FMLPreInitializationEvent event) {
if (debug) System.out.println("on Client side");
super.preInit(event);
ResourceHandler.init(event);
}
@Override
public void init(FMLInitializationEvent event) {
super.init(event);
//FMLCommonHandler.instance().bus().register(new KeyInputHandler());
FMLCommonHandler.instance().bus().register(new ClientEventHandler());
//if (ConfigHandler.enableVersionChecker) FMLCommonHandler.instance().bus().register(new UpdateChecker());
//MinecraftForge.EVENT_BUS.register(new HudHandler());
MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
//KeyBindings.init();
registerRenderIDs();
registerRendering();
}
@Override
public void postInit(FMLPostInitializationEvent event) {
super.postInit(event);
}
public void registerRendering() {
//Item Renderers
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(OSBlocks.defender), new RenderDefender());
//TileEntitySpecialRenderers
ClientRegistry.bindTileEntitySpecialRenderer(TileDefender.class, new RenderTileDefender());
/*
//Item Renderers
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBow());
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBow());
MinecraftForgeClient.registerItemRenderer(ModItems.mobSoul, new RenderMobSoul());
MinecraftForgeClient.registerItemRenderer(ModItems.chaosShard, new RenderChaosShard());
MinecraftForgeClient.registerItemRenderer(ModItems.reactorStabilizerParts, new RenderStabilizerPart());
MinecraftForgeClient.registerItemRenderer(ModItems.chaosFragment, new RenderChaosFragment());
if (!ConfigHandler.useOldArmorModel) {
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernHelm, new RenderArmor(ModItems.wyvernHelm));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernChest, new RenderArmor(ModItems.wyvernChest));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernLeggs, new RenderArmor(ModItems.wyvernLeggs));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBoots, new RenderArmor(ModItems.wyvernBoots));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicHelm, new RenderArmor(ModItems.draconicHelm));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicChest, new RenderArmor(ModItems.draconicChest));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicLeggs, new RenderArmor(ModItems.draconicLeggs));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBoots, new RenderArmor(ModItems.draconicBoots));
}
if (!ConfigHandler.useOldD2DToolTextures) {
MinecraftForgeClient.registerItemRenderer(ModItems.draconicSword, new RenderTool("models/tools/DraconicSword.obj", "textures/models/tools/DraconicSword.png", (IRenderTweak) ModItems.draconicSword));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernPickaxe, new RenderTool("models/tools/Pickaxe.obj", "textures/models/tools/Pickaxe.png", (IRenderTweak) ModItems.wyvernPickaxe));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicPickaxe, new RenderTool("models/tools/DraconicPickaxe.obj", "textures/models/tools/DraconicPickaxe.png", (IRenderTweak) ModItems.draconicPickaxe));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicAxe, new RenderTool("models/tools/DraconicLumberAxe.obj", "textures/models/tools/DraconicLumberAxe.png", (IRenderTweak) ModItems.draconicAxe));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernShovel, new RenderTool("models/tools/Shovel.obj", "textures/models/tools/Shovel.png", (IRenderTweak) ModItems.wyvernShovel));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicShovel, new RenderTool("models/tools/DraconicShovel.obj", "textures/models/tools/DraconicShovel.png", (IRenderTweak) ModItems.draconicShovel));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernSword, new RenderTool("models/tools/Sword.obj", "textures/models/tools/Sword.png", (IRenderTweak) ModItems.wyvernSword));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicDestructionStaff, new RenderTool("models/tools/DraconicStaffOfPower.obj", "textures/models/tools/DraconicStaffOfPower.png", (IRenderTweak) ModItems.draconicDestructionStaff));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicHoe, new RenderTool("models/tools/DraconicHoe.obj", "textures/models/tools/DraconicHoe.png", (IRenderTweak) ModItems.draconicHoe));
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBowModel(true));
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBowModel(false));
}
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.draconiumChest), new RenderDraconiumChest());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.particleGenerator), new RenderParticleGen());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyInfuser), new RenderEnergyInfuser());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyCrystal), new RenderCrystal());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorStabilizer), new RenderReactorStabilizer());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorEnergyInjector), new RenderReactorEnergyInjector());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorCore), new RenderReactorCore());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.chaosCrystal), new RenderChaosShard());
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.upgradeModifier), new RenderUpgradeModifier());
//ISimpleBlockRendering
RenderingRegistry.registerBlockHandler(new RenderTeleporterStand());
RenderingRegistry.registerBlockHandler(new RenderPortal());
//TileEntitySpecialRenderers
ClientRegistry.bindTileEntitySpecialRenderer(TileParticleGenerator.class, new RenderTileParticleGen());
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyInfuser.class, new RenderTileEnergyInfiser());
ClientRegistry.bindTileEntitySpecialRenderer(TileCustomSpawner.class, new RenderTileCustomSpawner());
//ClientRegistry.bindTileEntitySpecialRenderer(TileTestBlock.class, new RenderTileCrystal());
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyStorageCore.class, new RenderTileEnergyStorageCore());
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyPylon.class, new RenderTileEnergyPylon());
ClientRegistry.bindTileEntitySpecialRenderer(TilePlacedItem.class, new RenderTilePlacedItem());
ClientRegistry.bindTileEntitySpecialRenderer(TileDissEnchanter.class, new RenderTileDissEnchanter());
ClientRegistry.bindTileEntitySpecialRenderer(TileTeleporterStand.class, new RenderTileTeleporterStand());
ClientRegistry.bindTileEntitySpecialRenderer(TileDraconiumChest.class, new RenderTileDraconiumChest());
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyRelay.class, new RenderTileCrystal());
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyTransceiver.class, new RenderTileCrystal());
ClientRegistry.bindTileEntitySpecialRenderer(TileWirelessEnergyTransceiver.class, new RenderTileCrystal());
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorCore.class, new RenderTileReactorCore());
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorStabilizer.class, new RenderTileReactorStabilizer());
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorEnergyInjector.class, new RenderTileReactorEnergyInjector());
ClientRegistry.bindTileEntitySpecialRenderer(TileChaosShard.class, new RenderTileChaosShard());
ClientRegistry.bindTileEntitySpecialRenderer(TileUpgradeModifier.class, new RenderTileUpgradeModifier());
//Entitys
RenderingRegistry.registerEntityRenderingHandler(EntityCustomDragon.class, new RenderDragon());
RenderingRegistry.registerEntityRenderingHandler(EntityChaosGuardian.class, new RenderDragon());
RenderingRegistry.registerEntityRenderingHandler(EntityDragonHeart.class, new RenderDragonHeart());
RenderingRegistry.registerEntityRenderingHandler(EntityDragonProjectile.class, new RenderDragonProjectile());
RenderingRegistry.registerEntityRenderingHandler(EntityChaosCrystal.class, new RenderChaosCrystal());
RenderingRegistry.registerEntityRenderingHandler(EntityChaosVortex.class, new RenderEntityChaosVortex());
RenderingRegistry.registerEntityRenderingHandler(EntityCustomArrow.class, new RenderEntityCustomArrow());
*/
}
public void registerRenderIDs() {
//References.idTeleporterStand = RenderingRegistry.getNextAvailableRenderId();
//References.idPortal = RenderingRegistry.getNextAvailableRenderId();
}
/*
* ------------- Code inspiration pour le faisceau d'energie du satellite
*
@Override
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz, int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
if (!worldObj.isRemote) return null;
ParticleEnergyBeam beam = oldBeam;
boolean inRange = ParticleHandler.isInRange(x, y, z, 50) || ParticleHandler.isInRange(tx, ty, tz, 50);
if (beam == null || beam.isDead) {
if (inRange) {
beam = new ParticleEnergyBeam(worldObj, x, y, z, tx, ty, tz, 8, powerFlow, advanced, beamType);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(beam);
}
} else if (!inRange) {
beam.setDead();
return null;
} else {
beam.update(powerFlow, render);
}
return beam;
}
@Override
public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced, ParticleEnergyField oldBeam, boolean render) {
if (!worldObj.isRemote) return null;
ParticleEnergyField beam = oldBeam;
boolean inRange = ParticleHandler.isInRange(x, y, z, 50);
if (beam == null || beam.isDead) {
if (inRange) {
beam = new ParticleEnergyField(worldObj, x, y, z, 8, type, advanced);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(beam);
}
} else if (!inRange) {
beam.setDead();
return null;
} else {
beam.update(render);
}
return beam;
}
@Override
public ParticleReactorBeam reactorBeam(TileEntity tile, ParticleReactorBeam oldBeam, boolean render) {
if (!tile.getWorldObj().isRemote || !(tile instanceof IReactorPart)) return null;
ParticleReactorBeam beam = oldBeam;
boolean inRange = ParticleHandler.isInRange(tile.xCoord, tile.yCoord, tile.zCoord, 50);
if (beam == null || beam.isDead) {
if (inRange) {
beam = new ParticleReactorBeam(tile);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(beam);
}
} else if (!inRange) {
beam.setDead();
return null;
} else {
beam.update(render);
}
return beam;
}
*/
@Override
//public ParticleLaserBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz, int powerFlow, boolean advanced, ParticleLaserBeam oldBeam, boolean render, int beamType) {
public ParticleLaserBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz, int powerFlow, int pulseLenght, ParticleLaserBeam oldBeam, boolean render, int beamType) {
if (!worldObj.isRemote) return null;
ParticleLaserBeam beam = oldBeam;
boolean inRange = ParticleHandler.isInRange(x, y, z, 50) || ParticleHandler.isInRange(tx, ty, tz, 50);
if (beam == null || beam.isDead) {
if (inRange) {
beam = new ParticleLaserBeam(worldObj, x, y, z, tx, ty, tz, pulseLenght, powerFlow, beamType);
FMLClientHandler.instance().getClient().effectRenderer.addEffect(beam);
}
} else if (!inRange) {
beam.setDead();
return null;
} else {
beam.update(powerFlow, render);
}
return beam;
}
public boolean isOp(String paramString) {
return Minecraft.getMinecraft().theWorld.getWorldInfo().getGameType().isCreative();
}
@Override
public void spawnParticle(Object particle, int range) {
if (particle instanceof EntityFX && ((EntityFX) particle).worldObj.isRemote)
ParticleHandler.spawnCustomParticle((EntityFX) particle, range);
}
@Override
public ISound playISound(ISound sound) {
FMLClientHandler.instance().getClient().getSoundHandler().playSound(sound);
return sound;
}
/*
@Override
public void registerRender()
{
tesrRenderId = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new TESRInventoryRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(DefenderTileEntity.class, new TileEntityDefenderRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(PhotonAcceleratorTileEntity.class, new TileEntityPhotonAcceleratorRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(PhotonDeceleratorTileEntity.class, new TileEntityPhotonDeceleratorRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(InverterAdvTileEntity.class, new TileEntityInverterAdvRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(ExtenderTileEntity.class, new TileEntityExtenderRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(OverriderBlockTileEntity.class, new TileEntityOverriderRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(SateliteTileEntity.class, new SateliteRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(DefenderLaserTileEntity.class, new DefenderLaserRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(LaserLowTileEntity.class, new LaserLowRenderer());
}
@Override
public EntityPlayer getPlayerEntity(MessageContext ctx) {
// Note that if you simply return 'Minecraft.getMinecraft().thePlayer',
// your packets will not work as expected because you will be getting a
// client player even when you are on the server!
// Sounds absurd, but it's true.
// Solution is to double-check side before returning the player:
return (ctx.side.isClient() ? Minecraft.getMinecraft().thePlayer : super.getPlayerEntity(ctx));
}
*/
}

View File

@ -1,19 +0,0 @@
package fr.jackcartersmith.orbsat.client.creativetabs;
import fr.jackcartersmith.orbsat.common.OSItems;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class OSCreativeTabs extends CreativeTabs {
public OSCreativeTabs(int id, String label) {
super(id,label);
}
@Override
public Item getTabIconItem() {
return OSItems.basicExtrapolCircuit;
}
}

View File

@ -1,96 +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.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class OSGuiHandler implements IGuiHandler{
public static final int GUIID_OVERRIDER = 0;
public static final int GUIID_PHOTON_ACCELERATOR = 1;
public static final int GUIID_PHOTON_DECELERATOR = 2;
public static final int GUIID_INVERTER = 3;
public static final int GUIID_INVERTER_ADV = 4;
public OSGuiHandler() {
NetworkRegistry.INSTANCE.registerGuiHandler(OrbitalSatellite.instance, this);
}
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
/*
switch (id) {
case GUIID_OVERRIDER:
TileEntity te = world.getTileEntity(x, y, z);
if (te != null && te instanceof TileWeatherController) {
return new GUIWeatherController(player.inventory, (TileWeatherController) te);
}
break;
case GUIID_PHOTON_ACCELERATOR:
TileEntity te1 = world.getTileEntity(x, y, z);
if (te1 != null && te1 instanceof TileSunDial) {
return new GUISunDial(player.inventory, (TileSunDial) te1);
}
break;
case GUIID_PHOTON_DECELERATOR:
return new GUITeleporter(player);
case GUIID_INVERTER:
TileEntity te2 = world.getTileEntity(x, y, z);
if (te2 != null && te2 instanceof TileGrinder) {
return new GUIGrinder(player.inventory, (TileGrinder) te2);
}
break;
case GUIID_INVERTER_ADV:
TileEntity te3 = world.getTileEntity(x, y, z);
if (te3 != null && te3 instanceof TileSunDial) {
return new GUISunDial(player.inventory, (TileSunDial) te3);
}
break;
}
*/
return null;
}
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
/*
switch (id) {
case GUIID_OVERRIDER:
TileEntity te = world.getTileEntity(x, y, z);
if (te != null && te instanceof TileWeatherController) {
return new ContainerWeatherController(player.inventory, (TileWeatherController) te);
}
break;
case GUIID_PHOTON_ACCELERATOR:
TileEntity te1 = world.getTileEntity(x, y, z);
if (te1 != null && te1 instanceof TileSunDial) {
return new ContainerSunDial(player.inventory, (TileSunDial) te1);
}
break;
case GUIID_PHOTON_DECELERATOR:
TileEntity te2 = world.getTileEntity(x, y, z);
if (te2 != null && te2 instanceof TileSunDial) {
return new ContainerSunDial(player.inventory, (TileSunDial) te2);
}
break;
case GUIID_INVERTER:
TileEntity te3 = world.getTileEntity(x, y, z);
if (te3 != null && te3 instanceof TileSunDial) {
return new ContainerSunDial(player.inventory, (TileSunDial) te3);
}
break;
case GUIID_INVERTER_ADV:
TileEntity te4 = world.getTileEntity(x, y, z);
if (te4 != null && te4 instanceof TileSunDial) {
return new ContainerSunDial(player.inventory, (TileSunDial) te4);
}
break;
}
*/
return null;
}
}

View File

@ -1,95 +0,0 @@
package fr.jackcartersmith.orbsat.client.handler;
import net.minecraft.client.Minecraft;
public class ClientEventHandler {
//public static Map<EntityPlayer, XZPair<Float, Integer>> playerShieldStatus = new HashMap<EntityPlayer, XZPair<Float, Integer>>();
public static int elapsedTicks;
public static float previousSensitivity = 0;
public static boolean bowZoom = false;
public static boolean lastTickBowZoom = false;
public static int tickSet = 0;
public static float energyCrystalAlphaValue = 0f;
public static float energyCrystalAlphaTarget = 0f;
public static boolean playerHoldingWrench = false;
public static Minecraft mc;
//private static Random rand = new Random();
//private static IModelCustom shieldSphere;
public ClientEventHandler() {
//shieldSphere = AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/shieldSphere.obj"));
}
/*
@SubscribeEvent
public void tickEnd(TickEvent.ClientTickEvent event) {
if (event.phase != TickEvent.Phase.START || event.type != TickEvent.Type.CLIENT || event.side != Side.CLIENT)
return;
for (Iterator<Map.Entry<EntityPlayer, XZPair<Float, Integer>>> i = playerShieldStatus.entrySet().iterator(); i.hasNext(); ) {
Map.Entry<EntityPlayer, XZPair<Float, Integer>> entry = i.next();
if (elapsedTicks - entry.getValue().getValue() > 5) i.remove();
}
if (mc == null) mc = Minecraft.getMinecraft();
else if (mc.theWorld != null) {
elapsedTicks++;
HudHandler.clientTick();
if (bowZoom && !lastTickBowZoom) {
previousSensitivity = Minecraft.getMinecraft().gameSettings.mouseSensitivity;
Minecraft.getMinecraft().gameSettings.mouseSensitivity = previousSensitivity / 3;
} else if (!bowZoom && lastTickBowZoom) {
Minecraft.getMinecraft().gameSettings.mouseSensitivity = previousSensitivity;
}
lastTickBowZoom = bowZoom;
if (elapsedTicks - tickSet > 10) bowZoom = false;
if (energyCrystalAlphaValue < energyCrystalAlphaTarget) energyCrystalAlphaValue += 0.01f;
if (energyCrystalAlphaValue > energyCrystalAlphaTarget) energyCrystalAlphaValue -= 0.01f;
if (Math.abs(energyCrystalAlphaTarget - energyCrystalAlphaValue) <= 0.02f)
energyCrystalAlphaTarget = rand.nextFloat();
playerHoldingWrench = mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() == ModItems.wrench;
searchForPlayerMount();
}
}
@SubscribeEvent(priority = EventPriority.LOW)
public void fovUpdate(FOVUpdateEvent event) {
//region Bow FOV Update
if (event.entity.getHeldItem() != null && (event.entity.getHeldItem().getItem() instanceof WyvernBow || event.entity.getHeldItem().getItem() instanceof DraconicBow) && Minecraft.getMinecraft().gameSettings.keyBindUseItem.getIsKeyPressed()) {
BowHandler.BowProperties properties = new BowHandler.BowProperties(event.entity.getHeldItem(), event.entity);
event.newfov = ((6 - properties.zoomModifier) / 6) * event.fov;
// if (ItemNBTHelper.getString(event.entity.getItemInUse(), "mode", "").equals("sharpshooter")){
// if (event.entity.getItemInUse().getItem() instanceof WyvernBow) zMax = 1.35f;
// else if (event.entity.getItemInUse().getItem() instanceof DraconicBow) zMax = 2.5f;
// bowZoom = true;
// tickSet = elapsedTicks;
// }
}
//endregion
//region Armor move speed FOV effect cancellation
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(event.entity);
if (summery != null && summery.speedModifier > 0) {
IAttributeInstance iattributeinstance = event.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
float f = (float) ((iattributeinstance.getAttributeValue() / (double) event.entity.capabilities.getWalkSpeed() + 1.0D) / 2.0D);
event.newfov /= f;
}
//endregion
}
*/
}

View File

@ -1,75 +0,0 @@
package fr.jackcartersmith.orbsat.client.handler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import fr.jackcartersmith.orbsat.client.render.ParticleDistortion;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.world.World;
@SideOnly(Side.CLIENT)
public class ParticleHandler {
private static Minecraft mc = Minecraft.getMinecraft();
private static World theWorld = mc.theWorld;
public static EntityFX spawnParticle(String particleName, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
int var14 = mc.gameSettings.particleSetting;
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
var14 = 2;
}
double var15 = mc.renderViewEntity.posX - x;
double var17 = mc.renderViewEntity.posY - y;
double var19 = mc.renderViewEntity.posZ - z;
EntityFX var21 = null;
double var22 = 16.0D;
if (var15 * var15 + var17 * var17 + var19 * var19 > var22 * var22) {
return null;
} else if (var14 > 1) {
return null;
} else {
if (particleName.equals("distortionParticle")) {
var21 = new ParticleDistortion(theWorld, x, y, z, (float) motionX, (float) motionY, (float) motionZ, scale);
}
mc.effectRenderer.addEffect(var21);
return var21;
}
}
return null;
}
public static EntityFX spawnCustomParticle(EntityFX particle) {
return spawnCustomParticle(particle, 64);
}
public static EntityFX spawnCustomParticle(EntityFX particle, double vewRange) {
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
int var14 = mc.gameSettings.particleSetting;
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
var14 = 2;
}
if (!isInRange(particle.posX, particle.posY, particle.posZ, vewRange)) {
return null;
} else if (var14 > 1) {
return null;
} else {
mc.effectRenderer.addEffect(particle);
return particle;
}
}
return null;
}
public static boolean isInRange(double x, double y, double z, double vewRange) {
if (mc == null || mc.renderViewEntity == null || mc.effectRenderer == null) return false;
double var15 = mc.renderViewEntity.posX - x;
double var17 = mc.renderViewEntity.posY - y;
double var19 = mc.renderViewEntity.posZ - z;
if (var15 * var15 + var17 * var17 + var19 * var19 > vewRange * vewRange) {
return false;
}
return true;
}
}

View File

@ -1,80 +0,0 @@
package fr.jackcartersmith.orbsat.client.handler;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.util.ResourceLocation;
public class ResourceHandler {
public static ResourceHandler instance = new ResourceHandler();
private static ResourceLocation defaultParticles;
private static ResourceLocation particles = new ResourceLocation(OSRefs.RESOURCESPREFIX + "textures/particle/particles.png");
private static Map<String, ResourceLocation> cachedResources = new HashMap<String, ResourceLocation>();
private static String savePath;
private static File saveFolder;
//-------------------- File Handling -----------------------//
public static void init(FMLPreInitializationEvent event) {
FMLCommonHandler.instance().bus().register(instance);
}
public static File getConfigFolder() {
if (saveFolder == null) {
saveFolder = new File(savePath);
}
if (!saveFolder.exists()) saveFolder.mkdir();
return saveFolder;
}
//----------------------------------------------------------//
public static void bindTexture(ResourceLocation texture) {
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
}
/**
* Binds the vanilla particle sheet
*/
public static void bindDefaultParticles() {
if (defaultParticles == null) {
try {
defaultParticles = (ResourceLocation) ReflectionHelper.getPrivateValue(EffectRenderer.class, null, "particleTextures", "field_110737_b");
}
catch (Exception e) {
}
}
if (defaultParticles != null) bindTexture(defaultParticles);
}
public static void bindParticles() {
bindTexture(particles);
}
public static ResourceLocation getResource(String rs) {
if (!cachedResources.containsKey(rs))
cachedResources.put(rs, new ResourceLocation(OSRefs.RESOURCESPREFIX + rs));
return cachedResources.get(rs);
}
public static ResourceLocation getResourceWOP(String rs) {
if (!cachedResources.containsKey(rs)) cachedResources.put(rs, new ResourceLocation(rs));
return cachedResources.get(rs);
}
public static void bindResource(String rs) {
bindTexture(ResourceHandler.getResource(rs));
}
}

View File

@ -1,314 +0,0 @@
package fr.jackcartersmith.orbsat.client.model;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
/**
* ModelDefender - JackCarterSmith
* Created using Tabula 4.1.1
*/
public class ModelDefender extends ModelBase {
public ModelRenderer crystalPlateforme;
public ModelRenderer crystal;
public ModelRenderer photonInjector;
public ModelRenderer basePlateforme;
public ModelRenderer crystalPlateforme2;
public ModelRenderer photonInjector_1;
public ModelRenderer baseSide1;
public ModelRenderer baseSide2;
public ModelRenderer baseSide3;
public ModelRenderer baseSide4;
public ModelRenderer crystalArmSupport1;
public ModelRenderer crystalArmSupport2;
public ModelRenderer crystalArmSupport3;
public ModelRenderer crystalArmSupport4;
public ModelRenderer shape13;
public ModelRenderer shape14;
public ModelRenderer shape15;
public ModelRenderer shape16;
public ModelRenderer shape17;
public ModelRenderer shape18;
public ModelRenderer support1;
public ModelRenderer support2;
public ModelRenderer support3;
public ModelRenderer support4;
public ModelRenderer support5;
public ModelRenderer support6;
public ModelRenderer support7;
public ModelRenderer support8;
public ModelDefender() {
this.textureWidth = 128;
this.textureHeight = 128;
this.shape15 = new ModelRenderer(this, 0, 64);
this.shape15.setRotationPoint(2.0F, 17.0F, 0.0F);
this.shape15.addBox(0.0F, 0.0F, 0.0F, 2, 1, 1, 0.0F);
this.basePlateforme = new ModelRenderer(this, 0, 0);
this.basePlateforme.setRotationPoint(-8.0F, 23.0F, -8.0F);
this.basePlateforme.addBox(0.0F, 0.0F, 0.0F, 16, 1, 16, 0.0F);
this.photonInjector_1 = new ModelRenderer(this, 0, 17);
this.photonInjector_1.setRotationPoint(-2.0F, 11.0F, -2.0F);
this.photonInjector_1.addBox(0.0F, 0.0F, 0.0F, 4, 12, 4, 0.0F);
this.baseSide1 = new ModelRenderer(this, 16, 17);
this.baseSide1.mirror = true;
this.baseSide1.setRotationPoint(-8.0F, 19.0F, -8.0F);
this.baseSide1.addBox(0.0F, 0.0F, 0.0F, 16, 4, 1, 0.0F);
this.crystalArmSupport1 = new ModelRenderer(this, 0, 33);
this.crystalArmSupport1.setRotationPoint(-6.0F, -1.000000000000001F, -6.0F);
this.crystalArmSupport1.addBox(0.0F, 0.0F, 0.0F, 2, 24, 2, 0.0F);
this.shape16 = new ModelRenderer(this, 6, 64);
this.shape16.setRotationPoint(0.0F, 21.0F, -5.0F);
this.shape16.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1, 0.0F);
this.baseSide4 = new ModelRenderer(this, 16, 17);
this.baseSide4.mirror = true;
this.baseSide4.setRotationPoint(8.0F, 19.0F, -8.0F);
this.baseSide4.addBox(0.0F, 0.0F, 0.0F, 16, 4, 1, 0.0F);
this.setRotateAngle(baseSide4, 0.0F, -1.5707963267948966F, 0.0F);
this.shape14 = new ModelRenderer(this, 0, 68);
this.shape14.setRotationPoint(3.0F, 18.0F, 0.0F);
this.shape14.addBox(0.0F, 0.0F, 0.0F, 1, 5, 1, 0.0F);
this.shape17 = new ModelRenderer(this, 10, 64);
this.shape17.mirror = true;
this.shape17.setRotationPoint(-1.0F, 14.0F, 2.0F);
this.shape17.addBox(0.0F, 0.0F, 0.0F, 1, 9, 1, 0.0F);
this.support8 = new ModelRenderer(this, 52, 4);
this.support8.mirror = true;
this.support8.setRotationPoint(5.0F, 8.0F, 5.0F);
this.support8.addBox(0.0F, 0.0F, -0.5F, 5, 1, 1, -0.2F);
this.setRotateAngle(support8, 0.0F, 2.356194490192345F, 0.0F);
this.crystalArmSupport4 = new ModelRenderer(this, 0, 33);
this.crystalArmSupport4.setRotationPoint(4.0F, -1.000000000000001F, -6.0F);
this.crystalArmSupport4.addBox(0.0F, 0.0F, 0.0F, 2, 24, 2, 0.0F);
this.support5 = new ModelRenderer(this, 52, 4);
this.support5.mirror = true;
this.support5.setRotationPoint(-5.0F, 8.0F, 5.0F);
this.support5.addBox(0.0F, 0.0F, -0.5F, 5, 1, 1, -0.2F);
this.setRotateAngle(support5, 0.0F, 0.7853981633974483F, 0.0F);
this.crystalPlateforme = new ModelRenderer(this, 0, 0);
this.crystalPlateforme.setRotationPoint(-1.5F, 10.0F, -1.5F);
this.crystalPlateforme.addBox(0.0F, 0.0F, 0.0F, 3, 1, 3, 0.0F);
this.support6 = new ModelRenderer(this, 52, 4);
this.support6.mirror = true;
this.support6.setRotationPoint(-5.0F, 8.0F, -5.0F);
this.support6.addBox(0.0F, 0.0F, -0.5F, 5, 1, 1, -0.2F);
this.setRotateAngle(support6, 0.0F, -0.7853981633974483F, 0.0F);
this.photonInjector = new ModelRenderer(this, 8, 33);
this.photonInjector.setRotationPoint(0.0F, -6.0F, -3.5F);
this.photonInjector.addBox(0.0F, 0.0F, 0.0F, 5, 12, 5, 0.0F);
this.setRotateAngle(photonInjector, 0.0F, -0.7853981633974483F, 0.0F);
this.crystalArmSupport2 = new ModelRenderer(this, 0, 33);
this.crystalArmSupport2.setRotationPoint(-6.0F, -1.000000000000001F, 4.0F);
this.crystalArmSupport2.addBox(0.0F, 0.0F, 0.0F, 2, 24, 2, 0.0F);
this.shape13 = new ModelRenderer(this, 0, 64);
this.shape13.setRotationPoint(0.0F, 20.0F, -5.0F);
this.shape13.addBox(0.0F, 0.0F, 0.0F, 1, 1, 3, 0.0F);
this.shape18 = new ModelRenderer(this, 10, 64);
this.shape18.mirror = true;
this.shape18.setRotationPoint(-3.0F, 16.0F, 0.0F);
this.shape18.addBox(0.0F, 0.0F, 0.0F, 1, 7, 1, 0.0F);
this.baseSide2 = new ModelRenderer(this, 16, 17);
this.baseSide2.mirror = true;
this.baseSide2.setRotationPoint(-8.0F, 19.0F, 8.0F);
this.baseSide2.addBox(0.0F, 0.0F, 0.0F, 16, 4, 1, 0.0F);
this.setRotateAngle(baseSide2, 0.0F, 1.5707963267948966F, 0.0F);
this.crystal = new ModelRenderer(this, 0, 4);
this.crystal.setRotationPoint(0.0F, 8.5F, 0.0F);
this.crystal.addBox(-1.0F, -1.0F, -1.0F, 2, 2, 2, 0.0F);
//this.Shape7.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6);
//this.Shape7.setRotationPoint(0.0F, -4.0F, 0.0F);
this.support1 = new ModelRenderer(this, 52, 0);
this.support1.mirror = true;
this.support1.setRotationPoint(-5.0F, 1.0F, 5.0F);
this.support1.addBox(0.0F, 0.0F, -0.5F, 5, 3, 1, 0.0F);
this.setRotateAngle(support1, 0.0F, 0.7853981633974483F, 0.0F);
this.crystalArmSupport3 = new ModelRenderer(this, 0, 33);
this.crystalArmSupport3.setRotationPoint(4.0F, -1.000000000000001F, 4.0F);
this.crystalArmSupport3.addBox(0.0F, 0.0F, 0.0F, 2, 24, 2, 0.0F);
this.support4 = new ModelRenderer(this, 52, 0);
this.support4.mirror = true;
this.support4.setRotationPoint(5.0F, 1.0F, 5.0F);
this.support4.addBox(0.0F, 0.0F, -0.5F, 5, 3, 1, 0.0F);
this.setRotateAngle(support4, 0.0F, 2.356194490192345F, 0.0F);
this.support2 = new ModelRenderer(this, 52, 0);
this.support2.mirror = true;
this.support2.setRotationPoint(-5.0F, 1.0F, -5.0F);
this.support2.addBox(0.0F, 0.0F, -0.5F, 5, 3, 1, 0.0F);
this.setRotateAngle(support2, 0.0F, -0.7853981633974483F, 0.0F);
this.support3 = new ModelRenderer(this, 52, 0);
this.support3.mirror = true;
this.support3.setRotationPoint(5.0F, 1.0F, -5.0F);
this.support3.addBox(0.0F, 0.0F, -0.5F, 5, 3, 1, 0.0F);
this.setRotateAngle(support3, 0.0F, -2.356194490192345F, 0.0F);
this.support7 = new ModelRenderer(this, 52, 4);
this.support7.mirror = true;
this.support7.setRotationPoint(5.0F, 8.0F, -5.0F);
this.support7.addBox(0.0F, 0.0F, -0.5F, 5, 1, 1, -0.2F);
this.setRotateAngle(support7, 0.0F, -2.356194490192345F, 0.0F);
this.crystalPlateforme2 = new ModelRenderer(this, 0, 0);
this.crystalPlateforme2.setRotationPoint(-1.5F, 6.0F, -1.5F);
this.crystalPlateforme2.addBox(0.0F, 0.0F, 0.0F, 3, 1, 3, 0.0F);
this.baseSide3 = new ModelRenderer(this, 16, 17);
this.baseSide3.mirror = true;
this.baseSide3.setRotationPoint(8.0F, 19.0F, 8.0F);
this.baseSide3.addBox(0.0F, 0.0F, 0.0F, 16, 4, 1, 0.0F);
this.setRotateAngle(baseSide3, 0.0F, -3.141592653589793F, 0.0F);
}
public void render() {
this.shape15.render(0.0625F);
this.basePlateforme.render(0.0625F);
this.photonInjector_1.render(0.0625F);
this.baseSide1.render(0.0625F);
this.crystalArmSupport1.render(0.0625F);
this.shape16.render(0.0625F);
this.baseSide4.render(0.0625F);
this.shape14.render(0.0625F);
this.shape17.render(0.0625F);
this.support8.render(0.0625F);
this.crystalArmSupport4.render(0.0625F);
this.support5.render(0.0625F);
this.crystalPlateforme.render(0.0625F);
this.support6.render(0.0625F);
this.photonInjector.render(0.0625F);
this.crystalArmSupport2.render(0.0625F);
this.shape13.render(0.0625F);
this.shape18.render(0.0625F);
this.baseSide2.render(0.0625F);
this.support1.render(0.0625F);
this.crystalArmSupport3.render(0.0625F);
this.support4.render(0.0625F);
this.support2.render(0.0625F);
this.support3.render(0.0625F);
this.support7.render(0.0625F);
this.crystalPlateforme2.render(0.0625F);
this.baseSide3.render(0.0625F);
}
public void renderCrystal(float brightness) {
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
float b = brightness * 200F;
float colour = Math.min(2F, (brightness * 2F) + 0.5F);
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
GL11.glColor4f(colour*10F, colour*0F, colour*20F, 0.9F);
this.crystal.render(0.0625F);
GL11.glDisable(GL11.GL_BLEND);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastBrightnessX, lastBrightnessY);
if (brightness > 0F) GL11.glEnable(GL11.GL_LIGHTING);
}
/**
* This is a helper function from Tabula to set the rotation of model parts
*/
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
/* v1.0
public class ModelDefender extends ModelBase {
public ModelRenderer Shape1;
public ModelRenderer Shape2;
public ModelRenderer Shape3;
public ModelRenderer Shape4;
public ModelRenderer Shape5;
public ModelRenderer Shape6;
public ModelRenderer Shape7;
public 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.setRotateAngle(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.setRotateAngle(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.setRotateAngle(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.setRotateAngle(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.setRotateAngle(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.setRotateAngle(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, -4.0F, 0.0F);
this.Shape7.setTextureSize(128, 128);
this.Shape7.mirror = true;
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.setRotateAngle(this.Shape8, 0.0F, 0.0F, 0.0F);
}
public void render() {
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);
}
public void renderCrystal(float brightness) {
float lastBrightnessX = OpenGlHelper.lastBrightnessX;
float lastBrightnessY = OpenGlHelper.lastBrightnessY;
float b = brightness * 200F;
float colour = Math.min(2F, (brightness * 2F) + 0.5F);
if (brightness > 0F) GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, Math.min(200F, lastBrightnessX + b), Math.min(200F, lastBrightnessY + b));
GL11.glColor4f(colour*10F, colour*0F, colour*20F, 0.9F);
this.Shape7.render(0.0625F);
GL11.glDisable(GL11.GL_BLEND);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastBrightnessX, lastBrightnessY);
if (brightness > 0F) GL11.glEnable(GL11.GL_LIGHTING);
}
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
*/

View File

@ -1,101 +0,0 @@
package fr.jackcartersmith.orbsat.client.render;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import fr.jackcartersmith.orbsat.client.handler.ResourceHandler;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.World;
public class ParticleDistortion extends EntityFX{
double originalX;
double originalZ;
public ParticleDistortion(World par1World, double par2, double par4, double par6, float par8, float par9, float par10, float scale) {
this(par1World, par2, par4, par6, 1.0F, par8, par9, par10, scale);
}
public ParticleDistortion(World world, double par2, double par4, double par6, float par8, float par9, float par10, float par11, float scale) {
super(world, par2, par4, par6, 0.0D, 0.0D, 0.0D);
this.motionX = par9;//initial motion value X
this.motionY = par10;//initial motion value Y
this.motionZ = par11;//initial motion value Z
this.originalX = par9;
this.originalZ = par11;
if (par9 == 0.0F) {
par9 = 1.0F;
}
//float var12 = (float) Math.random() * 0.4F + 0.6F;
this.particleTextureIndexX = 0; //
this.particleTextureIndexY = 0;
this.particleRed = 0.7F;//RGB of your particle
this.particleGreen = 0.8F;
this.particleBlue = 1.0F;
//this.particleScale *= 0.05f + world.rand.nextFloat()*0.005;
//this.particleScale *= par8;
this.particleScale = scale;
this.particleMaxAge = 40 + world.rand.nextInt(40);//how soon the particle dies. You can use randomizer for this
this.noClip = true;//does your particle collide with blocks?
}
@Override
public void onUpdate() {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();//make sure to have this
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);// also important if you want your particle to move
this.motionX = motionX * (1 - (worldObj.rand.nextFloat() / 10F));
this.motionY = motionY * (1 - (worldObj.rand.nextFloat() / 10F));
this.motionZ = motionZ * (1 - (worldObj.rand.nextFloat() / 10F));
this.particleAlpha = (1F - ((float) this.particleAge / (float) this.particleMaxAge)) * 0.5F;
}
@Override
@SideOnly(Side.CLIENT)
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {//Note U=X V=Y
tessellator.draw();
ResourceHandler.bindParticles();
tessellator.startDrawingQuads();
tessellator.setBrightness(200);//make sure you have this!!
float minU = 0.0F + 0F;//(float)this.particleTextureIndexX / 32.0F;
float maxU = 0.0F + 0.1245F;//minU + 0.124F;
float minV = 0F;//(float)this.particleTextureIndexY / 32.0F;
float maxV = 0.1245F;//minV + 0.124F;
float drawScale = 0.1F * this.particleScale;
if (this.particleIcon != null) {
minU = this.particleIcon.getMinU();
maxU = this.particleIcon.getMaxU();
minV = this.particleIcon.getMinV();
maxV = this.particleIcon.getMaxV();
}
float drawX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
float drawY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
float drawZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
tessellator.setColorRGBA(0, 255, 255, (int) (this.particleAlpha * 255F));
tessellator.addVertexWithUV((double) (drawX - par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ - par5 * drawScale - par7 * drawScale), (double) maxU, (double) maxV);
tessellator.addVertexWithUV((double) (drawX - par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ - par5 * drawScale + par7 * drawScale), (double) maxU, (double) minV);
tessellator.addVertexWithUV((double) (drawX + par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ + par5 * drawScale + par7 * drawScale), (double) minU, (double) minV);
tessellator.addVertexWithUV((double) (drawX + par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ + par5 * drawScale - par7 * drawScale), (double) minU, (double) maxV);
tessellator.draw();
ResourceHandler.bindDefaultParticles();
tessellator.startDrawingQuads();
}
}

View File

@ -1,44 +0,0 @@
package fr.jackcartersmith.orbsat.client.render.block;
import org.lwjgl.opengl.GL11;
import fr.jackcartersmith.orbsat.client.handler.ResourceHandler;
import fr.jackcartersmith.orbsat.client.render.tile.RenderTileDefender;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
public class RenderDefender implements IItemRenderer{
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
GL11.glPushMatrix();
if (type == ItemRenderType.INVENTORY) {
GL11.glScaled(0.76, 0.76, 0.76);
GL11.glTranslated(0.5, 1.0, 0.5);
GL11.glRotated(180, 0, 1, 0);
} else if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
GL11.glTranslated(0.5, 2, 0.5);
GL11.glRotated(90, 0, 1, 0);
} else if (type == ItemRenderType.ENTITY) {
GL11.glScaled(3.0, 3.0, 3.0);
GL11.glTranslated(0.0, 1.5, 0.0);
GL11.glRotated(180, 0, 1, 0);
}
GL11.glRotated(180, 0, 0, 1);
ResourceHandler.bindResource("textures/models/defender.png");
RenderTileDefender.modelDefender.render();
RenderTileDefender.modelDefender.renderCrystal(1F);
GL11.glPopMatrix();
}
}

View File

@ -1,235 +0,0 @@
package fr.jackcartersmith.orbsat.client.render.particle;
import org.lwjgl.opengl.GL11;
import fr.jackcartersmith.orbsat.client.handler.ResourceHandler;
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
import fr.jackcartersmith.orbsat.common.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class ParticleLaserBeam extends EntityFX {
/**
* Power flow integer Ranges from 0 to 100
*/
private int flow;
/**
* Beam Target X
*/
private double tX = 0.0D;
/**
* Beam Target Y
*/
private double tY = 0.0D;
/**
* Beam Target Z
*/
private double tZ = 0.0D;
/**
* Modified Target X
*/
//private boolean advanced;
private boolean renderParticle = true;
private float length = 0.0F;
private float rotYaw = 0.0F;
private float rotPitch = 0.0F;
private float prevYaw = 0.0F;
private float prevPitch = 0.0F;
private EntityPlayer player;
//todo make sure not dyrectly up or down on y axis, Set dead when player goes out of range, PaRTICLE eNGINE
private static ResourceLocation beamTextureBasic = new ResourceLocation(OSRefs.MODID.toLowerCase(), "textures/models/laserBeam.png");
/**
* @param offsetMode 0 = no offset, 1 = offset target end, 2 = offset start end, 3 offset both ends
*/
//public ParticleLaserBeam(World world, double x, double y, double z, double tX, double tY, double tZ, int maxAge, int flow, boolean advanced, int offsetMode) {
public ParticleLaserBeam(World world, double x, double y, double z, double tX, double tY, double tZ, int maxAge, int flow, int offsetMode) {
super(world, x, y, z, 0.0D, 0.0D, 0.0D);
this.particleRed = 1F;
this.particleGreen = 1F;
this.particleBlue = 1F;
this.noClip = true;
this.motionX = 0.0D;
this.motionY = 0.0D;
this.motionZ = 0.0D;
this.particleMaxAge = maxAge;
this.flow = flow;
this.prevYaw = rotationYaw;
this.prevPitch = rotPitch;
this.setSize(0.2F, 0.2F);
//this.advanced = advanced;
this.tX = tX;
this.tY = tY;
this.tZ = tZ;
if (offsetMode > 0) {
double dist = Utils.getDistanceAtoB(x, z, tX, tZ);
if (dist == 0) dist = 0.1;
double xDist = x - tX;
double zDist = z - tZ;
double xOff = xDist / dist;
double zOff = zDist / dist;
if (xOff == 0 && zOff == 0) xOff = 1;
//LogHelper.info(xOff + " " + zOff);
double offM = 0.4D;
if (offsetMode == 2 || offsetMode == 3) setPosition(posX - xOff * offM, posY, posZ - zOff * offM);
if (offsetMode == 1 || offsetMode == 3) {
this.tX = tX + xOff * offM;
this.tY = tY;
this.tZ = tZ + zOff * offM;
}
}
}
public void update(int flow, boolean render) {
this.renderParticle = render;
for (this.flow = flow; this.particleMaxAge - this.particleAge < 4; ++this.particleMaxAge) {
}
}
@Override
public void onUpdate() {
//1.570797f
// double sin = Math.sin(-1f + (float)(particleAge % 360) / 180f * 1.570797f);
// LogHelper.info(sin + " " + particleAge % 360);
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.prevYaw = this.rotYaw;
this.prevPitch = this.rotPitch;
float xd = (float) (this.posX - this.tX);
float yd = (float) (this.posY - this.tY);
float zd = (float) (this.posZ - this.tZ);
this.length = MathHelper.sqrt_float(xd * xd + yd * yd + zd * zd);
double var7 = (double) MathHelper.sqrt_double((double) (xd * xd + zd * zd));
this.rotYaw = (float) (Math.atan2((double) xd, (double) zd) * 180.0D / 3.141592653589793D);
this.rotPitch = (float) (Math.atan2((double) yd, var7) * 180.0D / 3.141592653589793D);
this.prevYaw = this.rotYaw;
this.prevPitch = this.rotPitch;
if (this.particleAge++ >= this.particleMaxAge) {
this.setDead();
}
}
private EntityPlayer getPlayer() {
if (player == null) {
player = Minecraft.getMinecraft().thePlayer;
}
return player;
}
@Override
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) {
if (!renderParticle) return;
tessellator.draw();
GL11.glPushMatrix();
//GL11.glPushAttrib(GL11.GL_ATTRIB_STACK_DEPTH);
float var9 = 1.0F;
float slide = (float) getPlayer().ticksExisted;
float size = (float) flow / 100f * 2f; //0.7F;
/*
if (advanced) Minecraft.getMinecraft().renderEngine.bindTexture(beamTextureAdvanced);
else Minecraft.getMinecraft().renderEngine.bindTexture(beamTextureBasic);
*/
Minecraft.getMinecraft().renderEngine.bindTexture(beamTextureBasic);
GL11.glTexParameterf(3553, 10242, 10497.0F);
GL11.glTexParameterf(3553, 10243, 10497.0F);
GL11.glDisable(GL11.GL_CULL_FACE);
float var11 = slide + partialTick;
float var12 = -var11 * 0.2F - (float) MathHelper.floor_float(-var11 * 0.1F);
GL11.glBlendFunc(770, 1);
GL11.glDepthMask(false);
float xx = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) partialTick - interpPosX);
float yy = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) partialTick - interpPosY);
float zz = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) partialTick - interpPosZ);
GL11.glTranslated((double) xx, (double) yy, (double) zz);
float ry = (float) ((double) this.prevYaw + (double) (this.rotYaw - this.prevYaw) * (double) partialTick);
float rp = (float) ((double) this.prevPitch + (double) (this.rotPitch - this.prevPitch) * (double) partialTick);
GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(180.0F + ry, 0.0F, 0.0F, -1.0F);
GL11.glRotatef(rp, 1.0F, 0.0F, 0.0F);
double var44 = -0.15D * (double) size;
double var17 = 0.15D * (double) size;
GL11.glTranslated(0.03, 0, 0);
for (int t = 0; t < 2; ++t) {
double var29 = (double) (this.length * var9);
double var31 = 0D;
double var33 = 1D;
double var35 = (double) (-1.0F + var12 + (float) t / 3.0F);
double var37 = (double) (this.length * var9) + var35;
GL11.glRotatef(t * 90.0F, 0.0F, 1.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setBrightness(200);
tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1f);
tessellator.addVertexWithUV(var44, var29, 0.0D, var33, var37);
tessellator.addVertexWithUV(var44, 0.0D, 0.0D, var33, var35);
tessellator.addVertexWithUV(var17, 0.0D, 0.0D, var31, var35);
tessellator.addVertexWithUV(var17, var29, 0.0D, var31, var37);
tessellator.draw();
GL11.glRotatef(t * 90.0F, 0.0F, -1.0F, 0.0F);
}
/*
if (ClientEventHandler.playerHoldingWrench) {
var44 = -0.15D * (double) 1;
var17 = 0.15D * (double) 1;
//GL11.glColor4f(1f, 1f, 1f, 1f);
//GL11.glTranslated(0.1, 0, 0);
for (int t = 0; t < 2; ++t) {
double var29 = (double) (this.length * var9);
double var31 = 0D;
double var33 = 1D;
double var35 = (double) (-1.0F + var12 + (float) t / 3.0F);
double var37 = (double) (this.length * var9) + var35;
GL11.glRotatef(t * 90.0F, 0.0F, 1.0F, 0.0F);
tessellator.startDrawingQuads();
tessellator.setBrightness(200);
tessellator.setColorRGBA_F(0f, 1f, 0f, 1f);
tessellator.addVertexWithUV(var44, var29, 0.0D, var33, var37);
tessellator.addVertexWithUV(var44, 0.0D, 0.0D, var33, var35);
tessellator.addVertexWithUV(var17, 0.0D, 0.0D, var31, var35);
tessellator.addVertexWithUV(var17, var29, 0.0D, var31, var37);
tessellator.draw();
GL11.glRotatef(t * 90.0F, 0.0F, -1.0F, 0.0F);
}
}
*/
//GL11.glDepthMask(true);
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_CULL_FACE);
// GL11.glPopAttrib();
GL11.glPopMatrix();
ResourceHandler.bindDefaultParticles();
tessellator.startDrawingQuads();
}
public int getFlow() {
return flow;
}
public void setFlow(int flow) {
this.flow = flow;
}
}

View File

@ -1,84 +0,0 @@
package fr.jackcartersmith.orbsat.client.render.tile;
import org.lwjgl.opengl.GL11;
import fr.jackcartersmith.orbsat.client.handler.ResourceHandler;
import fr.jackcartersmith.orbsat.client.model.ModelDefender;
import fr.jackcartersmith.orbsat.common.tileentities.TileDefender;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
public class RenderTileDefender extends TileEntitySpecialRenderer {
public static ModelDefender modelDefender = new ModelDefender();
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
renderCore((TileDefender) tileEntity, x, y, z, partialTick);
GL11.glPopMatrix();
}
public void renderCore(TileDefender tile, double x, double y, double z, float partialTick) {
GL11.glPushMatrix();
ResourceHandler.bindResource("textures/models/defender.png");
GL11.glRotated(180, 2, 0, 0);
RenderTileDefender.modelDefender.render();
float ticks = ((float)Minecraft.getMinecraft().renderViewEntity.ticksExisted + partialTick) * tile.rotationSpeed;
if (tile.getWorld() != null)
{
GL11.glRotatef(ticks % 360.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(35.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F, 0.0F, 0.0F, 1.0F);
/*
GL11.glRotatef(ticks % 360.0F * tile.rotation, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(35.0F * tile.rotation, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(45.0F * tile.rotation, 0.0F, 0.0F, 1.0F);
*/
}
GL11.glTranslatef(0.3F,-0.22F,-0.3F);
RenderTileDefender.modelDefender.renderCrystal(tile.crystalBrightness);
GL11.glPopMatrix();
/*
switch (tile.facingDirection) {
case 1:
GL11.glRotated(180, -1, 0, 0);
break;
case 2:
GL11.glRotated(90, 1, 0, 0);
break;
case 3:
GL11.glRotated(90, -1, 0, 0);
break;
case 4:
GL11.glRotated(90, 0, 0, -1);
break;
case 5:
GL11.glRotated(90, 0, 0, 1);
}
modelDefender.render(null, 0F, 0F, 0F, 0F, 0F, scale);
GL11.glEnable(GL11.GL_BLEND);
//float rotation = tile.rotation + (partialTick * tile.rotationSpeed);
//GL11.glRotatef(tile.rotation + (partialTick * tile.rotationSpeed), 0F, 0F, 1F);
//GL11.glRotatef(-tile.rotation + (partialTick * tile.rotationSpeed), 0F, 0F, 1F);
//modelDefender.Shape7.rotateAngleY = tile.rotation * 90.0F;
//modelDefender.Shape7.rotateAngleZ = tile.rotation * 90.0F;
modelDefender.Shape7.rotateAngleY = (float) (-Math.sin(tile.rotation));
modelDefender.Shape7.rotateAngleZ = (float) (Math.sin(-2*Math.PI/3+tile.rotation));
modelDefender.Shape7.rotateAngleX = (float) (Math.sin(2*Math.PI/3+tile.rotation));
modelDefender.renderCrystal(null, 0F, tile.modelIllumination, 0F, 0F, 0F, scale);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
*/
}
}

Some files were not shown because too many files have changed in this diff Show More