diff --git a/.gitignore b/.gitignore index 97a0717..00d4a90 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,16 @@ /api /build /src/api +/src/main/java/tconstruct /*.exe /*.classpath /*.project -*.xcf \ No newline at end of file +*.xcf +/eclipse +.settings/org.eclipse.jdt.core.prefs +CREDITS-fml.txt +LICENSE-fml.txt +MinecraftForge-Credits.txt +MinecraftForge-License.txt +README.txt +forge-1.7.10-10.13.4.1448-1.7.10-changelog.txt diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..3c93bfe --- /dev/null +++ b/build.bat @@ -0,0 +1,2 @@ +call gradlew.bat build +pause \ No newline at end of file diff --git a/build.gradle b/build.gradle index 44ca3eb..eac805e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,57 +1,82 @@ -sourceSets.main { - java.srcDirs project.projectDir.name - resources.srcDirs project.projectDir.name +buildscript { + repositories { + mavenCentral() + maven { + name = "forge" + url = "http://files.minecraftforge.net/maven" + } + maven { + name = "sonatype" + url = "https://oss.sonatype.org/content/repositories/snapshots/" + } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' + } } - -version = "2.0.5.a-${project.minecraft.version}" + +apply plugin: 'forge' + +version = "2.4.3.d-1.7.10"//${project.minecraft.version}" +group= "shift.SextiarySector2" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "SextiarySector2" minecraft { - // replacing stuff in the source + version = "1.7.10-10.13.4.1448-1.7.10" + runDir = "eclipse" + assetDir = "eclipse/assets" + replace '@VERSION@', project.version replace '@MC_VERSION@', version } -dependencies { -compile project(':MCEconomy2') -compile fileTree(dir: 'api', include: '*.jar') +[compileJava, compileTestJava,recompMinecraft].each{ + it.options.encoding = 'UTF-8' + it.options.compilerArgs += ['-source', '1.7', '-target', '1.7'] } -//コンパイル時の文字コード指定とJavaのバージョン指定。この書式じゃないとgradle2.0では動かない。 - [compileJava, compileTestJava,recompMinecraft, makeStart].each{ - it.options.encoding = 'UTF-8' - it.options.compilerArgs += ['-source', '1.7', '-target', '1.7'] - } +dependencies { + compile fileTree(dir: 'api', include: '*.jar') +} processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version - + // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' - + // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } - + // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } - - //from(sourceSets.main.java.srcDirs+'/shift/sextiarysector/api/') { - //include '**/shift/sextiarysector/api/' - -// into sourceSets.main.java.srcDirs - //} - } jar { + into('src/shift/sextiarysector/api') { from 'src/main/java/shift/sextiarysector/api' } + + manifest { + attributes 'FMLCorePlugin' : 'shift.sextiarysector.asm.SSCore','FMLCorePluginContainsFMLMod':'true' + } + } +task devJar(type: Jar) { + from sourceSets.main.output + from sourceSets.main.allSource + classifier = 'dev' +} + +artifacts { + archives devJar +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..b761216 Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..678d9d8 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Jul 02 15:54:47 CDT 2014 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..91a7e26 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# 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" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 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=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..8a0b282 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@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 diff --git a/setup.bat b/setup.bat new file mode 100644 index 0000000..62356fc --- /dev/null +++ b/setup.bat @@ -0,0 +1,3 @@ +call gradlew.bat setupDevWorkspace +call gradlew.bat eclipse +pause \ No newline at end of file diff --git a/src/main/java/net/minecraft/block/BlockCauldron.java b/src/main/java/net/minecraft/block/BlockCauldron.java new file mode 100644 index 0000000..91d0e4d --- /dev/null +++ b/src/main/java/net/minecraft/block/BlockCauldron.java @@ -0,0 +1,292 @@ +package net.minecraft.block; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockCauldron extends Block +{ + @SideOnly(Side.CLIENT) + private static IIcon field_150029_a; + @SideOnly(Side.CLIENT) + private IIcon field_150028_b; + @SideOnly(Side.CLIENT) + private static IIcon field_150030_M; + private static final String __OBFID = "CL_00000213"; + + public BlockCauldron() + { + super(Material.iron); + } + + /** + * Gets the block's texture. Args: side, meta + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { + return p_149691_1_ == 1 ? this.field_150028_b : (p_149691_1_ == 0 ? this.field_150030_M : this.blockIcon); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) + { + this.field_150029_a = p_149651_1_.registerIcon(this.getTextureName() + "_" + "inner"); + this.field_150028_b = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.field_150030_M = p_149651_1_.registerIcon(this.getTextureName() + "_" + "bottom"); + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side"); + } + + /** + * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the + * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity + */ + @Override + public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + float f = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_); + this.setBlockBoundsForItemRender(); + } + + @SideOnly(Side.CLIENT) + public static IIcon getCauldronIcon(String p_150026_0_) + { + return p_150026_0_.equals("inner") ? field_150029_a : (p_150026_0_.equals("bottom") ? field_150030_M : null); + } + + /** + * Sets the block's bounds for rendering it as an item + */ + @Override + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + /** + * 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; + } + + /** + * The type of render function that is called for this block + */ + @Override + public int getRenderType() + { + return 24; + } + + /** + * 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; + } + + /** + * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity + */ + @Override + public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) + { + int l = func_150027_b(p_149670_1_.getBlockMetadata(p_149670_2_, p_149670_3_, p_149670_4_)); + float f = p_149670_3_ + (6.0F + 3 * l) / 16.0F; + + if (!p_149670_1_.isRemote && p_149670_5_.isBurning() && l > 0 && p_149670_5_.boundingBox.minY <= f) + { + p_149670_5_.extinguish(); + this.func_150024_a(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, l - 1); + } + } + + /** + * Called upon block activation (right click on the block.) + */ + @Override + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) + { + + if (p_149727_1_.isRemote) + { + return true; + } + else + { + ItemStack itemstack = p_149727_5_.inventory.getCurrentItem(); + + if (itemstack == null) + { + return true; + } + else + { + int i1 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + int j1 = func_150027_b(i1); + + if (itemstack.getItem() == Items.water_bucket) + { + if (j1 < 3) + { + if (!p_149727_5_.capabilities.isCreativeMode) + { + p_149727_5_.inventory.setInventorySlotContents(p_149727_5_.inventory.currentItem, new ItemStack(Items.bucket)); + } + + this.func_150024_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, 3); + } + + return true; + } + else + { + if (itemstack.getItem() == Items.glass_bottle) + { + if (j1 > 0) + { + if (!p_149727_5_.capabilities.isCreativeMode) + { + ItemStack itemstack1 = new ItemStack(Items.potionitem, 1, 0); + + if (!p_149727_5_.inventory.addItemStackToInventory(itemstack1)) + { + p_149727_1_.spawnEntityInWorld(new EntityItem(p_149727_1_, p_149727_2_ + 0.5D, p_149727_3_ + 1.5D, p_149727_4_ + 0.5D, itemstack1)); + } + else if (p_149727_5_ instanceof EntityPlayerMP) + { + ((EntityPlayerMP) p_149727_5_).sendContainerToPlayer(p_149727_5_.inventoryContainer); + } + + --itemstack.stackSize; + + if (itemstack.stackSize <= 0) + { + p_149727_5_.inventory.setInventorySlotContents(p_149727_5_.inventory.currentItem, (ItemStack) null); + } + } + + this.func_150024_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, j1 - 1); + } + } + else if (j1 > 0 && itemstack.getItem() instanceof ItemArmor && ((ItemArmor) itemstack.getItem()).getArmorMaterial() == ItemArmor.ArmorMaterial.CLOTH) + { + ItemArmor itemarmor = (ItemArmor) itemstack.getItem(); + itemarmor.removeColor(itemstack); + this.func_150024_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, j1 - 1); + return true; + } + + return false; + } + } + } + } + + public void func_150024_a(World p_150024_1_, int p_150024_2_, int p_150024_3_, int p_150024_4_, int p_150024_5_) + { + p_150024_1_.setBlockMetadataWithNotify(p_150024_2_, p_150024_3_, p_150024_4_, MathHelper.clamp_int(p_150024_5_, 0, 3), 2); + p_150024_1_.func_147453_f(p_150024_2_, p_150024_3_, p_150024_4_, this); + } + + /** + * currently only used by BlockCauldron to incrament meta-data during rain + */ + @Override + public void fillWithRain(World p_149639_1_, int p_149639_2_, int p_149639_3_, int p_149639_4_) + { + if (p_149639_1_.rand.nextInt(20) == 1) + { + int l = p_149639_1_.getBlockMetadata(p_149639_2_, p_149639_3_, p_149639_4_); + + if (l < 3) + { + p_149639_1_.setBlockMetadataWithNotify(p_149639_2_, p_149639_3_, p_149639_4_, l + 1, 2); + } + } + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return Items.cauldron; + } + + /** + * Gets an item for the block being called on. Args: world, x, y, z + */ + @Override + @SideOnly(Side.CLIENT) + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) + { + return Items.cauldron; + } + + /** + * If this returns true, then comparators facing away from this block will use the value from + * getComparatorInputOverride instead of the actual redstone signal strength. + */ + @Override + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + @Override + public int getComparatorInputOverride(World p_149736_1_, int p_149736_2_, int p_149736_3_, int p_149736_4_, int p_149736_5_) + { + int i1 = p_149736_1_.getBlockMetadata(p_149736_2_, p_149736_3_, p_149736_4_); + return func_150027_b(i1); + } + + public static int func_150027_b(int p_150027_0_) + { + return p_150027_0_; + } + + @SideOnly(Side.CLIENT) + public static float getRenderLiquidLevel(int p_150025_0_) + { + int j = MathHelper.clamp_int(p_150025_0_, 0, 3); + return (6 + 3 * j) / 16.0F; + } + +} diff --git a/src/main/java/shift/sextiarysector/Config.java b/src/main/java/shift/sextiarysector/Config.java index c1f9269..63c2df2 100644 --- a/src/main/java/shift/sextiarysector/Config.java +++ b/src/main/java/shift/sextiarysector/Config.java @@ -5,11 +5,33 @@ public class Config { + //Potion + public static int burn; + public static int hotSprings; + + //Biome + public static int magicDesert; + + //World + public static boolean generationCopperOre; + public static boolean generationZincOre; + public static boolean generationSilverOre; + + //Player + public static boolean peacefulMoisture; + public static boolean peacefulStamina; //Mod public static boolean modDCsAppleMilk; public static boolean modComputerCraft; public static boolean modTHKaguya; + public static boolean modIC2; + public static boolean modTofu; + public static boolean modTcon; + public static boolean modCleaver; + public static boolean modFMP; + public static boolean modRF; + public static boolean modTC; public static void ConfigRead(FMLPreInitializationEvent event) { @@ -18,8 +40,13 @@ public static void ConfigRead(FMLPreInitializationEvent event) { try { cfg.load(); + configForBiome(cfg); + configForWorld(cfg); + configForPotion(cfg); - ConfigForMCEconomy(cfg); + configForPlayer(cfg); + + configForPlugin(cfg); } catch (Exception e) { //FMLLog.log(Level.SEVERE, "", e.getMessage()); @@ -29,11 +56,38 @@ public static void ConfigRead(FMLPreInitializationEvent event) { } - public static void ConfigForMCEconomy(Configuration cfg) { + public static void configForPotion(Configuration cfg) { + burn = cfg.getInt("BurnID", "potion", 25, 25, 255, ""); + hotSprings = cfg.getInt("HotSpringsID", "potion", 26, 25, 255, ""); + } + + public static void configForBiome(Configuration cfg) { + //magicDesert = cfg.getInt("MagicDesertID", "biome", 120, 0, 255, ""); + } + + public static void configForWorld(Configuration cfg) { + generationCopperOre = cfg.getBoolean("GenerationCopperOre", "world", true, ""); + generationZincOre = cfg.getBoolean("GenerationZincOre", "world", true, ""); + generationSilverOre = cfg.getBoolean("GenerationSilverOre", "world", true, ""); + } + + public static void configForPlayer(Configuration cfg) { + peacefulMoisture = cfg.getBoolean("PeacefulMoisture", "player", false, ""); + peacefulStamina = cfg.getBoolean("PeacefulStamina", "player", false, ""); + } + + public static void configForPlugin(Configuration cfg) { modDCsAppleMilk = cfg.getBoolean("AppleMilk", "general", true, ""); modComputerCraft = cfg.getBoolean("ComputerCraft", "general", true, ""); modTHKaguya = cfg.getBoolean("THKaguya", "general", true, ""); + modIC2 = cfg.getBoolean("IC2", "general", true, ""); + modTofu = cfg.getBoolean("Tofu", "general", true, ""); + modTcon = cfg.getBoolean("Tcon", "general", true, ""); + modCleaver = cfg.getBoolean("Cleaver", "general", true, ""); + modFMP = cfg.getBoolean("ForgeMultipart", "general", true, ""); + modRF = cfg.getBoolean("RF", "general", true, ""); + modTC = cfg.getBoolean("Thaumcraft", "general", true, ""); } diff --git a/src/main/java/shift/sextiarysector/SSAchievement.java b/src/main/java/shift/sextiarysector/SSAchievement.java new file mode 100644 index 0000000..430cba9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/SSAchievement.java @@ -0,0 +1,220 @@ +package shift.sextiarysector; + +import java.util.ArrayList; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraftforge.common.AchievementPage; +import net.minecraftforge.oredict.OreDictionary; +import shift.sextiarysector.achievement.AchievementBase; +import shift.sextiarysector.achievement.AchievementCraft; +import shift.sextiarysector.achievement.AchievementCrop; +import shift.sextiarysector.achievement.AchievementFurnace; +import shift.sextiarysector.achievement.AchievementPageAgriculture; +import shift.sextiarysector.achievement.AchievementPageBase; +import shift.sextiarysector.achievement.AchievementPageEconomy; +import shift.sextiarysector.achievement.AchievementPageIndustry; +import shift.sextiarysector.achievement.AchievementPickup; + +public class SSAchievement { + + private static ArrayList core = new ArrayList(); + private static ArrayList agriculture = new ArrayList(); + private static ArrayList mining = new ArrayList(); + private static ArrayList industry = new ArrayList(); + private static ArrayList economy = new ArrayList(); + + //Core + public static Achievement moisture; + public static Achievement bottle; + public static Achievement drinkingWater; + public static Achievement craftFurnace; + public static Achievement fluidFurnace; + public static Achievement hammer; + public static Achievement freezer; + + //Agriculture + public static Achievement seed; + public static Achievement scoop; + public static Achievement farmland; + public static Achievement wateringCan; + public static Achievement hole; + public static Achievement paddy; + + public static Achievement turnip; + public static Achievement ironTurnip; + + public static Achievement cucumber; + + public static Achievement onion; + + public static Achievement tomato; + + public static Achievement corn; + public static Achievement goldenCorn; + + public static Achievement eggplant; + + public static Achievement sweetPotato; + + public static Achievement greenPepper; + + public static Achievement radish; + + public static Achievement rice; + + public static Achievement shiitake; + + //Mining + public static Achievement blueStoneDust; + public static Achievement copperOre; + public static Achievement silverOre; + public static Achievement mithrilOre; + + //Industry + public static Achievement blueStoneSlimeBall; + + //1 + public static Achievement woodGear; + public static Achievement smallWindmill; + public static Achievement millstone; + public static Achievement loom; + + //2 + public static Achievement stoneGear; + public static Achievement windmill; + public static Achievement smallWaterwheel; + public static Achievement sawmill; + public static Achievement spinningMachine; + + //3 + public static Achievement steelGear; + public static Achievement steamMotor; + public static Achievement largeWindmill; + public static Achievement pulverizer; + public static Achievement extractor; + public static Achievement fan; + public static Achievement saw; + + //4 + public static Achievement ninjaGear; + public static Achievement rollingMachine; + public static Achievement manaSqueezer; + + //5 + public static Achievement orichalcumGear; + public static Achievement timeMachine; + + //Economy + public static Achievement creeperFirework; + public static Achievement creeperChest; + public static Achievement shipping; + + public static void initAchievements() { + + moisture = new AchievementBase("moisture", 3, -1, new ItemStack(Items.water_bucket), (Achievement) null, core).initIndependentStat().registerStat(); + bottle = new AchievementCraft("bottle", 1, 1, new ItemStack(Items.glass_bottle), AchievementList.buildWorkBench, core).registerStat(); + drinkingWater = new AchievementFurnace("drinking_water", 3, 1, new ItemStack(SSItems.drinkingWaterBottle), bottle, core).registerStat(); + craftFurnace = new AchievementCraft("craft_furnace", -2, -1, new ItemStack(SSBlocks.LargeFurnace), AchievementList.buildWorkBench, core).registerStat(); + hammer = new AchievementFurnace("hammer", -4, -1, new ItemStack(SSItems.ironSpanner), craftFurnace, core).registerStat(); + fluidFurnace = new AchievementFurnace("fluid_furnace", -2, 1, new ItemStack(SSBlocks.fluidFurnace), craftFurnace, core).registerStat(); + freezer = new AchievementFurnace("freezer", 0, -3, new ItemStack(SSBlocks.freezer), craftFurnace, core).registerStat(); + + AchievementPage.registerAchievementPage(new AchievementPageBase("achievement.ss.core", core)); + + //霎イ讌ュ + seed = new AchievementBase("seed", -8, -2, new ItemStack(SSBlocks.tomato), (Achievement) null, agriculture).initIndependentStat().registerStat(); + scoop = new AchievementCraft("scoop", -6, -3, new ItemStack(SSItems.woodScoop), AchievementList.buildWorkBench, agriculture).registerStat(); + farmland = new AchievementBase("farmland", -4, -4, new ItemStack(Items.stone_hoe), scoop, agriculture).registerStat(); + wateringCan = new AchievementCraft("watering_can", 1, -2, new ItemStack(SSItems.woodWateringCan, 1, OreDictionary.WILDCARD_VALUE), AchievementList.buildWorkBench, agriculture).registerStat(); + hole = new AchievementBase("hole", -4, -2, new ItemStack(SSItems.ironScoop), scoop, agriculture).registerStat(); + paddy = new AchievementBase("paddy", -2, -2, new ItemStack(Items.water_bucket), hole, agriculture).registerStat(); + + int spring = 1; + turnip = new AchievementCrop("turnip", -7, spring, new ItemStack(SSItems.turnip), SSBlocks.turnip, seed, agriculture).registerStat(); + ironTurnip = new AchievementPickup("iron_turnip", -5, spring - 1, new ItemStack(SSItems.ironTurnip), turnip, agriculture).registerStat(); + + cucumber = new AchievementCrop("cucumber", -7, spring + 4, new ItemStack(SSItems.cucumber), SSBlocks.cucumber, seed, agriculture).registerStat(); + + int summer = 10; + onion = new AchievementCrop("onion", -7, summer, new ItemStack(SSItems.onion), SSBlocks.onion, seed, agriculture).registerStat(); + + tomato = new AchievementCrop("tomato", -7, summer + 4, new ItemStack(SSItems.tomato), SSBlocks.tomato, seed, agriculture).registerStat(); + + corn = new AchievementCrop("corn", -7, summer + 8, new ItemStack(SSItems.corn), SSBlocks.corn, seed, agriculture).registerStat(); + goldenCorn = new AchievementPickup("golden_corn", -5, summer + 7, new ItemStack(SSItems.goldenCorn), corn, agriculture).registerStat(); + + int autumn = 23; + eggplant = new AchievementCrop("eggplant", -7, autumn, new ItemStack(SSItems.eggplant), SSBlocks.eggplant, seed, agriculture).registerStat(); + + sweetPotato = new AchievementCrop("sweet_potato", -7, autumn + 4, new ItemStack(SSItems.sweetPotato), SSBlocks.sweetPotato, seed, agriculture).registerStat(); + + greenPepper = new AchievementCrop("green_pepper", -7, autumn + 8, new ItemStack(SSItems.greenPepper), SSBlocks.greenPepper, seed, agriculture).registerStat(); + + int winter = 36; + radish = new AchievementCrop("radish", -7, winter, new ItemStack(SSItems.radish), SSBlocks.radish, seed, agriculture).registerStat(); + + int spring2 = 41; + rice = new AchievementCrop("rice", -7, spring2, new ItemStack(SSItems.rice), SSBlocks.rice, seed, agriculture).registerStat(); + + int spring3 = 46; + shiitake = new AchievementCrop("shiitake", -7, spring3, new ItemStack(SSItems.shiitake), SSBlocks.shiitake, seed, agriculture).registerStat(); + + AchievementPage.registerAchievementPage(new AchievementPageAgriculture("achievement.ss.agriculture", agriculture)); + + //驩ア讌ュ + + blueStoneDust = new AchievementPickup("bluestone_dust", 0, 0, new ItemStack(SSItems.blueStoneDust), AchievementList.buildPickaxe, mining).registerStat(); + + copperOre = new AchievementPickup("copper_ore", 2, 0, new ItemStack(SSBlocks.copperOre), AchievementList.buildPickaxe, mining).registerStat(); + + silverOre = new AchievementPickup("silver_ore", 4, 2, new ItemStack(SSBlocks.silverOre), AchievementList.buildPickaxe, mining).registerStat(); + + mithrilOre = new AchievementPickup("mithril_ore", -2, -1, new ItemStack(SSBlocks.mithrilOre), AchievementList.buildPickaxe, mining).registerStat(); + + AchievementPage.registerAchievementPage(new AchievementPageBase("achievement.ss.mining", mining)); + + //蟾・讌ュ + + blueStoneSlimeBall = new AchievementFurnace("blue_gel", -4, -1, new ItemStack(SSItems.blueGel), blueStoneDust, industry).registerStat(); + + woodGear = new AchievementCraft("wood_gear", -2, 0, new ItemStack(SSItems.woodGear), blueStoneSlimeBall, industry).registerStat(); + smallWindmill = new AchievementCraft("small_windmill", -1, -2, new ItemStack(SSBlocks.smallWindmill), woodGear, industry).registerStat(); + millstone = new AchievementCraft("millstone", -1, 2, new ItemStack(SSBlocks.millstone), woodGear, industry).registerStat(); + loom = new AchievementCraft("loom", -1, 3, new ItemStack(SSBlocks.loom), woodGear, industry).registerStat(); + + stoneGear = new AchievementCraft("stone_gear", 1, 0, new ItemStack(SSItems.stoneGear), woodGear, industry).registerStat(); + windmill = new AchievementCraft("windmill", 2, -2, new ItemStack(SSBlocks.windmill), stoneGear, industry).registerStat(); + smallWaterwheel = new AchievementCraft("small_waterwheel", 2, -3, new ItemStack(SSBlocks.smallWaterwheel), stoneGear, industry).registerStat(); + sawmill = new AchievementCraft("sawmill", 2, 2, new ItemStack(SSBlocks.sawmill), stoneGear, industry).registerStat(); + spinningMachine = new AchievementCraft("spinning_machine", 2, 3, new ItemStack(SSBlocks.spinningMachine), stoneGear, industry).registerStat(); + + steelGear = new AchievementCraft("steel_gear", 4, 0, new ItemStack(SSItems.steelGear), stoneGear, industry).registerStat(); + steamMotor = new AchievementCraft("steam_motor", 5, -2, new ItemStack(SSBlocks.steamMotor), steelGear, industry).registerStat(); + largeWindmill = new AchievementCraft("large_windmill", 5, -3, new ItemStack(SSBlocks.largeWindmill), steelGear, industry).registerStat(); + pulverizer = new AchievementCraft("pulverizer", 5, 2, new ItemStack(SSBlocks.pulverizer), steelGear, industry).registerStat(); + extractor = new AchievementCraft("extractor", 5, 3, new ItemStack(SSBlocks.extractor), steelGear, industry).registerStat(); + fan = new AchievementCraft("fan", 5, 5, new ItemStack(SSBlocks.fan), steelGear, industry).registerStat(); + saw = new AchievementCraft("saw", 5, 6, new ItemStack(SSBlocks.saw), steelGear, industry).registerStat(); + + ninjaGear = new AchievementCraft("ninja_gear", 7, 0, new ItemStack(SSItems.ninjaGear), steelGear, industry).registerStat(); + rollingMachine = new AchievementCraft("rolling_machine", 8, 2, new ItemStack(SSBlocks.rollingMachine), ninjaGear, industry).registerStat(); + manaSqueezer = new AchievementCraft("mana_squeezer", 8, 3, new ItemStack(SSBlocks.manaSqueezer), ninjaGear, industry).registerStat(); + + orichalcumGear = new AchievementCraft("orichalcum_gear", 10, 0, new ItemStack(SSItems.orichalcumGear), ninjaGear, industry).registerStat(); + timeMachine = new AchievementCraft("time_machine", 11, 2, new ItemStack(SSBlocks.timeMachine), orichalcumGear, industry).registerStat(); + + AchievementPage.registerAchievementPage(new AchievementPageIndustry("achievement.ss.industry", industry)); + + //邨梧ク + creeperFirework = new AchievementBase("creeper_firework", 0, 0, new ItemStack(Items.fireworks), (Achievement) null, economy).initIndependentStat().registerStat(); + creeperChest = new AchievementBase("creeper_chest", 1, -2, new ItemStack(SSBlocks.creeperChest), creeperFirework, economy).registerStat(); + shipping = new AchievementBase("shipping", 3, -2, new ItemStack(SSBlocks.shippingBox), creeperChest, economy).registerStat(); + + AchievementPage.registerAchievementPage(new AchievementPageEconomy("achievement.ss.economy", economy)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/SSBlocks.java b/src/main/java/shift/sextiarysector/SSBlocks.java index ebfcb84..76ad9c9 100644 --- a/src/main/java/shift/sextiarysector/SSBlocks.java +++ b/src/main/java/shift/sextiarysector/SSBlocks.java @@ -3,41 +3,106 @@ import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import shift.sextiarysector.api.SextiarySectorAPI; import shift.sextiarysector.api.season.Season; +import shift.sextiarysector.block.BlockBlueFire; +import shift.sextiarysector.block.BlockBoardingBuoy; import shift.sextiarysector.block.BlockChunkLoader; +import shift.sextiarysector.block.BlockDetectorBuoy; +import shift.sextiarysector.block.BlockFan; +import shift.sextiarysector.block.BlockFigure; +import shift.sextiarysector.block.BlockFluidCrafter; +import shift.sextiarysector.block.BlockFluidFGFMachine; +import shift.sextiarysector.block.BlockFluidFurnace; +import shift.sextiarysector.block.BlockFoodSmokers; +import shift.sextiarysector.block.BlockFreezer; +import shift.sextiarysector.block.BlockFunnel; import shift.sextiarysector.block.BlockGFTank; import shift.sextiarysector.block.BlockGearBox; +import shift.sextiarysector.block.BlockGearShaft; import shift.sextiarysector.block.BlockHole; +import shift.sextiarysector.block.BlockHotSprings; import shift.sextiarysector.block.BlockLargeFurnace; +import shift.sextiarysector.block.BlockLargeOre; +import shift.sextiarysector.block.BlockLargeWindmill; +import shift.sextiarysector.block.BlockLeaf; +import shift.sextiarysector.block.BlockLeafBed; +import shift.sextiarysector.block.BlockMachineFrame; +import shift.sextiarysector.block.BlockMagiFurnace; import shift.sextiarysector.block.BlockMonitor; +import shift.sextiarysector.block.BlockOreBlock; +import shift.sextiarysector.block.BlockPaddy; +import shift.sextiarysector.block.BlockPipe; import shift.sextiarysector.block.BlockPowerStone; +import shift.sextiarysector.block.BlockPoweredBuoy; +import shift.sextiarysector.block.BlockPump; import shift.sextiarysector.block.BlockSSChest; import shift.sextiarysector.block.BlockSSCrop; import shift.sextiarysector.block.BlockSSCrop.CropStatus; import shift.sextiarysector.block.BlockSSCrop.CropType; import shift.sextiarysector.block.BlockSSFarmland; +import shift.sextiarysector.block.BlockSSFluid; import shift.sextiarysector.block.BlockSSOre; import shift.sextiarysector.block.BlockSSPane; +import shift.sextiarysector.block.BlockSandpit; +import shift.sextiarysector.block.BlockSaw; import shift.sextiarysector.block.BlockShaft; import shift.sextiarysector.block.BlockShippingBox; import shift.sextiarysector.block.BlockSimpleMachine; +import shift.sextiarysector.block.BlockSmallWaterwheel; import shift.sextiarysector.block.BlockSmallWindmill; +import shift.sextiarysector.block.BlockSquare; +import shift.sextiarysector.block.BlockSteamMotor; +import shift.sextiarysector.block.BlockSuctionMachine; +import shift.sextiarysector.block.BlockTank; +import shift.sextiarysector.block.BlockTrap; import shift.sextiarysector.block.BlockWindmill; +import shift.sextiarysector.block.BlockWood; +import shift.sextiarysector.block.BlockWoodHopper; +import shift.sextiarysector.item.ItemBlockBuoyBase; import shift.sextiarysector.item.ItemBlockCrop; +import shift.sextiarysector.item.ItemBlockDirection; +import shift.sextiarysector.item.ItemBlockFigure; +import shift.sextiarysector.item.ItemBlockFluidCrafter; +import shift.sextiarysector.item.ItemBlockGearShaft; +import shift.sextiarysector.item.ItemBlockMeta; import shift.sextiarysector.item.ItemBlockMonitor; -import shift.sextiarysector.item.ItemBlockShaft; +import shift.sextiarysector.item.ItemBlockSSFluid; +import shift.sextiarysector.tileentity.TileEntityFan; import shift.sextiarysector.tileentity.TileEntityFarmland; +import shift.sextiarysector.tileentity.TileEntityFigure; +import shift.sextiarysector.tileentity.TileEntityFluidCrafter; +import shift.sextiarysector.tileentity.TileEntityFluidFGFMachineBase; +import shift.sextiarysector.tileentity.TileEntityFluidFurnace; +import shift.sextiarysector.tileentity.TileEntityFoodSmokers; +import shift.sextiarysector.tileentity.TileEntityFreezer; +import shift.sextiarysector.tileentity.TileEntityFunnel; import shift.sextiarysector.tileentity.TileEntityGFTank; import shift.sextiarysector.tileentity.TileEntityGearBox; +import shift.sextiarysector.tileentity.TileEntityGearShaft; import shift.sextiarysector.tileentity.TileEntityLargeFurnace; +import shift.sextiarysector.tileentity.TileEntityLargeWindmill; +import shift.sextiarysector.tileentity.TileEntityMagicFurnace; import shift.sextiarysector.tileentity.TileEntityMonitor; +import shift.sextiarysector.tileentity.TileEntityPaddy; +import shift.sextiarysector.tileentity.TileEntityPipe; +import shift.sextiarysector.tileentity.TileEntityPump; import shift.sextiarysector.tileentity.TileEntitySSChest; import shift.sextiarysector.tileentity.TileEntitySSCrop; +import shift.sextiarysector.tileentity.TileEntitySaw; import shift.sextiarysector.tileentity.TileEntityShaft; +import shift.sextiarysector.tileentity.TileEntityShippingBox; import shift.sextiarysector.tileentity.TileEntitySimpleMachine; +import shift.sextiarysector.tileentity.TileEntitySmallWaterwheel; import shift.sextiarysector.tileentity.TileEntitySmallWindmill; +import shift.sextiarysector.tileentity.TileEntitySquare; +import shift.sextiarysector.tileentity.TileEntitySteamMotor; +import shift.sextiarysector.tileentity.TileEntitySuctionMachine; +import shift.sextiarysector.tileentity.TileEntityTank; +import shift.sextiarysector.tileentity.TileEntityTrap; import shift.sextiarysector.tileentity.TileEntityWindmill; +import shift.sextiarysector.tileentity.TileEntityWood; import cpw.mods.fml.common.registry.GameRegistry; public class SSBlocks { @@ -46,49 +111,165 @@ public class SSBlocks { public static Block LargeFurnace; + //public static Block craftFurnace; + //public static Block stoneFrame; + + public static Block fluidFurnace; + public static Block foodSmokers; + public static Block magicFurnace; + public static Block freezer; + + //public static Block bottle; + public static Block fluidCrafter; + + public static Block woodHopper; + + public static Block square; + + public static Block tank; + public static Block funnel; + public static Block copperPipe; + + public static Block blueFire; + + public static Block figure; + + public static Block leafBlock; + + public static Block trap; + + //Bed + public static Block leafBed; + + //豸イ菴 + public static Block drinkingWater; + public static Block hotSprings; + + public static Block season; + + //GF public static Block woodShaft; public static Block stoneShaft; - + public static Block steelShaft; + public static Block ninjaShaft; + public static Block orichalcumShaft; public static Block woodGearBox; public static Block stoneGearBox; + public static Block steelGearBox; + public static Block ninjaGearBox; + public static Block orichalcumGearBox; public static Block woodGFTank; public static Block stoneGFTank; + public static Block steelGFTank; + public static Block ninjaGFTank; + public static Block orichalcumGFTank; + + public static Block woodStoneGearShaft; + public static Block stoneSteelGearShaft; + public static Block steelNinjaGearShaft; + public static Block ninjaOrichalcumGearShaft; + //逋コ髮サ public static Block smallWindmill; public static Block windmill; + public static Block largeWindmill; + public static Block smallWaterwheel; + public static Block steamMotor; + + //讖滓「ー + public static Block machineFrame; public static Block millstone; public static Block loom; + public static Block sawmill; + public static Block spinningMachine; + public static Block extractor; + + public static Block pump; + public static Block suctionMachine; + + public static Block pulverizer; + + public static Block fan; + public static Block saw; + + public static Block rollingMachine; + public static Block manaSqueezer; + + public static Block timeMachine; public static Block hole; public static Block woodGrate; - public static Block woodPlate; + public static Block woodOakPlate; + public static Block woodBirchPlate; + public static Block woodSprucePlate; + public static Block woodJunglePlate; + public static Block woodAcaciaPlate; + public static Block woodBigOakPlate; + + //繝励Ξ繝シ繝 + public static Block ironPlate; + public static Block goldPlate; + + public static Block copperPlate; + public static Block zincPlate; + public static Block silverPlate; public static Block chunkLoader; + //驩ア遏ウ public static Block blueStoneOre; public static Block yellowStoneOre; + public static Block copperOre; + public static Block zincOre; + public static Block silverOre; + + public static Block mithrilOre; + public static Block orichalcumOre; + public static Block coalLargeOre; + public static Block ironLargeOre; + public static Block goldLargeOre; + + public static Block silverLargeOre; + + //驩ア遏ウ繝悶Ο繝繧ッ + public static Block copperBlock; + public static Block zincBlock; + public static Block silverBlock; + + public static Block steelBlock; + public static Block brassBlock; + public static Block ninjaBlock; + + public static Block mithrilBlock; + public static Block orichalcumBlock; + //邨梧ク public static Block shippingBox; public static Block creeperChest; public static Block monitor; + //霎イ讌ュ public static Block farmland; + public static Block paddy; + public static Block wood; public static Block turnip; public static Block cucumber; + public static Block ironTurnip; public static Block onion; public static Block tomato; public static Block corn; + public static Block goldenCorn; public static Block eggplant; public static Block sweetPotato; @@ -96,123 +277,425 @@ public class SSBlocks { public static Block radish; - public static void initBlicks(){ + public static Block rice; + + public static Block redMushroom; + public static Block shiitake; + + //豌エ逕」 + public static Block sandpit; + + //霈ク騾 + public static Block boardingBuoy; + public static Block poweredBuoy; + public static Block detectorBuoy; + + public static void initBlicks() { LargeFurnace = new BlockLargeFurnace().setBlockName("ss.large_furnace").setCreativeTab(SextiarySectorAPI.TabSSCore); GameRegistry.registerBlock(LargeFurnace, "LargeFurnace"); GameRegistry.registerTileEntity(TileEntityLargeFurnace.class, "LargeFurnace"); - hole = new BlockHole().setBlockName("ss.hole").setCreativeTab(SextiarySectorAPI.TabSSCore); + //craftFurnace = new BlockCraftFurnace().setBlockName("ss.large_furnace").setCreativeTab(SextiarySectorAPI.TabSSCore); + //GameRegistry.registerBlock(craftFurnace, "CraftFurnace"); + //GameRegistry.registerTileEntity(TileEntityCraftFurnace.class, "CraftFurnace"); + //stoneFrame = new BlockStoneFrame().setBlockName("ss.stone_frame").setCreativeTab(SextiarySectorAPI.TabSSCore); + //GameRegistry.registerBlock(stoneFrame, "StoneFrame"); + //GameRegistry.registerTileEntity(TileEntityStoneFrame.class, "StoneFrame"); + + fluidFurnace = new BlockFluidFurnace().setBlockName("ss.fluid_furnace").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(fluidFurnace, "FluidFurnace"); + GameRegistry.registerTileEntity(TileEntityFluidFurnace.class, "FluidFurnace"); + + foodSmokers = new BlockFoodSmokers().setBlockName("ss.food_smokers").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(foodSmokers, "FoodSmokers"); + GameRegistry.registerTileEntity(TileEntityFoodSmokers.class, "FoodSmokers"); + + magicFurnace = new BlockMagiFurnace().setBlockName("ss.magic_furnace").setBlockTextureName("sextiarysector:magic/furnace").setCreativeTab(SextiarySectorAPI.TabSSMagic); + GameRegistry.registerBlock(magicFurnace, "MagicFurnace"); + GameRegistry.registerTileEntity(TileEntityMagicFurnace.class, "MagicFurnace"); + + freezer = new BlockFreezer().setBlockName("ss.freezer").setBlockTextureName("sextiarysector:ice/freezer").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(freezer, "Freezer"); + GameRegistry.registerTileEntity(TileEntityFreezer.class, "SSFreezer"); + + //bottle = new BlockBottle().setBlockName("ss.bottle").setBlockTextureName("glass"); + //GameRegistry.registerBlock(bottle,ItemBlockBottle.class, "Bottle"); + //GameRegistry.registerTileEntity(TileEntityBlockBottle.class, "Bottle"); + + fluidCrafter = new BlockFluidCrafter().setBlockName("ss.fluid_crafter").setBlockTextureName("glass"); + GameRegistry.registerBlock(fluidCrafter, ItemBlockFluidCrafter.class, "FluidCrafter"); + GameRegistry.registerTileEntity(TileEntityFluidCrafter.class, "FluidCrafter"); + + hole = new BlockHole().setBlockName("ss.hole").setBlockTextureName("dirt").setCreativeTab(SextiarySectorAPI.TabSSCore); GameRegistry.registerBlock(hole, "Hole"); - woodGrate = (new BlockSSPane(ID+":wood_grate", ID+":wood_grate", Material.wood, false,0)).setHardness(0.5F).setBlockName("ss.wood_grate").setCreativeTab(SextiarySectorAPI.TabSSCore); + woodHopper = new BlockWoodHopper().setBlockName("ss.wood_hopper").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(woodHopper, "WoodHopper"); + + square = new BlockSquare().setBlockName("ss.square").setBlockTextureName("planks_oak"); + GameRegistry.registerBlock(square, ItemBlockDirection.class, "Square"); + GameRegistry.registerTileEntity(TileEntitySquare.class, "Square"); + + tank = new BlockTank().setBlockName("ss.tank").setBlockTextureName("glass").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(tank, "Tank"); + GameRegistry.registerTileEntity(TileEntityTank.class, "SSTank"); + + funnel = new BlockFunnel().setBlockName("ss.funnel").setBlockTextureName("sextiarysector:funnel").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(funnel, "Funnel"); + GameRegistry.registerTileEntity(TileEntityFunnel.class, "Funnel"); + + copperPipe = new BlockPipe().setBlockName("ss.copper_pipe").setBlockTextureName("planks_oak"); + GameRegistry.registerBlock(copperPipe, "CopperPipe"); + GameRegistry.registerTileEntity(TileEntityPipe.class, "SSPipe"); + + woodGrate = (new BlockSSPane(ID + ":wood_grate", ID + ":wood_grate", Material.wood, false, 0)).setHardness(0.5F).setBlockName("ss.wood_grate").setCreativeTab(SextiarySectorAPI.TabSSCore); GameRegistry.registerBlock(woodGrate, "WoodGrate"); - woodPlate = (new BlockSSPane("planks_oak", "planks_oak", Material.wood, false,1)).setHardness(0.5F).setBlockName("ss.wood_plate").setBlockTextureName(ID+":plate/wood_plate").setCreativeTab(SextiarySectorAPI.TabSSCore); - GameRegistry.registerBlock(woodPlate, "WoodPlate"); + woodOakPlate = (new BlockSSPane("planks_oak", "planks_oak", Material.wood, false, 1)).setHardness(0.5F).setBlockName("ss.oak_wood_plate").setBlockTextureName(ID + ":plate/wood_oak_plate").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(woodOakPlate, "WoodOakPlate"); + + woodBirchPlate = (new BlockSSPane("planks_birch", "planks_birch", Material.wood, false, 1)).setHardness(0.5F).setBlockName("ss.birch_wood_plate").setBlockTextureName(ID + ":plate/wood_birch_plate").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(woodBirchPlate, "WoodBirchPlate"); + + woodSprucePlate = (new BlockSSPane("planks_spruce", "planks_spruce", Material.wood, false, 1)).setHardness(0.5F).setBlockName("ss.spruce_wood_plate").setBlockTextureName(ID + ":plate/wood_spruce_plate").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(woodSprucePlate, "WoodSprucePlate"); + + woodJunglePlate = (new BlockSSPane("planks_jungle", "planks_jungle", Material.wood, false, 1)).setHardness(0.5F).setBlockName("ss.jungle_wood_plate").setBlockTextureName(ID + ":plate/wood_jungle_plate").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(woodJunglePlate, "WoodJunglePlate"); + + woodAcaciaPlate = (new BlockSSPane("planks_acacia", "planks_acacia", Material.wood, false, 1)).setHardness(0.5F).setBlockName("ss.acacia_wood_plate").setBlockTextureName(ID + ":plate/wood_acacia_plate").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(woodAcaciaPlate, "WoodAcaciaPlate"); + + woodBigOakPlate = (new BlockSSPane("planks_big_oak", "planks_big_oak", Material.wood, false, 1)).setHardness(0.5F).setBlockName("ss.big_oak_wood_plate").setBlockTextureName(ID + ":plate/wood_big_oak_plate").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(woodBigOakPlate, "WoodBigOakPlate"); + + //繝励Ξ繝シ繝 + ironPlate = (new BlockSSPane("iron_block", ID + ":iron_block_top", Material.iron, true, 1)).setHardness(0.5F).setBlockName("ss.iron_plate").setBlockTextureName(ID + ":plate/iron_plate").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerBlock(ironPlate, "IronPlate"); + + goldPlate = (new BlockSSPane("gold_block", ID + ":gold_block_top", Material.iron, true, 1)).setHardness(0.5F).setBlockName("ss.gold_plate").setBlockTextureName(ID + ":plate/gold_plate").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerBlock(goldPlate, "GoldPlate"); + + copperPlate = (new BlockSSPane(ID + ":ore/copper_block", ID + ":ore/copper_block_top", Material.iron, true, 1)).setHardness(0.5F).setBlockName("ss.copper_plate").setBlockTextureName(ID + ":plate/copper_plate") + .setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerBlock(copperPlate, "CopperPlate"); + zincPlate = (new BlockSSPane(ID + ":ore/zinc_block", ID + ":ore/zinc_block_top", Material.iron, true, 1)).setHardness(0.5F).setBlockName("ss.zinc_plate").setBlockTextureName(ID + ":plate/zinc_plate").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerBlock(zincPlate, "ZincPlate"); + silverPlate = (new BlockSSPane(ID + ":ore/silver_block", ID + ":ore/silver_block_top", Material.iron, true, 1)).setHardness(0.5F).setBlockName("ss.silver_plate").setBlockTextureName(ID + ":plate/silver_plate") + .setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerBlock(silverPlate, "SilverPlate"); chunkLoader = new BlockChunkLoader().setHardness(1.5F).setBlockName("ss.chunk_loader").setBlockTextureName("sextiarysector:time_loader"); GameRegistry.registerBlock(chunkLoader, "ChunkLoader"); - blueStoneOre = new BlockPowerStone().setBlockName("ss.blue_stone").setBlockTextureName("sextiarysector:bluestone_ore").setCreativeTab(SextiarySectorAPI.TabSSCore); + blueFire = new BlockBlueFire().setBlockName("ss.blue_fire").setBlockTextureName("sextiarysector:blue_fire"); + GameRegistry.registerBlock(blueFire, "BlueFire"); + + figure = new BlockFigure().setBlockName("ss.figure").setBlockTextureName("sextiarysector:figure").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(figure, ItemBlockFigure.class, "Figure"); + GameRegistry.registerTileEntity(TileEntityFigure.class, "SSFigure"); + + leafBlock = new BlockLeaf().setBlockName("ss.leaf_block").setBlockTextureName("sextiarysector:leaf_bed_2").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(leafBlock, "LeafBlock"); + + trap = new BlockTrap().setBlockName("ss.trap").setBlockTextureName("sextiarysector:wood_grate").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(trap, ItemBlockMeta.class, "Trap"); + GameRegistry.registerTileEntity(TileEntityTrap.class, "SSTrap"); + + leafBed = new BlockLeafBed().setBlockName("ss.leaf_bed").setBlockTextureName("sextiarysector:leaf_bed");//.setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(leafBed, "LeafBed"); + + //豸イ菴 + drinkingWater = new BlockSSFluid(SSFluids.springWater).setBlockName("ss.drinking_water");//.setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(drinkingWater, ItemBlockSSFluid.class, "DrinkingWater"); + + hotSprings = new BlockHotSprings(SSFluids.hotSprings).setBlockName("ss.hot_springs");//.setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerBlock(hotSprings, ItemBlockSSFluid.class, "HotSprings"); + + //season = new BlockSeasonFluid(SSFluids.season).setBlockName("ss.season").setCreativeTab(SextiarySectorAPI.TabSSCore); + //GameRegistry.registerBlock(season, "Season"); + + //驩ア遏ウ + blueStoneOre = new BlockPowerStone(2).setBlockName("ss.blue_stone").setBlockTextureName("sextiarysector:ore/bluestone_ore").setCreativeTab(SextiarySectorAPI.TabSSMining); GameRegistry.registerBlock(blueStoneOre, "BlueStoneOre"); - yellowStoneOre = new BlockPowerStone().setBlockName("ss.yellow_stone").setBlockTextureName("sextiarysector:yellowstone_ore").setCreativeTab(SextiarySectorAPI.TabSSCore); + yellowStoneOre = new BlockPowerStone(2).setBlockName("ss.yellow_stone").setBlockTextureName("sextiarysector:ore/yellowstone_ore").setCreativeTab(SextiarySectorAPI.TabSSMining); GameRegistry.registerBlock(yellowStoneOre, "YellowStoneOre"); - coalLargeOre = new BlockSSOre(SSItems.coalDust,Blocks.coal_ore,1).setBlockName("ss.coal_large_ore").setBlockTextureName("sextiarysector:ore/coal_large_ore"); + copperOre = new BlockSSOre(null, 1).setBlockName("ss.copper_ore").setBlockTextureName("sextiarysector:ore/copper_ore"); + GameRegistry.registerBlock(copperOre, "CopperOre"); + + zincOre = new BlockSSOre(null, 1).setBlockName("ss.zinc_ore").setBlockTextureName("sextiarysector:ore/zinc_ore"); + GameRegistry.registerBlock(zincOre, "ZincOre"); + + silverOre = new BlockSSOre(null, 2).setBlockName("ss.silver_ore").setBlockTextureName("sextiarysector:ore/silver_ore"); + GameRegistry.registerBlock(silverOre, "SilverOre"); + + mithrilOre = new BlockSSOre(null, 2).setBlockName("ss.mithril_ore").setBlockTextureName("sextiarysector:ore/mithril_ore"); + GameRegistry.registerBlock(mithrilOre, "MithrilOre"); + + orichalcumOre = new BlockSSOre(SSItems.orichalcumGem, 3).setBlockName("ss.orichalcum_ore").setBlockTextureName("sextiarysector:ore/orichalcum_ore"); + GameRegistry.registerBlock(orichalcumOre, "OrichalcumOre"); + + coalLargeOre = new BlockLargeOre(SSItems.coalDust, Blocks.coal_ore, 1).setBlockName("ss.coal_large_ore").setBlockTextureName("sextiarysector:ore/coal_large_ore"); GameRegistry.registerBlock(coalLargeOre, "CoalLargeOre"); + ironLargeOre = new BlockLargeOre(SSItems.ironDust, Blocks.iron_ore, 2).setBlockName("ss.iron_large_ore").setBlockTextureName("sextiarysector:ore/iron_large_ore"); + GameRegistry.registerBlock(ironLargeOre, "IronLargeOre"); + + goldLargeOre = new BlockLargeOre(SSItems.goldDust, Blocks.gold_ore, 2).setBlockName("ss.gold_large_ore").setBlockTextureName("sextiarysector:ore/gold_large_ore"); + GameRegistry.registerBlock(goldLargeOre, "GoldLargeOre"); + + //驩ア遏ウ繝悶Ο繝繧ッ + copperBlock = new BlockOreBlock().setBlockName("ss.copper_block").setBlockTextureName("sextiarysector:ore/copper_block"); + GameRegistry.registerBlock(copperBlock, "CopperBlock"); + + zincBlock = new BlockOreBlock().setBlockName("ss.zinc_block").setBlockTextureName("sextiarysector:ore/zinc_block"); + GameRegistry.registerBlock(zincBlock, "ZincBlock"); + + silverBlock = new BlockOreBlock().setBlockName("ss.silver_block").setBlockTextureName("sextiarysector:ore/silver_block"); + GameRegistry.registerBlock(silverBlock, "SilverBlock"); + + steelBlock = new BlockOreBlock().setBlockName("ss.steel_block").setBlockTextureName("sextiarysector:ore/steel_block"); + GameRegistry.registerBlock(steelBlock, "SteelBlock"); + + brassBlock = new BlockOreBlock().setBlockName("ss.brass_block").setBlockTextureName("sextiarysector:ore/brass_block"); + GameRegistry.registerBlock(brassBlock, "BrassBlock"); + + ninjaBlock = new BlockOreBlock().setBlockName("ss.ninja_block").setBlockTextureName("sextiarysector:ore/ninja_block"); + GameRegistry.registerBlock(ninjaBlock, "NinjaBlock"); + mithrilBlock = new BlockOreBlock().setBlockName("ss.mithril_block").setBlockTextureName("sextiarysector:ore/mithril_block"); + GameRegistry.registerBlock(mithrilBlock, "MithrilBlock"); + + orichalcumBlock = new BlockOreBlock().setBlockName("ss.orichalcum_block").setBlockTextureName("sextiarysector:ore/orichalcum_block"); + GameRegistry.registerBlock(orichalcumBlock, "OrichalcumBlock"); + + //large + silverLargeOre = new BlockLargeOre(SSItems.silverDust, SSBlocks.silverOre, 2).setBlockName("ss.silver_large_ore").setBlockTextureName("sextiarysector:ore/silver_large_ore"); + GameRegistry.registerBlock(silverLargeOre, "SilverLargeOre"); + + //GF GameRegistry.registerTileEntity(TileEntityShaft.class, "Shaft"); woodShaft = new BlockShaft(1).setBlockName("ss.wood_shaft").setBlockTextureName("planks_oak").setStepSound(Block.soundTypeWood); - GameRegistry.registerBlock(woodShaft,ItemBlockShaft.class, "WoodShaft"); + GameRegistry.registerBlock(woodShaft, ItemBlockDirection.class, "WoodShaft"); stoneShaft = new BlockShaft(2).setBlockName("ss.stone_shaft").setBlockTextureName("planks_oak").setStepSound(Block.soundTypeStone); - GameRegistry.registerBlock(stoneShaft,ItemBlockShaft.class, "StoneShaft"); + GameRegistry.registerBlock(stoneShaft, ItemBlockDirection.class, "StoneShaft"); + + steelShaft = new BlockShaft(3).setBlockName("ss.steel_shaft").setBlockTextureName("planks_oak").setStepSound(Block.soundTypeMetal); + GameRegistry.registerBlock(steelShaft, ItemBlockDirection.class, "SteelShaft"); + + ninjaShaft = new BlockShaft(4).setBlockName("ss.ninja_shaft").setBlockTextureName("planks_oak").setStepSound(Block.soundTypeMetal); + GameRegistry.registerBlock(ninjaShaft, ItemBlockDirection.class, "NinjaShaft"); + + orichalcumShaft = new BlockShaft(5).setBlockName("ss.orichalcum_shaft").setBlockTextureName("planks_oak").setStepSound(Block.soundTypeMetal); + GameRegistry.registerBlock(orichalcumShaft, ItemBlockDirection.class, "OrichalcumShaft"); GameRegistry.registerTileEntity(TileEntityGearBox.class, "GearBox"); - woodGearBox = new BlockGearBox(Material.wood,1).setBlockName("ss.wood_gear_box").setBlockTextureName("sextiarysector:machine/wood_gear_box").setStepSound(Block.soundTypeWood); + woodGearBox = new BlockGearBox(Material.wood, 1).setBlockName("ss.wood_gear_box").setBlockTextureName("sextiarysector:machine/wood_gear_box").setStepSound(Block.soundTypeWood); GameRegistry.registerBlock(woodGearBox, "WoodGearBox"); - stoneGearBox = new BlockGearBox(Material.rock,2).setBlockName("ss.stone_gear_box").setBlockTextureName("sextiarysector:machine/stone_gear_box").setStepSound(Block.soundTypeStone); + stoneGearBox = new BlockGearBox(Material.rock, 2).setBlockName("ss.stone_gear_box").setBlockTextureName("sextiarysector:machine/stone_gear_box").setStepSound(Block.soundTypeStone); GameRegistry.registerBlock(stoneGearBox, "StoneGearBox"); + steelGearBox = new BlockGearBox(Material.iron, 3).setBlockName("ss.steel_gear_box").setBlockTextureName("sextiarysector:machine/steel_gear_box").setStepSound(Block.soundTypeMetal); + GameRegistry.registerBlock(steelGearBox, "SteelGearBox"); + + ninjaGearBox = new BlockGearBox(Material.iron, 4).setBlockName("ss.ninja_gear_box").setBlockTextureName("sextiarysector:machine/ninja_gear_box").setStepSound(Block.soundTypeMetal); + GameRegistry.registerBlock(ninjaGearBox, "NinjaGearBox"); + + orichalcumGearBox = new BlockGearBox(Material.iron, 5).setBlockName("ss.orichalcum_gear_box").setBlockTextureName("sextiarysector:machine/orichalcum_gear_box").setStepSound(Block.soundTypeMetal); + GameRegistry.registerBlock(orichalcumGearBox, "OrichalcumGearBox"); GameRegistry.registerTileEntity(TileEntityGFTank.class, "GFTank"); - woodGFTank = new BlockGFTank(Material.wood,40,1).setBlockName("ss.wood_gf_tank").setBlockTextureName("sextiarysector:machine/wood_gf_tank").setStepSound(Block.soundTypeWood); + woodGFTank = new BlockGFTank(Material.wood, 50, 1).setBlockName("ss.wood_gf_tank").setBlockTextureName("sextiarysector:machine/wood_gf_tank").setStepSound(Block.soundTypeWood); GameRegistry.registerBlock(woodGFTank, "WoodGFTank"); - stoneGFTank = new BlockGFTank(Material.rock,41,2).setBlockName("ss.stone_gf_tank").setBlockTextureName("sextiarysector:machine/stone_gf_tank").setStepSound(Block.soundTypeWood); + stoneGFTank = new BlockGFTank(Material.rock, 51, 2).setBlockName("ss.stone_gf_tank").setBlockTextureName("sextiarysector:machine/stone_gf_tank").setStepSound(Block.soundTypeWood); GameRegistry.registerBlock(stoneGFTank, "StoneGFTank"); - smallWindmill = new BlockSmallWindmill().setBlockName("ss.small_windmill").setBlockTextureName("planks_oak").setCreativeTab(SextiarySectorAPI.TabSSMachine); + steelGFTank = new BlockGFTank(Material.iron, 52, 3).setBlockName("ss.steel_gf_tank").setBlockTextureName("sextiarysector:machine/steel_gf_tank").setStepSound(Block.soundTypeMetal); + GameRegistry.registerBlock(steelGFTank, "SteelGFTank"); + + ninjaGFTank = new BlockGFTank(Material.iron, 53, 4).setBlockName("ss.ninja_gf_tank").setBlockTextureName("sextiarysector:machine/ninja_gf_tank").setStepSound(Block.soundTypeMetal); + GameRegistry.registerBlock(ninjaGFTank, "NinjaGFTank"); + + orichalcumGFTank = new BlockGFTank(Material.iron, 54, 5).setBlockName("ss.orichalcum_gf_tank").setBlockTextureName("sextiarysector:machine/orichalcum_gf_tank").setStepSound(Block.soundTypeMetal); + GameRegistry.registerBlock(orichalcumGFTank, "OrichalcumGFTank"); + + GameRegistry.registerTileEntity(TileEntityGearShaft.class, "GearShaft"); + woodStoneGearShaft = new BlockGearShaft(1).setBlockName("ss.wood_stone_gear_shaft").setBlockTextureName("planks_oak").setStepSound(Block.soundTypeWood); + GameRegistry.registerBlock(woodStoneGearShaft, ItemBlockGearShaft.class, "WoodStoneGearShaft"); + + stoneSteelGearShaft = new BlockGearShaft(2).setBlockName("ss.stone_steel_gear_shaft").setBlockTextureName("planks_oak").setStepSound(Block.soundTypeWood); + GameRegistry.registerBlock(stoneSteelGearShaft, ItemBlockGearShaft.class, "StoneSteelGearShaft"); + + steelNinjaGearShaft = new BlockGearShaft(3).setBlockName("ss.steel_ninja_gear_shaft").setBlockTextureName("planks_oak").setStepSound(Block.soundTypeWood); + GameRegistry.registerBlock(steelNinjaGearShaft, ItemBlockGearShaft.class, "SteelNinjaGearShaft"); + + ninjaOrichalcumGearShaft = new BlockGearShaft(4).setBlockName("ss.ninja_orichalcum_gear_shaft").setBlockTextureName("planks_oak").setStepSound(Block.soundTypeWood); + GameRegistry.registerBlock(ninjaOrichalcumGearShaft, ItemBlockGearShaft.class, "NinjaOrichalcumGearShaft"); + + //逋コ髮サ + smallWindmill = new BlockSmallWindmill().setBlockName("ss.small_windmill").setBlockTextureName("planks_oak").setCreativeTab(SextiarySectorAPI.TabSSIndustry); GameRegistry.registerTileEntity(TileEntitySmallWindmill.class, "SmallWindmill"); GameRegistry.registerBlock(smallWindmill, "SmallWindmill"); - windmill = new BlockWindmill().setBlockName("ss.windmill").setBlockTextureName("planks_oak").setCreativeTab(SextiarySectorAPI.TabSSMachine); + windmill = new BlockWindmill().setBlockName("ss.windmill").setBlockTextureName("planks_oak").setCreativeTab(SextiarySectorAPI.TabSSIndustry); GameRegistry.registerTileEntity(TileEntityWindmill.class, "Windmill"); GameRegistry.registerBlock(windmill, "Windmill"); + largeWindmill = new BlockLargeWindmill().setBlockName("ss.large_windmill").setBlockTextureName("planks_oak").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerTileEntity(TileEntityLargeWindmill.class, "LargeWindmill"); + GameRegistry.registerBlock(largeWindmill, "LargeWindmill"); + + smallWaterwheel = new BlockSmallWaterwheel().setBlockName("ss.small_waterwheel").setBlockTextureName("planks_oak").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerTileEntity(TileEntitySmallWaterwheel.class, "SmallWaterwheel"); + GameRegistry.registerBlock(smallWaterwheel, "SmallWaterwheel"); + + steamMotor = new BlockSteamMotor().setBlockName("ss.steam_motor").setBlockTextureName("planks_oak").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerTileEntity(TileEntitySteamMotor.class, "SteamMotor"); + GameRegistry.registerBlock(steamMotor, ItemBlockDirection.class, "SteamMotor"); + + //讖滓「ー + machineFrame = new BlockMachineFrame().setBlockName("ss.machine_frame").setBlockTextureName("sextiarysector:machine/machine").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(machineFrame, "MachineFrame"); + GameRegistry.registerTileEntity(TileEntitySimpleMachine.class, "SimpleMachine"); - millstone = new BlockSimpleMachine("millstone",20,SSRecipes.millstone,1).setBlockName("ss.millstone").setCreativeTab(SextiarySectorAPI.TabSSMachine); + GameRegistry.registerTileEntity(TileEntityFluidFGFMachineBase.class, "FluidFGFMachine"); + + millstone = new BlockSimpleMachine("millstone", 20, SSRecipes.millstone, 1).setBlockName("ss.millstone").setCreativeTab(SextiarySectorAPI.TabSSIndustry); GameRegistry.registerBlock(millstone, "Millstone"); - loom = new BlockSimpleMachine("loom",21,SSRecipes.loom,1).setBlockName("ss.loom").setCreativeTab(SextiarySectorAPI.TabSSMachine); + loom = new BlockSimpleMachine("loom", 21, SSRecipes.loom, 1).setBlockName("ss.loom").setCreativeTab(SextiarySectorAPI.TabSSIndustry); GameRegistry.registerBlock(loom, "Loom"); + sawmill = new BlockSimpleMachine("sawmill", 25, SSRecipes.sawmill, 2).setBlockName("ss.sawmill").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(sawmill, "Sawmill"); + + spinningMachine = new BlockSimpleMachine("spinning_machine", 26, SSRecipes.spinning_machine, 2).setBlockName("ss.spinning_machine").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(spinningMachine, "SpinningMachine"); + + pump = new BlockPump().setBlockTextureName("sextiarysector:machine/pump").setBlockName("ss.pump"); + GameRegistry.registerTileEntity(TileEntityPump.class, "SSPump"); + GameRegistry.registerBlock(pump, "pump"); + + suctionMachine = new BlockSuctionMachine().setBlockTextureName("sextiarysector:machine/pump").setBlockName("ss.suction_machine"); + GameRegistry.registerTileEntity(TileEntitySuctionMachine.class, "SSSuctionMachine"); + GameRegistry.registerBlock(suctionMachine, "SuctionMachine"); + + pulverizer = new BlockSimpleMachine("pulverizer", 30, SSRecipes.pulverizer, 3).setBlockName("ss.pulverizer").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(pulverizer, "Pulverizer"); + + extractor = new BlockFluidFGFMachine("extractor", 31, SSRecipes.extractor, 3).setBlockName("ss.extractor").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(extractor, "Extractor"); + + fan = new BlockFan().setBlockName("ss.fan").setBlockTextureName("stone"); + GameRegistry.registerTileEntity(TileEntityFan.class, "Fan"); + GameRegistry.registerBlock(fan, ItemBlockDirection.class, "Fan"); + + saw = new BlockSaw().setBlockName("ss.saw").setBlockTextureName("stone"); + GameRegistry.registerTileEntity(TileEntitySaw.class, "Saw"); + GameRegistry.registerBlock(saw, ItemBlockDirection.class, "Saw"); + + rollingMachine = new BlockSimpleMachine("rolling_machine", 35, SSRecipes.rollingMachine, 4).setBlockName("ss.rolling_machine").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(rollingMachine, "RollingMachine"); + + manaSqueezer = new BlockFluidFGFMachine("mana_squeezer", 36, SSRecipes.manaSqueezer, 4).setBlockName("ss.mana_squeezer").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(manaSqueezer, "ManaSqueezer"); + + timeMachine = new BlockSimpleMachine("time_machine", 40, SSRecipes.timeMachine, 5).setBlockName("ss.time_machine").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(timeMachine, "TimeMachine"); + shippingBox = new BlockShippingBox().setBlockName("ss.shipping_box").setBlockTextureName("sextiarysector:shipping_box").setCreativeTab(SextiarySectorAPI.TabSSEconomy); GameRegistry.registerBlock(shippingBox, "ShippingBox"); + GameRegistry.registerTileEntity(TileEntityShippingBox.class, "ShippingBox"); creeperChest = new BlockSSChest(6).setBlockName("ss.creeper_chest").setHardness(2.5F).setStepSound(Block.soundTypeWood).setCreativeTab(SextiarySectorAPI.TabSSEconomy); GameRegistry.registerBlock(creeperChest, "CreeperChest"); GameRegistry.registerTileEntity(TileEntitySSChest.class, "SSChest"); monitor = new BlockMonitor().setBlockName("ss.monitor").setBlockTextureName("stone"); - GameRegistry.registerBlock(monitor,ItemBlockMonitor.class, "Monitor"); + GameRegistry.registerBlock(monitor, ItemBlockMonitor.class, "Monitor"); GameRegistry.registerTileEntity(TileEntityMonitor.class, "SSMonitor"); - farmland = new BlockSSFarmland().setBlockName("ss.farmland").setBlockTextureName("farmland").setCreativeTab(SextiarySectorAPI.TabSSAgriculture); - GameRegistry.registerBlock(farmland,"Farmland"); + GameRegistry.registerBlock(farmland, "Farmland"); GameRegistry.registerTileEntity(TileEntityFarmland.class, "SSFarmland"); + paddy = new BlockPaddy().setBlockName("ss.paddy").setBlockTextureName("dirt").setCreativeTab(SextiarySectorAPI.TabSSAgriculture); + GameRegistry.registerBlock(paddy, "Paddy"); + GameRegistry.registerTileEntity(TileEntityPaddy.class, "SSPaddy"); + + wood = new BlockWood().setBlockName("ss.wood").setBlockTextureName("sextiarysector:wood").setCreativeTab(SextiarySectorAPI.TabSSAgriculture); + GameRegistry.registerBlock(wood, "Wood"); + GameRegistry.registerTileEntity(TileEntityWood.class, "SSWood"); + //驥手除 GameRegistry.registerTileEntity(TileEntitySSCrop.class, "SSCrop"); - turnip = new BlockSSCrop(CropType.Normal, new CropStatus(new int[]{2,3,4},Season.SPRING), SSItems.turnip, false).setBlockName("ss.turnip").setBlockTextureName("turnip"); - GameRegistry.registerBlock(turnip,ItemBlockCrop.class,"BlockTurnip"); + turnip = new BlockSSCrop(CropType.Normal, new CropStatus(new int[] { 2, 3, 4 }, Season.SPRING), farmland, SSItems.turnip, false).setBlockName("ss.turnip").setBlockTextureName("turnip"); + GameRegistry.registerBlock(turnip, ItemBlockCrop.class, "BlockTurnip"); - cucumber = new BlockSSCrop(CropType.Close, new CropStatus(new int[]{2,6,10,3},Season.SPRING), SSItems.cucumber, true).setBlockName("ss.cucumber").setBlockTextureName("cucumber"); - GameRegistry.registerBlock(cucumber,ItemBlockCrop.class,"BlockCucumber"); + cucumber = new BlockSSCrop(CropType.Close, new CropStatus(new int[] { 2, 6, 10, 3 }, Season.SPRING), farmland, SSItems.cucumber, true).setBlockName("ss.cucumber").setBlockTextureName("cucumber"); + GameRegistry.registerBlock(cucumber, ItemBlockCrop.class, "BlockCucumber"); + ironTurnip = new BlockSSCrop(CropType.Normal, new CropStatus(new int[] { 4, 8, 12 }, Season.SPRING), farmland, SSItems.ironTurnip, false).setBlockName("ss.iron_turnip").setBlockTextureName("iron_turnip"); + GameRegistry.registerBlock(ironTurnip, ItemBlockCrop.class, "BlockIronTurnip"); - onion = new BlockSSCrop(CropType.Normal, new CropStatus(new int[]{2,4,8},Season.SUMMER), SSItems.onion, false).setBlockName("ss.onion").setBlockTextureName("onion"); - GameRegistry.registerBlock(onion,ItemBlockCrop.class,"BlockOnion"); + onion = new BlockSSCrop(CropType.Normal, new CropStatus(new int[] { 2, 4, 8 }, Season.SUMMER), farmland, SSItems.onion, false).setBlockName("ss.onion").setBlockTextureName("onion"); + GameRegistry.registerBlock(onion, ItemBlockCrop.class, "BlockOnion"); - tomato = new BlockSSCrop(CropType.Close, new CropStatus(new int[]{4,10,14,2},Season.SUMMER), SSItems.tomato, true).setBlockName("ss.tomato").setBlockTextureName("tomato"); - GameRegistry.registerBlock(tomato,ItemBlockCrop.class,"BlockTomato"); + tomato = new BlockSSCrop(CropType.Close, new CropStatus(new int[] { 4, 10, 14, 2 }, Season.SUMMER), farmland, SSItems.tomato, true).setBlockName("ss.tomato").setBlockTextureName("tomato"); + GameRegistry.registerBlock(tomato, ItemBlockCrop.class, "BlockTomato"); - corn = new BlockSSCrop(CropType.Close, new CropStatus(new int[]{5,10,16,4},Season.SUMMER), SSItems.corn, true).setBlockName("ss.corn").setBlockTextureName("corn"); - GameRegistry.registerBlock(corn,ItemBlockCrop.class,"BlockCorn"); + corn = new BlockSSCrop(CropType.Close, new CropStatus(new int[] { 5, 10, 16, 4 }, Season.SUMMER), farmland, SSItems.corn, true).setBlockName("ss.corn").setBlockTextureName("corn"); + GameRegistry.registerBlock(corn, ItemBlockCrop.class, "BlockCorn"); + goldenCorn = new BlockSSCrop(CropType.Close, new CropStatus(new int[] { 7, 12, 18, 4 }, Season.SUMMER), farmland, SSItems.goldenCorn, true).setBlockName("ss.golden_corn").setBlockTextureName("golden_corn"); + GameRegistry.registerBlock(goldenCorn, ItemBlockCrop.class, "BlockGoldenCorn"); - eggplant = new BlockSSCrop(CropType.Close, new CropStatus(new int[]{3,7,12,3},Season.AUTUMN), SSItems.eggplant, true).setBlockName("ss.eggplant").setBlockTextureName("eggplant"); - GameRegistry.registerBlock(eggplant,ItemBlockCrop.class,"BlockEggplant"); + eggplant = new BlockSSCrop(CropType.Close, new CropStatus(new int[] { 3, 7, 12, 3 }, Season.AUTUMN), farmland, SSItems.eggplant, true).setBlockName("ss.eggplant").setBlockTextureName("eggplant"); + GameRegistry.registerBlock(eggplant, ItemBlockCrop.class, "BlockEggplant"); - sweetPotato = new BlockSSCrop(CropType.Normal, new CropStatus(new int[]{2,4,6,2},Season.AUTUMN), SSItems.sweetPotato, true).setBlockName("ss.sweet_potato").setBlockTextureName("sweet_potato"); - GameRegistry.registerBlock(sweetPotato,ItemBlockCrop.class,"BlockSweetPotato"); + sweetPotato = new BlockSSCrop(CropType.Normal, new CropStatus(new int[] { 2, 4, 6, 2 }, Season.AUTUMN), farmland, SSItems.sweetPotato, true).setBlockName("ss.sweet_potato").setBlockTextureName("sweet_potato"); + GameRegistry.registerBlock(sweetPotato, ItemBlockCrop.class, "BlockSweetPotato"); - greenPepper = new BlockSSCrop(CropType.Close, new CropStatus(new int[]{4,8,14,3},Season.AUTUMN), SSItems.greenPepper, true).setBlockName("ss.green_pepper").setBlockTextureName("green_pepper"); - GameRegistry.registerBlock(greenPepper,ItemBlockCrop.class,"BlockGreenPepper"); + greenPepper = new BlockSSCrop(CropType.Close, new CropStatus(new int[] { 4, 8, 14, 3 }, Season.AUTUMN), farmland, SSItems.greenPepper, true).setBlockName("ss.green_pepper").setBlockTextureName("green_pepper"); + GameRegistry.registerBlock(greenPepper, ItemBlockCrop.class, "BlockGreenPepper"); - radish = new BlockSSCrop(CropType.Normal, new CropStatus(new int[]{2,3,4},Season.WINTER), SSItems.radish, false).setBlockName("ss.radish").setBlockTextureName("radish"); - GameRegistry.registerBlock(radish,ItemBlockCrop.class,"BlockRadish"); + radish = new BlockSSCrop(CropType.Normal, new CropStatus(new int[] { 2, 3, 4 }, Season.WINTER), farmland, SSItems.radish, false).setBlockName("ss.radish").setBlockTextureName("radish"); + GameRegistry.registerBlock(radish, ItemBlockCrop.class, "BlockRadish"); - //initVanillaBlock(); + //邀ウ + ///28,46,68 + rice = new BlockSSCrop(CropType.Normal, new CropStatus(new int[] { 28, 46, 68 }, Season.SPRING, Season.SUMMER, Season.AUTUMN), paddy, SSItems.rice, false).setBlockName("ss.rice").setBlockTextureName("rice"); + GameRegistry.registerBlock(rice, ItemBlockCrop.class, "BlockRice"); + redMushroom = new BlockSSCrop(CropType.Close, new CropStatus(new int[] { 6, 8, 14 }, Season.SPRING, Season.SUMMER), wood, Item.getItemFromBlock(Blocks.red_mushroom), false).setBlockName("ss.mushroom_red").setBlockTextureName("mushroom_red"); + GameRegistry.registerBlock(redMushroom, ItemBlockCrop.class, "BlockRedMushroom"); - } + shiitake = new BlockSSCrop(CropType.Close, new CropStatus(new int[] { 3, 5, 12 }, Season.SPRING), wood, SSItems.shiitake, false).setBlockName("ss.shiitake").setBlockTextureName("shiitake"); + GameRegistry.registerBlock(shiitake, ItemBlockCrop.class, "BlockShiitake"); + //豌エ逕」 + sandpit = new BlockSandpit().setBlockName("ss.sandpit").setBlockTextureName("sand"); + GameRegistry.registerBlock(sandpit, "Sandpit"); + + //霈ク騾 + boardingBuoy = new BlockBoardingBuoy().setBlockName("ss.boarding_buoy").setBlockTextureName("sextiarysector:buoy/boarding_buoy"); + GameRegistry.registerBlock(boardingBuoy, ItemBlockBuoyBase.class, "BoardingBuoy"); + + poweredBuoy = new BlockPoweredBuoy().setBlockName("ss.powered_buoy").setBlockTextureName("sextiarysector:buoy/powered_buoy"); + GameRegistry.registerBlock(poweredBuoy, ItemBlockBuoyBase.class, "PoweredBuoy"); + + detectorBuoy = new BlockDetectorBuoy().setBlockName("ss.detector_buoy").setBlockTextureName("sextiarysector:buoy/detector_buoy"); + GameRegistry.registerBlock(detectorBuoy, ItemBlockBuoyBase.class, "DetectorBuoy"); + + //initVanillaBlock(); + + } } diff --git a/src/main/java/shift/sextiarysector/SSCreativeTabs.java b/src/main/java/shift/sextiarysector/SSCreativeTabs.java index bbdd932..9e2d361 100644 --- a/src/main/java/shift/sextiarysector/SSCreativeTabs.java +++ b/src/main/java/shift/sextiarysector/SSCreativeTabs.java @@ -9,16 +9,23 @@ public class SSCreativeTabs { - public static void initCreativeTabs(){ + public static void initCreativeTabs() { SextiarySectorAPI.TabSSCore = new CreativeTabSSCore(); - SextiarySectorAPI.TabSSMachine = new CreativeTabSSMachine(); + SextiarySectorAPI.TabSSFluid = new CreativeTabSSFluid(); + SextiarySectorAPI.TabSSPlayer = new CreativeTabSSPlayer(); SextiarySectorAPI.TabSSAgriculture = new CreativeTabSSAgriculture(); + SextiarySectorAPI.TabSSFishery = new CreativeTabSSFishery(); + SextiarySectorAPI.TabSSMining = new CreativeTabSSMining(); + SextiarySectorAPI.TabSSIndustry = new CreativeTabSSIndustry(); + SextiarySectorAPI.TabSSCooking = new CreativeTabSSCooking(); + SextiarySectorAPI.TabSSTransport = new CreativeTabSSTransport(); SextiarySectorAPI.TabSSEconomy = new CreativeTabSSEconomy(); + SextiarySectorAPI.TabSSMagic = new CreativeTabSSMagic(); } - private static class CreativeTabSSCore extends CreativeTabs{ + private static class CreativeTabSSCore extends CreativeTabs { public CreativeTabSSCore() { super("ss.core"); @@ -29,18 +36,19 @@ public Item getTabIconItem() { return null;//SSBlocks.LargeFurnace.g; } + @Override @SideOnly(Side.CLIENT) - public ItemStack getIconItemStack() - { - return new ItemStack(SSBlocks.LargeFurnace,1); - } + public ItemStack getIconItemStack() + { + return new ItemStack(SSBlocks.LargeFurnace, 1); + } } - private static class CreativeTabSSMachine extends CreativeTabs{ + private static class CreativeTabSSFluid extends CreativeTabs { - public CreativeTabSSMachine() { - super("ss.machine"); + public CreativeTabSSFluid() { + super("ss.fluid"); } @Override @@ -48,15 +56,36 @@ public Item getTabIconItem() { return null;//SSBlocks.LargeFurnace.g; } + @Override @SideOnly(Side.CLIENT) - public ItemStack getIconItemStack() - { - return new ItemStack(SSBlocks.woodShaft,1); - } + public ItemStack getIconItemStack() + { + return new ItemStack(SSItems.lavaBottle, 1); + } } - private static class CreativeTabSSAgriculture extends CreativeTabs{ + private static class CreativeTabSSPlayer extends CreativeTabs { + + public CreativeTabSSPlayer() { + super("ss.player"); + } + + @Override + public Item getTabIconItem() { + return null;//SSBlocks.LargeFurnace.g; + } + + @Override + @SideOnly(Side.CLIENT) + public ItemStack getIconItemStack() + { + return new ItemStack(SSItems.ironRing, 1); + } + + } + + private static class CreativeTabSSAgriculture extends CreativeTabs { public CreativeTabSSAgriculture() { super("ss.agriculture"); @@ -67,15 +96,116 @@ public Item getTabIconItem() { return null;//SSBlocks.LargeFurnace.g; } + @Override + @SideOnly(Side.CLIENT) + public ItemStack getIconItemStack() + { + return new ItemStack(SSBlocks.turnip, 1); + } + + } + + private static class CreativeTabSSFishery extends CreativeTabs { + + public CreativeTabSSFishery() { + super("ss.fishery"); + } + + @Override + public Item getTabIconItem() { + return null;//SSBlocks.LargeFurnace.g; + } + + @Override + @SideOnly(Side.CLIENT) + public ItemStack getIconItemStack() + { + return new ItemStack(SSItems.laver, 1); + } + + } + + private static class CreativeTabSSMining extends CreativeTabs { + + public CreativeTabSSMining() { + super("ss.mining"); + } + + @Override + public Item getTabIconItem() { + return null;//SSBlocks.LargeFurnace.g; + } + + @Override + @SideOnly(Side.CLIENT) + public ItemStack getIconItemStack() + { + return new ItemStack(SSBlocks.ironLargeOre, 1); + } + + } + + private static class CreativeTabSSIndustry extends CreativeTabs { + + public CreativeTabSSIndustry() { + super("ss.industry"); + } + + @Override + public Item getTabIconItem() { + return null;//SSBlocks.LargeFurnace.g; + } + + @Override @SideOnly(Side.CLIENT) - public ItemStack getIconItemStack() - { - return new ItemStack(SSBlocks.turnip,1); - } + public ItemStack getIconItemStack() + { + return new ItemStack(SSBlocks.woodShaft, 1); + } } - private static class CreativeTabSSEconomy extends CreativeTabs{ + private static class CreativeTabSSCooking extends CreativeTabs { + + public CreativeTabSSCooking() { + super("ss.cooking"); + } + + @Override + public Item getTabIconItem() { + return null;//SSBlocks.LargeFurnace.g; + } + + @Override + @SideOnly(Side.CLIENT) + public ItemStack getIconItemStack() + { + return new ItemStack(SSItems.ironKnife, 1); + } + + } + + private static class CreativeTabSSTransport extends CreativeTabs { + + public CreativeTabSSTransport() { + super("ss.transport"); + } + + @Override + public Item getTabIconItem() { + return null;//SSBlocks.LargeFurnace.g; + } + + @Override + @SideOnly(Side.CLIENT) + public ItemStack getIconItemStack() + { + return new ItemStack(SSItems.mineboatChest, 1); + } + + } + + private static class CreativeTabSSEconomy extends CreativeTabs { public CreativeTabSSEconomy() { super("ss.economy"); @@ -86,11 +216,32 @@ public Item getTabIconItem() { return null;//SSBlocks.LargeFurnace.g; } + @Override + @SideOnly(Side.CLIENT) + public ItemStack getIconItemStack() + { + return new ItemStack(SSBlocks.creeperChest, 1); + } + + } + + private static class CreativeTabSSMagic extends CreativeTabs { + + public CreativeTabSSMagic() { + super("ss.magic"); + } + + @Override + public Item getTabIconItem() { + return null;//SSBlocks.LargeFurnace.g; + } + + @Override @SideOnly(Side.CLIENT) - public ItemStack getIconItemStack() - { - return new ItemStack(SSBlocks.creeperChest,1); - } + public ItemStack getIconItemStack() + { + return new ItemStack(SSItems.magicDust, 1); + } } diff --git a/src/main/java/shift/sextiarysector/SSEntitys.java b/src/main/java/shift/sextiarysector/SSEntitys.java new file mode 100644 index 0000000..263ccef --- /dev/null +++ b/src/main/java/shift/sextiarysector/SSEntitys.java @@ -0,0 +1,16 @@ +package shift.sextiarysector; + +import shift.sextiarysector.entity.EntityMineboatChest; +import shift.sextiarysector.entity.EntityMineboatTank; +import cpw.mods.fml.common.registry.EntityRegistry; + +public class SSEntitys { + + public static void initEntity() { + + EntityRegistry.registerModEntity(EntityMineboatChest.class, "MineboatChest", 0, SextiarySector.instance, 250, 5, true); + EntityRegistry.registerModEntity(EntityMineboatTank.class, "EntityMineboatTank", 1, SextiarySector.instance, 250, 5, true); + + } + +} diff --git a/src/main/java/shift/sextiarysector/SSEvents.java b/src/main/java/shift/sextiarysector/SSEvents.java index 111f136..38a9160 100644 --- a/src/main/java/shift/sextiarysector/SSEvents.java +++ b/src/main/java/shift/sextiarysector/SSEvents.java @@ -2,27 +2,53 @@ import net.minecraftforge.common.MinecraftForge; import shift.sextiarysector.api.event.VanillaFoodHandler; +import shift.sextiarysector.event.AchievementEventHandler; import shift.sextiarysector.event.ClientEventHandler; import shift.sextiarysector.event.CommonEventHandler; import shift.sextiarysector.event.HUDEventHandler; +import shift.sextiarysector.event.OreDictionaryEventHandler; import shift.sextiarysector.event.PlayerStatusEventHandler; +import shift.sextiarysector.event.PlayerUnitEventHandler; import shift.sextiarysector.event.WorldEventHandler; +import shift.sextiarysector.gui.tab.TabManager; import shift.sextiarysector.player.EntityPlayerManager; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class SSEvents { - public static void preInit(FMLPreInitializationEvent event){ + public static void preInit(FMLPreInitializationEvent event) { - MinecraftForge.EVENT_BUS.register(new CommonEventHandler()); - MinecraftForge.EVENT_BUS.register(EntityPlayerManager.instance); - FMLCommonHandler.instance().bus().register(EntityPlayerManager.instance); - if(event.getSide().isClient())MinecraftForge.EVENT_BUS.register(new HUDEventHandler()); - MinecraftForge.EVENT_BUS.register(new PlayerStatusEventHandler()); - MinecraftForge.EVENT_BUS.register(new VanillaFoodHandler()); - if(event.getSide().isClient())MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); - MinecraftForge.ORE_GEN_BUS.register(new WorldEventHandler()); + MinecraftForge.EVENT_BUS.register(new CommonEventHandler()); + + MinecraftForge.EVENT_BUS.register(EntityPlayerManager.instance); + FMLCommonHandler.instance().bus().register(EntityPlayerManager.instance); + + if (event.getSide().isClient()) { + MinecraftForge.EVENT_BUS.register(new HUDEventHandler()); + } + + MinecraftForge.EVENT_BUS.register(new PlayerStatusEventHandler()); + FMLCommonHandler.instance().bus().register(new PlayerStatusEventHandler()); + MinecraftForge.EVENT_BUS.register(new PlayerUnitEventHandler()); + MinecraftForge.EVENT_BUS.register(new VanillaFoodHandler()); + + MinecraftForge.EVENT_BUS.register(new OreDictionaryEventHandler()); + + if (event.getSide().isClient()) { + MinecraftForge.EVENT_BUS.register(new ClientEventHandler()); + } + + if (event.getSide().isClient()) { + MinecraftForge.EVENT_BUS.register(new TabManager()); + } + + MinecraftForge.EVENT_BUS.register(new WorldEventHandler()); + MinecraftForge.ORE_GEN_BUS.register(new WorldEventHandler()); + + MinecraftForge.EVENT_BUS.register(new AchievementEventHandler()); + + //MinecraftForge.EVENT_BUS.register(new SantaEventHandler()); } diff --git a/src/main/java/shift/sextiarysector/SSFluids.java b/src/main/java/shift/sextiarysector/SSFluids.java new file mode 100644 index 0000000..075b087 --- /dev/null +++ b/src/main/java/shift/sextiarysector/SSFluids.java @@ -0,0 +1,169 @@ +package shift.sextiarysector; + +import java.util.Locale; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; +import shift.sextiarysector.api.EnumColor; +import shift.sextiarysector.event.ClientEventHandler; +import shift.sextiarysector.fluid.FluidColor; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SSFluids { + + public static Fluid takumiTea; + public static Fluid drinkingWater; + public static Fluid springWater; + public static Fluid hotSprings; + + public static Fluid steam; + public static Fluid mana; + public static Fluid oxygen; + public static Fluid season; + + public static Fluid sap; + + public static Fluid iron; + public static Fluid gold; + + public static Fluid[] color; + + public static void initFluids() { + + takumiTea = registerFluid("TakumiTea", 0, 0x006400, 5, 2.0f).setUnlocalizedName("takumi_tea"); + drinkingWater = registerFluid("DrinkingWater", 0, 0x87CEFA, 4, 1.0f).setUnlocalizedName("drinking_water"); + springWater = registerFluid("SpringWater", 0, 0x87CEFA, 4, 1.0f).setUnlocalizedName("spring_water"); + hotSprings = registerFluid("HotSprings", 0, 0xFFFFFF, 4, 1.0f).setUnlocalizedName("hot_springs"); + + steam = registerFluid("Steam", 1, 0xFFFFFF, 1, 1.0f).setUnlocalizedName("steam").setGaseous(true); + mana = registerFluid("Mana", 1, 0x7CF4E4, 1, 1.0f).setUnlocalizedName("mana").setGaseous(true); + oxygen = registerFluid("Oxygen", 0, 0xFFFFFF, 1, 1.0f).setUnlocalizedName("oxygen").setGaseous(true); + //season = new SSFluid("season", 1, 0xFFFFFF, 1, 1.0f).setUnlocalizedName("season").setDensity(-10).setGaseous(true); + + sap = registerFluid("Sap", 2, 0xFF7F50, 1, 1.0f).setUnlocalizedName("sap"); + + iron = registerFluid("Iron", 2, 0xFF1493, 1, 1.0f).setUnlocalizedName("iron"); + gold = registerFluid("Gold", 2, 0xFFD700, 1, 1.0f).setUnlocalizedName("gold"); + + color = new Fluid[16]; + for (int i = 0; i < color.length; i++) { + color[i] = new FluidColor("ss_" + EnumColor.getColor(i).name(), EnumColor.getColor(i)).setUnlocalizedName(EnumColor.getColor(i).name().toLowerCase(Locale.ENGLISH)); + } + + } + + public static void postFluids() { + + for (int i = 1; i <= FluidRegistry.getRegisteredFluids().size(); i++) { + FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid(i), new ItemStack(SSBlocks.fluidCrafter, 1, i), new ItemStack(SSBlocks.fluidCrafter, 1, 0)); + } + + FluidContainerRegistry.registerFluidContainer(FluidRegistry.WATER, new ItemStack(SSItems.waterBottle, 1), FluidContainerRegistry.EMPTY_BOTTLE); + FluidContainerRegistry.registerFluidContainer(FluidRegistry.LAVA, new ItemStack(SSItems.lavaBottle, 1), FluidContainerRegistry.EMPTY_BOTTLE); + + //FluidContainerRegistry.registerFluidContainer(takumiTea, new ItemStack(SSItems.takumiTeaBottle, 1), new ItemStack(SSItems.emptyBottle, 1)); + //FluidContainerRegistry.registerFluidContainer(drinkingWater, new ItemStack(SSItems.drinkingWaterBottle, 1), new ItemStack(SSItems.emptyBottle, 1)); + //FluidContainerRegistry.registerFluidContainer(sap, new ItemStack(SSItems.sapBottle, 1), new ItemStack(SSItems.emptyBottle, 1)); + + FluidContainerRegistry.registerFluidContainer(takumiTea, new ItemStack(SSItems.takumiTeaBottle, 1), FluidContainerRegistry.EMPTY_BOTTLE); + FluidContainerRegistry.registerFluidContainer(drinkingWater, new ItemStack(SSItems.drinkingWaterBottle, 1), FluidContainerRegistry.EMPTY_BOTTLE); + FluidContainerRegistry.registerFluidContainer(sap, new ItemStack(SSItems.sapBottle, 1), FluidContainerRegistry.EMPTY_BOTTLE); + + FluidContainerRegistry.registerFluidContainer(steam, new ItemStack(SSItems.steamBucket, 1), new ItemStack(Items.bucket, 1)); + FluidContainerRegistry.registerFluidContainer(iron, new ItemStack(SSItems.ironFluidBucket, 1), new ItemStack(Items.bucket, 1)); + FluidContainerRegistry.registerFluidContainer(gold, new ItemStack(SSItems.goldFluidBucket, 1), new ItemStack(Items.bucket, 1)); + + for (int i = 0; i < color.length; i++) { + + ItemStack item = new ItemStack(SSItems.colorSpray, 1, i); + ((IFluidContainerItem) item.getItem()).fill(item, new FluidStack(color[i], 1000), true); + FluidContainerRegistry.registerFluidContainer(color[i], item, new ItemStack(SSItems.emptyBottle)); + } + + } + + public static Fluid registerFluid(String fluidName, int type, int color, int moisture, float moistureSaturation) { + + Fluid f = new SSFluid(fluidName, type, color, moisture, moistureSaturation); + boolean t = FluidRegistry.registerFluid(f); + + if (!t) { + + if (FluidRegistry.getFluid(fluidName) != null) { + f = FluidRegistry.getFluid(fluidName); + } + + } + + return f; + + } + + public static class SSFluid extends Fluid { + + private final int type; + private final int color; + + public int moisture; + public float moistureSaturation; + + public SSFluid(String fluidName, int type, int color, int moisture, float moistureSaturation) { + super(fluidName); + this.type = type; + this.color = color; + this.moisture = moisture; + this.moistureSaturation = moistureSaturation; + } + + @Override + public String getUnlocalizedName() + { + return "fluid.ss." + this.unlocalizedName; + } + + @Override + public int getColor() + { + return color; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getStillIcon() + { + switch (type) { + case 0: + return ClientEventHandler.waterStill; + case 1: + return ClientEventHandler.portal; + case 2: + return ClientEventHandler.lavaStill; + } + return ClientEventHandler.waterStill; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getFlowingIcon() + { + switch (type) { + case 0: + return ClientEventHandler.waterFlow; + case 1: + return ClientEventHandler.portal; + case 2: + return ClientEventHandler.lavaFlow; + } + return ClientEventHandler.waterStill; + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/SSFuels.java b/src/main/java/shift/sextiarysector/SSFuels.java new file mode 100644 index 0000000..1288eb8 --- /dev/null +++ b/src/main/java/shift/sextiarysector/SSFuels.java @@ -0,0 +1,29 @@ +package shift.sextiarysector; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.IFuelHandler; + +public class SSFuels implements IFuelHandler { + + @Override + public int getBurnTime(ItemStack fuel) { + + if (fuel == null) return 0; + + Item item = fuel.getItem(); + + if (item == null) return 0; + + if (item == SSItems.leaf) return 50; + if (item == Item.getItemFromBlock(SSBlocks.leafBlock)) return 450; + if (item == SSItems.leafBed) return 1600; + if (item == SSItems.woodWateringCan) return 200; + + if (item == SSItems.lavaBottle) return 20000; + + return 0; + + } + +} diff --git a/src/main/java/shift/sextiarysector/SSGuiHandler.java b/src/main/java/shift/sextiarysector/SSGuiHandler.java index 97cfdc2..dbc610a 100644 --- a/src/main/java/shift/sextiarysector/SSGuiHandler.java +++ b/src/main/java/shift/sextiarysector/SSGuiHandler.java @@ -4,26 +4,64 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; +import shift.sextiarysector.container.ContainerCraftFurnace; +import shift.sextiarysector.container.ContainerFluidGFMachineBase; +import shift.sextiarysector.container.ContainerFluidMachineBase; +import shift.sextiarysector.container.ContainerFreezer; +import shift.sextiarysector.container.ContainerFunnel; import shift.sextiarysector.container.ContainerGFTank; import shift.sextiarysector.container.ContainerLargeFurnace; +import shift.sextiarysector.container.ContainerMPRepair; +import shift.sextiarysector.container.ContainerMagicFurnace; +import shift.sextiarysector.container.ContainerPlayerNext; +import shift.sextiarysector.container.ContainerRucksack; +import shift.sextiarysector.container.ContainerShippingBox; import shift.sextiarysector.container.ContainerSimpleMachine; +import shift.sextiarysector.container.ContainerSteamMotor; +import shift.sextiarysector.container.ContainerTabWorkbench; +import shift.sextiarysector.gui.GuiCraftFurnace; +import shift.sextiarysector.gui.GuiExtractor; +import shift.sextiarysector.gui.GuiFluidFurnace; +import shift.sextiarysector.gui.GuiFoodSmokers; +import shift.sextiarysector.gui.GuiFreezer; +import shift.sextiarysector.gui.GuiFunnel; import shift.sextiarysector.gui.GuiGFTank; +import shift.sextiarysector.gui.GuiInventoryNext; import shift.sextiarysector.gui.GuiLargeFurnace; import shift.sextiarysector.gui.GuiLoom; +import shift.sextiarysector.gui.GuiMPRepair; +import shift.sextiarysector.gui.GuiMagicFurnace; +import shift.sextiarysector.gui.GuiManaSqueezer; import shift.sextiarysector.gui.GuiMillstone; +import shift.sextiarysector.gui.GuiPulverizer; +import shift.sextiarysector.gui.GuiRollingMachine; +import shift.sextiarysector.gui.GuiRucksack; +import shift.sextiarysector.gui.GuiSawmill; +import shift.sextiarysector.gui.GuiShippingBox; +import shift.sextiarysector.gui.GuiSpinningMachine; +import shift.sextiarysector.gui.GuiSteamMotor; +import shift.sextiarysector.gui.GuiTabCrafting; +import shift.sextiarysector.gui.GuiTimeMachine; import shift.sextiarysector.gui.IServerGuiElement; +import shift.sextiarysector.player.EntityPlayerManager; +import shift.sextiarysector.tileentity.TileEntityCraftFurnace; +import shift.sextiarysector.tileentity.TileEntityFluidFGFMachineBase; +import shift.sextiarysector.tileentity.TileEntityFluidMachineBase; +import shift.sextiarysector.tileentity.TileEntityFreezer; +import shift.sextiarysector.tileentity.TileEntityFunnel; import shift.sextiarysector.tileentity.TileEntityGFTank; import shift.sextiarysector.tileentity.TileEntityLargeFurnace; +import shift.sextiarysector.tileentity.TileEntityMagicFurnace; import shift.sextiarysector.tileentity.TileEntitySimpleMachine; +import shift.sextiarysector.tileentity.TileEntitySteamMotor; import cpw.mods.fml.common.network.IGuiHandler; public class SSGuiHandler implements IGuiHandler { public static ArrayList list = new ArrayList(); - @Override - public Object getServerGuiElement(int ID, EntityPlayer player, World world,int x, int y, int z) { + public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { //System.out.println(ID); /* @@ -33,19 +71,65 @@ public Object getServerGuiElement(int ID, EntityPlayer player, World world,int x return null; }*/ + switch (ID) { + + case 0: + return new ContainerLargeFurnace(player.inventory, (TileEntityLargeFurnace) world.getTileEntity(x, y, z)); + case 1: + case 2: + return new ContainerFluidMachineBase(player.inventory, (TileEntityFluidMachineBase) world.getTileEntity(x, y, z)); - switch(ID){ + case 5: + return new ContainerCraftFurnace(player.inventory, (TileEntityCraftFurnace) world.getTileEntity(x, y, z)); + case 6: + return new ContainerFreezer(player.inventory, (TileEntityFreezer) world.getTileEntity(x, y, z)); - case 0 : return new ContainerLargeFurnace(player.inventory, (TileEntityLargeFurnace) world.getTileEntity(x, y, z)); + case 10: + return new ContainerMPRepair(player.inventory, world, x, y, z, player); + case 11: + return new ContainerFunnel(player.inventory, (TileEntityFunnel) world.getTileEntity(x, y, z)); case 20: case 21: + case 25: + case 26: + case 30: + case 35: + case 40: return new ContainerSimpleMachine(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); - case 40: - case 41: + case 31: + case 36: + return new ContainerFluidGFMachineBase(player.inventory, (TileEntityFluidFGFMachineBase) world.getTileEntity(x, y, z)); + + case 50: + case 51: + case 52: + case 53: + case 54: return new ContainerGFTank(player.inventory, (TileEntityGFTank) world.getTileEntity(x, y, z)); + case 60: + return new ContainerSteamMotor(player.inventory, (TileEntitySteamMotor) world.getTileEntity(x, y, z)); + + case 90: + return new ContainerMagicFurnace(player.inventory, (TileEntityMagicFurnace) world.getTileEntity(x, y, z)); + + case 200: + return new ContainerPlayerNext(player.inventory, player); + case 201: + return new ContainerTabWorkbench(player.inventory, world, x, y, z); + + case 205: + return new ContainerRucksack(player.inventory); + case 206: + return new ContainerRucksack(player.inventory, EntityPlayerManager.getEquipmentStats(player).inventory); + + case 210: + return new ContainerShippingBox(player.inventory, player); + case 211: + return new ContainerRucksack(player.inventory, EntityPlayerManager.getEquipmentStats(player).inventory); + } /* @@ -75,22 +159,84 @@ public Object getServerGuiElement(int ID, EntityPlayer player, World world,int x return null; - } @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world,int x, int y, int z) { + public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { + + switch (ID) { + + case 0: + return new GuiLargeFurnace(player.inventory, (TileEntityLargeFurnace) world.getTileEntity(x, y, z)); + case 1: + return new GuiFluidFurnace(player.inventory, (TileEntityFluidMachineBase) world.getTileEntity(x, y, z)); + case 2: + return new GuiFoodSmokers(player.inventory, (TileEntityFluidMachineBase) world.getTileEntity(x, y, z)); + + case 5: + return new GuiCraftFurnace(player.inventory, (TileEntityCraftFurnace) world.getTileEntity(x, y, z)); + case 6: + return new GuiFreezer(player.inventory, (TileEntityFreezer) world.getTileEntity(x, y, z)); + + case 10: + return new GuiMPRepair(player.inventory, world, x, y, z); + case 11: + return new GuiFunnel(player.inventory, (TileEntityFunnel) world.getTileEntity(x, y, z)); - switch(ID){ + case 20: + return new GuiMillstone(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); + case 21: + return new GuiLoom(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); + + case 25: + return new GuiSawmill(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); + case 26: + return new GuiSpinningMachine(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); - case 0 : return new GuiLargeFurnace(player.inventory, (TileEntityLargeFurnace) world.getTileEntity(x, y, z)); + case 30: + return new GuiPulverizer(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); + case 31: + return new GuiExtractor(player.inventory, (TileEntityFluidFGFMachineBase) world.getTileEntity(x, y, z)); - case 20:return new GuiMillstone(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); - case 21:return new GuiLoom(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); + case 35: + return new GuiRollingMachine(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); - case 40:return new GuiGFTank(player.inventory, (TileEntityGFTank) world.getTileEntity(x, y, z),1); - case 41:return new GuiGFTank(player.inventory, (TileEntityGFTank) world.getTileEntity(x, y, z),2); + case 36: + return new GuiManaSqueezer(player.inventory, (TileEntityFluidFGFMachineBase) world.getTileEntity(x, y, z)); + + case 40: + return new GuiTimeMachine(player.inventory, (TileEntitySimpleMachine) world.getTileEntity(x, y, z)); + + case 50: + return new GuiGFTank(player.inventory, (TileEntityGFTank) world.getTileEntity(x, y, z), 1); + case 51: + return new GuiGFTank(player.inventory, (TileEntityGFTank) world.getTileEntity(x, y, z), 2); + case 52: + return new GuiGFTank(player.inventory, (TileEntityGFTank) world.getTileEntity(x, y, z), 3); + case 53: + return new GuiGFTank(player.inventory, (TileEntityGFTank) world.getTileEntity(x, y, z), 4); + case 54: + return new GuiGFTank(player.inventory, (TileEntityGFTank) world.getTileEntity(x, y, z), 5); + + case 60: + return new GuiSteamMotor(player.inventory, (TileEntitySteamMotor) world.getTileEntity(x, y, z)); + + case 90: + return new GuiMagicFurnace(player.inventory, (TileEntityMagicFurnace) world.getTileEntity(x, y, z)); + + case 200: + return new GuiInventoryNext(player); + case 201: + return new GuiTabCrafting(player.inventory, world, x, y, z); + + case 205: + return new GuiRucksack(player.inventory); + case 206: + return new GuiRucksack(player.inventory, EntityPlayerManager.getEquipmentStats(player).inventory); + + case 210: + return new GuiShippingBox(player); } diff --git a/src/main/java/shift/sextiarysector/SSItems.java b/src/main/java/shift/sextiarysector/SSItems.java index 82f35de..6c1e283 100644 --- a/src/main/java/shift/sextiarysector/SSItems.java +++ b/src/main/java/shift/sextiarysector/SSItems.java @@ -1,37 +1,90 @@ package shift.sextiarysector; +import java.util.ArrayList; + +import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemSpade; +import net.minecraft.item.ItemSword; import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.item.ItemBottle; import shift.sextiarysector.item.ItemCalendar; +import shift.sextiarysector.item.ItemContactLenses; import shift.sextiarysector.item.ItemCrop; +import shift.sextiarysector.item.ItemDrink; +import shift.sextiarysector.item.ItemFigureBox; +import shift.sextiarysector.item.ItemFoodCrop; import shift.sextiarysector.item.ItemFoodDrink; +import shift.sextiarysector.item.ItemFullBottle; +import shift.sextiarysector.item.ItemGFContactLenses; import shift.sextiarysector.item.ItemGearStorage; +import shift.sextiarysector.item.ItemGuiUnit; import shift.sextiarysector.item.ItemHammer; +import shift.sextiarysector.item.ItemKnife; +import shift.sextiarysector.item.ItemLavaBottle; +import shift.sextiarysector.item.ItemLeafBed; +import shift.sextiarysector.item.ItemMineboat; +import shift.sextiarysector.item.ItemMineboatTank; +import shift.sextiarysector.item.ItemOxygenTank; +import shift.sextiarysector.item.ItemProtectionRing; +import shift.sextiarysector.item.ItemRucksack; +import shift.sextiarysector.item.ItemSSArmor; +import shift.sextiarysector.item.ItemSSAxe; +import shift.sextiarysector.item.ItemSSPickaxe; +import shift.sextiarysector.item.ItemSSShears; import shift.sextiarysector.item.ItemScoop; import shift.sextiarysector.item.ItemSeasonStone; import shift.sextiarysector.item.ItemShiftHat; +import shift.sextiarysector.item.ItemShopRing; +import shift.sextiarysector.item.ItemSimpleBucket; +import shift.sextiarysector.item.ItemSoup; +import shift.sextiarysector.item.ItemSpray; +import shift.sextiarysector.item.ItemUnit; +import shift.sextiarysector.item.ItemWaterBottle; import shift.sextiarysector.item.ItemWateringCan; +import shift.sextiarysector.module.ModuleToolMaterial; import cpw.mods.fml.common.registry.GameRegistry; public class SSItems { - //Gear - public static Item unit; public static Item woodGear; + public static Item stoneGear; + public static Item steelGear; + public static Item ninjaGear; + public static Item orichalcumGear; + public static Item woodUnitGear; + public static Item stoneUnitGear; + public static Item steelUnitGear; + public static Item ninjaUnitGear; + public static Item orichalcumUnitGear; public static Item woodGFStorage; + public static Item stoneGFStorage; + public static Item steelGFStorage; + public static Item ninjaGFStorage; + public static Item orichalcumGFStorage; + //hammer public static Item hammer; + public static Item ironSpanner; + public static Item colorSpray; + public static Item calendar; public static Item seasonStone; + //繝吶ャ繝 + public static Item leafBed; + //邏譚 + public static Item leaf; + public static Item dustWaterLily; public static Item stoneDust; @@ -40,11 +93,78 @@ public class SSItems { public static Item yellowStoneDust; public static Item coalDust; + public static Item ironDust; + public static Item goldDust; + public static Item diamondDust; - public static Item blueStoneSlimeBall; + public static Item copperDust; + public static Item zincDust; + public static Item silverDust; - //鬟イ縺ソ迚ゥ - public static Item drinkingWaterSmallBottle; + public static Item mithrilDust; + + public static Item ironNugget; + public static Item copperNugget; + public static Item zincNugget; + public static Item silverNugget; + + public static Item steelNugget; + public static Item ninjaNugget; + + public static Item obsidianNugget; + + public static Item steelIngot; + public static Item brassIngot; + + public static Item blueStoneIngot; + public static Item yellowStoneIngot; + + public static Item copperIngot; + public static Item zincIngot; + public static Item silverIngot; + + public static Item mithrilIngot; + public static Item orichalcumGem; + + public static Item ninjaIngot; + + public static Item redGel; + public static Item blueGel; + public static Item yellowGel; + + public static Item craftReactor; + public static Item energyReactor; + public static Item objectReactor; + + //豸イ菴 + public static Item emptyBottle; + public static Item waterBottle; + public static Item lavaBottle; + public static Item sapBottle; + + public static Item steamBucket; + public static Item ironFluidBucket; + public static Item goldFluidBucket; + + //鬲疲ウ + public static Item magicDust; + + //蟶 + public static Item silkBobbin; + public static Item smallCloth; + public static Item silkCloth; + public static Item canvas; + public static Item dryingFlesh; + public static Item fleshBobbin; + public static Item stringMass; + public static Item strongString; + public static Item strongStringBobbin; + public static Item strongCloth; + public static Item strongCanvas; + + //public static Item bottle; + + public static Item figureBox; //驕灘キ public static Item woodScoop; @@ -53,10 +173,69 @@ public class SSItems { public static Item goldScoop; public static Item diamondScoop; + public static Item brassScoop; + //public static Item diamondScoop; + + public static Item woodKnife; + public static Item stoneKnife; + public static Item ironKnife; + public static Item goldKnife; + public static Item diamondKnife; + + public static Item brassKnife; + + //驕灘キ 繝舌ル繝ゥ + + // 驫 + public static Item copperShovel; + public static Item copperPickaxe; + public static Item copperAxe; + public static Item copperSword; + public static Item copperHoe; + + // 鮟驫 + public static Item brassShovel; + public static Item brassPickaxe; + public static Item brassAxe; + public static Item brassSword; + public static Item brassHoe; + + // 繝九Φ繧ク繝」 + public static Item ninjaShovel; + public static Item ninjaPickaxe; + public static Item ninjaAxe; + public static Item ninjaSword; + public static Item ninjaHoe; + + //髦イ蜈キ + // 驫 + public static Item copperHelmet; + public static Item copperChestplate; + public static Item copperLeggings; + public static Item copperBoots; + + // 繝九Φ繧ク繝」 + public static Item ninjaHelmet; + public static Item ninjaChestplate; + public static Item ninjaLeggings; + public static Item ninjaBoots; + + //縺昴ョ莉 public static Item woodWateringCan; + public static Item brassShears; + + //豌エ逕」 + public static Item mineboatChest; + public static Item mineboatTank; + + public static Item laver; //驥手除 + public static ArrayList farmlandCrops = new ArrayList(); + public static ArrayList paddyCrops = new ArrayList(); + public static ArrayList woodCrops = new ArrayList(); + public static Item turnip; public static Item cucumber; @@ -68,32 +247,141 @@ public class SSItems { public static Item goldenCorn; - public static Item eggplant; public static Item sweetPotato; public static Item greenPepper; + public static Item bluePotato; + public static Item radish; + public static Item rice; + + public static Item shiitake; + + //鬲 + public static Item squidSashimi; + + //譁咏炊 + public static Item whiteRice; + + public static Item salt; + public static Item curryPowder; + + public static Item laverRoasted; + + public static Item chickenSmoked; + public static Item porkchopSmoked; + public static Item beefSmoked; + + public static Item riceBall; + public static Item curryRice; + + public static Item carrotSoup; + public static Item cornSoup; + public static Item eggSoup; + public static Item mushroomStew; + public static Item onionSoup; + public static Item enderSoup; + public static Item tomatoSoup; + + public static Item chocolate; + + //鬟イ縺ソ迚ゥ + //public static Item drinkingWaterSmallBottle; + public static Item drinkingWaterBottle; + public static Item takumiTeaBottle; + //陬蛯 public static Item shiftHat; - public static void initItems(){ + public static Item rucksack; + public static Item oxygenTank; + public static Item gfContactLenses; + public static Item waterContactLenses; - unit = new Item().setUnlocalizedName("ss.unit").setTextureName("sextiarysector:machine/unit").setCreativeTab(SextiarySectorAPI.TabSSMachine); + //unit + public static Item craftUnit; + + public static Item attackUnit; + public static Item defenseUnit; + public static Item attackRustUnit; + public static Item defenseRustUnit; + + public static Item jumpUnit; + + public static Item bedMonsterUnit; + + public static Item pickaxeUnit; + + public static Item debugUnit; + + //繝ェ繝ウ繧ー + public static Item ironRing; + public static Item creeperRing; + public static Item mpRing; + public static Item xpRing; + + public static void initItems() { + + unit = new Item().setUnlocalizedName("ss.unit").setTextureName("sextiarysector:machine/unit").setCreativeTab(SextiarySectorAPI.TabSSIndustry); GameRegistry.registerItem(unit, "Unit"); - woodGear = new Item().setUnlocalizedName("ss.wood_gear").setTextureName("sextiarysector:machine/wood_gear").setCreativeTab(SextiarySectorAPI.TabSSMachine); + woodGear = new Item().setUnlocalizedName("ss.wood_gear").setTextureName("sextiarysector:machine/wood_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); GameRegistry.registerItem(woodGear, "WoodGear"); - woodUnitGear = new Item().setUnlocalizedName("ss.wood_unit_gear").setTextureName("sextiarysector:machine/wood_unit_gear").setCreativeTab(SextiarySectorAPI.TabSSMachine); + stoneGear = new Item().setUnlocalizedName("ss.stone_gear").setTextureName("sextiarysector:machine/stone_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(stoneGear, "StoneGear"); + + steelGear = new Item().setUnlocalizedName("ss.steel_gear").setTextureName("sextiarysector:machine/steel_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(steelGear, "SteelGear"); + + ninjaGear = new Item().setUnlocalizedName("ss.ninja_gear").setTextureName("sextiarysector:machine/ninja_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(ninjaGear, "NinjaGear"); + + orichalcumGear = new Item().setUnlocalizedName("ss.orichalcum_gear").setTextureName("sextiarysector:machine/orichalcum_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(orichalcumGear, "OrichalcumGear"); + + woodUnitGear = new Item().setUnlocalizedName("ss.wood_unit_gear").setTextureName("sextiarysector:machine/wood_unit_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); GameRegistry.registerItem(woodUnitGear, "WoodUnitGear"); - woodGFStorage = new ItemGearStorage(1, 10000, 1).setUnlocalizedName("ss.wood_gf_storage").setTextureName("sextiarysector:gearforce/gear_storage").setCreativeTab(SextiarySectorAPI.TabSSMachine); + stoneUnitGear = new Item().setUnlocalizedName("ss.stone_unit_gear").setTextureName("sextiarysector:machine/stone_unit_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(stoneUnitGear, "StoneUnitGear"); + + steelUnitGear = new Item().setUnlocalizedName("ss.steel_unit_gear").setTextureName("sextiarysector:machine/steel_unit_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(steelUnitGear, "steelUnitGear"); + + ninjaUnitGear = new Item().setUnlocalizedName("ss.ninja_unit_gear").setTextureName("sextiarysector:machine/ninja_unit_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(ninjaUnitGear, "NinjaUnitGear"); + + orichalcumUnitGear = new Item().setUnlocalizedName("ss.orichalcum_unit_gear").setTextureName("sextiarysector:machine/orichalcum_unit_gear").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(orichalcumUnitGear, "OrichalcumUnitGear"); + + woodGFStorage = new ItemGearStorage(1, 10000, 1).setUnlocalizedName("ss.wood_gf_storage").setTextureName("sextiarysector:gearforce/wood_gear_storage").setCreativeTab(SextiarySectorAPI.TabSSIndustry); GameRegistry.registerItem(woodGFStorage, "WoodGFStorage"); - hammer = new ItemHammer().setUnlocalizedName("ss.hammer").setTextureName("sextiarysector:machine/hammer").setCreativeTab(SextiarySectorAPI.TabSSMachine); - GameRegistry.registerItem(hammer, "Hammer"); + stoneGFStorage = new ItemGearStorage(2, 10000, 2).setUnlocalizedName("ss.stone_gf_storage").setTextureName("sextiarysector:gearforce/stone_gear_storage").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(stoneGFStorage, "StoneGFStorage"); + + steelGFStorage = new ItemGearStorage(3, 10000, 3).setUnlocalizedName("ss.steel_gf_storage").setTextureName("sextiarysector:gearforce/steel_gear_storage").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(steelGFStorage, "SteelGFStorage"); + + ninjaGFStorage = new ItemGearStorage(4, 10000, 4).setUnlocalizedName("ss.ninja_gf_storage").setTextureName("sextiarysector:gearforce/ninja_gear_storage").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(ninjaGFStorage, "NinjaGFStorage"); + + orichalcumGFStorage = new ItemGearStorage(5, 10000, 5).setUnlocalizedName("ss.orichalcum_gf_storage").setTextureName("sextiarysector:gearforce/orichalcum_gear_storage").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(orichalcumGFStorage, "OrichalcumGFStorage"); + + //繝上Φ繝槭シ + //hammer = new ItemHammer().setUnlocalizedName("ss.iron_spanner").setTextureName("sextiarysector:gearforce/iron_spanner").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + + ironSpanner = new ItemHammer().setUnlocalizedName("ss.iron_spanner").setTextureName("sextiarysector:gearforce/iron_spanner").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerItem(ironSpanner, "IronSpanner"); + + hammer = ironSpanner; + + colorSpray = new ItemSpray().setUnlocalizedName("ss.color_spray").setTextureName("sextiarysector:fluid/color_spray").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(colorSpray, "ColorSpray"); calendar = new ItemCalendar().setUnlocalizedName("ss.calendar").setTextureName("sextiarysector:calendar").setCreativeTab(SextiarySectorAPI.TabSSCore); GameRegistry.registerItem(calendar, "Calendar"); @@ -101,28 +389,189 @@ public static void initItems(){ seasonStone = new ItemSeasonStone().setUnlocalizedName("ss.season_stone").setTextureName("sextiarysector:season_stone").setCreativeTab(SextiarySectorAPI.TabSSCore); GameRegistry.registerItem(seasonStone, "SeasonStone"); + leafBed = new ItemLeafBed().setUnlocalizedName("ss.leaf_bed").setTextureName("sextiarysector:leaf_bed").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(leafBed, "ItemLeafBed"); + + //邏譚 + leaf = new Item().setUnlocalizedName("ss.leaf").setTextureName("sextiarysector:leaf").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(leaf, "Leaf"); + dustWaterLily = new Item().setUnlocalizedName("ss.dust_waterlily").setTextureName("sextiarysector:dust/waterlily_dust").setCreativeTab(SextiarySectorAPI.TabSSCore); GameRegistry.registerItem(dustWaterLily, "DustWaterLily"); - stoneDust = new Item().setUnlocalizedName("ss.stone_dust").setTextureName("sextiarysector:dust/stone_dust").setCreativeTab(SextiarySectorAPI.TabSSCore); + stoneDust = new Item().setUnlocalizedName("ss.stone_dust").setTextureName("sextiarysector:dust/stone_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); GameRegistry.registerItem(stoneDust, "StoneDust"); - blueStoneDust = new Item().setUnlocalizedName("ss.dust_blue_stone").setTextureName("sextiarysector:dust/bluestone_dust").setCreativeTab(SextiarySectorAPI.TabSSCore); + blueStoneDust = new Item().setUnlocalizedName("ss.dust_blue_stone").setTextureName("sextiarysector:dust/bluestone_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); GameRegistry.registerItem(blueStoneDust, "DustBlueStone"); - yellowStoneDust = new Item().setUnlocalizedName("ss.dust_yellow_stone").setTextureName("sextiarysector:dust/yellowstone_dust").setCreativeTab(SextiarySectorAPI.TabSSCore); + yellowStoneDust = new Item().setUnlocalizedName("ss.dust_yellow_stone").setTextureName("sextiarysector:dust/yellowstone_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); GameRegistry.registerItem(yellowStoneDust, "DustYellowStone"); - coalDust = new Item().setUnlocalizedName("ss.coal_dust").setTextureName("sextiarysector:dust/coal_dust").setCreativeTab(SextiarySectorAPI.TabSSCore); + coalDust = new Item().setUnlocalizedName("ss.coal_dust").setTextureName("sextiarysector:dust/coal_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); GameRegistry.registerItem(coalDust, "CoalDust"); - blueStoneSlimeBall = new Item().setUnlocalizedName("ss.blue_stone_slime_ball").setTextureName("sextiarysector:slimeball/bluestone_slimeball").setCreativeTab(SextiarySectorAPI.TabSSCore); - GameRegistry.registerItem(blueStoneSlimeBall, "BlueStoneSlimeBall"); + ironDust = new Item().setUnlocalizedName("ss.iron_dust").setTextureName("sextiarysector:dust/iron_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(ironDust, "IronDust"); - //鬟イ縺ソ迚ゥ - drinkingWaterSmallBottle = new ItemFoodDrink(0, 3.5f, 2, 6.5f, 0, 0, false).setUnlocalizedName("ss.drinking_water_small_bottle").setTextureName("sextiarysector:drink/drinking_water_small_bottle"); - GameRegistry.registerItem(drinkingWaterSmallBottle, "DrinkingWaterSmallBottle"); + goldDust = new Item().setUnlocalizedName("ss.gold_dust").setTextureName("sextiarysector:dust/gold_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(goldDust, "GoldDust"); + + diamondDust = new Item().setUnlocalizedName("ss.diamond_dust").setTextureName("sextiarysector:dust/diamond_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(diamondDust, "DiamondDust"); + + copperDust = new Item().setUnlocalizedName("ss.copper_dust").setTextureName("sextiarysector:dust/copper_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(copperDust, "CopperDust"); + + zincDust = new Item().setUnlocalizedName("ss.zinc_dust").setTextureName("sextiarysector:dust/zinc_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(zincDust, "ZincDust"); + + silverDust = new Item().setUnlocalizedName("ss.silver_dust").setTextureName("sextiarysector:dust/silver_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(silverDust, "SilverDust"); + + mithrilDust = new Item().setUnlocalizedName("ss.mithril_dust").setTextureName("sextiarysector:dust/mithril_dust").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(mithrilDust, "MithrilDust"); + + //繝翫ご繝繝 + ironNugget = new Item().setUnlocalizedName("ss.iron_nugget").setTextureName("sextiarysector:nugget/iron_nugget").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(ironNugget, "IronNugget"); + + copperNugget = new Item().setUnlocalizedName("ss.copper_nugget").setTextureName("sextiarysector:nugget/copper_nugget").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(copperNugget, "CopperNugget"); + + zincNugget = new Item().setUnlocalizedName("ss.zinc_nugget").setTextureName("sextiarysector:nugget/zinc_nugget").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(zincNugget, "ZincNugget"); + + silverNugget = new Item().setUnlocalizedName("ss.silver_nugget").setTextureName("sextiarysector:nugget/silver_nugget").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(silverNugget, "SilverNugget"); + + steelNugget = new Item().setUnlocalizedName("ss.steel_nugget").setTextureName("sextiarysector:nugget/steel_nugget").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(steelNugget, "SteelNugget"); + + ninjaNugget = new Item().setUnlocalizedName("ss.ninja_nugget").setTextureName("sextiarysector:nugget/ninja_nugget").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(ninjaNugget, "NinjaNugget"); + + obsidianNugget = new Item().setUnlocalizedName("ss.obsidian_nugget").setTextureName("sextiarysector:nugget/obsidian_nugget").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(obsidianNugget, "ObsidianNugget"); + + //繝翫ご繝繝 迚ケ谿 + + //繧、繝ウ繧エ繝繝 + steelIngot = new Item().setUnlocalizedName("ss.steel_ingot").setTextureName("sextiarysector:ingot/steel_ingot").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(steelIngot, "SteelIngot"); + brassIngot = new Item().setUnlocalizedName("ss.brass_ingot").setTextureName("sextiarysector:ingot/brass_ingot").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(brassIngot, "BrassIngot"); + + blueStoneIngot = new Item().setUnlocalizedName("ss.bluestone_ingot").setTextureName("sextiarysector:ingot/bluestone_ingot").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(blueStoneIngot, "BlueStoneIngot"); + + yellowStoneIngot = new Item().setUnlocalizedName("ss.yellowstone_ingot").setTextureName("sextiarysector:ingot/yellowstone_ingot").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(yellowStoneIngot, "YellowStoneIngot"); + + copperIngot = new Item().setUnlocalizedName("ss.copper_ingot").setTextureName("sextiarysector:ingot/copper_ingot").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(copperIngot, "CopperIngot"); + + zincIngot = new Item().setUnlocalizedName("ss.zinc_ingot").setTextureName("sextiarysector:ingot/zinc_ingot").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(zincIngot, "ZincIngot"); + + silverIngot = new Item().setUnlocalizedName("ss.silver_ingot").setTextureName("sextiarysector:ingot/silver_ingot").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(silverIngot, "SilverIngot"); + + mithrilIngot = new Item().setUnlocalizedName("ss.mithril_ingot").setTextureName("sextiarysector:ingot/mithril_ingot").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(mithrilIngot, "MithrilIngot"); + + orichalcumGem = new Item().setUnlocalizedName("ss.orichalcum_gem").setTextureName("sextiarysector:gem/orichalcum_gem").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(orichalcumGem, "OrichalcumGem"); + + ninjaIngot = new Item().setUnlocalizedName("ss.ninja_ingot").setTextureName("sextiarysector:ingot/ninja_ingot").setCreativeTab(SextiarySectorAPI.TabSSMining); + GameRegistry.registerItem(ninjaIngot, "NinjaIngot"); + + redGel = new Item().setUnlocalizedName("ss.red_gel").setTextureName("sextiarysector:gel/red_gel").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(redGel, "RedGel"); + + blueGel = new Item().setUnlocalizedName("ss.blue_gel").setTextureName("sextiarysector:gel/blue_gel").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(blueGel, "BlueGel"); + + yellowGel = new Item().setUnlocalizedName("ss.yellow_gel").setTextureName("sextiarysector:gel/yellow_gel").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(yellowGel, "YellowGel"); + + craftReactor = new Item().setUnlocalizedName("ss.craft_reactor").setTextureName("sextiarysector:reactor/craft_reactor").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(craftReactor, "CraftReactor"); + + energyReactor = new Item().setUnlocalizedName("ss.energy_reactor").setTextureName("sextiarysector:reactor/energy_reactor").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(energyReactor, "EnergyReactor"); + + objectReactor = new Item().setUnlocalizedName("ss.object_reactor").setTextureName("sextiarysector:reactor/object_reactor").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(objectReactor, "ObjectReactor"); + + //豸イ菴 + //繝懊ヨ繝ォ + emptyBottle = new ItemBottle().setUnlocalizedName("ss.empty_bottle").setTextureName("sextiarysector:fluid/empty_bottle"); + GameRegistry.registerItem(emptyBottle, "EmptyBottle"); + + waterBottle = new ItemWaterBottle().setUnlocalizedName("ss.water_bottle").setTextureName("sextiarysector:fluid/water_bottle"); + GameRegistry.registerItem(waterBottle, "WaterBottle"); + + lavaBottle = new ItemLavaBottle().setUnlocalizedName("ss.lava_bottle").setTextureName("sextiarysector:fluid/lava_bottle"); + GameRegistry.registerItem(lavaBottle, "LavaBottle"); + + sapBottle = new ItemFullBottle().setUnlocalizedName("ss.sap_bottle").setTextureName("sextiarysector:fluid/sap_bottle"); + GameRegistry.registerItem(sapBottle, "SapBottle"); + + //繝舌こ繝 + steamBucket = new ItemSimpleBucket().setUnlocalizedName("ss.steam_bucket").setTextureName("sextiarysector:fluid/steam_bucket"); + GameRegistry.registerItem(steamBucket, "SteamBucket"); + + ironFluidBucket = new ItemSimpleBucket().setUnlocalizedName("ss.iron_fluid_bucket").setTextureName("sextiarysector:fluid/iron_fluid_bucket"); + GameRegistry.registerItem(ironFluidBucket, "IronFluidBucket"); + + goldFluidBucket = new ItemSimpleBucket().setUnlocalizedName("ss.gold_fluid_bucket").setTextureName("sextiarysector:fluid/gold_fluid_bucket"); + GameRegistry.registerItem(goldFluidBucket, "GoldFluidBucket"); + + //鬲疲ウ + magicDust = new Item().setUnlocalizedName("ss.magic_dust").setTextureName("sextiarysector:dust/magic_dust").setCreativeTab(SextiarySectorAPI.TabSSMagic); + GameRegistry.registerItem(magicDust, "MagicDust"); + + //蟶 + silkBobbin = new Item().setUnlocalizedName("ss.silk_bobbin").setTextureName("sextiarysector:loom/silk_bobbin").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(silkBobbin, "SilkBobbin"); + + smallCloth = new Item().setUnlocalizedName("ss.small_cloth").setTextureName("sextiarysector:loom/small_cloth").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(smallCloth, "SmallCloth"); + + silkCloth = new Item().setUnlocalizedName("ss.silk_cloth").setTextureName("sextiarysector:loom/silk_cloth").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(silkCloth, "silkCloth"); + + canvas = new Item().setUnlocalizedName("ss.canvas").setTextureName("sextiarysector:loom/canvas").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(canvas, "Canvas"); + + dryingFlesh = new Item().setUnlocalizedName("ss.drying_flesh").setTextureName("sextiarysector:loom/drying_flesh").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(dryingFlesh, "DryingFlesh"); + + fleshBobbin = new Item().setUnlocalizedName("ss.flesh_bobbin").setTextureName("sextiarysector:loom/flesh_bobbin").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(fleshBobbin, "FleshBobbin"); + + stringMass = new Item().setUnlocalizedName("ss.string_mass").setTextureName("sextiarysector:loom/string_mass").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(stringMass, "StringMass"); + + strongString = new Item().setUnlocalizedName("ss.strong_string").setTextureName("sextiarysector:loom/strong_string").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(strongString, "StrongString"); + + strongStringBobbin = new Item().setUnlocalizedName("ss.strong_string_bobbin").setTextureName("sextiarysector:loom/strong_string_bobbin").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(strongStringBobbin, "StrongStringBobbin"); + + strongCloth = new Item().setUnlocalizedName("ss.strong_cloth").setTextureName("sextiarysector:loom/strong_cloth").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(strongCloth, "StrongCloth"); + + strongCanvas = new Item().setUnlocalizedName("ss.strong_canvas").setTextureName("sextiarysector:loom/strong_canvas").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(strongCanvas, "StrongCanvas"); + + //bottle = new ItemBlockBottle().setUnlocalizedName("ss.bottle").setTextureName("sextiarysector:drink/empty_bottle"); + //GameRegistry.registerItem(bottle, "Bottle"); + + figureBox = new ItemFigureBox().setUnlocalizedName("ss.figure_box").setTextureName("sextiarysector:figure_box").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(figureBox, "FigureBox"); //驕灘キ woodScoop = new ItemScoop(ToolMaterial.WOOD).setUnlocalizedName("ss.wood_scoop").setTextureName("wood_scoop"); @@ -136,48 +585,260 @@ public static void initItems(){ GameRegistry.registerItem(goldScoop, "GoldScoop"); GameRegistry.registerItem(diamondScoop, "DiamondScoop"); + brassScoop = new ItemScoop(ModuleToolMaterial.brassTool).setUnlocalizedName("ss.brass_scoop").setTextureName("brass_scoop"); + GameRegistry.registerItem(brassScoop, "BrassScoop"); + + woodKnife = new ItemKnife(ToolMaterial.WOOD).setUnlocalizedName("ss.wood_knife").setTextureName("wood_knife"); + stoneKnife = new ItemKnife(ToolMaterial.STONE).setUnlocalizedName("ss.stone_knife").setTextureName("stone_knife"); + ironKnife = new ItemKnife(ToolMaterial.IRON).setUnlocalizedName("ss.iron_knife").setTextureName("iron_knife"); + goldKnife = new ItemKnife(ToolMaterial.GOLD).setUnlocalizedName("ss.gold_knife").setTextureName("gold_knife"); + diamondKnife = new ItemKnife(ToolMaterial.EMERALD).setUnlocalizedName("ss.diamond_knife").setTextureName("diamond_knife"); + GameRegistry.registerItem(woodKnife, "WoodKnife"); + GameRegistry.registerItem(stoneKnife, "StoneKnife"); + GameRegistry.registerItem(ironKnife, "IronKnife"); + GameRegistry.registerItem(goldKnife, "GoldKnife"); + GameRegistry.registerItem(diamondKnife, "DiamondKnife"); + + brassKnife = new ItemKnife(ModuleToolMaterial.brassTool).setUnlocalizedName("ss.brass_knife").setTextureName("brass_knife"); + GameRegistry.registerItem(brassKnife, "BrassKnife"); + + //繝舌ル繝ゥ + // 驫 + copperShovel = new ItemSpade(ModuleToolMaterial.copperTool).setUnlocalizedName("ss.copper_shovel").setTextureName("sextiarysector:tool/copper_shovel").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(copperShovel, "CopperShovel"); + copperPickaxe = new ItemSSPickaxe(ModuleToolMaterial.copperTool).setUnlocalizedName("ss.copper_pickaxe").setTextureName("sextiarysector:tool/copper_pickaxe").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(copperPickaxe, "CopperPickaxe"); + copperAxe = new ItemSSAxe(ModuleToolMaterial.copperTool).setUnlocalizedName("ss.copper_axe").setTextureName("sextiarysector:tool/copper_axe").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(copperAxe, "CopperAxe"); + copperSword = new ItemSword(ModuleToolMaterial.copperTool).setUnlocalizedName("ss.copper_sword").setTextureName("sextiarysector:tool/copper_sword").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(copperSword, "CopperSword"); + copperHoe = new ItemHoe(ModuleToolMaterial.copperTool).setUnlocalizedName("ss.copper_hoe").setTextureName("sextiarysector:tool/copper_hoe").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(copperHoe, "CopperHoe"); + + //鮟驫 + brassShovel = new ItemSpade(ModuleToolMaterial.brassTool).setUnlocalizedName("ss.brass_shovel").setTextureName("sextiarysector:tool/brass_shovel").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(brassShovel, "BrassShovel"); + brassPickaxe = new ItemSSPickaxe(ModuleToolMaterial.brassTool).setUnlocalizedName("ss.brass_pickaxe").setTextureName("sextiarysector:tool/brass_pickaxe").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(brassPickaxe, "BrassPickaxe"); + brassAxe = new ItemSSAxe(ModuleToolMaterial.brassTool).setUnlocalizedName("ss.brass_axe").setTextureName("sextiarysector:tool/brass_axe").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(brassAxe, "BrassAxe"); + brassSword = new ItemSword(ModuleToolMaterial.brassTool).setUnlocalizedName("ss.brass_sword").setTextureName("sextiarysector:tool/brass_sword").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(brassSword, "BrassSword"); + brassHoe = new ItemHoe(ModuleToolMaterial.brassTool).setUnlocalizedName("ss.brass_hoe").setTextureName("sextiarysector:tool/brass_hoe").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(brassHoe, "BrassHoe"); + + // 繝九Φ繧ク繝」 + ninjaShovel = new ItemSpade(ModuleToolMaterial.ninjaTool).setUnlocalizedName("ss.ninja_shovel").setTextureName("sextiarysector:tool/ninja_shovel").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(ninjaShovel, "NinjaShovel"); + ninjaPickaxe = new ItemSSPickaxe(ModuleToolMaterial.ninjaTool).setUnlocalizedName("ss.ninja_pickaxe").setTextureName("sextiarysector:tool/ninja_pickaxe").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(ninjaPickaxe, "NinjaPickaxe"); + ninjaAxe = new ItemSSAxe(ModuleToolMaterial.ninjaTool).setUnlocalizedName("ss.ninja_axe").setTextureName("sextiarysector:tool/ninja_axe").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(ninjaAxe, "NinjaAxe"); + ninjaSword = new ItemSword(ModuleToolMaterial.ninjaTool).setUnlocalizedName("ss.ninja_sword").setTextureName("sextiarysector:tool/ninja_sword").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(ninjaSword, "NinjaSword"); + ninjaHoe = new ItemHoe(ModuleToolMaterial.ninjaTool).setUnlocalizedName("ss.ninja_hoe").setTextureName("sextiarysector:tool/ninja_hoe").setCreativeTab(SextiarySectorAPI.TabSSCore); + GameRegistry.registerItem(ninjaHoe, "NinjaHoe"); + + //Item i = Items.iron_axe; + + //髦イ蜈キ + // 驫 + copperHelmet = new ItemSSArmor(ModuleToolMaterial.copperArmor, 0, 0).setUnlocalizedName("ss.copper_helmet").setTextureName("sextiarysector:armor/copper_helmet"); + GameRegistry.registerItem(copperHelmet, "CopperHelmet"); + copperChestplate = new ItemSSArmor(ModuleToolMaterial.copperArmor, 0, 1).setUnlocalizedName("ss.copper_chestplate").setTextureName("sextiarysector:armor/copper_chestplate"); + GameRegistry.registerItem(copperChestplate, "CopperChestplate"); + copperLeggings = new ItemSSArmor(ModuleToolMaterial.copperArmor, 0, 2).setUnlocalizedName("ss.copper_leggings").setTextureName("sextiarysector:armor/copper_leggings"); + GameRegistry.registerItem(copperLeggings, "CopperLeggings"); + copperBoots = new ItemSSArmor(ModuleToolMaterial.copperArmor, 0, 3).setUnlocalizedName("ss.copper_boots").setTextureName("sextiarysector:armor/copper_boots"); + GameRegistry.registerItem(copperBoots, "CopperBoots"); + + // 繝九Φ繧ク繝」 + ninjaHelmet = new ItemSSArmor(ModuleToolMaterial.ninjaArmor, 0, 0).setUnlocalizedName("ss.ninja_helmet").setTextureName("sextiarysector:armor/ninja_helmet"); + GameRegistry.registerItem(ninjaHelmet, "NinjaHelmet"); + ninjaChestplate = new ItemSSArmor(ModuleToolMaterial.ninjaArmor, 0, 1).setUnlocalizedName("ss.ninja_chestplate").setTextureName("sextiarysector:armor/ninja_chestplate"); + GameRegistry.registerItem(ninjaChestplate, "NinjaChestplate"); + ninjaLeggings = new ItemSSArmor(ModuleToolMaterial.ninjaArmor, 0, 2).setUnlocalizedName("ss.ninja_leggings").setTextureName("sextiarysector:armor/ninja_leggings"); + GameRegistry.registerItem(ninjaLeggings, "NinjaLeggings"); + ninjaBoots = new ItemSSArmor(ModuleToolMaterial.ninjaArmor, 0, 3).setUnlocalizedName("ss.ninja_boots").setTextureName("sextiarysector:armor/ninja_boots"); + GameRegistry.registerItem(ninjaBoots, "NinjaBoots"); + + //豌エ繧繧 woodWateringCan = new ItemWateringCan(ToolMaterial.WOOD).setUnlocalizedName("ss.wood_watering_can").setTextureName("wood_watering_can"); GameRegistry.registerItem(woodWateringCan, "WoodWateringCan"); - turnip = new ItemCrop(3, 1, 1, 4, 0, 0, false).setUnlocalizedName("ss.turnip").setTextureName("sextiarysector:crop/turnip"); + brassShears = new ItemSSShears(ModuleToolMaterial.brassTool).setUnlocalizedName("ss.brass_shears").setTextureName("sextiarysector:tool/brass_shears"); + GameRegistry.registerItem(brassShears, "BrassShears"); + + //豌エ逕」 + mineboatChest = new ItemMineboat().setUnlocalizedName("ss.mineboat_chest").setTextureName("sextiarysector:mineboat_chest"); + GameRegistry.registerItem(mineboatChest, "MineboatChest"); + + mineboatTank = new ItemMineboatTank().setUnlocalizedName("ss.mineboat_tank").setTextureName("sextiarysector:mineboat_tank"); + GameRegistry.registerItem(mineboatTank, "MineboatTank"); + + laver = new Item().setUnlocalizedName("ss.laver").setTextureName("sextiarysector:food/fish/laver").setCreativeTab(SextiarySectorAPI.TabSSFishery); + GameRegistry.registerItem(laver, "Laver"); + + //驥手除 + turnip = new ItemFoodCrop(farmlandCrops, 3, 1, 1, 4, 0, 0, false).setUnlocalizedName("ss.turnip").setTextureName("sextiarysector:food/vegetable/turnip"); GameRegistry.registerItem(turnip, "Turnip"); - cucumber = new ItemCrop(1, 1, 3, 4, 0, 2, false).setUnlocalizedName("ss.cucumber").setTextureName("sextiarysector:crop/cucumber"); + cucumber = new ItemFoodCrop(farmlandCrops, 1, 1, 3, 4, 0, 2, false).setUnlocalizedName("ss.cucumber").setTextureName("sextiarysector:food/vegetable/cucumber"); GameRegistry.registerItem(cucumber, "Cucumber"); - ironTurnip = new ItemCrop(0, 1, 0, 0, 0, 0, false).setUnlocalizedName("ss.iron_turnip").setTextureName("sextiarysector:crop/iron_turnip"); + ironTurnip = new ItemFoodCrop(farmlandCrops, 0, 1, 0, 0, 0, 0, false).setUnlocalizedName("ss.iron_turnip").setTextureName("sextiarysector:food/vegetable/iron_turnip"); GameRegistry.registerItem(ironTurnip, "IronTurnip"); - - onion = new ItemCrop(2, 1, 1, 0, 0, 0, false).setUnlocalizedName("ss.onion").setTextureName("sextiarysector:crop/onion"); + onion = new ItemFoodCrop(farmlandCrops, 2, 1, 1, 0, 0, 0, false).setUnlocalizedName("ss.onion").setTextureName("sextiarysector:food/vegetable/onion"); GameRegistry.registerItem(onion, "Onion"); - tomato = new ItemCrop(1, 1, 4, 5, 0, 0, false).setUnlocalizedName("ss.tomato").setTextureName("sextiarysector:crop/tomato"); + tomato = new ItemFoodCrop(farmlandCrops, 1, 1, 4, 5, 0, 0, false).setUnlocalizedName("ss.tomato").setTextureName("sextiarysector:food/vegetable/tomato"); GameRegistry.registerItem(tomato, "Tomato"); - corn = new ItemCrop(0, 1, 1, 6, 4, 2, false).setUnlocalizedName("ss.corn").setTextureName("sextiarysector:crop/corn"); + corn = new ItemFoodCrop(farmlandCrops, 0, 1, 1, 6, 4, 2, false).setUnlocalizedName("ss.corn").setTextureName("sextiarysector:food/vegetable/corn"); GameRegistry.registerItem(corn, "corn"); - goldenCorn = new ItemCrop(0, 2, 0, 0, 0, 0, false).setUnlocalizedName("ss.golden_corn").setTextureName("sextiarysector:crop/golden_corn"); + goldenCorn = new ItemFoodCrop(farmlandCrops, 0, 2, 0, 0, 0, 0, false).setUnlocalizedName("ss.golden_corn").setTextureName("sextiarysector:food/vegetable/golden_corn"); GameRegistry.registerItem(goldenCorn, "GoldCorn"); - - eggplant = new ItemCrop(1, 1, 4, 2, 0, 0, false).setUnlocalizedName("ss.eggplant").setTextureName("sextiarysector:crop/eggplant"); + eggplant = new ItemFoodCrop(farmlandCrops, 1, 1, 4, 2, 0, 0, false).setUnlocalizedName("ss.eggplant").setTextureName("sextiarysector:food/vegetable/eggplant"); GameRegistry.registerItem(eggplant, "Eggplant"); - sweetPotato = new ItemCrop(4, 1, 0, 0, 6, 0, false).setUnlocalizedName("ss.sweet_potato").setTextureName("sextiarysector:crop/sweet_potato"); + sweetPotato = new ItemFoodCrop(farmlandCrops, 4, 1, 0, 0, 6, 0, false).setUnlocalizedName("ss.sweet_potato").setTextureName("sextiarysector:food/vegetable/sweet_potato"); GameRegistry.registerItem(sweetPotato, "SweetPotato"); - greenPepper = new ItemCrop(2, 1, 2, 1, 0, 0, false).setUnlocalizedName("ss.green_pepper").setTextureName("sextiarysector:crop/green_pepper"); + greenPepper = new ItemFoodCrop(farmlandCrops, 2, 1, 2, 1, 0, 0, false).setUnlocalizedName("ss.green_pepper").setTextureName("sextiarysector:food/vegetable/green_pepper"); GameRegistry.registerItem(greenPepper, "GreenPepper"); + bluePotato = new ItemFoodCrop(paddyCrops, 1, 0, 5, 8, 2, 0, false).setUnlocalizedName("ss.blue_potato").setTextureName("sextiarysector:food/vegetable/blue_potato"); + GameRegistry.registerItem(bluePotato, "BluePotato"); - radish = new ItemCrop(3, 1, 2, 1, 0, 0, false).setUnlocalizedName("ss.radish").setTextureName("sextiarysector:crop/radish"); + radish = new ItemFoodCrop(farmlandCrops, 3, 1, 2, 1, 0, 0, false).setUnlocalizedName("ss.radish").setTextureName("sextiarysector:food/vegetable/radish"); GameRegistry.registerItem(radish, "Radish"); + rice = new ItemCrop(paddyCrops).setUnlocalizedName("ss.rice").setTextureName("sextiarysector:food/grain/rice").setCreativeTab(SextiarySectorAPI.TabSSAgriculture); + GameRegistry.registerItem(rice, "Rice"); + + shiitake = new ItemFoodCrop(woodCrops, 2, 1, 0, 0, 2, 0, false).setUnlocalizedName("ss.shiitake").setTextureName("sextiarysector:food/mushroom/shiitake"); + GameRegistry.registerItem(shiitake, "Shiitake"); + + //縺輔°縺ェ + squidSashimi = new ItemFoodDrink(2, 1.2f, 0, 0.4f, 0, 0, false).setUnlocalizedName("ss.squid_sashimi").setTextureName("sextiarysector:food/fish/squid_sashimi").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(squidSashimi, "SquidSashimi"); + + //譁咏炊 + whiteRice = new Item().setUnlocalizedName("ss.white_rice").setTextureName("sextiarysector:food/grain/white_rice").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(whiteRice, "WhiteRice"); + + salt = new Item().setUnlocalizedName("ss.salt").setTextureName("sextiarysector:food/condiment/salt").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(salt, "Salt"); + + curryPowder = new Item().setUnlocalizedName("ss.curry_powder").setTextureName("sextiarysector:food/condiment/curry_powder").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(curryPowder, "CurryPowder"); + + laverRoasted = new ItemFoodDrink(3, 1.2f, 0, 0, 2, 0, false).setUnlocalizedName("ss.laver_roasted").setTextureName("sextiarysector:food/fish/laver_roasted").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(laverRoasted, "LaverRoasted"); + + chickenSmoked = new ItemFoodDrink(2, 4.6f, 0, 0, 4, 2.0f, false).setUnlocalizedName("ss.chicken_smoked").setTextureName("sextiarysector:food/meat/chicken_smoked").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(chickenSmoked, "ChickenSmoked"); + + porkchopSmoked = new ItemFoodDrink(3, 7.6f, 0, 0, 4, 2.0f, false).setUnlocalizedName("ss.porkchop_smoked").setTextureName("sextiarysector:food/meat/porkchop_smoked").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(porkchopSmoked, "PorkchopSmoked"); + + beefSmoked = new ItemFoodDrink(3, 7.6f, 0, 0, 4, 2.0f, false).setUnlocalizedName("ss.beef_smoked").setTextureName("sextiarysector:food/meat/beef_smoked").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(beefSmoked, "BeefSmoked"); + + riceBall = new ItemFoodDrink(4, 0.6f, 0, 0, 4, 6.0f, false).setUnlocalizedName("ss.rice_ball").setTextureName("sextiarysector:food/rice/rice_ball").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(riceBall, "RiceBall"); + + curryRice = new ItemFoodDrink(9, 12.6f, 0, 0, 15, 2.0f, false).setUnlocalizedName("ss.curry_rice").setTextureName("sextiarysector:food/rice/curry_rice").setContainerItem(Items.bowl).setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(curryRice, "CurryRice"); + + carrotSoup = new ItemSoup(2, 0.6f, 4, 1, 0, 0.0f, false).setUnlocalizedName("ss.carrot_soup").setTextureName("sextiarysector:food/soup/carrot_soup"); + GameRegistry.registerItem(carrotSoup, "CarrotSoup"); + + cornSoup = new ItemSoup(1, 0.6f, 5, 1, 0, 0.0f, false).setUnlocalizedName("ss.corn_soup").setTextureName("sextiarysector:food/soup/corn_soup"); + GameRegistry.registerItem(cornSoup, "CornSoup"); + + eggSoup = new ItemSoup(3, 0.6f, 4, 2, 0, 0.0f, false).setUnlocalizedName("ss.egg_soup").setTextureName("sextiarysector:food/soup/egg_soup"); + GameRegistry.registerItem(eggSoup, "EggSoup"); + + onionSoup = new ItemSoup(1, 0.6f, 5, 1, 0, 0.0f, false).setUnlocalizedName("ss.onion_soup").setTextureName("sextiarysector:food/soup/onion_soup"); + GameRegistry.registerItem(onionSoup, "OnionSoup"); + + enderSoup = new ItemSoup(0, 0.6f, 4, 1, 20, 0.0f, false).setUnlocalizedName("ss.ender_soup").setTextureName("sextiarysector:food/soup/ender_soup"); + GameRegistry.registerItem(enderSoup, "EnderSoup"); + + tomatoSoup = new ItemSoup(1, 0.6f, 3, 4.0f, 0, 0.0f, false).setUnlocalizedName("ss.tomato_soup").setTextureName("sextiarysector:food/soup/tomato_soup"); + GameRegistry.registerItem(tomatoSoup, "TomatoSoup"); + + chocolate = new ItemFoodDrink(2, 1.2f, 0, 0, 6, 4.0f, false).setUnlocalizedName("ss.chocolate").setTextureName("sextiarysector:food/dessert/chocolate").setCreativeTab(SextiarySectorAPI.TabSSCooking); + GameRegistry.registerItem(chocolate, "Chocolate"); + + //鬟イ縺ソ迚ゥ + drinkingWaterBottle = new ItemDrink(0, 2.5f, 5, 7.8f, 0, 0, false).setUnlocalizedName("ss.drinking_water_bottle").setTextureName("sextiarysector:fluid/drinking_water_bottle"); + GameRegistry.registerItem(drinkingWaterBottle, "DrinkingWaterBottle"); + + takumiTeaBottle = new ItemDrink(0, 0.0f, 6, 9.5f, 0, 0, false).setUnlocalizedName("ss.takumi_tea_bottle").setTextureName("sextiarysector:fluid/takumi_tea_bottle"); + GameRegistry.registerItem(takumiTeaBottle, "TAKUMITeaBottle"); + + //陬蛯 shiftHat = new ItemShiftHat().setUnlocalizedName("ss.shift_hat").setTextureName("sextiarysector:shift_hat"); GameRegistry.registerItem(shiftHat, "ShiftHat"); + rucksack = new ItemRucksack().setUnlocalizedName("ss.rucksack").setTextureName("sextiarysector:rucksack"); + GameRegistry.registerItem(rucksack, "Rucksack"); + + oxygenTank = new ItemOxygenTank().setUnlocalizedName("ss.oxygen_tank").setTextureName("sextiarysector:oxygen_tank").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(oxygenTank, "OxygenTank"); + + gfContactLenses = new ItemGFContactLenses().setUnlocalizedName("ss.gf_contact_lenses").setTextureName("sextiarysector:face/gf_contact_lenses"); + GameRegistry.registerItem(gfContactLenses, "GFContactLenses"); + + waterContactLenses = new ItemContactLenses().setUnlocalizedName("ss.water_contact_lenses").setTextureName("sextiarysector:face/water_contact_lenses"); + GameRegistry.registerItem(waterContactLenses, "WaterContactLenses"); + + //Unit + craftUnit = new ItemGuiUnit(201).setUnlocalizedName("ss.craft_unit").setTextureName("sextiarysector:unit/craft_unit").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(craftUnit, "CraftUnit"); + + attackUnit = new ItemUnit().setUnlocalizedName("ss.attack_unit").setTextureName("sextiarysector:unit/attack_unit").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(attackUnit, "AttackUnit"); + + defenseUnit = new ItemUnit().setUnlocalizedName("ss.defense_unit").setTextureName("sextiarysector:unit/defense_unit").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(defenseUnit, "DefenseUnit"); + + attackRustUnit = new ItemUnit().setUnlocalizedName("ss.attack_rust_unit").setTextureName("sextiarysector:unit/attack_rust_unit").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(attackRustUnit, "AttackRustUnit"); + + defenseRustUnit = new ItemUnit().setUnlocalizedName("ss.defense_rust_unit").setTextureName("sextiarysector:unit/defense_rust_unit").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(defenseRustUnit, "DefenseRustUnit"); + + jumpUnit = new ItemUnit().setUnlocalizedName("ss.jump_unit").setTextureName("sextiarysector:unit/jump_unit").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(jumpUnit, "JumpUnit"); + + //bedMonsterUnit = new ItemUnit().setUnlocalizedName("ss.bed_monster_unit").setTextureName("sextiarysector:unit/bed_monster_unit").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + //GameRegistry.registerItem(bedMonsterUnit, "BedMonsterUnit"); + + pickaxeUnit = new ItemUnit().setUnlocalizedName("ss.pickaxe_unit").setTextureName("sextiarysector:unit/pickaxe_unit").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(pickaxeUnit, "PickaxeUnit"); + + debugUnit = new ItemUnit().setUnlocalizedName("ss.debug_unit").setTextureName("sextiarysector:unit/debug_unit").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(debugUnit, "DebugUnit"); + + //Ring + ironRing = new Item().setUnlocalizedName("ss.iron_ring").setTextureName("sextiarysector:ring/iron_ring").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(ironRing, "IronRing"); + + creeperRing = new ItemShopRing().setUnlocalizedName("ss.creeper_ring").setTextureName("sextiarysector:ring/creeper_ring"); + GameRegistry.registerItem(creeperRing, "CreeperRing"); + + mpRing = new ItemProtectionRing().setUnlocalizedName("ss.mp_ring").setTextureName("sextiarysector:ring/mp_ring").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(mpRing, "MPRing"); + + xpRing = new ItemProtectionRing().setUnlocalizedName("ss.xp_ring").setTextureName("sextiarysector:ring/xp_ring").setCreativeTab(SextiarySectorAPI.TabSSPlayer); + GameRegistry.registerItem(xpRing, "XPRing"); + } } diff --git a/src/main/java/shift/sextiarysector/SSMaterials.java b/src/main/java/shift/sextiarysector/SSMaterials.java new file mode 100644 index 0000000..4ea9df4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/SSMaterials.java @@ -0,0 +1,18 @@ +package shift.sextiarysector; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; + +public class SSMaterials extends Material { + + public SSMaterials(MapColor p_i2116_1_) { + super(p_i2116_1_); + } + + public static Material machine; + + public static void preInitMaterial() { + machine = (new SSMaterials(MapColor.ironColor)).setRequiresTool(); + } + +} diff --git a/src/main/java/shift/sextiarysector/SSOreDictionary.java b/src/main/java/shift/sextiarysector/SSOreDictionary.java index b664e5e..b8b7b01 100644 --- a/src/main/java/shift/sextiarysector/SSOreDictionary.java +++ b/src/main/java/shift/sextiarysector/SSOreDictionary.java @@ -1,13 +1,207 @@ package shift.sextiarysector; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.oredict.OreDictionary; public class SSOreDictionary { - public static void init(){ + public static void init() { - OreDictionary.registerOre("craftingSugar", Items.sugar); + OreDictionary.registerOre("condimentSugar", Items.sugar); + + OreDictionary.registerOre("eggChicken", Items.egg); + OreDictionary.registerOre("cookingEgg", Items.egg); + + OreDictionary.registerOre("cropRedMushroom", Blocks.brown_mushroom); + OreDictionary.registerOre("cropBrownMushroom", Blocks.brown_mushroom); + OreDictionary.registerOre("cookingMushroom", Blocks.red_mushroom); + OreDictionary.registerOre("cookingMushroom", Blocks.brown_mushroom); + + OreDictionary.registerOre("cookingVegetable", Items.potato); + OreDictionary.registerOre("cookingVegetable", Items.carrot); + + OreDictionary.registerOre("condimentCocoa", new ItemStack(Items.dye, 1, 3)); + + OreDictionary.registerOre("containerWoodBowl", Items.bowl); + OreDictionary.registerOre("containerBucket", Items.bucket); + OreDictionary.registerOre("containerBottle", Items.glass_bottle); + + OreDictionary.registerOre("dustRedstone", Items.redstone); + + OreDictionary.registerOre("craftingString", new ItemStack(Items.string, 1, 0)); + + for (int i = 0; i < 16; i++) { + OreDictionary.registerOre("blockWool", new ItemStack(Blocks.wool, 1, i)); + } + + OreDictionary.registerOre("fluidWater", Items.water_bucket); + OreDictionary.registerOre("fluidWater", new ItemStack(Items.potionitem, 1, 0)); + + OreDictionary.registerOre("craftingMagic", Items.nether_star); + + //邏譚 繝励Ξ繝シ繝 + OreDictionary.registerOre("plateWood", SSBlocks.woodOakPlate); + OreDictionary.registerOre("plateWood", SSBlocks.woodBirchPlate); + OreDictionary.registerOre("plateWood", SSBlocks.woodSprucePlate); + OreDictionary.registerOre("plateWood", SSBlocks.woodJunglePlate); + OreDictionary.registerOre("plateWood", SSBlocks.woodAcaciaPlate); + OreDictionary.registerOre("plateWood", SSBlocks.woodBigOakPlate); + + OreDictionary.registerOre("plateIron", SSBlocks.ironPlate); + OreDictionary.registerOre("plateGold", SSBlocks.goldPlate); + + OreDictionary.registerOre("plateCopper", SSBlocks.copperPlate); + OreDictionary.registerOre("plateZinc", SSBlocks.zincPlate); + OreDictionary.registerOre("plateSilver", SSBlocks.silverPlate); + + /* + OreDictionary.registerOre("plankWood", SSBlocks.woodOakPlate); + OreDictionary.registerOre("plankWood", SSBlocks.woodBirchPlate); + OreDictionary.registerOre("plankWood", SSBlocks.woodSprucePlate); + OreDictionary.registerOre("plankWood", SSBlocks.woodJunglePlate); + OreDictionary.registerOre("plankWood", SSBlocks.woodAcaciaPlate); + OreDictionary.registerOre("plankWood", SSBlocks.woodBigOakPlate); + */ + + OreDictionary.registerOre("gearWood", SSItems.woodGear); + OreDictionary.registerOre("gearStone", SSItems.stoneGear); + OreDictionary.registerOre("gearSteel", SSItems.steelGear); + OreDictionary.registerOre("gearNinja", SSItems.ninjaGear); + OreDictionary.registerOre("gearOrichalcum", SSItems.orichalcumGear); + + OreDictionary.registerOre("dustCoal", SSItems.coalDust); + OreDictionary.registerOre("dustIron", SSItems.ironDust); + OreDictionary.registerOre("dustGold", SSItems.goldDust); + OreDictionary.registerOre("dustDiamond", SSItems.diamondDust); + OreDictionary.registerOre("dustCopper", SSItems.copperDust); + OreDictionary.registerOre("dustZinc", SSItems.zincDust); + OreDictionary.registerOre("dustSilver", SSItems.silverDust); + OreDictionary.registerOre("dustMithril", SSItems.mithrilDust); + OreDictionary.registerOre("dustBluestone", SSItems.blueStoneDust); + OreDictionary.registerOre("dustYellowstone", SSItems.yellowStoneDust); + + OreDictionary.registerOre("nuggetIron", SSItems.ironNugget); + OreDictionary.registerOre("nuggetCopper", SSItems.copperNugget); + OreDictionary.registerOre("nuggetZinc", SSItems.zincNugget); + OreDictionary.registerOre("nuggetSilver", SSItems.silverNugget); + + OreDictionary.registerOre("nuggetSteel", SSItems.steelNugget); + OreDictionary.registerOre("nuggetNinja", SSItems.ninjaNugget); + + OreDictionary.registerOre("nuggetObsidian", SSItems.obsidianNugget); + + OreDictionary.registerOre("ingotSteel", SSItems.steelIngot); + OreDictionary.registerOre("ingotBrass", SSItems.brassIngot); + OreDictionary.registerOre("ingotBluestone", SSItems.blueStoneIngot); + OreDictionary.registerOre("ingotYellowstone", SSItems.yellowStoneIngot); + OreDictionary.registerOre("ingotNinja", SSItems.ninjaIngot); + OreDictionary.registerOre("ingotCopper", SSItems.copperIngot); + OreDictionary.registerOre("ingotZinc", SSItems.zincIngot); + OreDictionary.registerOre("ingotSilver", SSItems.silverIngot); + OreDictionary.registerOre("ingotMithril", SSItems.mithrilIngot); + + OreDictionary.registerOre("gemOrichalcum", SSItems.orichalcumGem); + + OreDictionary.registerOre("blockCopper", SSBlocks.copperBlock); + OreDictionary.registerOre("blockZinc", SSBlocks.zincBlock); + OreDictionary.registerOre("blockSilver", SSBlocks.silverBlock); + OreDictionary.registerOre("blockSteel", SSBlocks.steelBlock); + OreDictionary.registerOre("blockBrass", SSBlocks.brassBlock); + OreDictionary.registerOre("blockNinja", SSBlocks.ninjaBlock); + OreDictionary.registerOre("blockMithril", SSBlocks.mithrilBlock); + OreDictionary.registerOre("blockOrichalcum", SSBlocks.orichalcumBlock); + + OreDictionary.registerOre("oreCopper", SSBlocks.copperOre); + OreDictionary.registerOre("oreZinc", SSBlocks.zincOre); + OreDictionary.registerOre("oreSilver", SSBlocks.silverOre); + + OreDictionary.registerOre("oreMithril", SSBlocks.mithrilOre); + + OreDictionary.registerOre("oreIron", SSItems.ironTurnip); + OreDictionary.registerOre("oreGold", SSItems.goldenCorn); + + OreDictionary.registerOre("gelRedstone", SSItems.redGel); + OreDictionary.registerOre("gelBluestone", SSItems.blueGel); + OreDictionary.registerOre("gelYellowstone", SSItems.yellowGel); + + OreDictionary.registerOre("ringIron", SSItems.ironRing); + + OreDictionary.registerOre("treeLeaves", SSBlocks.leafBlock); + + //蟶 + OreDictionary.registerOre("massString", SSItems.stringMass); + OreDictionary.registerOre("blockWool", SSItems.stringMass); + + OreDictionary.registerOre("clothSilk", SSItems.silkCloth); + OreDictionary.registerOre("itemCloth", SSItems.silkCloth); + OreDictionary.registerOre("blockWool", SSItems.silkCloth); + //OreDictionary.registerOre("craftingFilterCloth", SSItems.silkCloth); + + //OreDictionary.registerOre("craftingSmallCloth", SSItems.smallCloth); + //OreDictionary.registerOre("craftingFilterCloth", SSItems.smallCloth); + + //豸イ菴 + OreDictionary.registerOre("fluidIron", new ItemStack(SSBlocks.fluidCrafter, 1, SSFluids.iron.getID())); + OreDictionary.registerOre("fluidGold", new ItemStack(SSBlocks.fluidCrafter, 1, SSFluids.gold.getID())); + + OreDictionary.registerOre("fluidIron", new ItemStack(SSItems.ironFluidBucket)); + OreDictionary.registerOre("fluidGold", new ItemStack(SSItems.goldFluidBucket)); + + Item[] Knife = new Item[] { SSItems.woodKnife, SSItems.stoneKnife, SSItems.ironKnife, SSItems.goldKnife, SSItems.diamondKnife }; + for (int i = 0; i < Knife.length; i++) { + OreDictionary.registerOre("craftingToolWireCutter", new ItemStack(Knife[i], 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("craftingToolKnife", new ItemStack(Knife[i], 1, OreDictionary.WILDCARD_VALUE)); + } + + OreDictionary.registerOre("fluidSap", new ItemStack(SSItems.sapBottle)); + OreDictionary.registerOre("fluidSap", new ItemStack(SSBlocks.fluidCrafter, 1, SSFluids.sap.getID())); + + OreDictionary.registerOre("slimeball", new ItemStack(SSItems.sapBottle)); + OreDictionary.registerOre("slimeball", new ItemStack(SSBlocks.fluidCrafter, 1, SSFluids.sap.getID())); + + OreDictionary.registerOre("containerBottle", new ItemStack(SSItems.emptyBottle)); + + //鬟溘∋迚ゥ + + OreDictionary.registerOre("condimentCurryPowder", SSItems.curryPowder); + OreDictionary.registerOre("condimentSalt", SSItems.salt); + //OreDictionary.registerOre("salt", SSItems.salt); + //OreDictionary.registerOre("itemSalt", SSItems.salt); + + OreDictionary.registerOre("algaLaver", SSItems.laver); + OreDictionary.registerOre("cookingLaver", SSItems.laverRoasted); + + OreDictionary.registerOre("cropTurnip", SSItems.turnip); + OreDictionary.registerOre("cookingVegetable", SSItems.turnip); + OreDictionary.registerOre("cropCucumber", SSItems.cucumber); + OreDictionary.registerOre("cookingVegetable", SSItems.cucumber); + + OreDictionary.registerOre("cropOnion", SSItems.onion); + OreDictionary.registerOre("cookingVegetable", SSItems.onion); + OreDictionary.registerOre("cropTomato", SSItems.tomato); + OreDictionary.registerOre("cookingVegetable", SSItems.tomato); + OreDictionary.registerOre("cropCorn", SSItems.corn); + + OreDictionary.registerOre("cropEggplant", SSItems.eggplant); + OreDictionary.registerOre("cookingVegetable", SSItems.eggplant); + OreDictionary.registerOre("cropSweetPotato", SSItems.sweetPotato); + OreDictionary.registerOre("cropGreenPepper", SSItems.greenPepper); + OreDictionary.registerOre("cookingVegetable", SSItems.greenPepper); + + OreDictionary.registerOre("cropRadish", SSItems.radish); + OreDictionary.registerOre("cookingVegetable", SSItems.radish); + + OreDictionary.registerOre("cropRice", SSItems.rice); + + OreDictionary.registerOre("cookingRice", SSItems.whiteRice); + + //鬟イ縺ソ迚ゥ + OreDictionary.registerOre("fluidWater", new ItemStack(SSBlocks.fluidCrafter, 1, FluidRegistry.WATER.getID())); + OreDictionary.registerOre("fluidSteam", new ItemStack(SSItems.steamBucket)); } diff --git a/src/main/java/shift/sextiarysector/SSPlayerTabs.java b/src/main/java/shift/sextiarysector/SSPlayerTabs.java new file mode 100644 index 0000000..60aca78 --- /dev/null +++ b/src/main/java/shift/sextiarysector/SSPlayerTabs.java @@ -0,0 +1,38 @@ +package shift.sextiarysector; + +import net.minecraft.item.ItemStack; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.gui.tab.AbstractTab; +import shift.sextiarysector.gui.tab.InventoryTabEquipment; +import shift.sextiarysector.gui.tab.InventoryTabSS; +import shift.sextiarysector.gui.tab.TabManager; +import shift.sextiarysector.item.ItemShopRing; + +public class SSPlayerTabs { + + public static AbstractTab ss; + + public static AbstractTab craft; + + public static AbstractTab rucksack; + + public static AbstractTab creeperShop; + + public static void initRecipes() { + + ss = new InventoryTabSS(); + TabManager.registerTab(ss); + + craft = new InventoryTabEquipment(EquipmentType.Unit, new ItemStack(SSItems.craftUnit)); + TabManager.registerTab(craft); + + rucksack = new InventoryTabEquipment(EquipmentType.Bag, new ItemStack(SSItems.rucksack)); + TabManager.registerTab(rucksack); + + creeperShop = new InventoryTabEquipment(EquipmentType.Other, new ItemStack(SSItems.creeperRing)); + TabManager.registerTab(creeperShop); + ((ItemShopRing) SSItems.creeperRing).setTab(creeperShop); + + } + +} diff --git a/src/main/java/shift/sextiarysector/SSPotions.java b/src/main/java/shift/sextiarysector/SSPotions.java new file mode 100644 index 0000000..ece4e35 --- /dev/null +++ b/src/main/java/shift/sextiarysector/SSPotions.java @@ -0,0 +1,17 @@ +package shift.sextiarysector; + +import net.minecraft.potion.Potion; +import shift.sextiarysector.api.potion.PotionBurn; +import shift.sextiarysector.api.potion.PotionHotSprings; + +public class SSPotions { + + public static Potion burn; + public static Potion hotSprings; + + public static void initPotions() { + burn = new PotionBurn(Config.burn, true, 0xd60330, 0).setPotionName("ss.potion.burn"); + hotSprings = new PotionHotSprings(Config.hotSprings, false, 0x0349d6, 3).setPotionName("ss.potion.hot_springs"); + } + +} diff --git a/src/main/java/shift/sextiarysector/SSRecipes.java b/src/main/java/shift/sextiarysector/SSRecipes.java index f06106b..7c3dd99 100644 --- a/src/main/java/shift/sextiarysector/SSRecipes.java +++ b/src/main/java/shift/sextiarysector/SSRecipes.java @@ -1,47 +1,143 @@ package shift.sextiarysector; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.item.crafting.ShapelessRecipes; +import shift.sextiarysector.api.recipe.RecipeAPI; import shift.sextiarysector.recipe.FurnaceCraftingManager; +import shift.sextiarysector.recipe.RecipeSimpleFluid; +import shift.sextiarysector.recipe.RecipeSimpleFuel; import shift.sextiarysector.recipe.RecipeSimpleMachine; +import shift.sextiarysector.recipe.RecipesArmor; import shift.sextiarysector.recipe.RecipesCore; +import shift.sextiarysector.recipe.RecipesExtractor; +import shift.sextiarysector.recipe.RecipesFluidFurnace; +import shift.sextiarysector.recipe.RecipesFoodSmokers; +import shift.sextiarysector.recipe.RecipesFreezer; +import shift.sextiarysector.recipe.RecipesFurnace; import shift.sextiarysector.recipe.RecipesFurnaceCraft; +import shift.sextiarysector.recipe.RecipesIceFuel; import shift.sextiarysector.recipe.RecipesLoom; import shift.sextiarysector.recipe.RecipesMachine; +import shift.sextiarysector.recipe.RecipesMagicFuel; +import shift.sextiarysector.recipe.RecipesMagicFurnace; +import shift.sextiarysector.recipe.RecipesManaSqueezer; import shift.sextiarysector.recipe.RecipesMillstone; import shift.sextiarysector.recipe.RecipesNormalBlock; +import shift.sextiarysector.recipe.RecipesPulverizer; +import shift.sextiarysector.recipe.RecipesRollingMachine; +import shift.sextiarysector.recipe.RecipesSawmill; +import shift.sextiarysector.recipe.RecipesSpinningMachine; +import shift.sextiarysector.recipe.RecipesTimeMachine; import shift.sextiarysector.recipe.RecipesTool; +import shift.sextiarysector.recipe.RecipesVanilla; public class SSRecipes { - public static RecipeSimpleMachine millstone; - public static RecipeSimpleMachine loom; + public static RecipeSimpleFluid fluidFurnace; + public static RecipeSimpleFluid foodSmokers; + public static RecipeSimpleMachine magicFurnace; + public static RecipeSimpleMachine freezer; - public static void initRecipeLists(){ + public static RecipeSimpleFuel magicFuel; + public static RecipeSimpleFuel iceFuel; - millstone = new RecipeSimpleMachine(); - loom = new RecipeSimpleMachine(); + public static RecipeSimpleMachine millstone; + public static RecipeSimpleMachine loom; + public static RecipeSimpleMachine sawmill; + public static RecipeSimpleMachine spinning_machine; + public static RecipeSimpleFluid extractor; + public static RecipeSimpleMachine pulverizer; + public static RecipeSimpleMachine rollingMachine; + public static RecipeSimpleFluid manaSqueezer; + public static RecipeSimpleMachine timeMachine; + + public static void initRecipeLists() { + + fluidFurnace = new RecipeSimpleFluid(); + foodSmokers = new RecipeSimpleFluid(); + magicFurnace = new RecipeSimpleMachine(); + freezer = new RecipeSimpleMachine(); + + magicFuel = new RecipeSimpleFuel(); + iceFuel = new RecipeSimpleFuel(); + + RecipeAPI.millstone = millstone = new RecipeSimpleMachine(); + RecipeAPI.loom = loom = new RecipeSimpleMachine(); + RecipeAPI.sawmill = sawmill = new RecipeSimpleMachine(); + RecipeAPI.spinning_machine = spinning_machine = new RecipeSimpleMachine(); + RecipeAPI.extractor = extractor = new RecipeSimpleFluid(); + RecipeAPI.pulverizer = pulverizer = new RecipeSimpleMachine(); + RecipeAPI.rollingMachine = rollingMachine = new RecipeSimpleMachine(); + RecipeAPI.manaSqueezer = manaSqueezer = new RecipeSimpleFluid(); + RecipeAPI.timeMachine = timeMachine = new RecipeSimpleMachine(); } - public static void initRecipes(){ + public static void initRecipes() { CraftingManager m = CraftingManager.getInstance(); + RecipesFurnace.addRecipes(); + RecipesVanilla.addRecipes(m); RecipesNormalBlock.addRecipes(m); RecipesMachine.addRecipes(m); RecipesCore.addRecipes(m); RecipesTool.addRecipes(m); + RecipesArmor.addRecipes(m); FurnaceCraftingManager fm = FurnaceCraftingManager.getInstance(); RecipesFurnaceCraft.addRecipes(fm); - //Millstone + RecipesFluidFurnace.addRecipes(fluidFurnace); + RecipesFoodSmokers.addRecipes(foodSmokers); + + RecipesMagicFurnace.addRecipes(magicFurnace); + RecipesMagicFuel.addRecipes(magicFuel); + + RecipesFreezer.addRecipes(freezer); + RecipesIceFuel.addRecipes(iceFuel); + + //GF RecipesMillstone.addRecipes(millstone); RecipesLoom.addRecipes(loom); + RecipesSawmill.addRecipes(sawmill); + + RecipesSpinningMachine.addRecipes(spinning_machine); + + RecipesExtractor.addRecipes(extractor); + + RecipesPulverizer.addRecipes(pulverizer); + + RecipesRollingMachine.addRecipes(rollingMachine); + + RecipesManaSqueezer.addRecipes(manaSqueezer); + + RecipesTimeMachine.addRecipes(timeMachine); + } + public static void deleteVanillaRecipe() { + + CraftingManager m = CraftingManager.getInstance(); + ItemStack wool = new ItemStack(Blocks.wool); + + for (int i = 0; i < m.getRecipeList().size(); i++) { + + IRecipe re = (IRecipe) m.getRecipeList().get(i); + if (re != null && re.getRecipeOutput() != null && re.getRecipeOutput().isItemEqual(wool) && re instanceof ShapedRecipes && !(re instanceof ShapelessRecipes)) { + m.getRecipeList().remove(i); + return; + } + + } + + } } diff --git a/src/main/java/shift/sextiarysector/SSShops.java b/src/main/java/shift/sextiarysector/SSShops.java index 4e8ce21..8be80d5 100644 --- a/src/main/java/shift/sextiarysector/SSShops.java +++ b/src/main/java/shift/sextiarysector/SSShops.java @@ -1,67 +1,119 @@ package shift.sextiarysector; +import java.util.ArrayList; + import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; import shift.mceconomy2.api.MCEconomyAPI; +import shift.mceconomy2.api.shop.IProductItem; +import shift.mceconomy2.api.shop.IProductList; import shift.mceconomy2.api.shop.ProductItem; -import shift.mceconomy2.api.shop.ProductList; +import shift.sextiarysector.block.BlockMonitor; import shift.sextiarysector.block.BlockMonitor.MonitorType; +import shift.sextiarysector.item.ItemFigureBox; +import shift.sextiarysector.item.ItemShopRing; public class SSShops { - public static void initShops(){ + public static SSProductList[] creepers; + + public static void initShops() { - SSProductList[] creepers = new SSProductList[4]; + creepers = new SSProductList[4]; - for(int i = 0;i<4;i++){ + for (int i = 0; i < 4; i++) { creepers[i] = new SSProductList("shop.ss.creeper"); - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.blueStoneDust,2),320)); - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.yellowStoneDust,2),320)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.blueStoneDust, 2), 320)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.yellowStoneDust, 2), 320)); + + //creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.brassIngot, 2), 230)); + + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.takumiTeaBottle, 2), 216)); + + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.seasonStone, 1), 3000)); + + creepers[i].addItemProduct(new ProductItem(((ItemFigureBox) SSItems.figureBox).getEditionFigureBox("figure_beginner"), 300)); + creepers[i].addItemProduct(new ProductItem(((ItemFigureBox) SSItems.figureBox).getEditionFigureBox("ore_festival"), 500)); + + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.woodStoneGearShaft, 1, 0), 260)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.woodStoneGearShaft, 1, 1), 260)); + + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.gfContactLenses, 1), 300)); + + //creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.attackUnit, 1), 2400)); + //creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.defenseUnit, 1), 3600)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.craftUnit, 1), 5300)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.pickaxeUnit, 1), 6800)); - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.seasonStone,1),3000)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.wood, 1), 180)); - if(i==0){ - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.turnip,1),200)); - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.cucumber,1),380)); + if (i == 0) { + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.turnip, 8), 180)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.cucumber, 8), 360)); + + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.rice, 8), 280)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.shiitake, 8), 210)); + + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.mithrilIngot, 1), 1400)); } - if(i==1){ - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.onion,1),200)); - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.tomato,1),200)); - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.corn,1),800)); + if (i == 1) { + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.onion, 8), 180)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.tomato, 8), 190)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.corn, 8), 740)); + + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.magicDust, 4), 500)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.waterContactLenses, 1), 700)); } - if(i==2){ - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.eggplant,1),310)); - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.sweetPotato,1),120)); - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.greenPepper,1),340)); + if (i == 2) { + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.eggplant, 8), 290)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.sweetPotato, 8), 110)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.greenPepper, 8), 320)); + + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.fluidCrafter, 4, 0), 580)); + } - if(i==3){ - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.radish,1),180)); + if (i == 3) { + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSBlocks.radish, 8), 170)); - creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.stoneDust,4),500)); + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.stoneDust, 4), 500)); } + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.curryPowder, 4), 200)); + + creepers[i].addItemProduct(new ProductItem(new ItemStack(SSItems.orichalcumGem, 1), 9999)); + + creepers[i].addItemProduct(new ProductItem(BlockMonitor.getMonitor(MonitorType.creeper), 100000)); + } MonitorType.creeper.setList(creepers); - + //SSProductList[] creepersR = new SSProductList[4]; + //for (int i = 0; i < 4; i++) { + // creepersR[i] = creepers[i].copySSProductList(); + //} + //((ItemShopRing) SSItems.creeperRing).setList(creepersR); + ((ItemShopRing) SSItems.creeperRing).setList(creepers); SSProductList robot = new SSProductList("shop.ss.robot"); MonitorType.robot.setList(robot); - robot.addItemProduct(new ProductItem(new ItemStack(Blocks.chest,1),250)); + robot.addItemProduct(new ProductItem(new ItemStack(Blocks.lava, 1), 250)); } - public static class SSProductList extends ProductList{ + public static class SSProductList implements IProductList { + public ArrayList productItemList = new ArrayList(); String name; public int id; - public SSProductList(String name){ + public SSProductList(String name) { this.name = name; this.id = MCEconomyAPI.registerProductList(this); } @@ -71,41 +123,72 @@ public String getProductListName() { return this.name; } + public SSProductList copySSProductList() { + + SSProductList c = new SSProductList(this.name); + c.productItemList = this.getProductList(); + + return c; + } + + @Override + public void addItemProduct(IProductItem item) { + productItemList.add(item); + } + + @Override + public int getItemProductSize() { + return productItemList.size(); + } + + @Override + public ArrayList getProductList() { + return productItemList; + } + } - public static void initPurchase(){ + public static void initPurchase() { + + MCEconomyAPI.addPurchaseItem(new ItemStack(Items.skull, 1, OreDictionary.WILDCARD_VALUE), 25); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.turnip), 280); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.cucumber), 350); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.turnip), 30); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.cucumber), 35); MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.ironTurnip), 300); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.turnip,1,1), 2800); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.cucumber,1,1), 3500); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.ironTurnip,1,1), 3000); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.turnip, 1, 1), 300); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.cucumber, 1, 1), 350); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.ironTurnip, 1, 1), 3000); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.onion), 320); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.tomato), 150); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.corn), 720); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.onion), 38); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.tomato), 16); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.corn), 84); MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.goldenCorn), 800); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.onion,1,1), 3200); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.tomato,1,1), 1500); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.corn,1,1), 7200); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.goldenCorn,1,1), 8000); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.onion, 1, 1), 380); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.tomato, 1, 1), 160); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.corn, 1, 1), 840); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.goldenCorn, 1, 1), 8000); + + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.eggplant), 32); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.sweetPotato), 20); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.greenPepper), 22); + + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.eggplant, 1, 1), 320); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.sweetPotato, 1, 1), 200); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.greenPepper, 1, 1), 220); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.radish), 24); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.eggplant), 210); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.sweetPotato), 120); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.greenPepper), 200); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.radish, 1, 1), 240); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.eggplant,1,1), 2100); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.sweetPotato,1,1), 1200); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.greenPepper,1,1), 2000); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.rice), 84); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.rice, 1, 1), 840); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.radish), 220); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.shiitake), 31); - MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.radish,1,1), 2200); + MCEconomyAPI.addPurchaseItem(new ItemStack(SSItems.shiitake, 1, 1), 310); } diff --git a/src/main/java/shift/sextiarysector/SSVillages.java b/src/main/java/shift/sextiarysector/SSVillages.java index b32b9ad..8400624 100644 --- a/src/main/java/shift/sextiarysector/SSVillages.java +++ b/src/main/java/shift/sextiarysector/SSVillages.java @@ -1,7 +1,9 @@ package shift.sextiarysector; import net.minecraft.world.gen.structure.MapGenStructureIO; +import shift.sextiarysector.world.village.ComponentWell; import shift.sextiarysector.world.village.ComponentWindmill; +import shift.sextiarysector.world.village.VillageCreationHandlerWell; import shift.sextiarysector.world.village.VillageCreationHandlerWindmill; import cpw.mods.fml.common.registry.VillagerRegistry; @@ -13,6 +15,10 @@ public static void initVillages(){ MapGenStructureIO.registerStructure(ComponentWindmill.class, "VISSSWM"); MapGenStructureIO.func_143031_a(ComponentWindmill.class, "VISSSWM"); + VillagerRegistry.instance().registerVillageCreationHandler(new VillageCreationHandlerWell()); + MapGenStructureIO.registerStructure(ComponentWell.class, "VISSSWE"); + MapGenStructureIO.func_143031_a(ComponentWell.class, "VISSSWE"); + } } diff --git a/src/main/java/shift/sextiarysector/SSWorld.java b/src/main/java/shift/sextiarysector/SSWorld.java new file mode 100644 index 0000000..bf07483 --- /dev/null +++ b/src/main/java/shift/sextiarysector/SSWorld.java @@ -0,0 +1,18 @@ +package shift.sextiarysector; + +import net.minecraft.world.biome.BiomeGenBase; +import cpw.mods.fml.common.event.FMLInitializationEvent; + +public class SSWorld { + + public static BiomeGenBase magicDesert; + + public static void init(FMLInitializationEvent event) { + + //magicDesert = (new BiomeGenMagicDesert(Config.magicDesert)).setColor(0xff0000).setBiomeName("MagicDesert"); + + //BiomeDictionary.registerBiomeType(magicDesert, HOT, DRY, SANDY ,MAGICAL ); + + } + +} diff --git a/src/main/java/shift/sextiarysector/SextiarySector.java b/src/main/java/shift/sextiarysector/SextiarySector.java index 2f1fdcb..b94b8aa 100644 --- a/src/main/java/shift/sextiarysector/SextiarySector.java +++ b/src/main/java/shift/sextiarysector/SextiarySector.java @@ -1,22 +1,27 @@ package shift.sextiarysector; - - import java.util.ArrayList; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import shift.mceconomy2.gui.HUDMP; import shift.sextiarysector.api.SextiarySectorAPI; -import shift.sextiarysector.api.machine.item.GearForceItem; +import shift.sextiarysector.api.gearforce.item.GearForceItemAPI; import shift.sextiarysector.item.GearForceItemManager; import shift.sextiarysector.module.IModule; -import shift.sextiarysector.module.ModuleAchievement; import shift.sextiarysector.module.ModuleAgriculture; +import shift.sextiarysector.module.ModuleChest; import shift.sextiarysector.module.ModuleChunkLoader; +import shift.sextiarysector.module.ModuleFigure; +import shift.sextiarysector.module.ModuleFishing; +import shift.sextiarysector.module.ModuleHotSprings; +import shift.sextiarysector.module.ModuleSandpit; import shift.sextiarysector.module.ModuleSeason; -import shift.sextiarysector.packet.PacketHandler; +import shift.sextiarysector.module.ModuleStatistics; +import shift.sextiarysector.module.ModuleToolMaterial; +import shift.sextiarysector.module.ModuleTrap; +import shift.sextiarysector.module.ModuleVanillaRecipe; +import shift.sextiarysector.packet.SSPacketHandler; import shift.sextiarysector.player.EntityPlayerManager; import shift.sextiarysector.plugin.SSPlugins; import shift.sextiarysector.proxy.CommonProxy; @@ -27,105 +32,140 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.common.registry.GameRegistry; -@Mod(modid = SextiarySectorAPI.MODID, version = SextiarySector.VERSION, dependencies = SextiarySector.DEPENDENCY) +@Mod(modid = SextiarySector.MODID, version = SextiarySector.VERSION, dependencies = SextiarySector.DEPENDENCY) public class SextiarySector { - //public static final String MODID = "SextiarySector"; - public static final String VERSION = "2.0.5"; + public static final String MODID = "SextiarySector"; + public static final String VERSION = "2.4.3"; - @Mod.Instance("SextiarySector") - public static SextiarySector instance; + @Mod.Instance("SextiarySector") + public static SextiarySector instance; - public static final String DEPENDENCY = "";//"required-after:mceconomy2"; + public static final String DEPENDENCY = "";//"required-after:mceconomy2"; - @SidedProxy(clientSide = "shift.sextiarysector.proxy.ClientProxy", serverSide = "shift.sextiarysector.proxy.CommonProxy") + @SidedProxy(modId = MODID, clientSide = "shift.sextiarysector.proxy.ClientProxy", serverSide = "shift.sextiarysector.proxy.CommonProxy") public static CommonProxy proxy; - public static final Logger Log = LogManager.getLogger(SextiarySectorAPI.MODID); + public static final Logger Log = LogManager.getLogger(SextiarySectorAPI.MODID); - public static final ArrayList modules = new ArrayList(); + public static final ArrayList modules = new ArrayList(); - @Mod.EventHandler + @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { - Log.info("PreInit"); + Log.info("PreInit"); - Config.ConfigRead(event); + Config.ConfigRead(event); - PacketHandler.init(event); + SSPacketHandler.init(event); - SextiarySector.proxy.setCustomRenderers(); + SextiarySector.proxy.setCustomRenderers(); - SSEvents.preInit(event); + SSEvents.preInit(event); - GearForceItem.manager = new GearForceItemManager(); + GearForceItemAPI.manager = new GearForceItemManager(); - //Module - modules.add(ModuleAchievement.getInstance()); - modules.add(ModuleChunkLoader.getInstance()); - modules.add(ModuleSeason.getInstance()); - modules.add(ModuleAgriculture.getInstance()); + //Module + modules.add(ModuleStatistics.getInstance()); + modules.add(ModuleChest.getInstance()); + modules.add(ModuleChunkLoader.getInstance()); + modules.add(ModuleSeason.getInstance()); + modules.add(ModuleAgriculture.getInstance()); + modules.add(ModuleTrap.getInstance()); + modules.add(ModuleSandpit.getInstance()); + modules.add(ModuleHotSprings.getInstance()); + modules.add(ModuleFigure.getInstance()); + modules.add(ModuleToolMaterial.getInstance()); + modules.add(ModuleVanillaRecipe.getInstance()); + modules.add(ModuleFishing.getInstance()); - SSRecipes.initRecipeLists(); + for (IModule m : modules) { + m.preInit(event); + } - SextiarySectorAPI.playerManager = EntityPlayerManager.instance; + SSRecipes.deleteVanillaRecipe(); + SSRecipes.initRecipeLists(); - SSCreativeTabs.initCreativeTabs(); - SSItems.initItems(); - SSBlocks.initBlicks(); + SextiarySectorAPI.playerManager = EntityPlayerManager.instance; - NetworkRegistry.INSTANCE.registerGuiHandler(this, new SSGuiHandler()); + SSCreativeTabs.initCreativeTabs(); + SSFluids.initFluids(); + SSPotions.initPotions(); + SSMaterials.preInitMaterial(); + SSItems.initItems(); + SSBlocks.initBlicks(); + SSEntitys.initEntity(); + GameRegistry.registerFuelHandler(new SSFuels()); - SSOreDictionary.init(); + NetworkRegistry.INSTANCE.registerGuiHandler(this, new SSGuiHandler()); - for(IModule m : modules){ - m.preInit(event); - } + SSOreDictionary.init(); - } + /* + GameRegistry.registerTileEntity(TileEmptyCauldron.class, "SSCauldron"); + Iterable> cc = new ArrayList(); + ((ArrayList) cc).add(ITileEntityProvider.class); + ExtendedClassSupport.loadAndGenerateNewExtendedClass(BlockCauldron.class, Block.class, BlockSSCauldron.class, ITileEntityProvider.class, cc); + */ + SSPlugins.initModHelper(); - @Mod.EventHandler - public void init(FMLInitializationEvent event) - { + proxy.setPluginCustomRenderers(event); + SSPlugins.prePlugins(event); - if(event.getSide().isClient()){ - HUDMP.left_height += 10; - } + SSAchievement.initAchievements(); + + SextiarySector.proxy.setItemCustomRenderers(); + + } - SSRecipes.initRecipes(); + @Mod.EventHandler + public void init(FMLInitializationEvent event) + { + + SSWorld.init(event); + //if (event.getSide().isClient()) { + // HUDMP.left_height += 10; + //} - for(IModule m : modules){ - m.load(event); - } + SSRecipes.initRecipes(); + + for (IModule m : modules) { + m.load(event); + } - SSVillages.initVillages(); + SSVillages.initVillages(); - SSPlugins.initModHelper(); + if (event.getSide().isClient()) SSPlayerTabs.initRecipes(); - SSPlugins.initPlugins(event); + //SSPlugins.initModHelper(); - } + SSPlugins.initPlugins(event); - @Mod.EventHandler - public void postInit(FMLPostInitializationEvent event) - { + //Blocks.leaves.setTickRandomly(true); - RecipesFurnaceCraft.addVanillaRecipes(); - SSShops.initShops(); - SSShops.initPurchase(); + } - for(IModule m : modules){ - m.postInit(event); - } + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent event) + { - SSPlugins.postPlugins(event); + SextiarySector.proxy.registerInventoryTabs(); + RecipesFurnaceCraft.addVanillaRecipes(); + SSFluids.postFluids(); + SSShops.initShops(); + SSShops.initPurchase(); - } + for (IModule m : modules) { + m.postInit(event); + } + SSPlugins.postPlugins(event); + } } diff --git a/src/main/java/shift/sextiarysector/achievement/AchievementBase.java b/src/main/java/shift/sextiarysector/achievement/AchievementBase.java new file mode 100644 index 0000000..eed4089 --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/AchievementBase.java @@ -0,0 +1,35 @@ +package shift.sextiarysector.achievement; + +import java.util.ArrayList; + +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import net.minecraft.util.StatCollector; +import shift.sextiarysector.SextiarySector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AchievementBase extends Achievement{ + + private final String achievementDescription2; + + public AchievementBase(String p_i45302_1_,int p_i45302_3_, int p_i45302_4_, ItemStack p_i45302_5_, Achievement p_i45302_6_, ArrayLista) { + super("achievement.ss"+p_i45302_1_, "ss." + p_i45302_1_, p_i45302_3_, p_i45302_4_, p_i45302_5_,p_i45302_6_); + this.achievementDescription2 = "achievement.ss." + p_i45302_1_ + ".desc2"; + a.add(this); + } + + @SideOnly(Side.CLIENT) + public String getDescription() + { + + if(((EntityClientPlayerMP) SextiarySector.proxy.getClientPlayer()).getStatFileWriter().hasAchievementUnlocked(this)){ + return StatCollector.translateToLocal(this.achievementDescription2); + }else{ + return super.getDescription(); + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/achievement/AchievementCraft.java b/src/main/java/shift/sextiarysector/achievement/AchievementCraft.java new file mode 100644 index 0000000..baa2074 --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/AchievementCraft.java @@ -0,0 +1,30 @@ +package shift.sextiarysector.achievement; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; + +public class AchievementCraft extends AchievementBase{ + + public AchievementCraft(String p_i45302_1_, int p_i45302_3_,int p_i45302_4_, ItemStack p_i45302_5_, Achievement p_i45302_6_,ArrayList a) { + super(p_i45302_1_, p_i45302_3_, p_i45302_4_, p_i45302_5_, p_i45302_6_, a); + FMLCommonHandler.instance().bus().register(this); + } + + @SubscribeEvent + public void onItemCraftedEvent(ItemCraftedEvent event){ + if(checkItem(event.crafting, this.theItemStack) && event.player != null){ + event.player.addStat(this, 1); + } + } + + private boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } + +} diff --git a/src/main/java/shift/sextiarysector/achievement/AchievementCrop.java b/src/main/java/shift/sextiarysector/achievement/AchievementCrop.java new file mode 100644 index 0000000..58268d8 --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/AchievementCrop.java @@ -0,0 +1,77 @@ +package shift.sextiarysector.achievement; + +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.client.entity.EntityClientPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.season.Season; +import shift.sextiarysector.block.BlockSSCrop; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class AchievementCrop extends AchievementPickup{ + + private BlockSSCrop crop; + private String n = "\n";//System.getProperty("line.separator"); + + public AchievementCrop(String p_i45302_1_, int p_i45302_3_,int p_i45302_4_, ItemStack p_i45302_5_, Block block, Achievement p_i45302_6_,ArrayList a) { + super(p_i45302_1_, p_i45302_3_, p_i45302_4_, p_i45302_5_, p_i45302_6_, a); + this.crop = (BlockSSCrop) block; + } + + EnumChatFormatting[] InformationC = new EnumChatFormatting[]{EnumChatFormatting.LIGHT_PURPLE,EnumChatFormatting.GREEN,EnumChatFormatting.YELLOW,EnumChatFormatting.BLUE,EnumChatFormatting.GRAY}; + + @SideOnly(Side.CLIENT) + public String getDescription() + { + + if(((EntityClientPlayerMP) SextiarySector.proxy.getClientPlayer()).getStatFileWriter().hasAchievementUnlocked(this)){ + + StringBuffer str = new StringBuffer(); + + str.append(StatCollector.translateToLocal("achievement.ss.data")); + str.append(n); + str.append(StatCollector.translateToLocal("tooltip.season.seed")); + str.append(" : "); + + Season[] season = ((BlockSSCrop)this.crop).getStatus().getSeason(); + + if(season.length==1){ + + str.append(InformationC[season[0].ordinal()]); + str.append(season[0].getTranslatedName()); + + }else if(season.length>=2){ + + str.append(InformationC[season[0].ordinal()]); + str.append(season[0].getTranslatedName()); + + str.append(InformationC[4]); + str.append(" - "); + + str.append(InformationC[season[season.length-1].ordinal()]); + str.append(season[season.length-1].getTranslatedName()); + + } + + str.append(InformationC[4]); + + str.append(n); + + str.append(StatCollector.translateToLocal("tooltip.season.day")); + str.append(" : "); + str.append(this.crop.getStatus().getDays()[2]); + + return str.toString(); + }else{ + return super.getDescription(); + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/achievement/AchievementFurnace.java b/src/main/java/shift/sextiarysector/achievement/AchievementFurnace.java new file mode 100644 index 0000000..d632f8f --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/AchievementFurnace.java @@ -0,0 +1,29 @@ +package shift.sextiarysector.achievement; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent.ItemSmeltedEvent; + +public class AchievementFurnace extends AchievementBase{ + + public AchievementFurnace(String p_i45302_1_, int p_i45302_3_,int p_i45302_4_, ItemStack p_i45302_5_, Achievement p_i45302_6_,ArrayList a) { + super(p_i45302_1_, p_i45302_3_, p_i45302_4_, p_i45302_5_, p_i45302_6_, a); + FMLCommonHandler.instance().bus().register(this); + } + + @SubscribeEvent + public void onItemSmeltedEvent(ItemSmeltedEvent event){ + if(checkItem(event.smelting, this.theItemStack) && event.player != null){ + event.player.addStat(this, 1); + } + } + + private boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } +} diff --git a/src/main/java/shift/sextiarysector/achievement/AchievementPageAgriculture.java b/src/main/java/shift/sextiarysector/achievement/AchievementPageAgriculture.java new file mode 100644 index 0000000..c4580c4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/AchievementPageAgriculture.java @@ -0,0 +1,26 @@ +package shift.sextiarysector.achievement; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.stats.Achievement; +import net.minecraft.util.IIcon; + +public class AchievementPageAgriculture extends AchievementPageBase implements IAchievementIcon { + + public AchievementPageAgriculture(String name,ArrayList achievements) { + super(name, achievements); + } + + @Override + public IIcon getIcon(Random random, int k3, int j2, int i3) { + return Blocks.dirt.getIcon(0, 0); + } + + @Override + public float getBrightness(int j2, int i3) { + return 0.6f; + } + +} diff --git a/src/main/java/shift/sextiarysector/achievement/AchievementPageBase.java b/src/main/java/shift/sextiarysector/achievement/AchievementPageBase.java new file mode 100644 index 0000000..9c6f246 --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/AchievementPageBase.java @@ -0,0 +1,21 @@ +package shift.sextiarysector.achievement; + +import java.util.ArrayList; + +import net.minecraft.stats.Achievement; +import net.minecraft.util.StatCollector; +import net.minecraftforge.common.AchievementPage; + +public class AchievementPageBase extends AchievementPage{ + + public AchievementPageBase(String name, ArrayList achievements) { + super(name, achievements.toArray(new Achievement[0])); + } + + @Override + public String getName() + { + return StatCollector.translateToLocal(super.getName()); + } + +} diff --git a/src/main/java/shift/sextiarysector/achievement/AchievementPageEconomy.java b/src/main/java/shift/sextiarysector/achievement/AchievementPageEconomy.java new file mode 100644 index 0000000..3ade030 --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/AchievementPageEconomy.java @@ -0,0 +1,63 @@ +package shift.sextiarysector.achievement; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.stats.Achievement; +import net.minecraft.util.IIcon; + +public class AchievementPageEconomy extends AchievementPageBase implements IAchievementIcon { + + public AchievementPageEconomy(String name,ArrayList achievements) { + super(name, achievements); + } + + @Override + public IIcon getIcon(Random random, int k3, int j2, int i3) { + + IIcon iicon = Blocks.sand.getIcon(0, 0); + + if (k3 <= 37 && j2 + i3 != 35) + { + if (k3 == 22) + { + if (random.nextInt(2) == 0) + { + iicon = Blocks.gold_ore.getIcon(0, 0); + } + else + { + iicon = Blocks.gold_ore.getIcon(0, 0); + } + } + else if (k3 == 10) + { + iicon = Blocks.gold_ore.getIcon(0, 0); + } + else if (k3 == 8) + { + iicon = Blocks.gold_ore.getIcon(0, 0); + } + else if (k3 > 4) + { + iicon = Blocks.stone.getIcon(0, 0); + } + else if (k3 > 0) + { + iicon = Blocks.dirt.getIcon(0, 0); + } + } + else + { + iicon = Blocks.bedrock.getIcon(0, 0); + } + + return iicon; + } + + @Override + public float getBrightness(int j2, int i3) { + return 0.6F - (float)(j2 + i3) / 25.0F * 0.3F; + } +} diff --git a/src/main/java/shift/sextiarysector/achievement/AchievementPageIndustry.java b/src/main/java/shift/sextiarysector/achievement/AchievementPageIndustry.java new file mode 100644 index 0000000..708880d --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/AchievementPageIndustry.java @@ -0,0 +1,27 @@ +package shift.sextiarysector.achievement; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.stats.Achievement; +import net.minecraft.util.IIcon; + +public class AchievementPageIndustry extends AchievementPageBase implements IAchievementIcon { + + public AchievementPageIndustry(String name,ArrayList achievements) { + super(name, achievements); + } + + @Override + public IIcon getIcon(Random random, int k3, int j2, int i3) { + + return Blocks.iron_block.getIcon(0, 0); + + } + + @Override + public float getBrightness(int j2, int i3) { + return 0.6f; + } +} diff --git a/src/main/java/shift/sextiarysector/achievement/AchievementPickup.java b/src/main/java/shift/sextiarysector/achievement/AchievementPickup.java new file mode 100644 index 0000000..3334ad9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/AchievementPickup.java @@ -0,0 +1,29 @@ +package shift.sextiarysector.achievement; + +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent; + +public class AchievementPickup extends AchievementBase{ + + public AchievementPickup(String p_i45302_1_, int p_i45302_3_,int p_i45302_4_, ItemStack p_i45302_5_, Achievement p_i45302_6_,ArrayList a) { + super(p_i45302_1_, p_i45302_3_, p_i45302_4_, p_i45302_5_, p_i45302_6_, a); + FMLCommonHandler.instance().bus().register(this); + } + + @SubscribeEvent + public void onItemPickupEvent(ItemPickupEvent event){ + if(checkItem(event.pickedUp.getEntityItem(), this.theItemStack) && event.player != null){ + event.player.addStat(this, 1); + } + } + + private boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } +} diff --git a/src/main/java/shift/sextiarysector/achievement/IAchievementIcon.java b/src/main/java/shift/sextiarysector/achievement/IAchievementIcon.java new file mode 100644 index 0000000..2f8a828 --- /dev/null +++ b/src/main/java/shift/sextiarysector/achievement/IAchievementIcon.java @@ -0,0 +1,13 @@ +package shift.sextiarysector.achievement; + +import java.util.Random; + +import net.minecraft.util.IIcon; + +public interface IAchievementIcon { + + IIcon getIcon(Random random , int k3, int j2, int i3); + + float getBrightness(int j2, int i3); + +} diff --git a/src/main/java/shift/sextiarysector/agriculture/FarmlandRegistry.java b/src/main/java/shift/sextiarysector/agriculture/FarmlandRegistry.java new file mode 100644 index 0000000..f98a307 --- /dev/null +++ b/src/main/java/shift/sextiarysector/agriculture/FarmlandRegistry.java @@ -0,0 +1,18 @@ +package shift.sextiarysector.agriculture; + +import net.minecraft.block.Block; +import shift.sextiarysector.api.agriculture.IFarmlandRegistry; + +public class FarmlandRegistry implements IFarmlandRegistry { + + @Override + public void registerFarmland(String name, Block block) { + + } + + @Override + public Block getFarmland(String name) { + return null; + } + +} diff --git a/src/main/java/shift/sextiarysector/api/EnumColor.java b/src/main/java/shift/sextiarysector/api/EnumColor.java new file mode 100644 index 0000000..34b1df1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/EnumColor.java @@ -0,0 +1,59 @@ +package shift.sextiarysector.api; + +public enum EnumColor { + + Black(0x000000), + Red(0xFF0000), + Green(0x088A29), + Brown(0x8A4B08), + Blue(0x0000FF), + Purple(0xB404AE), + Cyan(0x00FFFF), + LightGray(0x2EFE2E), + Gray(0x848484), + Pink(0xFF00FF), + Lime(0x64FE2E), + Yellow(0xFFFF00), + LightBlue(0x2E9AFE), + Magenta(0xFF00BF), + Orange(0xFF4000), + White(0xFFFFFF), + Unknown(0x000000); + + public static EnumColor[] colors = { + Black, + Red, + Green, + Brown, + Blue, + Purple, + Cyan, + LightGray, + Gray, + Pink, + Lime, + Yellow, + LightBlue, + Magenta, + Orange, + White + }; + + public final int color; + + private EnumColor(int color) { + this.color = color; + } + + public static EnumColor getColor(int i) { + + if (0 > i || i > 15) return Unknown; + + return colors[i]; + + } + + public byte[] getGLColor3ub() { + return new byte[] { (byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF) }; + } +} \ No newline at end of file diff --git a/src/main/java/shift/sextiarysector/api/IColorItem.java b/src/main/java/shift/sextiarysector/api/IColorItem.java new file mode 100644 index 0000000..926f8f5 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/IColorItem.java @@ -0,0 +1,13 @@ +package shift.sextiarysector.api; + +import net.minecraft.item.ItemStack; + +public interface IColorItem { + + public EnumColor getColor(ItemStack item); + + public void useItem(ItemStack item); + + public boolean canUse(ItemStack item); + +} diff --git a/src/main/java/shift/sextiarysector/api/IPlayerManager.java b/src/main/java/shift/sextiarysector/api/IPlayerManager.java index fe27779..0c67d11 100644 --- a/src/main/java/shift/sextiarysector/api/IPlayerManager.java +++ b/src/main/java/shift/sextiarysector/api/IPlayerManager.java @@ -6,10 +6,14 @@ public interface IPlayerManager { public void addMoistureStats(EntityPlayer entityPlayer, int par1, float par2); + public int getMoistureLevel(EntityPlayer entityPlayer); + public void addMoistureExhaustion(EntityPlayer entityPlayer, float par1); public void addStaminaStats(EntityPlayer entityPlayer, int par1, float par2); + public int getStaminaLevel(EntityPlayer entityPlayer); + public void addStaminaExhaustion(EntityPlayer entityPlayer, float par1); } diff --git a/src/main/java/shift/sextiarysector/api/SextiarySectorAPI.java b/src/main/java/shift/sextiarysector/api/SextiarySectorAPI.java index 468a90b..82d699d 100644 --- a/src/main/java/shift/sextiarysector/api/SextiarySectorAPI.java +++ b/src/main/java/shift/sextiarysector/api/SextiarySectorAPI.java @@ -14,28 +14,33 @@ public class SextiarySectorAPI { /** ModID */ public static final String MODID = "SextiarySector"; - //CreativeTabs + /* + * ------------------------------------------- + * CreativeTabs 繧ッ繝ェ繧ィ繧、繝繧」繝悶ち繝 + * ------------------------------------------- + */ + public static CreativeTabs TabSSCore; - public static CreativeTabs TabSSMachine; + public static CreativeTabs TabSSFluid; + public static CreativeTabs TabSSPlayer; public static CreativeTabs TabSSAgriculture; + public static CreativeTabs TabSSFishery; + public static CreativeTabs TabSSMining; + public static CreativeTabs TabSSIndustry; + public static CreativeTabs TabSSCooking; + public static CreativeTabs TabSSTransport; public static CreativeTabs TabSSEconomy; - - /** - * IPlayerManager Player髢「菫ゅョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ
- * 縺薙ョ繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺九i謫堺ス懊r縺励※縺上□縺輔>縲 - */ - public static IPlayerManager playerManager ; - - - + public static CreativeTabs TabSSMagic; /* - * ----------------------- + * ------------------------------------------- * Player 繝励Ξ繧、繝、繝シ - *------------------------ + * ------------------------------------------- */ - //繝。繝「 MAX豌エ蛻 20 , MAX繧ケ繧ソ繝溘リ 1000 + public static IPlayerManager playerManager; + + //繝。繝「 MAX豌エ蛻 20 , MAX繧ケ繧ソ繝溘リ 100 /** * addMoistureStats 繝励Ξ繧、繝、繝シ縺ョ豌エ蛻繧イ繝シ繧ク繧貞屓蠕ゥ縺励∪縺 @@ -47,12 +52,16 @@ public static void addMoistureStats(EntityPlayer entityPlayer, int par1, float p playerManager.addMoistureStats(entityPlayer, par1, par2); } + public static int getMoistureLevel(EntityPlayer entityPlayer) { + return playerManager.getMoistureLevel(entityPlayer); + } + /** * addMoistureExhaustion 繝励Ξ繧、繝、繝シ縺ョ豌エ蛻繧イ繝シ繧ク繧呈ク帙i縺励∪縺 * @param entityPlayer 繝励Ξ繧、繝、繝シ * @param amount 貂帙i縺咎(4.0f縺ァ1) */ - public static void addMoistureExhaustion(EntityPlayer entityPlayer, float amount){ + public static void addMoistureExhaustion(EntityPlayer entityPlayer, float amount) { playerManager.addMoistureExhaustion(entityPlayer, amount); } @@ -62,18 +71,21 @@ public static void addMoistureExhaustion(EntityPlayer entityPlayer, float amount * @param par1 繧ケ繧ソ繝溘リ * @param par2 髫縺励せ繧ソ繝溘リ */ - public static void addStaminaStats(EntityPlayer entityPlayer, int par1, float par2){ + public static void addStaminaStats(EntityPlayer entityPlayer, int par1, float par2) { playerManager.addStaminaStats(entityPlayer, par1, par2); } + public static int getStaminaLevel(EntityPlayer entityPlayer) { + return playerManager.getStaminaLevel(entityPlayer); + } + /** * addMoistureExhaustion 繝励Ξ繧、繝、繝シ縺ョ繧ケ繧ソ繝溘リ繧イ繝シ繧ク繧呈ク帙i縺励∪縺 * @param entityPlayer 繝励Ξ繧、繝、繝シ * @param amount 貂帙i縺咎(4.0f縺ァ1) */ - public static void addStaminaExhaustion(EntityPlayer entityPlayer, float amount){ + public static void addStaminaExhaustion(EntityPlayer entityPlayer, float amount) { playerManager.addStaminaExhaustion(entityPlayer, amount); } - } diff --git a/src/main/java/shift/sextiarysector/api/agriculture/AgricultureAPI.java b/src/main/java/shift/sextiarysector/api/agriculture/AgricultureAPI.java index 322d84d..7fcd01d 100644 --- a/src/main/java/shift/sextiarysector/api/agriculture/AgricultureAPI.java +++ b/src/main/java/shift/sextiarysector/api/agriculture/AgricultureAPI.java @@ -1,7 +1,18 @@ package shift.sextiarysector.api.agriculture; +import net.minecraft.block.Block; + public class AgricultureAPI { - public static IFertilizerManager fertilizerManager ; + public static IFertilizerManager fertilizerManager; + public static IFarmlandRegistry farmlandRegistry; + + public static void registerFarmland(String name, Block block) { + farmlandRegistry.registerFarmland(name, block); + } + + public Block getFarmland(String name) { + return farmlandRegistry.getFarmland(name); + } } diff --git a/src/main/java/shift/sextiarysector/api/agriculture/BlockCropBase.java b/src/main/java/shift/sextiarysector/api/agriculture/BlockCropBase.java new file mode 100644 index 0000000..29d2fb3 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/agriculture/BlockCropBase.java @@ -0,0 +1,56 @@ +package shift.sextiarysector.api.agriculture; + +import java.util.Random; + +import net.minecraft.block.BlockBush; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.item.Item; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockCropBase extends BlockBush implements ITileEntityProvider { + + @SideOnly(Side.CLIENT) + private IIcon[] icons; + private CropRendererType rendererID; + private CropStatus status; + + private Item drop; + + private static Random random = new Random(); + + /* + public BlockCropBase(CropStatus status, CropRendererType rendererID, Item drop) + { + this.setTickRandomly(true); + this.type = type; + this.drop = drop; + this.status = status; + this.farmland = farmland; + this.re_harvest = re_harvest; + + if (type.equals(CropType.Normal)) { + float f = 0.5F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); + } else { + float f = 0.2F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f * 3.0F, 0.5F + f); + } + + //this.setCreativeTab((CreativeTabs)null); + this.setHardness(0.2F); + this.setStepSound(soundTypeGrass); + this.disableStats(); + this.isBlockContainer = true; + this.setCreativeTab(SextiarySectorAPI.TabSSAgriculture); + }*/ + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return null; + } + +} diff --git a/src/main/java/shift/sextiarysector/api/agriculture/CropRendererType.java b/src/main/java/shift/sextiarysector/api/agriculture/CropRendererType.java new file mode 100644 index 0000000..f14a3a1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/agriculture/CropRendererType.java @@ -0,0 +1,14 @@ +package shift.sextiarysector.api.agriculture; + +public enum CropRendererType { + + Normal(6), + Close(1); + + public int id; + + CropRendererType(int renderID) { + this.id = renderID; + } + +} diff --git a/src/main/java/shift/sextiarysector/api/agriculture/CropStatus.java b/src/main/java/shift/sextiarysector/api/agriculture/CropStatus.java new file mode 100644 index 0000000..eddf364 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/agriculture/CropStatus.java @@ -0,0 +1,42 @@ +package shift.sextiarysector.api.agriculture; + +import shift.sextiarysector.api.season.Season; + +public class CropStatus { + + private boolean reHarvest; + + private int days[]; + + public Season[] seasons; + + public CropStatus(String farmland, boolean reHarvest, int[] days, Season... seasons) { + + this.days = days; + this.seasons = seasons; + + if (reHarvest) { + if (days.length != 4) throw new IllegalArgumentException("Size of days is less days.length = 4"); + } else { + if (days.length != 3) throw new IllegalArgumentException("Size of days is less days.length = 3"); + } + + } + + public int[] getDays() { + return days; + } + + private void setDay(int[] day) { + this.days = day; + } + + public Season[] getSeason() { + return seasons; + } + + public boolean isReHarvest() { + return this.reHarvest; + } + +} diff --git a/src/main/java/shift/sextiarysector/api/agriculture/FarmlandType.java b/src/main/java/shift/sextiarysector/api/agriculture/FarmlandType.java new file mode 100644 index 0000000..3b81018 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/agriculture/FarmlandType.java @@ -0,0 +1,8 @@ +package shift.sextiarysector.api.agriculture; + +public enum FarmlandType { + + Normal, + Paddy; + +} diff --git a/src/main/java/shift/sextiarysector/api/agriculture/IFarmland.java b/src/main/java/shift/sextiarysector/api/agriculture/IFarmland.java new file mode 100644 index 0000000..768b1e8 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/agriculture/IFarmland.java @@ -0,0 +1,11 @@ +package shift.sextiarysector.api.agriculture; + +import net.minecraftforge.fluids.IFluidHandler; + +public interface IFarmland extends IFluidHandler{ + + public boolean canGrowth(); + + public void growth(); + +} diff --git a/src/main/java/shift/sextiarysector/api/agriculture/IFarmlandRegistry.java b/src/main/java/shift/sextiarysector/api/agriculture/IFarmlandRegistry.java new file mode 100644 index 0000000..b83d1d0 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/agriculture/IFarmlandRegistry.java @@ -0,0 +1,11 @@ +package shift.sextiarysector.api.agriculture; + +import net.minecraft.block.Block; + +public interface IFarmlandRegistry { + + public void registerFarmland(String name, Block block); + + public Block getFarmland(String name); + +} diff --git a/src/main/java/shift/sextiarysector/api/agriculture/IFertilizerManager.java b/src/main/java/shift/sextiarysector/api/agriculture/IFertilizerManager.java index 1f01257..b1f9b8a 100644 --- a/src/main/java/shift/sextiarysector/api/agriculture/IFertilizerManager.java +++ b/src/main/java/shift/sextiarysector/api/agriculture/IFertilizerManager.java @@ -3,6 +3,6 @@ public interface IFertilizerManager { - public void registerFertilizer(IFertilizer fertilizer); + public void registerFertilizer(FarmlandType type ,IFertilizer fertilizer); } diff --git a/src/main/java/shift/sextiarysector/api/agriculture/package-info.java b/src/main/java/shift/sextiarysector/api/agriculture/package-info.java index bc715c3..585534a 100644 --- a/src/main/java/shift/sextiarysector/api/agriculture/package-info.java +++ b/src/main/java/shift/sextiarysector/api/agriculture/package-info.java @@ -1,4 +1,5 @@ -@API(apiVersion = "1.0.0", owner = shift.sextiarysector.api.SextiarySectorAPI.MODID, provides = "SextiarySectorAPI|agriculture") +@API(apiVersion = "1.0.0", owner = "SextiarySectorAPI|core", provides = "SextiarySectorAPI|agriculture") package shift.sextiarysector.api.agriculture; + import cpw.mods.fml.common.API; diff --git a/src/main/java/shift/sextiarysector/api/equipment/EquipmentType.java b/src/main/java/shift/sextiarysector/api/equipment/EquipmentType.java new file mode 100644 index 0000000..eb18ecc --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/equipment/EquipmentType.java @@ -0,0 +1,105 @@ +package shift.sextiarysector.api.equipment; + +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.util.IIcon; + +public enum EquipmentType { + + DecorationHelmet("decoration_helmet", new int[] { 0 }), + DecorationPlate("decoration_plate", new int[] { 1 }), + DecorationLegs("decoration_legs", new int[] { 2 }), + DecorationBoots("decoration_boots", new int[] { 3 }), + //Necklace("necklace", new int[] { 4 }), + //Ring("ring", new int[] { 5, 6, 7 }), + Face("face", new int[] { 4 }), + Bag("bag", new int[] { 5 }), + Hand("hand", new int[] { 6 }), + Belt("belt", new int[] { 7 }), + Unit("unit", new int[] { 8, 9, 10, 11, 12, 13, 14, 15 }), + Other("other", new int[] { 16, 17, 18, 19 }); + + private IIcon icon; + private String iconName; + private int[] slot; + + EquipmentType(String name, int[] slot) { + this.iconName = name; + this.slot = slot; + } + + public void registerIcon(TextureMap map) { + this.setIcon(map.registerIcon("sextiarysector:gui/slot_" + this.iconName)); + } + + public IIcon getIcon() { + return icon; + } + + public void setIcon(IIcon icon) { + this.icon = icon; + } + + public int[] getSlots() { + return this.slot; + } + + public int getSlot(int id) { + return this.slot[id]; + } + + public static EquipmentType getEquipmentTypeFromSlot(int slot) { + + switch (slot) { + + case 0: + return DecorationHelmet; + + case 1: + return DecorationPlate; + + case 2: + return DecorationLegs; + + case 3: + return DecorationBoots; + + //case 4: + // return Necklace; + + //case 5: + //case 6: + //case 7: + // return Ring; + + case 4: + return Face; + case 5: + return Bag; + case 6: + return Hand; + case 7: + return Belt; + + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + //case 16: + //case 17: + //case 18: + //case 19: + return Unit; + case 16: + case 17: + case 18: + case 19: + return Unit; + } + return Unit; + } + +} diff --git a/src/main/java/shift/sextiarysector/api/equipment/IEquipment.java b/src/main/java/shift/sextiarysector/api/equipment/IEquipment.java new file mode 100644 index 0000000..7638ada --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/equipment/IEquipment.java @@ -0,0 +1,18 @@ +package shift.sextiarysector.api.equipment; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public interface IEquipment { + + boolean canTakeStack(EquipmentType equipment, ItemStack stack, EntityPlayer player); + + boolean isItemValid(EquipmentType equipment, ItemStack stack); + + void onUpdate(EquipmentType equipment, ItemStack stack, World world, Entity player, int slot); + + boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player); + +} diff --git a/src/main/java/shift/sextiarysector/api/event/BlockBottleEvent.java b/src/main/java/shift/sextiarysector/api/event/BlockBottleEvent.java new file mode 100644 index 0000000..9c1a18e --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/event/BlockBottleEvent.java @@ -0,0 +1,16 @@ +package shift.sextiarysector.api.event; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.event.entity.player.PlayerEvent; +import net.minecraftforge.fluids.FluidStack; + +public class BlockBottleEvent extends PlayerEvent{ + + public FluidStack fluid; + + public BlockBottleEvent(EntityPlayer player , FluidStack fluid) { + super(player); + this.fluid = fluid; + } + +} diff --git a/src/main/java/shift/sextiarysector/api/event/FillBottleEvent.java b/src/main/java/shift/sextiarysector/api/event/FillBottleEvent.java new file mode 100644 index 0000000..fbcdfd6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/event/FillBottleEvent.java @@ -0,0 +1,25 @@ +package shift.sextiarysector.api.event; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.player.PlayerEvent; + +public class FillBottleEvent extends PlayerEvent +{ + + public final ItemStack current; + public final World world; + public final MovingObjectPosition target; + + public ItemStack result; + + public FillBottleEvent(EntityPlayer player, ItemStack current, World world, MovingObjectPosition target) + { + super(player); + this.current = current; + this.world = world; + this.target = target; + } +} diff --git a/src/main/java/shift/sextiarysector/api/event/VanillaFoodHandler.java b/src/main/java/shift/sextiarysector/api/event/VanillaFoodHandler.java index 45e5bc0..75b6a87 100644 --- a/src/main/java/shift/sextiarysector/api/event/VanillaFoodHandler.java +++ b/src/main/java/shift/sextiarysector/api/event/VanillaFoodHandler.java @@ -5,6 +5,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; import shift.sextiarysector.api.IDrink; import shift.sextiarysector.api.SextiarySectorAPI; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -13,105 +15,129 @@ public class VanillaFoodHandler { /**繝舌ル繝ゥ縺ョ鬟溘∋迚ゥ繧帝」溘∋縺滓凾縺ョ蜍穂ス*/ @SubscribeEvent - public void onPlayerEatenEvent(PlayerEatenEvent event) { + public void onPlayerEatenEvent(PlayerEatenEvent event) { ItemStack food = event.food; EntityPlayer player = (EntityPlayer) event.entity; //豌エ蜈・繧顔童 - if(food.getItem() == Items.potionitem){ + if (food.getItem() == Items.potionitem && food.getItemDamage() == 0) { SextiarySectorAPI.playerManager.addMoistureStats(player, 3, 0); - player.addPotionEffect(new PotionEffect(Potion.hunger.getId(),600,0)); + player.addExhaustion(4.5f); + player.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 30, 0)); } //縺阪ョ縺薙す繝√Η繝シ - if(food.getItem() == Items.mushroom_stew){ + if (food.getItem() == Items.mushroom_stew) { SextiarySectorAPI.playerManager.addMoistureStats(player, 2, 2); } //魑・ - if(food.getItem() == Items.chicken){ + if (food.getItem() == Items.chicken) { SextiarySectorAPI.playerManager.addMoistureStats(player, 1, 0); } - if(food.getItem() == Items.cooked_chicken){ + if (food.getItem() == Items.cooked_chicken) { - SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 9.2f); + SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 7.2f); SextiarySectorAPI.playerManager.addStaminaStats(player, 4, 2); } //雎 - if(food.getItem() == Items.porkchop){ + if (food.getItem() == Items.porkchop) { SextiarySectorAPI.playerManager.addMoistureStats(player, 1, 0); } - if(food.getItem() == Items.cooked_porkchop){ + if (food.getItem() == Items.cooked_porkchop) { - SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 12.2f); + SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 8.2f); SextiarySectorAPI.playerManager.addStaminaStats(player, 5, 1); } //迚 - if(food.getItem() == Items.beef){ + if (food.getItem() == Items.beef) { SextiarySectorAPI.playerManager.addMoistureStats(player, 1, 0); } - if(food.getItem() == Items.cooked_beef){ + if (food.getItem() == Items.cooked_beef) { - SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 16.2f); + SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 10.2f); SextiarySectorAPI.playerManager.addStaminaStats(player, 7, 4); } //鬲 - if(food.getItem() == Items.fish){ + if (food.getItem() == Items.fish) { SextiarySectorAPI.playerManager.addMoistureStats(player, 4, 2); - player.addPotionEffect(new PotionEffect(Potion.hunger.getId(),600,0)); + player.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 600, 0)); } - if(food.getItem() == Items.cooked_fished){ + if (food.getItem() == Items.cooked_fished) { - SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 6.2f); + SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 5.2f); SextiarySectorAPI.playerManager.addStaminaStats(player, 6, 2); } //繝ェ繝ウ繧エ - if(food.getItem() == Items.apple){ + if (food.getItem() == Items.apple) { - SextiarySectorAPI.playerManager.addMoistureStats(player, 1,1.0f); + SextiarySectorAPI.playerManager.addMoistureStats(player, 1, 0.3f); } //繧ケ繧、繧ォ - if(food.getItem() == Items.melon){ + if (food.getItem() == Items.melon) { - SextiarySectorAPI.playerManager.addMoistureStats(player, 3,1.0f); + SextiarySectorAPI.playerManager.addMoistureStats(player, 1, 1.0f); } //繝代Φ - if(food.getItem() == Items.bread){ + if (food.getItem() == Items.bread) { - SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 6.8f); + SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 5.2f); SextiarySectorAPI.playerManager.addStaminaStats(player, 4, 4); } //迚帑ケウ - if(food.getItem() == Items.milk_bucket){ + if (food.getItem() == Items.milk_bucket) { SextiarySectorAPI.playerManager.addMoistureStats(player, 4, 4); } - if(food.getItem() instanceof IDrink){ - SextiarySectorAPI.playerManager.addMoistureStats(player, ((IDrink)food.getItem()).getMoisture(food), ((IDrink)food.getItem()).getMoistureSaturation(food)); + if (food.getItem() instanceof IDrink) { + SextiarySectorAPI.playerManager.addMoistureStats(player, ((IDrink) food.getItem()).getMoisture(food), ((IDrink) food.getItem()).getMoistureSaturation(food)); + } + + } + + /**繝舌ル繝ゥ縺ョ豸イ菴薙r鬟イ繧薙□譎ゅョ蜍穂ス*/ + @SubscribeEvent + public void onPlayerEatenEvent(BlockBottleEvent event) { + + FluidStack fluid = event.fluid; + EntityPlayer player = (EntityPlayer) event.entity; + + if (fluid.getFluid().getID() == FluidRegistry.WATER.getID()) { + + SextiarySectorAPI.playerManager.addMoistureStats(player, 3, 0); + player.addExhaustion(4.5f); + player.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 30, 0)); + + } + + if (fluid.getFluid().getID() == FluidRegistry.LAVA.getID()) { + + SextiarySectorAPI.playerManager.addMoistureExhaustion(player, 12.0f); + } } diff --git a/src/main/java/shift/sextiarysector/api/gearforce/item/GearForceItemAPI.java b/src/main/java/shift/sextiarysector/api/gearforce/item/GearForceItemAPI.java new file mode 100644 index 0000000..4e6567e --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/gearforce/item/GearForceItemAPI.java @@ -0,0 +1,137 @@ +package shift.sextiarysector.api.gearforce.item; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; + +/** + * IGearForceItem繧貞ョ溯」縺励◆繧「繧、繝繝縺ョGF繧貞ョ滄圀縺ォ謫堺ス懊☆繧気lass + * @version 1.0.0 + * @author Shift02 + * + */ +public class GearForceItemAPI { + + public static IGearForceItemManager manager; + + /** + * + * 繧「繧、繝繝縺ォGF繧定ソス蜉縺吶k + * + * @param itemStack GF繧定ソス蜉縺吶k繧「繧、繝繝 + * @param power 繝代Ρ繝シ + * @param speed 繧ケ繝斐シ繝 + * @param simulate 繧キ繝溘Η繝ャ繝シ繧キ繝ァ繝ウ縺九←縺縺 true縺縺ィ霑ス蜉縺ッ縺輔l縺セ縺帙s(邨先棡縺ッ謌サ縺」縺ヲ縺阪∪縺) + * @return 霑ス蜉縺ァ縺阪◆繧ケ繝斐シ繝 + */ + public static int addEnergy(ItemStack itemStack, int power, int speed, boolean simulate) { + return manager.addEnergy(itemStack, power, speed, simulate); + } + + /** + * + * 繧「繧、繝繝縺九iGF繧呈ク帙i縺 + * + * @param itemStack GF繧呈ク帙i縺吶い繧、繝繝 + * @param power 繝代Ρ繝シ + * @param speed 繧ケ繝斐シ繝 + * @param simulate 繧キ繝溘Η繝ャ繝シ繧キ繝ァ繝ウ縺九←縺縺 true縺縺ィ霑ス蜉縺ッ縺輔l縺セ縺帙s(邨先棡縺ッ謌サ縺」縺ヲ縺阪∪縺) + * @return 貂帙i縺帙l縺溘せ繝斐シ繝 + */ + public static int reduceEnergy(ItemStack itemStack, int power, int speed, boolean simulate) { + return manager.reduceEnergy(itemStack, power, speed, simulate); + } + + /** + * + * 繧「繧、繝繝縺ョ繝代Ρ繝シ縺ョ譛螟ァ蛟、繧貞叙蠕励☆繧 + * + * @param itemStack 蜿門セ励☆繧九い繧、繝繝 + * @return 繝代Ρ繝シ + */ + public static int getMaxPower(ItemStack itemStack) { + return ((IGearForceItem) itemStack.getItem()).getMaxPower(itemStack); + } + + /** + * + * 繧「繧、繝繝縺ョ繧ケ繝斐シ繝峨ョ譛螟ァ蛟、(螳ケ驥)繧貞叙蠕励☆繧 + * + * @param itemStack 蜿門セ励☆繧九い繧、繝繝 + * @return 繧ケ繝斐シ繝 + */ + public static int getMaxSpeed(ItemStack itemStack) { + return ((IGearForceItem) itemStack.getItem()).getMaxSpeed(itemStack); + } + + /** + * + * 繧「繧、繝繝縺ョ迴セ蝨ィ縺ョ繝代Ρ繝シ繧貞叙蠕励☆繧 + * + * @param itemStack 蜿門セ励☆繧九い繧、繝繝 + * @return 繝代Ρ繝シ + */ + public static int getPower(ItemStack itemStack) { + return manager.getPower(itemStack); + } + + /** + * + * 繧「繧、繝繝縺ョ迴セ蝨ィ縺ョ繧ケ繝斐シ繝峨r蜿門セ励☆繧 + * + * @param itemStack 蜿門セ励☆繧九い繧、繝繝 + * @return 繧ケ繝斐シ繝 + */ + public static int getSpeed(ItemStack itemStack) { + return manager.getSpeed(itemStack); + } + + /** + * + * 繧「繧、繝繝縺ォ繝代Ρ繝シ縺ィ繧ケ繝斐シ繝峨r繧サ繝繝医☆繧 + * + * @param itemStack + * @param power + * @param speed + * @return 繧サ繝繝亥コ譚・繧後ーtrue + */ + public static boolean setEnergy(ItemStack itemStack, int power, int speed) { + return manager.setEnergy(itemStack, power, speed); + } + + /** + * + * 繧「繧、繝繝縺茎peed繧呈カ郁イサ蜃コ譚・繧九° + * + * @param itemStack + * @param speed + * @return speed莉・荳翫ョ繧ィ繝阪Ν繧ョ繝シ縺後≠繧後ーtrue + */ + public static boolean canUse(ItemStack itemStack, int speed) { + return manager.canUse(itemStack, speed); + } + + /** + * + * 繧「繧、繝繝繧剃スソ逕ィ縺吶k譎ゅ↓蜻シ縺カ + * + * @param itemStack + * @param speed + * @param entity + * @return + */ + public static boolean use(ItemStack itemStack, int speed, EntityLivingBase entity) { + return manager.use(itemStack, speed, entity); + } + + /** + * + * itemStack縺隈F繧呈桶縺縺薙→縺悟コ譚・繧九°縺ゥ縺縺 + * + * @param itemStack + * @return + */ + public static boolean isGearForceItem(ItemStack itemStack) { + return manager.isGearForceItem(itemStack); + } + +} diff --git a/src/main/java/shift/sextiarysector/api/gearforce/item/IGearForceGridItem.java b/src/main/java/shift/sextiarysector/api/gearforce/item/IGearForceGridItem.java new file mode 100644 index 0000000..981618d --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/gearforce/item/IGearForceGridItem.java @@ -0,0 +1,6 @@ +package shift.sextiarysector.api.gearforce.item; + +//TODO +public interface IGearForceGridItem { + +} diff --git a/src/main/java/shift/sextiarysector/api/gearforce/item/IGearForceItem.java b/src/main/java/shift/sextiarysector/api/gearforce/item/IGearForceItem.java new file mode 100644 index 0000000..51e6af9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/gearforce/item/IGearForceItem.java @@ -0,0 +1,32 @@ +package shift.sextiarysector.api.gearforce.item; + +import net.minecraft.item.ItemStack; + +/** + * IGearForceItem Item縺ァGF繧呈桶縺医k繧医≧縺ォ縺ェ繧九う繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ
+ * Item縺ォ螳溯」縺励※縺上□縺輔> + * @see ItemGearForce + * @version 1.0.0 + * @author Shift02 + */ +public interface IGearForceItem { + + /** + * 繧「繧、繝繝縺ォ繝√Ε繝シ繧ク蜃コ譚・繧九ヱ繝ッ繝シ + * + * @param container 繧「繧、繝繝 + * @return + */ + int getMaxPower(ItemStack container); + + /** + * 繧「繧、繝繝縺ォ繝√Ε繝シ繧ク蜃コ譚・繧区怙螟ァ繧ケ繝斐シ繝 + * + * @param container 繧「繧、繝繝 + * @return + */ + int getMaxSpeed(ItemStack container); + + boolean canSetSlot(int power); + +} diff --git a/src/main/java/shift/sextiarysector/api/machine/item/IGearForceItemManager.java b/src/main/java/shift/sextiarysector/api/gearforce/item/IGearForceItemManager.java similarity index 92% rename from src/main/java/shift/sextiarysector/api/machine/item/IGearForceItemManager.java rename to src/main/java/shift/sextiarysector/api/gearforce/item/IGearForceItemManager.java index 8ba2550..9e689ab 100644 --- a/src/main/java/shift/sextiarysector/api/machine/item/IGearForceItemManager.java +++ b/src/main/java/shift/sextiarysector/api/gearforce/item/IGearForceItemManager.java @@ -1,14 +1,14 @@ -package shift.sextiarysector.api.machine.item; +package shift.sextiarysector.api.gearforce.item; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; public interface IGearForceItemManager { - public int reduceEnergy(ItemStack itemStack, int power, int speed, boolean simulate); - public int addEnergy(ItemStack itemStack, int power, int speed, boolean simulate); + public int reduceEnergy(ItemStack itemStack, int power, int speed, boolean simulate); + public int getSpeed(ItemStack theItem); public int getPower(ItemStack theItem); diff --git a/src/main/java/shift/sextiarysector/api/gearforce/item/IHammer.java b/src/main/java/shift/sextiarysector/api/gearforce/item/IHammer.java new file mode 100644 index 0000000..fb4a964 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/gearforce/item/IHammer.java @@ -0,0 +1,12 @@ +package shift.sextiarysector.api.gearforce.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + +public interface IHammer { + + public boolean canUse(ItemStack item, EntityPlayer player, int damage); + + public boolean use(ItemStack item, EntityPlayer player, int damage); + +} diff --git a/src/main/java/shift/sextiarysector/api/gearforce/item/ItemGearForce.java b/src/main/java/shift/sextiarysector/api/gearforce/item/ItemGearForce.java new file mode 100644 index 0000000..17177bb --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/gearforce/item/ItemGearForce.java @@ -0,0 +1,101 @@ +package shift.sextiarysector.api.gearforce.item; + +import java.text.NumberFormat; +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +/** + * ItemGearForce {@link IGearForceItem} 縺ョ螳溯」萓 + * @see IGearForceItem + * @version 1.0.0 + * @author Shift02 + */ +public class ItemGearForce extends Item implements IGearForceItem { + + int power; + int speed; + + int slot; + + public ItemGearForce(int power, int maxSpeed, int slot) { + + this.setMaxStackSize(1); + this.setNoRepair(); + + this.power = power; + this.speed = maxSpeed; + + this.slot = slot; + + } + + @Override + public void addInformation(ItemStack itemStack, EntityPlayer par3EntityPlayer, List list, boolean par4) + { + + /* + if(!par3EntityPlayer.capabilities.isCreativeMode){ + return ; + }*/ + + //EnumChatFormatting color;// = ""; + + NumberFormat nf = NumberFormat.getNumberInstance(); + + int power = GearForceItemAPI.manager.getPower(itemStack); + int speed = GearForceItemAPI.manager.getSpeed(itemStack); + + list.add("" + EnumChatFormatting.RED + "Power " + EnumChatFormatting.GRAY + power + " / " + this.getMaxPower(itemStack) + ""); + list.add("" + EnumChatFormatting.BLUE + "Speed " + EnumChatFormatting.GRAY + nf.format(speed) + " / " + nf.format(this.getMaxSpeed(itemStack)) + ""); + + } + + @Override + public boolean showDurabilityBar(ItemStack stack) + { + + if (GearForceItemAPI.manager.getSpeed(stack) == 0) return false; + + return true;//stack.isItemDamaged(); + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + return 1.0D - ((double) GearForceItemAPI.manager.getSpeed(stack) / (double) this.getMaxSpeed(stack)); + } + + @Override + public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) + { + ItemStack empty = new ItemStack(this); + ItemStack full = new ItemStack(this); + + GearForceItemAPI.manager.setEnergy(empty, this.getMaxPower(empty), 0); + GearForceItemAPI.manager.setEnergy(full, this.getMaxPower(empty), this.getMaxSpeed(full)); + + par3List.add(empty); + par3List.add(full); + } + + @Override + public int getMaxPower(ItemStack container) { + return this.power; + } + + @Override + public int getMaxSpeed(ItemStack container) { + return this.speed; + } + + @Override + public boolean canSetSlot(int power) { + return slot == power; + } + +} diff --git a/src/main/java/shift/sextiarysector/api/machine/energy/EnergyStorage.java b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/EnergyStorage.java similarity index 93% rename from src/main/java/shift/sextiarysector/api/machine/energy/EnergyStorage.java rename to src/main/java/shift/sextiarysector/api/gearforce/tileentity/EnergyStorage.java index baba657..cca834d 100644 --- a/src/main/java/shift/sextiarysector/api/machine/energy/EnergyStorage.java +++ b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/EnergyStorage.java @@ -1,4 +1,4 @@ -package shift.sextiarysector.api.machine.energy; +package shift.sextiarysector.api.gearforce.tileentity; import net.minecraft.nbt.NBTTagCompound; @@ -138,7 +138,7 @@ public void modifyEnergyStored(int energy) { @Override public int addEnergy(int maxPower, int maxSpeed, boolean simulate) { - if(!this.isTransmissionGear()&&maxPower!=this.getMaxPowerStored()){ + if(!this.isTransmissionGear()&&maxPower!=this.getMaxPower()){ return 0; } @@ -155,7 +155,7 @@ public int addEnergy(int maxPower, int maxSpeed, boolean simulate) { @Override public int drawEnergy(int maxPower, int maxSpeed, boolean simulate) { - if(!this.isTransmissionGear()&&maxPower!=this.getMaxPowerStored()){ + if(!this.isTransmissionGear()&&maxPower!=this.getMaxPower()){ return 0; } @@ -194,12 +194,12 @@ public int getSpeedStored() { } @Override - public int getMaxPowerStored() { + public int getMaxPower() { return powerCapacity; } @Override - public int getMaxSpeedStored() { + public int getMaxSpeed() { return speedCapacity; } diff --git a/src/main/java/shift/sextiarysector/api/machine/energy/IEnergyHandler.java b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IEnergyHandler.java similarity index 89% rename from src/main/java/shift/sextiarysector/api/machine/energy/IEnergyHandler.java rename to src/main/java/shift/sextiarysector/api/gearforce/tileentity/IEnergyHandler.java index 33ba8c9..c55cf82 100644 --- a/src/main/java/shift/sextiarysector/api/machine/energy/IEnergyHandler.java +++ b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IEnergyHandler.java @@ -1,15 +1,17 @@ -package shift.sextiarysector.api.machine.energy; +package shift.sextiarysector.api.gearforce.tileentity; import net.minecraftforge.common.util.ForgeDirection; /** - * IEnergyHandler TileEntity逕ィ縺ョ繧ィ繝阪Ν繧ョ繝シ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ
- * TileEntity縺ォ螳溯」縺励※菴ソ縺」縺ヲ縺上□縺輔>縲 + * + * IGFEnergyHandler繧剃スソ縺」縺ヲ縺上□縺輔> + * * @see IEnergyStorage * @see EnergyStorage - * @version 1.0.0 + * @version 1.1.0 * @author Shift02 */ +@Deprecated public interface IEnergyHandler { /** @@ -32,7 +34,6 @@ public interface IEnergyHandler { */ int drawEnergy(ForgeDirection from, int power, int speed, boolean simulate); - /** * canInterface 郢九′繧九° * @param from 譁ケ隗 @@ -67,5 +68,4 @@ public interface IEnergyHandler { * @return 譛螟ァ蛟、(螳ケ驥) */ long getMaxSpeedStored(ForgeDirection from); - } diff --git a/src/main/java/shift/sextiarysector/api/machine/energy/IEnergyStorage.java b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IEnergyStorage.java similarity index 91% rename from src/main/java/shift/sextiarysector/api/machine/energy/IEnergyStorage.java rename to src/main/java/shift/sextiarysector/api/gearforce/tileentity/IEnergyStorage.java index 72e6882..f014bb9 100644 --- a/src/main/java/shift/sextiarysector/api/machine/energy/IEnergyStorage.java +++ b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IEnergyStorage.java @@ -1,4 +1,4 @@ -package shift.sextiarysector.api.machine.energy; +package shift.sextiarysector.api.gearforce.tileentity; /** * IEnergyStorage 繧ィ繝阪Ν繧ョ繝シ逕ィ縺ョ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ
@@ -46,11 +46,11 @@ public interface IEnergyStorage { /** * @return 譛螟ァ縺ョ蜉帙ョ蛟、 */ - int getMaxPowerStored(); + int getMaxPower(); /** * @return 譛螟ァ縺ョ騾溷コヲ縺ョ蛟、 */ - int getMaxSpeedStored(); + int getMaxSpeed(); } diff --git a/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IGearForceGrid.java b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IGearForceGrid.java new file mode 100644 index 0000000..d92a626 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IGearForceGrid.java @@ -0,0 +1,11 @@ +package shift.sextiarysector.api.gearforce.tileentity; + +import net.minecraftforge.common.util.ForgeDirection; + +public interface IGearForceGrid { + + boolean canIn(ForgeDirection from); + + boolean canOut(ForgeDirection from); + +} diff --git a/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IGearForceHandler.java b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IGearForceHandler.java new file mode 100644 index 0000000..355cc6d --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/IGearForceHandler.java @@ -0,0 +1,70 @@ +package shift.sextiarysector.api.gearforce.tileentity; + +import net.minecraftforge.common.util.ForgeDirection; + +/** + * IGFEnergyHandler TileEntity逕ィ縺ョ繧ィ繝阪Ν繧ョ繝シ繧、繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ
+ * TileEntity縺ォ螳溯」縺励※菴ソ縺」縺ヲ縺上□縺輔>縲 + * @see IEnergyStorage + * @see EnergyStorage + * @version 1.1.0 + * @author Shift02 + */ +public interface IGearForceHandler { + + /** + * addEnergy 繧ィ繝ャ繝ォ繧ョ繝シ縺ョ霑ス蜉 + * @param from 繧ィ繝阪Ν繧ョ繝シ繧貞刈縺医k譁ケ隗 + * @param power 蜉縺医k蜉帙ョ驥 + * @param speed 蜉縺医k騾溷コヲ縺ョ驥 + * @param simulate 繧キ繝溘Η繝ャ繝シ繧キ繝ァ繝ウ縺九←縺縺 + * @return 螳滄圀縺ォ蜉縺医l縺滄溷コヲ + */ + int addEnergy(ForgeDirection from, int power, int speed, boolean simulate); + + /** + * drawEnergy 繧ィ繝ャ繝ォ繧ョ繝シ縺ョ貂帛ー + * @param from 繧ィ繝阪Ν繧ョ繝シ繧呈ク帙i縺呎婿隗 + * @param power 貂帙i縺吝鴨縺ョ驥 + * @param speed 貂帙i縺咎溷コヲ縺ョ驥 + * @param simulate 繧キ繝溘Η繝ャ繝シ繧キ繝ァ繝ウ縺九←縺縺 + * @return 螳滄圀縺ォ貂帙i縺帙l縺滄溷コヲ + */ + int drawEnergy(ForgeDirection from, int power, int speed, boolean simulate); + + /** + * canInterface 郢九′繧九° + * @param from 譁ケ隗 + * @return 縺昴ョ譁ケ隗偵↓蜍募鴨繧貞・蜉帙∪縺溘ッ蜃コ蜉帛コ譚・繧句エ蜷医ッtrue + */ + boolean canInterface(ForgeDirection from); + + /** + * getPowerStored 蜉帙ョ蜿門セ + * @param from 譁ケ隗 + * @return 縺昴ョ譁ケ隗偵ョ迴セ蝨ィ縺ョ蜉帙ョ驥 + */ + int getPowerStored(ForgeDirection from); + + /** + * getSpeedStored 騾溷コヲ縺ョ蜿門セ + * @param from 譁ケ隗 + * @return 縺昴ョ譁ケ隗偵ョ迴セ蝨ィ縺ョ騾溷コヲ縺ョ驥 + */ + int getSpeedStored(ForgeDirection from); + + /** + * getMaxPowerStored 蜉帙ョ譛螟ァ蛟、(螳ケ驥)縺ョ蜿門セ + * @param from 譁ケ隗 + * @return 譛螟ァ蛟、(螳ケ驥) + */ + int getMaxPowerStored(ForgeDirection from); + + /** + * getMaxSpeedStored 騾溷コヲ縺ョ譛螟ァ蛟、(螳ケ驥)縺ョ蜿門セ + * @param from 譁ケ隗 + * @return 譛螟ァ蛟、(螳ケ驥) + */ + int getMaxSpeedStored(ForgeDirection from); + +} diff --git a/src/main/java/shift/sextiarysector/api/machine/energy/TileEnergyHandler.java b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/TileEnergyHandler.java similarity index 71% rename from src/main/java/shift/sextiarysector/api/machine/energy/TileEnergyHandler.java rename to src/main/java/shift/sextiarysector/api/gearforce/tileentity/TileEnergyHandler.java index 6c285a6..cb5a96c 100644 --- a/src/main/java/shift/sextiarysector/api/machine/energy/TileEnergyHandler.java +++ b/src/main/java/shift/sextiarysector/api/gearforce/tileentity/TileEnergyHandler.java @@ -1,4 +1,4 @@ -package shift.sextiarysector.api.machine.energy; +package shift.sextiarysector.api.gearforce.tileentity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; @@ -7,10 +7,14 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -public class TileEnergyHandler extends TileEntity implements IEnergyHandler { - - EnergyStorage storage = new EnergyStorage("Base",1,1000); +/** + * IGFEnergyHandler縺ョ螳溯」萓 + * @version 1.0.0 + * @author Shift02 + */ +public class TileEnergyHandler extends TileEntity implements IGearForceHandler { + EnergyStorage storage = new EnergyStorage("Base", 1, 1000); //EnergyStorage縺ョ蛻ゥ逕ィ @Override @@ -42,7 +46,7 @@ public int getPowerStored(ForgeDirection from) { } @Override - public long getSpeedStored(ForgeDirection from) { + public int getSpeedStored(ForgeDirection from) { return storage.getSpeedStored(); @@ -51,18 +55,17 @@ public long getSpeedStored(ForgeDirection from) { @Override public int getMaxPowerStored(ForgeDirection from) { - return storage.getMaxPowerStored(); + return storage.getMaxPower(); } @Override - public long getMaxSpeedStored(ForgeDirection from) { + public int getMaxSpeedStored(ForgeDirection from) { - return storage.getMaxSpeedStored(); + return storage.getMaxSpeed(); } - //NBT髢「菫 @Override public void readFromNBT(NBTTagCompound nbt) { @@ -81,12 +84,12 @@ public void writeToNBT(NBTTagCompound nbt) { @Override public Packet getDescriptionPacket() { NBTTagCompound nbt = new NBTTagCompound(); - this.writeToNBT(nbt); - return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + this.writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); } @Override - public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { this.readFromNBT(pkt.func_148857_g()); } diff --git a/src/main/java/shift/sextiarysector/api/machine/item/GearForceItem.java b/src/main/java/shift/sextiarysector/api/machine/item/GearForceItem.java deleted file mode 100644 index 48bafb8..0000000 --- a/src/main/java/shift/sextiarysector/api/machine/item/GearForceItem.java +++ /dev/null @@ -1,7 +0,0 @@ -package shift.sextiarysector.api.machine.item; - -public class GearForceItem { - - public static IGearForceItemManager manager; - -} diff --git a/src/main/java/shift/sextiarysector/api/machine/item/IGearForceItem.java b/src/main/java/shift/sextiarysector/api/machine/item/IGearForceItem.java deleted file mode 100644 index 57af6de..0000000 --- a/src/main/java/shift/sextiarysector/api/machine/item/IGearForceItem.java +++ /dev/null @@ -1,22 +0,0 @@ -package shift.sextiarysector.api.machine.item; - -import net.minecraft.item.ItemStack; - -/** - * IGearForceItem Item縺ァGF繧呈桶縺医k繧医≧縺ォ縺ェ繧九う繝ウ繧ソ繝シ繝輔ぉ繝シ繧ケ
- * Item縺ォ螳溯」縺励※縺上□縺輔> - * @see ItemGearForce - * @version 1.0.0 - * @author Shift02 - */ -public interface IGearForceItem { - - int getMaxPowerStored(ItemStack container); - - int getMaxSpeedStored(ItemStack container); - - boolean canSetSlot(int power); - - boolean isCustomDamage(ItemStack container); - -} diff --git a/src/main/java/shift/sextiarysector/api/machine/item/IHammer.java b/src/main/java/shift/sextiarysector/api/machine/item/IHammer.java deleted file mode 100644 index 98cb768..0000000 --- a/src/main/java/shift/sextiarysector/api/machine/item/IHammer.java +++ /dev/null @@ -1,11 +0,0 @@ -package shift.sextiarysector.api.machine.item; - -import net.minecraft.item.ItemStack; - -public interface IHammer { - - public boolean canUse(ItemStack item); - - public boolean use(ItemStack item); - -} diff --git a/src/main/java/shift/sextiarysector/api/machine/item/ItemGearForce.java b/src/main/java/shift/sextiarysector/api/machine/item/ItemGearForce.java deleted file mode 100644 index 0b08ba5..0000000 --- a/src/main/java/shift/sextiarysector/api/machine/item/ItemGearForce.java +++ /dev/null @@ -1,91 +0,0 @@ -package shift.sextiarysector.api.machine.item; - -import java.text.NumberFormat; -import java.util.List; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; - -/** - * ItemGearForce {@link IGearForceItem} 縺ョ螳溯」萓 - * @see IGearForceItem - * @version 1.0.0 - * @author Shift02 - */ -public class ItemGearForce extends Item implements IGearForceItem{ - - int power; - int speed; - - int slot; - - public ItemGearForce(int power, int maxSpeed, int slot){ - - this.setMaxStackSize(1); - this.setNoRepair(); - - this.power=power; - this.speed=maxSpeed; - - this.slot=slot; - - } - - @Override - public void addInformation(ItemStack itemStack, EntityPlayer par3EntityPlayer, List list, boolean par4) - { - - /* - if(!par3EntityPlayer.capabilities.isCreativeMode){ - return ; - }*/ - - //EnumChatFormatting color;// = ""; - - NumberFormat nf = NumberFormat.getNumberInstance(); - - int power = GearForceItem.manager.getPower(itemStack); - int speed = GearForceItem.manager.getSpeed(itemStack); - - list.add(""+ EnumChatFormatting.RED + "Power " + EnumChatFormatting.GRAY + power +" / "+this.getMaxPowerStored(itemStack)+ ""); - list.add(""+ EnumChatFormatting.BLUE + "Speed " + EnumChatFormatting.GRAY + nf.format(speed) +" / "+ nf.format(this.getMaxSpeedStored(itemStack))+ ""); - - } - - @Override - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) - { - ItemStack empty = new ItemStack(this); - ItemStack full = new ItemStack(this); - - GearForceItem.manager.setEnergy(empty, this.getMaxPowerStored(empty), 0); - GearForceItem.manager.setEnergy(full, this.getMaxPowerStored(empty), this.getMaxSpeedStored(full)); - - par3List.add(empty); - par3List.add(full); - } - - @Override - public int getMaxPowerStored(ItemStack container) { - return this.power; - } - - @Override - public int getMaxSpeedStored(ItemStack container) { - return this.speed; - } - - @Override - public boolean isCustomDamage(ItemStack container) { - return true; - } - - @Override - public boolean canSetSlot(int power) { - return slot>=power; - } - -} diff --git a/src/main/java/shift/sextiarysector/api/package-info.java b/src/main/java/shift/sextiarysector/api/package-info.java index 41b7324..7f7aac4 100644 --- a/src/main/java/shift/sextiarysector/api/package-info.java +++ b/src/main/java/shift/sextiarysector/api/package-info.java @@ -1,4 +1,5 @@ @API(apiVersion = "1.0.4", owner = shift.sextiarysector.api.SextiarySectorAPI.MODID, provides = "SextiarySectorAPI|core") package shift.sextiarysector.api; + import cpw.mods.fml.common.API; diff --git a/src/main/java/shift/sextiarysector/api/potion/PotionBase.java b/src/main/java/shift/sextiarysector/api/potion/PotionBase.java new file mode 100644 index 0000000..93cfed3 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/potion/PotionBase.java @@ -0,0 +1,27 @@ +package shift.sextiarysector.api.potion; + +import net.minecraft.client.Minecraft; +import net.minecraft.potion.Potion; +import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public abstract class PotionBase extends Potion { + + protected static final ResourceLocation field_147001_a = new ResourceLocation("sextiarysector:textures/guis/potion.png"); + + public PotionBase(int id, boolean isBadEffect, int liquidColor, int icon) { + super(id, isBadEffect, liquidColor); + this.setIconIndex(icon % 8, icon / 8); + } + + @Override + @SideOnly(Side.CLIENT) + public int getStatusIconIndex() { + Minecraft.getMinecraft().renderEngine.bindTexture(this.getPotionResource()); + return super.getStatusIconIndex(); + } + + abstract protected ResourceLocation getPotionResource(); + +} diff --git a/src/main/java/shift/sextiarysector/api/potion/PotionBurn.java b/src/main/java/shift/sextiarysector/api/potion/PotionBurn.java new file mode 100644 index 0000000..d6539fb --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/potion/PotionBurn.java @@ -0,0 +1,37 @@ +package shift.sextiarysector.api.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; +import net.minecraft.util.ResourceLocation; + +public class PotionBurn extends PotionBase { + + public PotionBurn(int id, boolean isBadEffect, int liquidColor, int icon) { + super(id, isBadEffect, liquidColor, icon); + } + + public static final ResourceLocation rl = new ResourceLocation("sextiarysector", "textures/guis/inventory_ss_potion.png"); + + @Override + protected ResourceLocation getPotionResource() { + return rl; + } + + @Override + public void performEffect(EntityLivingBase p_76394_1_, int p_76394_2_) + { + + if (p_76394_1_.getHealth() > 1.0F) + { + p_76394_1_.attackEntityFrom(DamageSource.onFire, 1.0F); + } + + } + + @Override + public boolean isReady(int par1, int par2) + { + int k = 30 >> par2; + return k > 0 ? par1 % k == 0 : true; + } +} diff --git a/src/main/java/shift/sextiarysector/api/potion/PotionHotSprings.java b/src/main/java/shift/sextiarysector/api/potion/PotionHotSprings.java new file mode 100644 index 0000000..b95cd63 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/potion/PotionHotSprings.java @@ -0,0 +1,42 @@ +package shift.sextiarysector.api.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class PotionHotSprings extends PotionBase { + + public PotionHotSprings(int id, boolean isBadEffect, int liquidColor, int icon) { + super(id, isBadEffect, liquidColor, icon); + } + + public static final ResourceLocation rl = new ResourceLocation("sextiarysector", "textures/guis/inventory_ss_potion.png"); + + @Override + protected ResourceLocation getPotionResource() { + return rl; + } + + @Override + public void performEffect(EntityLivingBase p_76394_1_, int p_76394_2_) + { + + if (!(p_76394_1_ instanceof EntityPlayer)) return; + + EntityPlayer player = (EntityPlayer) p_76394_1_; + + if (SextiarySectorAPI.getMoistureLevel(player) < 3) return; + + SextiarySectorAPI.addStaminaStats(player, 3, 0.7f); + SextiarySectorAPI.addMoistureExhaustion(player, 1.9f); + } + + @Override + public boolean isReady(int par1, int par2) + { + int k = 70 >> par2; + return k > 0 ? par1 % k == 0 : true; + } + +} diff --git a/src/main/java/shift/sextiarysector/api/recipe/IFluidRecipe.java b/src/main/java/shift/sextiarysector/api/recipe/IFluidRecipe.java new file mode 100644 index 0000000..514468e --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/recipe/IFluidRecipe.java @@ -0,0 +1,22 @@ +package shift.sextiarysector.api.recipe; + +import java.util.Map; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public interface IFluidRecipe { + + public void add(ItemStack par1ItemStack, ItemStack par2ItemStack, FluidStack par3FluidStack); + + public void add(String par1String, ItemStack par2ItemStack, FluidStack par3FluidStack); + + public ItemStack getResult(ItemStack item); + + public FluidStack getFluidResult(ItemStack item); + + public Map getMetaList(); + + public Map getOreList(); + +} diff --git a/src/main/java/shift/sextiarysector/api/recipe/INormalRecipe.java b/src/main/java/shift/sextiarysector/api/recipe/INormalRecipe.java new file mode 100644 index 0000000..6578405 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/recipe/INormalRecipe.java @@ -0,0 +1,54 @@ +package shift.sextiarysector.api.recipe; + +import java.util.Map; + +import net.minecraft.item.ItemStack; + +/** + * + * 騾壼クク縺ョ蜉蟾・繝ャ繧キ繝皮畑Interface + * + * @author Shift02 + * + */ +public interface INormalRecipe { + + /** + * 繝ャ繧キ繝斐ョ霑ス蜉 + * + * @param material 譚先侭 (ItemStack) + * @param result 螳梧仙刀 + */ + public void add(ItemStack material, ItemStack result); + + /** + * 繝ャ繧キ繝斐ョ霑ス蜉 + * + * @param oreDictionary 譚先侭 (String) + * @param result 螳梧仙刀 + */ + public void add(String oreDictionary, ItemStack result); + + /** + * 譚先侭縺九i螳梧仙刀繧貞叙蠕励☆繧 + * + * @param material 譚先侭 + * @return 螳梧仙刀 縺ェ縺蝣エ蜷医ッnull縺瑚ソ斐k + */ + public ItemStack getResult(ItemStack material); + + /** + * 繝ャ繧キ繝斐ョ邂。逅繝ェ繧ケ繝 + * + * @return ItemStack縺ァ邂。逅縺励※縺繧九Μ繧ケ繝 + */ + public Map getMetaList(); + + /** + * 繝ャ繧キ繝斐ョ邂。逅繝ェ繧ケ繝 + * + * @return OreDictionary縺ァ邂。逅縺励※縺繧九Μ繧ケ繝 + */ + public Map getOreList(); + +} diff --git a/src/main/java/shift/sextiarysector/api/recipe/RecipeAPI.java b/src/main/java/shift/sextiarysector/api/recipe/RecipeAPI.java new file mode 100644 index 0000000..74666f4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/api/recipe/RecipeAPI.java @@ -0,0 +1,34 @@ +package shift.sextiarysector.api.recipe; + +/** + * 繝ャ繧キ繝斐r邂。逅縺励※縺繧気lass
+ * SextiarySector2縺ョ讖滓「ー縺ォ繝ャ繧キ繝斐r霑ス蜉縺ァ縺阪∪縺吶 + * + * @version 1.0.0 + * @author Shift02 + * + */ +public class RecipeAPI { + + public static INormalRecipe millstone;; + public static INormalRecipe loom; + public static INormalRecipe sawmill; + public static INormalRecipe spinning_machine; + public static IFluidRecipe extractor; + public static INormalRecipe pulverizer; + public static INormalRecipe rollingMachine; + public static IFluidRecipe manaSqueezer; + public static INormalRecipe timeMachine; + + /** + * + * INormalRecipe縺ョ菴ソ縺譁ケ + * + * RecipeAPI.millstone.add(new ItemStack(Blocks.stone, 1), new ItemStack(Blocks.cobblestone, 1)); + * + * 縺薙l縺ァ遏ウ縺九i荳ク遏ウ繧剃ス懊k繝ャ繧キ繝斐′遏ウ閾シ縺ォ霑ス蜉縺輔l繧 + * + * + */ + +} diff --git a/src/main/java/shift/sextiarysector/api/season/package-info.java b/src/main/java/shift/sextiarysector/api/season/package-info.java index b6df146..d37f79d 100644 --- a/src/main/java/shift/sextiarysector/api/season/package-info.java +++ b/src/main/java/shift/sextiarysector/api/season/package-info.java @@ -1,4 +1,5 @@ -@API(apiVersion = "1.0.0", owner = shift.sextiarysector.api.SextiarySectorAPI.MODID, provides = "SextiarySectorAPI|season") +@API(apiVersion = "1.0.0", owner = "SextiarySectorAPI|core", provides = "SextiarySectorAPI|season") package shift.sextiarysector.api.season; + import cpw.mods.fml.common.API; diff --git a/src/main/java/shift/sextiarysector/asm/CauldronTransformer.java b/src/main/java/shift/sextiarysector/asm/CauldronTransformer.java new file mode 100644 index 0000000..cea9cee --- /dev/null +++ b/src/main/java/shift/sextiarysector/asm/CauldronTransformer.java @@ -0,0 +1,134 @@ +package shift.sextiarysector.asm; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.Opcodes; + +public class CauldronTransformer implements IClassTransformer, Opcodes +{ + // 謾ケ螟牙ッセ雎。縺ョ繧ッ繝ゥ繧ケ縺ョ螳悟ィ菫ョ鬟セ蜷阪〒縺吶 + // 蠕瑚ソー縺ァMinecraft.jar蜀縺ョ髮」隱ュ蛹悶&繧後k繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ィ縺吶k蝣エ蜷医ョ邁。譏薙↑蜿門セ玲婿豕輔r邏ケ莉九@縺セ縺吶 + private static final String TARGET_CLASS_NAME = "net.minecraft.block.BlockCauldron"; + + // 繧ッ繝ゥ繧ケ縺後Ο繝シ繝峨&繧後k髫帙↓蜻シ縺ウ蜃コ縺輔l繧九Γ繧ス繝繝峨〒縺吶 + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) + { + // FMLRelauncher.side() : Client/Server 縺ゥ縺。繧峨°荳譁ケ縺ョ繧貞ッセ雎。縺ィ縺吶k蝣エ蜷医d縲 + // 荳縺、縺ョMOD縺ァ Client/Sever 荳。譁ケ縺ォ蟇セ蠢懊@縺櫪OD縺ァ縲√%縺ョ蛟、繧貞愛螳壹@縺ヲ蜃ヲ逅繧貞、峨∴繧倶コ九′縺ァ縺阪∪縺吶 + // 莉雁屓縺ッ"CLIENT"縺ィ豈碑シ縺励,lient蛛エ縺ョ繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ィ縺励※縺繧倶セ九〒縺吶 + // Client蛛エ蟆ら畑縺ョMOD縺ィ縺励※蜈ャ髢九☆繧九ョ縺ァ縺ゅl縺ー縲∝愛螳壹ッ蠢鬆医〒縺ッ縺ゅj縺セ縺帙s縲 + + // name : 迴セ蝨ィ繝ュ繝シ繝峨&繧後h縺縺ィ縺励※縺繧九け繝ゥ繧ケ蜷阪′譬シ邏阪&繧後※縺縺セ縺吶 + if (!transformedName.equals(TARGET_CLASS_NAME)) + { + // 蜃ヲ逅蟇セ雎。螟悶↑縺ョ縺ァ菴輔b縺励↑縺 + return basicClass; + } + + try + { + // -------------------------------------------------------------- + // 繧ッ繝ゥ繧ケ繝輔ぃ繧、繝ォ荳ク縺斐→蟾ョ縺玲崛縺医k蝣エ蜷 + // -------------------------------------------------------------- + return replaceClass(basicClass); + + // -------------------------------------------------------------- + // ASM繧剃スソ逕ィ縺励∵里蟄倥ョ繧ッ繝ゥ繧ケ繝輔ぃ繧、繝ォ縺ォ謾ケ螟峨r譁ス縺吝エ蜷医 + // -------------------------------------------------------------- + // return hookDoRenderLivingMethod(bytes); + + } catch (Exception e) + { + throw new RuntimeException("failed : TutorialTransformer loading", e); + } + } + + // 荳玖ィ倥ョ諠ウ螳壹〒螳溯」縺輔l縺ヲ縺縺セ縺吶 + // 蟇セ雎。繧ッ繝ゥ繧ケ縺ョ bytes 繧 ModifiedTargetClass.class 繝輔ぃ繧、繝ォ縺ォ鄂ョ縺肴鋤縺医k + private byte[] replaceClass(byte[] bytes) throws IOException + { + ZipFile zf = null; + InputStream zi = null; + + File f = null; + + try + { + + if (SSCore.location.isDirectory()) { + + f = new File(SSCore.location, "./net/minecraft/block/BlockCauldron.class"); + + if (f != null) + { + + zi = new FileInputStream(f); + int len = (int) f.length(); + bytes = new byte[len]; + + // 繝偵シ繝励し繧、繧コ繧定カ縺医↑縺繧医≧縺ォ縲√せ繝医Μ繝シ繝縺九i繝輔ぃ繧、繝ォ繧1024縺壹▽隱ュ縺ソ霎シ繧薙〒 bytes 縺ォ譬シ邏阪☆繧 + int MAX_READ = 1024; + int readed = 0, readsize, ret; + while (readed < len) { + readsize = MAX_READ; + if (len - readed < MAX_READ) { + readsize = len - readed; + } + ret = zi.read(bytes, readed, readsize); + if (ret == -1) break; + readed += ret; + } + } + + } else { + + zf = new ZipFile(SSCore.location); + + // 蟾ョ縺玲崛縺亥セ後ョ繝輔ぃ繧、繝ォ縺ァ縺吶Doremod縺ョjar蜀縺ョ繝代せ繧呈欠螳壹@縺セ縺吶 + ZipEntry ze = zf.getEntry("BlockSSCauldron.class"); + + if (ze != null) + { + zi = zf.getInputStream(ze); + int len = (int) ze.getSize(); + bytes = new byte[len]; + + // 繝偵シ繝励し繧、繧コ繧定カ縺医↑縺繧医≧縺ォ縲√せ繝医Μ繝シ繝縺九i繝輔ぃ繧、繝ォ繧1024縺壹▽隱ュ縺ソ霎シ繧薙〒 bytes 縺ォ譬シ邏阪☆繧 + int MAX_READ = 1024; + int readed = 0, readsize, ret; + while (readed < len) { + readsize = MAX_READ; + if (len - readed < MAX_READ) { + readsize = len - readed; + } + ret = zi.read(bytes, readed, readsize); + if (ret == -1) break; + readed += ret; + } + } + + } + + return bytes; + } finally + { + if (zi != null) + { + zi.close(); + } + + if (zf != null) + { + zf.close(); + } + } + } +} diff --git a/src/main/java/shift/sextiarysector/asm/DepLoader.java b/src/main/java/shift/sextiarysector/asm/DepLoader.java new file mode 100644 index 0000000..412bcd6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/asm/DepLoader.java @@ -0,0 +1,656 @@ +package shift.sextiarysector.asm; + +import java.awt.Desktop; +import java.awt.Dialog.ModalityType; +import java.awt.Dimension; +import java.awt.GraphicsEnvironment; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; +import java.io.Closeable; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.InterruptedIOException; +import java.lang.reflect.Field; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.net.URLConnection; +import java.nio.ByteBuffer; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +import javax.swing.Box; +import javax.swing.JDialog; +import javax.swing.JEditorPane; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JProgressBar; +import javax.swing.WindowConstants; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; + +import net.minecraft.launchwrapper.LaunchClassLoader; +import sun.misc.URLClassPath; +import sun.net.util.URLUtil; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +import cpw.mods.fml.common.versioning.ComparableVersion; +import cpw.mods.fml.relauncher.FMLInjectionData; +import cpw.mods.fml.relauncher.FMLLaunchHandler; +import cpw.mods.fml.relauncher.IFMLCallHook; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** + * The majority of this source code was created by FML staff and chickenbone. + * My work is not nearly. + */ +public class DepLoader implements IFMLCallHook { + private static ByteBuffer downloadBuffer = ByteBuffer.allocateDirect(1 << 23); + private static final String owner = "SS2's DepLoader";//"CB's DepLoader"; + private static DepLoadInst inst; + + private static final String DEPENDENCIES_INFO = "ss_dependencies.info"; + + public interface IDownloadDisplay { + void resetProgress(int sizeGuess); + + void setPokeThread(Thread currentThread); + + void updateProgress(int fullLength); + + boolean shouldStopIt(); + + void updateProgressString(String string, Object... data); + + Object makeDialog(); + + void showErrorDialog(String name, String url); + } + + @SuppressWarnings("serial") + public static class Downloader extends JOptionPane implements IDownloadDisplay { + private JDialog container; + private JLabel currentActivity; + private JProgressBar progress; + boolean stopIt; + Thread pokeThread; + + private Box makeProgressPanel() { + Box box = Box.createVerticalBox(); + box.add(Box.createRigidArea(new Dimension(0, 10))); + JLabel welcomeLabel = new JLabel("" + owner + " is setting up your minecraft environment"); + box.add(welcomeLabel); + welcomeLabel.setAlignmentY(LEFT_ALIGNMENT); + welcomeLabel = new JLabel("Please wait, " + owner + " has some tasks to do before you can play"); + welcomeLabel.setAlignmentY(LEFT_ALIGNMENT); + box.add(welcomeLabel); + box.add(Box.createRigidArea(new Dimension(0, 10))); + currentActivity = new JLabel("Currently doing ..."); + box.add(currentActivity); + box.add(Box.createRigidArea(new Dimension(0, 10))); + progress = new JProgressBar(0, 100); + progress.setStringPainted(true); + box.add(progress); + box.add(Box.createRigidArea(new Dimension(0, 30))); + return box; + } + + @Override + public JDialog makeDialog() { + if (container != null) + return container; + + setMessageType(JOptionPane.INFORMATION_MESSAGE); + setMessage(makeProgressPanel()); + setOptions(new Object[] { "Stop" }); + addPropertyChangeListener(new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (evt.getSource() == Downloader.this && evt.getPropertyName() == VALUE_PROPERTY) { + requestClose("This will stop minecraft from launching\nAre you sure you want to do this?"); + } + } + }); + container = new JDialog(null, "Hello", ModalityType.MODELESS); + container.setResizable(false); + container.setLocationRelativeTo(null); + container.add(this); + this.updateUI(); + container.pack(); + container.setMinimumSize(container.getPreferredSize()); + container.setVisible(true); + container.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); + container.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + requestClose("Closing this window will stop minecraft from launching\nAre you sure you wish to do this?"); + } + }); + return container; + } + + protected void requestClose(String message) { + int shouldClose = JOptionPane.showConfirmDialog(container, message, "Are you sure you want to stop?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); + if (shouldClose == JOptionPane.YES_OPTION) + container.dispose(); + + stopIt = true; + if (pokeThread != null) + pokeThread.interrupt(); + } + + @Override + public void updateProgressString(String progressUpdate, Object... data) { + //FMLLog.finest(progressUpdate, data); + if (currentActivity != null) + currentActivity.setText(String.format(progressUpdate, data)); + } + + @Override + public void resetProgress(int sizeGuess) { + if (progress != null) + progress.getModel().setRangeProperties(0, 0, 0, sizeGuess, false); + } + + @Override + public void updateProgress(int fullLength) { + if (progress != null) + progress.getModel().setValue(fullLength); + } + + @Override + public void setPokeThread(Thread currentThread) { + this.pokeThread = currentThread; + } + + @Override + public boolean shouldStopIt() { + return stopIt; + } + + @Override + public void showErrorDialog(String name, String url) { + JEditorPane ep = new JEditorPane("text/html", + // "" + + // owner + " was unable to download required library " + name + + // "
Check your internet connection and try restarting or download it manually from" + + // "
" + url + " and put it in your mods folder" + + // ""); + //"" + + // owner + getI18n("dep.ss.error1") + name + getI18n("dep.ss.error2") + + // "
" + getI18n("dep.ss.error3") + + // "
" + url + "" + getI18n("dep.ss.error4") + + // ""); + getErrorI18n(name, url)); + + ep.setEditable(false); + ep.setOpaque(false); + ep.addHyperlinkListener(new HyperlinkListener() { + @Override + public void hyperlinkUpdate(HyperlinkEvent event) { + try { + if (event.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) + Desktop.getDesktop().browse(event.getURL().toURI()); + } catch (Exception e) { + } + } + }); + + JOptionPane.showMessageDialog(null, ep, "A download error has occured", JOptionPane.ERROR_MESSAGE); + } + + @SideOnly(Side.CLIENT) + public String getErrorI18n(String name, String url) { + //return net.minecraft.client.resources.I18n.format(s); + + if (Locale.getDefault().equals(Locale.JAPANESE) || Locale.getDefault().equals(Locale.JAPAN)) { + + return "" + + owner + " 縺ッ蠢隕√↑繝ゥ繧、繝悶Λ繝ェ " + name + " 繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨☆繧九%縺ィ縺後〒縺阪∪縺帙s縺ァ縺励◆縲" + + "
繧、繝ウ繧ソ繝シ繝阪ャ繝医ョ謗・邯壹r遒コ隱阪@縺ヲ蜀崎オキ蜍輔☆繧九°縲" + + "
謇句虚縺ァ " + url + " 縺九i繝繧ヲ繝ウ繝ュ繝シ繝峨@縺ヲmods繝輔か繝ォ繝縺ォ蜈・繧後※縺上□縺輔>縲" + + ""; + + } + + return "" + + owner + " was unable to download required library " + name + + "
Check your internet connection and try restarting or download it manually from" + + "
" + url + " and put it in your mods folder" + + ""; + } + + } + + public static class DummyDownloader implements IDownloadDisplay { + @Override + public void resetProgress(int sizeGuess) { + } + + @Override + public void setPokeThread(Thread currentThread) { + } + + @Override + public void updateProgress(int fullLength) { + } + + @Override + public boolean shouldStopIt() { + return false; + } + + @Override + public void updateProgressString(String string, Object... data) { + } + + @Override + public Object makeDialog() { + return null; + } + + @Override + public void showErrorDialog(String name, String url) { + } + } + + public static class VersionedFile + { + public final Pattern pattern; + public final String filename; + public final ComparableVersion version; + public final String name; + + public VersionedFile(String filename, Pattern pattern) { + this.pattern = pattern; + this.filename = filename; + Matcher m = pattern.matcher(filename); + if (m.matches()) { + name = m.group(1); + version = new ComparableVersion(m.group(2)); + } + else { + name = null; + version = null; + } + } + + public boolean matches() { + return name != null; + } + } + + public static class Dependency + { + public String url; + public VersionedFile file; + + public String existing; + /** + * Flag set to add this dep to the classpath immediately because it is required for a coremod. + */ + public boolean coreLib; + + public Dependency(String url, VersionedFile file, boolean coreLib) { + this.url = url; + this.file = file; + this.coreLib = coreLib; + } + } + + public static class DepLoadInst { + private final File modsDir; + private final File v_modsDir; + private final File eclipse_modDir; + private IDownloadDisplay downloadMonitor; + private JDialog popupWindow; + + private final Map depMap = new HashMap(); + private final HashSet depSet = new HashSet(); + + public DepLoadInst() { + String mcVer = (String) FMLInjectionData.data()[4]; + File mcDir = (File) FMLInjectionData.data()[6]; + + modsDir = new File(mcDir, "mods"); + v_modsDir = new File(mcDir, "mods/" + mcVer); + eclipse_modDir = new File(mcDir, "../bin"); + if (!v_modsDir.exists()) + v_modsDir.mkdirs(); + + } + + private void addClasspath(String name) { + try { + ((LaunchClassLoader) DepLoader.class.getClassLoader()).addURL(new File(v_modsDir, name).toURI().toURL()); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } + } + + private void deleteMod(File mod) { + if (mod.delete()) + return; + + try { + ClassLoader cl = DepLoader.class.getClassLoader(); + URL url = mod.toURI().toURL(); + Field f_ucp = URLClassLoader.class.getDeclaredField("ucp"); + Field f_loaders = URLClassPath.class.getDeclaredField("loaders"); + Field f_lmap = URLClassPath.class.getDeclaredField("lmap"); + f_ucp.setAccessible(true); + f_loaders.setAccessible(true); + f_lmap.setAccessible(true); + + URLClassPath ucp = (URLClassPath) f_ucp.get(cl); + Closeable loader = ((Map) f_lmap.get(ucp)).remove(URLUtil.urlNoFragString(url)); + if (loader != null) { + loader.close(); + ((List) f_loaders.get(ucp)).remove(loader); + } + } catch (Exception e) { + e.printStackTrace(); + } + + if (!mod.delete()) { + mod.deleteOnExit(); + String msg = owner + " was unable to delete file " + mod.getPath() + " the game will now try to delete it on exit. If this dialog appears again, delete it manually."; + System.err.println(msg); + if (!GraphicsEnvironment.isHeadless()) + JOptionPane.showMessageDialog(null, msg, "An update error has occured", JOptionPane.ERROR_MESSAGE); + + System.exit(1); + } + } + + private void download(Dependency dep) { + popupWindow = (JDialog) downloadMonitor.makeDialog(); + File libFile = new File(v_modsDir, dep.file.filename); + try { + URL libDownload = new URL(dep.url + '/' + dep.file.filename); + downloadMonitor.updateProgressString("Downloading file %s", libDownload.toString()); + System.out.format("Downloading file %s\n", libDownload.toString()); + URLConnection connection = libDownload.openConnection(); + connection.setConnectTimeout(5000); + connection.setReadTimeout(5000); + connection.setRequestProperty("User-Agent", "" + owner + " Downloader"); + int sizeGuess = connection.getContentLength(); + download(connection.getInputStream(), sizeGuess, libFile); + downloadMonitor.updateProgressString("Download complete"); + System.out.println("Download complete"); + + scanDepInfo(libFile); + } catch (Exception e) { + libFile.delete(); + if (downloadMonitor.shouldStopIt()) { + System.err.println("You have stopped the downloading operation before it could complete"); + System.exit(1); + return; + } + downloadMonitor.showErrorDialog(dep.file.filename, dep.url + '/' + dep.file.filename); + throw new RuntimeException("A download error occured", e); + } + } + + private void download(InputStream is, int sizeGuess, File target) throws Exception { + if (sizeGuess > downloadBuffer.capacity()) + throw new Exception(String.format("The file %s is too large to be downloaded by " + owner + " - the download is invalid", target.getName())); + + downloadBuffer.clear(); + + int bytesRead, fullLength = 0; + + downloadMonitor.resetProgress(sizeGuess); + try { + downloadMonitor.setPokeThread(Thread.currentThread()); + byte[] smallBuffer = new byte[1024]; + while ((bytesRead = is.read(smallBuffer)) >= 0) { + downloadBuffer.put(smallBuffer, 0, bytesRead); + fullLength += bytesRead; + if (downloadMonitor.shouldStopIt()) { + break; + } + downloadMonitor.updateProgress(fullLength); + } + is.close(); + downloadMonitor.setPokeThread(null); + downloadBuffer.limit(fullLength); + downloadBuffer.position(0); + } catch (InterruptedIOException e) { + // We were interrupted by the stop button. We're stopping now.. clear interruption flag. + Thread.interrupted(); + throw new Exception("Stop"); + } catch (IOException e) { + throw e; + } + + try { + /*String cksum = generateChecksum(downloadBuffer); + if (cksum.equals(validationHash)) + {*/ + if (!target.exists()) + target.createNewFile(); + + downloadBuffer.position(0); + FileOutputStream fos = new FileOutputStream(target); + fos.getChannel().write(downloadBuffer); + fos.close(); + /*} + else + { + throw new RuntimeException(String.format("The downloaded file %s has an invalid checksum %s (expecting %s). The download did not succeed correctly and the file has been deleted. Please try launching again.", target.getName(), cksum, validationHash)); + }*/ + } catch (Exception e) { + throw e; + } + } + + private String checkExisting(Dependency dep) { + for (File f : modsDir.listFiles()) { + VersionedFile vfile = new VersionedFile(f.getName(), dep.file.pattern); + if (!vfile.matches() || !vfile.name.equals(dep.file.name)) + continue; + + if (f.renameTo(new File(v_modsDir, f.getName()))) + continue; + + deleteMod(f); + } + + for (File f : v_modsDir.listFiles()) { + VersionedFile vfile = new VersionedFile(f.getName(), dep.file.pattern); + if (!vfile.matches() || !vfile.name.equals(dep.file.name)) + continue; + + int cmp = vfile.version.compareTo(dep.file.version); + if (cmp < 0) { + System.out.println("Deleted old version " + f.getName()); + deleteMod(f); + return null; + } + if (cmp > 0) { + System.err.println("Warning: version of " + dep.file.name + ", " + vfile.version + " is newer than request " + dep.file.version); + return f.getName(); + } + return f.getName();//found dependency + } + return null; + } + + public void load() { + scanDepInfos(); + if (depMap.isEmpty()) + return; + + loadDeps(); + activateDeps(); + } + + private void activateDeps() { + for (Dependency dep : depMap.values()) + if (dep.coreLib) + addClasspath(dep.existing); + } + + private void loadDeps() { + downloadMonitor = FMLLaunchHandler.side().isClient() ? new Downloader() : new DummyDownloader(); + try { + while (!depSet.isEmpty()) { + Iterator it = depSet.iterator(); + Dependency dep = depMap.get(it.next()); + it.remove(); + load(dep); + } + } finally { + if (popupWindow != null) { + popupWindow.setVisible(false); + popupWindow.dispose(); + } + } + } + + private void load(Dependency dep) { + dep.existing = checkExisting(dep); + if (dep.existing == null)//download dep + { + download(dep); + dep.existing = dep.file.filename; + } + } + + private List modFiles() { + List list = new LinkedList(); + list.addAll(Arrays.asList(modsDir.listFiles())); + //list.add(new File(eclipse_modDir, "ss.zip"));//SS2逕ィ縺ョ蜃ヲ逅 + list.addAll(Arrays.asList(v_modsDir.listFiles())); + return list; + } + + private void scanDepInfos() { + for (File file : modFiles()) { + if (!file.getName().endsWith(".jar") && !file.getName().endsWith(".zip")) + continue; + + scanDepInfo(file); + } + } + + private void scanDepInfo(File file) { + try { + ZipFile zip = new ZipFile(file); + ZipEntry e = zip.getEntry("ss_dependencies.info"); + if (e == null) e = zip.getEntry("ss_dependencies.info"); + if (e != null) + loadJSon(zip.getInputStream(e)); + zip.close(); + } catch (Exception e) { + System.err.println("Failed to load dependencies.info from " + file.getName() + " as JSON"); + e.printStackTrace(); + } + } + + private void loadJSon(InputStream input) throws IOException { + InputStreamReader reader = new InputStreamReader(input); + JsonElement root = new JsonParser().parse(reader); + if (root.isJsonArray()) + loadJSonArr(root); + else + loadJson(root.getAsJsonObject()); + reader.close(); + } + + private void loadJSonArr(JsonElement root) throws IOException { + for (JsonElement node : root.getAsJsonArray()) + loadJson(node.getAsJsonObject()); + } + + private void loadJson(JsonObject node) throws IOException { + boolean obfuscated = ((LaunchClassLoader) DepLoader.class.getClassLoader()) + .getClassBytes("net.minecraft.world.World") == null; + + String testClass = node.get("class").getAsString(); + if (DepLoader.class.getResource("/" + testClass.replace('.', '/') + ".class") != null) + return; + + String repo = node.get("repo").getAsString(); + String filename = node.get("file").getAsString(); + if (!obfuscated && node.has("dev")) + filename = node.get("dev").getAsString(); + + boolean coreLib = node.has("coreLib") && node.get("coreLib").getAsBoolean(); + + Pattern pattern = null; + try { + if (node.has("pattern")) + pattern = Pattern.compile(node.get("pattern").getAsString()); + } catch (PatternSyntaxException e) { + System.err.println("Invalid filename pattern: " + node.get("pattern")); + e.printStackTrace(); + } + if (pattern == null) + pattern = Pattern.compile("(\\w+).*?([\\d\\.]+)[-\\w]*\\.[^\\d]+"); + + VersionedFile file = new VersionedFile(filename, pattern); + if (!file.matches()) + throw new RuntimeException("Invalid filename format for dependency: " + filename); + + addDep(new Dependency(repo, file, coreLib)); + } + + private void addDep(Dependency newDep) { + if (mergeNew(depMap.get(newDep.file.name), newDep)) { + depMap.put(newDep.file.name, newDep); + depSet.add(newDep.file.name); + } + } + + private boolean mergeNew(Dependency oldDep, Dependency newDep) { + if (oldDep == null) + return true; + + Dependency newest = newDep.file.version.compareTo(oldDep.file.version) > 0 ? newDep : oldDep; + newest.coreLib = newDep.coreLib || oldDep.coreLib; + + return newest == newDep; + } + } + + public static void load() { + if (inst == null) { + inst = new DepLoadInst(); + inst.load(); + } + } + + @Override + public Void call() throws Exception { + load(); + return null; + } + + @Override + public void injectData(Map data) { + + } + +} \ No newline at end of file diff --git a/src/main/java/shift/sextiarysector/asm/SSBottle.java b/src/main/java/shift/sextiarysector/asm/SSBottle.java new file mode 100644 index 0000000..6f25cc2 --- /dev/null +++ b/src/main/java/shift/sextiarysector/asm/SSBottle.java @@ -0,0 +1,5 @@ +package shift.sextiarysector.asm; + +public class SSBottle { + +} diff --git a/src/main/java/shift/sextiarysector/asm/SSCore.java b/src/main/java/shift/sextiarysector/asm/SSCore.java new file mode 100644 index 0000000..5b6063a --- /dev/null +++ b/src/main/java/shift/sextiarysector/asm/SSCore.java @@ -0,0 +1,56 @@ +package shift.sextiarysector.asm; + +import java.io.File; +import java.util.Map; + +import cpw.mods.fml.relauncher.IFMLCallHook; +import cpw.mods.fml.relauncher.IFMLLoadingPlugin; + +public class SSCore implements IFMLLoadingPlugin, IFMLCallHook { + + static File location; + + @Override + public String[] getASMTransformerClass() { + return new String[] { "shift.sextiarysector.asm.TransformerBottle", "shift.sextiarysector.asm.TransformerEntityPlayerSP" }; + } + + @Override + public String getModContainerClass() { + return null; + } + + @Override + public String getSetupClass() { + return DepLoader.class.getName(); + } + + @Override + public void injectData(Map data) { + if (data.containsKey("coremodLocation")) + { + location = (File) data.get("coremodLocation"); + } + + if (location == null) { + + location = new File((File) data.get("mcLocation"), "../bin"); + + location.mkdir(); + + } + } + + @Override + public Void call() { + //DepLoader.load(); + + return null; + } + + @Override + public String getAccessTransformerClass() { + return null; + } + +} diff --git a/src/main/java/shift/sextiarysector/asm/TransformerBottle.java b/src/main/java/shift/sextiarysector/asm/TransformerBottle.java new file mode 100644 index 0000000..9404624 --- /dev/null +++ b/src/main/java/shift/sextiarysector/asm/TransformerBottle.java @@ -0,0 +1,124 @@ +package shift.sextiarysector.asm; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.MethodInsnNode; +import org.objectweb.asm.tree.MethodNode; +import org.objectweb.asm.tree.VarInsnNode; + +import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; + +public class TransformerBottle implements IClassTransformer, Opcodes +{ + // 謾ケ螟牙ッセ雎。縺ョ繧ッ繝ゥ繧ケ縺ョ螳悟ィ菫ョ鬟セ蜷阪〒縺吶 + // 蠕瑚ソー縺ァMinecraft.jar蜀縺ョ髮」隱ュ蛹悶&繧後k繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ィ縺吶k蝣エ蜷医ョ邁。譏薙↑蜿門セ玲婿豕輔r邏ケ莉九@縺セ縺吶 + private static final String TARGET_CLASS_NAME = "net.minecraft.item.ItemGlassBottle"; + + // 繧ッ繝ゥ繧ケ縺後Ο繝シ繝峨&繧後k髫帙↓蜻シ縺ウ蜃コ縺輔l繧九Γ繧ス繝繝峨〒縺吶 + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) + { + // FMLRelauncher.side() : Client/Server 縺ゥ縺。繧峨°荳譁ケ縺ョ繧貞ッセ雎。縺ィ縺吶k蝣エ蜷医d縲 + // 荳縺、縺ョMOD縺ァ Client/Sever 荳。譁ケ縺ォ蟇セ蠢懊@縺櫪OD縺ァ縲√%縺ョ蛟、繧貞愛螳壹@縺ヲ蜃ヲ逅繧貞、峨∴繧倶コ九′縺ァ縺阪∪縺吶 + // 莉雁屓縺ッ"CLIENT"縺ィ豈碑シ縺励,lient蛛エ縺ョ繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ィ縺励※縺繧倶セ九〒縺吶 + // Client蛛エ蟆ら畑縺ョMOD縺ィ縺励※蜈ャ髢九☆繧九ョ縺ァ縺ゅl縺ー縲∝愛螳壹ッ蠢鬆医〒縺ッ縺ゅj縺セ縺帙s縲 + + // name : 迴セ蝨ィ繝ュ繝シ繝峨&繧後h縺縺ィ縺励※縺繧九け繝ゥ繧ケ蜷阪′譬シ邏阪&繧後※縺縺セ縺吶 + if (!transformedName.equals(TARGET_CLASS_NAME)) + { + + // 蜃ヲ逅蟇セ雎。螟悶↑縺ョ縺ァ菴輔b縺励↑縺 + return basicClass; + } + + try + { + // -------------------------------------------------------------- + // ASM繧剃スソ逕ィ縺励∵里蟄倥ョ繧ッ繝ゥ繧ケ繝輔ぃ繧、繝ォ縺ォ謾ケ螟峨r譁ス縺吝エ蜷医 + // -------------------------------------------------------------- + return hookOnItemRightClick(name, basicClass); + + } catch (Exception e) + { + throw new RuntimeException("failed : TransformerBottle loading", e); + } + } + + // 荳玖ィ倥ョ諠ウ螳壹〒螳溯」縺輔l縺ヲ縺縺セ縺吶 + // EntityLiving.class 縺ョ doRenderLiving 縺ョ蜈磯ュ縺ォ + // tutorial/test.class 縺ョ passTestRender(EntityLiving, double, double, double)繝。繧ス繝繝峨ョ蜻シ縺ウ蜃コ縺励r霑ス蜉縺吶k縲 + private byte[] hookOnItemRightClick(String className, byte[] bytes) + { + // ASM縺ァ縲|ytes縺ォ譬シ邏阪&繧後◆繧ッ繝ゥ繧ケ繝輔ぃ繧、繝ォ繧定ァ」譫舌@縺セ縺吶 + ClassNode cnode = new ClassNode(); + ClassReader reader = new ClassReader(bytes); + reader.accept(cnode, 0); + + // 謾ケ螟牙ッセ雎。縺ョ繝。繧ス繝繝牙錐縺ァ縺 + String targetMethodName = "onItemRightClick"; + String targetMethodNameSRG = "func_77659_a"; + + // 謾ケ螟牙ッセ雎。繝。繧ス繝繝峨ョ謌サ繧雁、蝙九♀繧医ウ縲∝シ墓焚蝙九r縺ゅi繧上@縺セ縺吶窶サシ + String targetMethoddesc = "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/EntityPlayer;)Lnet/minecraft/item/ItemStack;"; + String targetMethoddescSRG = "(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/EntityPlayer;)Lnet/minecraft/item/ItemStack;"; + + // 蟇セ雎。縺ョ繝。繧ス繝繝峨r讀懃エ「蜿門セ励@縺セ縺吶 + MethodNode mnode = null; + + String mdesc = null; + + for (MethodNode curMnode : cnode.methods) + { + + String mName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodName(className, curMnode.name, curMnode.desc); + String mdName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodDesc(curMnode.desc); + //System.out.println("[ " + mName + " : " + curMnode.name + " ] [ " + mdName + " : " + curMnode.desc); + if ((targetMethodName.equals(curMnode.name) && targetMethoddesc.equals(curMnode.desc)) || (targetMethodNameSRG.equals(mName) && targetMethoddescSRG.equals(mdName))) + { + mnode = curMnode; + mdesc = curMnode.desc; + break; + } + } + + if (mnode != null) + { + + InsnList overrideList = new InsnList(); + + // 繝。繧ス繝繝峨さ繝シ繝ォ繧偵√ヰ繧、繝医さ繝シ繝峨〒縺ゅi繧上@縺滉セ九〒縺吶 + + overrideList.add(new VarInsnNode(ALOAD, 1)); + overrideList.add(new VarInsnNode(ALOAD, 2)); + overrideList.add(new VarInsnNode(ALOAD, 3)); + overrideList.add(new MethodInsnNode(INVOKESTATIC, + "shift/sextiarysector/asm/vanilla/BottleMethod", + "onBottleRightClick", + mdesc + , false)); + overrideList.add(new InsnNode(ARETURN)); + + // mnode.instructions.get(1)縺ァ縲∝ッセ雎。縺ョ繝。繧ス繝繝峨ョ蜈磯ュ繧貞叙蠕 + // mnode.instructions.insert縺ァ縲∵欠螳壹@縺滉ス咲スョ縺ォ繝舌う繝医さ繝シ繝峨r謖ソ蜈・縺励∪縺吶 + mnode.instructions.insert(mnode.instructions.get(1), overrideList); + + //mnode.maxLocals = 4; + + // 謾ケ螟峨@縺溘け繝ゥ繧ケ繝輔ぃ繧、繝ォ繧偵ヰ繧、繝亥励↓譖ク縺榊コ縺励∪縺 + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + cnode.accept(cw); + bytes = cw.toByteArray(); + + System.out.println("bbbb"); + } + + return bytes; + } + +} diff --git a/src/main/java/shift/sextiarysector/asm/TransformerEntityPlayerSP.java b/src/main/java/shift/sextiarysector/asm/TransformerEntityPlayerSP.java new file mode 100644 index 0000000..634bb77 --- /dev/null +++ b/src/main/java/shift/sextiarysector/asm/TransformerEntityPlayerSP.java @@ -0,0 +1,223 @@ +package shift.sextiarysector.asm; + +import java.util.Set; + +import net.minecraft.launchwrapper.IClassTransformer; + +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.commons.AnalyzerAdapter; + +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper; + +public class TransformerEntityPlayerSP implements IClassTransformer, Opcodes +{ + // 謾ケ螟牙ッセ雎。縺ョ繧ッ繝ゥ繧ケ縺ョ螳悟ィ菫ョ鬟セ蜷阪〒縺吶 + // 蠕瑚ソー縺ァMinecraft.jar蜀縺ョ髮」隱ュ蛹悶&繧後k繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ィ縺吶k蝣エ蜷医ョ邁。譏薙↑蜿門セ玲婿豕輔r邏ケ莉九@縺セ縺吶 + private static final String TARGET_CLASS_NAME = "net.minecraft.client.entity.EntityPlayerSP"; + + @Override + public byte[] transform(String name, String transformedName, byte[] bytes) + { + try + { + final String targetClassName = "net.minecraft.client.entity.EntityPlayerSP"; + if (targetClassName.equals(transformedName)) { + System.out.println("start transform > EntityPlayerSP"); + ClassReader classReader = new ClassReader(bytes); + ClassWriter classWriter = new ClassWriter(0); + classReader.accept(new addHooksVisitor(name, classWriter), ClassReader.EXPAND_FRAMES); + return classWriter.toByteArray(); + } + } catch (Exception e) + { + throw new RuntimeException("failed : EntityPlayerSP loading", e); + } + + return bytes; + } + + static class addHooksVisitor extends ClassVisitor + { + String owner; + + public addHooksVisitor(String owner, ClassVisitor cv) + { + super(Opcodes.ASM5, cv); + this.owner = owner; + } + + private final Set targetMethodName = Sets.newHashSet("onLivingUpdate", "func_70636_d"); + private final String targetMethoddesc = "()V"; + + private boolean isTransformed = false; + + @Override + public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) + { + + MethodVisitor mv = super.visitMethod(access, name, desc, signature, exceptions); + + if (!isTransformed) { + + FMLDeobfuscatingRemapper remap = FMLDeobfuscatingRemapper.INSTANCE; + + if (targetMethodName.contains(remap.mapMethodName(owner, name, desc)) && targetMethoddesc.equals(remap.mapMethodDesc(desc))) + { + mv = new AddHookMethodVisitor(owner, access, name, desc, mv); + + isTransformed = true; + + } + + } + + return mv; + } + } + + static class AddHookMethodVisitor extends AnalyzerAdapter { + + protected AddHookMethodVisitor(String owner, int access, String name, String desc, MethodVisitor mv) { + super(Opcodes.ASM5, owner, access, name, desc, mv); + } + + private final String targetoOwner = "net/minecraft/util/FoodStats"; + private final Set targetName = Sets.newHashSet("getFoodLevel", "func_75116_a"); + private final String targetDesc = "()I"; + + @Override + public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { + super.visitMethodInsn(opcode, owner, name, desc, itf); + + FMLDeobfuscatingRemapper remap = FMLDeobfuscatingRemapper.INSTANCE; + if (opcode == Opcodes.INVOKEVIRTUAL + && targetoOwner.equals(remap.map(owner)) + && targetName.contains(remap.mapMethodName(owner, name, desc)) + && targetDesc.equals(remap.mapMethodDesc(desc))) { + + //mv.visitVarInsn(ALOAD, 1); + + this.mv.visitMethodInsn(Opcodes.INVOKESTATIC, "shift/sextiarysector/asm/vanilla/EntityPlayerSPMethod", "isFlag", "(I)I", false); + + } + } + } + + /* + // 繧ッ繝ゥ繧ケ縺後Ο繝シ繝峨&繧後k髫帙↓蜻シ縺ウ蜃コ縺輔l繧九Γ繧ス繝繝峨〒縺吶 + @Override + public byte[] transform(String name, String transformedName, byte[] basicClass) + { + // FMLRelauncher.side() : Client/Server 縺ゥ縺。繧峨°荳譁ケ縺ョ繧貞ッセ雎。縺ィ縺吶k蝣エ蜷医d縲 + // 荳縺、縺ョMOD縺ァ Client/Sever 荳。譁ケ縺ォ蟇セ蠢懊@縺櫪OD縺ァ縲√%縺ョ蛟、繧貞愛螳壹@縺ヲ蜃ヲ逅繧貞、峨∴繧倶コ九′縺ァ縺阪∪縺吶 + // 莉雁屓縺ッ"CLIENT"縺ィ豈碑シ縺励,lient蛛エ縺ョ繝輔ぃ繧、繝ォ繧貞ッセ雎。縺ィ縺励※縺繧倶セ九〒縺吶 + // Client蛛エ蟆ら畑縺ョMOD縺ィ縺励※蜈ャ髢九☆繧九ョ縺ァ縺ゅl縺ー縲∝愛螳壹ッ蠢鬆医〒縺ッ縺ゅj縺セ縺帙s縲 + + // name : 迴セ蝨ィ繝ュ繝シ繝峨&繧後h縺縺ィ縺励※縺繧九け繝ゥ繧ケ蜷阪′譬シ邏阪&繧後※縺縺セ縺吶 + if (!transformedName.equals(TARGET_CLASS_NAME)) + { + + // 蜃ヲ逅蟇セ雎。螟悶↑縺ョ縺ァ菴輔b縺励↑縺 + return basicClass; + } + + try + { + // -------------------------------------------------------------- + // ASM繧剃スソ逕ィ縺励∵里蟄倥ョ繧ッ繝ゥ繧ケ繝輔ぃ繧、繝ォ縺ォ謾ケ螟峨r譁ス縺吝エ蜷医 + // -------------------------------------------------------------- + return hookOnItemRightClick(name, basicClass); + + } catch (Exception e) + { + throw new RuntimeException("failed : TransformerBottle loading", e); + } + } + + // 荳玖ィ倥ョ諠ウ螳壹〒螳溯」縺輔l縺ヲ縺縺セ縺吶 + // EntityLiving.class 縺ョ doRenderLiving 縺ョ蜈磯ュ縺ォ + // tutorial/test.class 縺ョ passTestRender(EntityLiving, double, double, double)繝。繧ス繝繝峨ョ蜻シ縺ウ蜃コ縺励r霑ス蜉縺吶k縲 + private byte[] hookOnItemRightClick(String className, byte[] bytes) + { + // ASM縺ァ縲|ytes縺ォ譬シ邏阪&繧後◆繧ッ繝ゥ繧ケ繝輔ぃ繧、繝ォ繧定ァ」譫舌@縺セ縺吶 + ClassNode cnode = new ClassNode(); + ClassReader reader = new ClassReader(bytes); + reader.accept(cnode, 0); + + // 謾ケ螟牙ッセ雎。縺ョ繝。繧ス繝繝牙錐縺ァ縺 + String targetMethodName = "onLivingUpdate";//"setSprinting"; + String targetMethodNameSRG = "func_70636_d";//"func_70031_b"; + + // 謾ケ螟牙ッセ雎。繝。繧ス繝繝峨ョ謌サ繧雁、蝙九♀繧医ウ縲∝シ墓焚蝙九r縺ゅi繧上@縺セ縺吶窶サシ + String targetMethoddesc = "()V";//"(Z)V"; + String targetMethoddescSRG = "(Z)V"; + + // 蟇セ雎。縺ョ繝。繧ス繝繝峨r讀懃エ「蜿門セ励@縺セ縺吶 + MethodNode mnode = null; + + String mdesc = null; + + for (MethodNode curMnode : cnode.methods) + { + + String mName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodName(className, curMnode.name, curMnode.desc); + String mdName = FMLDeobfuscatingRemapper.INSTANCE.mapMethodDesc(curMnode.desc); + System.out.println("[ " + mName + " : " + curMnode.name + " ] [ " + mdName + " : " + curMnode.desc); + if ((targetMethodName.equals(curMnode.name) && targetMethoddesc.equals(curMnode.desc)) || (targetMethodNameSRG.equals(mName) && targetMethoddescSRG.equals(mdName))) + { + mnode = curMnode; + mdesc = curMnode.desc; + break; + } + } + + if (mnode != null) + { + + InsnList overrideList = new InsnList(); + + // 繝。繧ス繝繝峨さ繝シ繝ォ繧偵√ヰ繧、繝医さ繝シ繝峨〒縺ゅi繧上@縺滉セ九〒縺吶 + + overrideList.add(new VarInsnNode(ILOAD, 1)); + overrideList.add(new MethodInsnNode(INVOKESTATIC, + "shift/sextiarysector/asm/vanilla/EntityPlayerSPMethod", + "isSprinting", + "(Z)Z" + , false)); + Label l8 = new Label(); + overrideList.add(new JumpInsnNode(IFEQ, this.getLabelNode(l8))); + overrideList.add(new InsnNode(RETURN)); + overrideList.add(this.getLabelNode(l8)); + + // mnode.instructions.get(1)縺ァ縲∝ッセ雎。縺ョ繝。繧ス繝繝峨ョ蜈磯ュ繧貞叙蠕 + // mnode.instructions.insert縺ァ縲∵欠螳壹@縺滉ス咲スョ縺ォ繝舌う繝医さ繝シ繝峨r謖ソ蜈・縺励∪縺吶 + mnode.instructions.insert(mnode.instructions.get(1), overrideList); + + //mnode.maxLocals = 4; + + // 謾ケ螟峨@縺溘け繝ゥ繧ケ繝輔ぃ繧、繝ォ繧偵ヰ繧、繝亥励↓譖ク縺榊コ縺励∪縺 + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + cnode.accept(cw); + bytes = cw.toByteArray(); + + System.out.println("bbbb"); + } + + return bytes; + } + + protected LabelNode getLabelNode(final Label l) { + if (!(l.info instanceof LabelNode)) { + l.info = new LabelNode(); + } + return (LabelNode) l.info; + } + + */ +} diff --git a/src/main/java/shift/sextiarysector/asm/vanilla/BottleMethod.java b/src/main/java/shift/sextiarysector/asm/vanilla/BottleMethod.java new file mode 100644 index 0000000..50461af --- /dev/null +++ b/src/main/java/shift/sextiarysector/asm/vanilla/BottleMethod.java @@ -0,0 +1,131 @@ +package shift.sextiarysector.asm.vanilla; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SSItems; + +public class BottleMethod { + + public static ItemStack onBottleRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) + { + + MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, true); + + if (movingobjectposition == null) + { + return p_77659_1_; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!p_77659_2_.canMineBlock(p_77659_3_, i, j, k)) + { + return p_77659_1_; + } + + if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_)) + { + return p_77659_1_; + } + + Block block = p_77659_2_.getBlock(i, j, k); + + if (block == Blocks.water) + { + + --p_77659_1_.stackSize; + + if (p_77659_1_.stackSize <= 0) + { + return new ItemStack(Items.potionitem); + } + + if (!p_77659_3_.inventory.addItemStackToInventory(new ItemStack(Items.potionitem))) + { + p_77659_3_.dropPlayerItemWithRandomChoice(new ItemStack(Items.potionitem, 1, 0), false); + } + + } + + if (block == Blocks.lava) { + + --p_77659_1_.stackSize; + + p_77659_2_.setBlockToAir(i, j, k); + + if (p_77659_1_.stackSize <= 0) + { + return new ItemStack(SSItems.lavaBottle); + } + + if (!p_77659_3_.inventory.addItemStackToInventory(new ItemStack(SSItems.lavaBottle))) + { + p_77659_3_.dropPlayerItemWithRandomChoice(new ItemStack(SSItems.lavaBottle, 1, 0), false); + } + + } + + if (block == SSBlocks.drinkingWater) { + + --p_77659_1_.stackSize; + + //p_77659_2_.setBlockToAir(i, j, k); + + if (p_77659_1_.stackSize <= 0) + { + return new ItemStack(SSItems.drinkingWaterBottle); + } + + if (!p_77659_3_.inventory.addItemStackToInventory(new ItemStack(SSItems.drinkingWaterBottle))) + { + p_77659_3_.dropPlayerItemWithRandomChoice(new ItemStack(SSItems.drinkingWaterBottle, 1, 0), false); + } + + } + + } + + return p_77659_1_; + } + + } + + protected static MovingObjectPosition getMovingObjectPositionFromPlayer(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_) + { + float f = 1.0F; + float f1 = p_77621_2_.prevRotationPitch + (p_77621_2_.rotationPitch - p_77621_2_.prevRotationPitch) * f; + float f2 = p_77621_2_.prevRotationYaw + (p_77621_2_.rotationYaw - p_77621_2_.prevRotationYaw) * f; + double d0 = p_77621_2_.prevPosX + (p_77621_2_.posX - p_77621_2_.prevPosX) * f; + double d1 = p_77621_2_.prevPosY + (p_77621_2_.posY - p_77621_2_.prevPosY) * f + (p_77621_1_.isRemote ? p_77621_2_.getEyeHeight() - p_77621_2_.getDefaultEyeHeight() : p_77621_2_.getEyeHeight()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences + double d2 = p_77621_2_.prevPosZ + (p_77621_2_.posZ - p_77621_2_.prevPosZ) * f; + Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); + float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 5.0D; + if (p_77621_2_ instanceof EntityPlayerMP) + { + d3 = ((EntityPlayerMP) p_77621_2_).theItemInWorldManager.getBlockReachDistance(); + } + Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); + return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false); + } + +} diff --git a/src/main/java/shift/sextiarysector/asm/vanilla/EntityPlayerSPMethod.java b/src/main/java/shift/sextiarysector/asm/vanilla/EntityPlayerSPMethod.java new file mode 100644 index 0000000..c213f20 --- /dev/null +++ b/src/main/java/shift/sextiarysector/asm/vanilla/EntityPlayerSPMethod.java @@ -0,0 +1,48 @@ +package shift.sextiarysector.asm.vanilla; + +import net.minecraft.client.entity.EntityPlayerSP; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.player.EntityPlayerManager; + +public class EntityPlayerSPMethod { + + public static boolean isSprinting(boolean p_70031_1_) + { + + if (p_70031_1_) return false; + + try { + + EntityPlayerSP p = (EntityPlayerSP) SextiarySector.proxy.getClientPlayer(); + if (p.sprintingTicksLeft == 0) return false; + float f = 0.8f; + + if (p.movementInput.moveForward < f || p.isCollidedHorizontally) return false; + + if (!(p.getFoodStats().getFoodLevel() > 6.0F || p.capabilities.allowFlying)) return true; + + } catch (Exception e) { + + } + + return false; + } + + public static int isFlag(int i) + { + + try { + + EntityPlayerSP p = (EntityPlayerSP) SextiarySector.proxy.getClientPlayer(); + + if (EntityPlayerManager.getStaminaStats(p).getStaminaLevel() == 0) return 0; + + } catch (Exception e) { + + } + + return 10; + + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockBlueFire.java b/src/main/java/shift/sextiarysector/block/BlockBlueFire.java new file mode 100644 index 0000000..6734f53 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockBlueFire.java @@ -0,0 +1,223 @@ +package shift.sextiarysector.block; + +import static net.minecraftforge.common.util.ForgeDirection.*; + +import java.util.Random; + +import net.minecraft.block.BlockFire; +import net.minecraft.init.Blocks; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class BlockBlueFire extends BlockFire{ + + public BlockBlueFire() + { + super(); + this.setHardness(0.0F); + this.setLightLevel(1.0F); + this.setStepSound(soundTypeWood); + this.setBlockName("fire"); + this.disableStats(); + this.setTickRandomly(true); + } + + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) + { + + this.addFuel(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_); + + if (p_149674_1_.getGameRules().getGameRuleBooleanValue("doFireTick")) + { + boolean flag = p_149674_1_.getBlock(p_149674_2_, p_149674_3_ - 1, p_149674_4_).isFireSource(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP); + + if (!this.canPlaceBlockAt(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) + { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } + + if (!flag && p_149674_1_.isRaining() && (p_149674_1_.canLightningStrikeAt(p_149674_2_, p_149674_3_, p_149674_4_) || p_149674_1_.canLightningStrikeAt(p_149674_2_ - 1, p_149674_3_, p_149674_4_) || p_149674_1_.canLightningStrikeAt(p_149674_2_ + 1, p_149674_3_, p_149674_4_) || p_149674_1_.canLightningStrikeAt(p_149674_2_, p_149674_3_, p_149674_4_ - 1) || p_149674_1_.canLightningStrikeAt(p_149674_2_, p_149674_3_, p_149674_4_ + 1))) + { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } + else + { + int l = p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_); + + if (l < 15) + { + p_149674_1_.setBlockMetadataWithNotify(p_149674_2_, p_149674_3_, p_149674_4_, l + p_149674_5_.nextInt(3) / 2, 4); + } + + p_149674_1_.scheduleBlockUpdate(p_149674_2_, p_149674_3_, p_149674_4_, this, this.tickRate(p_149674_1_) + p_149674_5_.nextInt(10)); + + if (!flag && !this.canNeighborBurn(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_)) + { + if (!World.doesBlockHaveSolidTopSurface(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_) || l > 3) + { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } + } + else if (!flag && !this.canCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, UP) && l == 15 && p_149674_5_.nextInt(4) == 0) + { + p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_); + } + else + { + boolean flag1 = p_149674_1_.isBlockHighHumidity(p_149674_2_, p_149674_3_, p_149674_4_); + byte b0 = 0; + + if (flag1) + { + b0 = -50; + } + + this.tryCatchFire(p_149674_1_, p_149674_2_ + 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, WEST ); + this.tryCatchFire(p_149674_1_, p_149674_2_ - 1, p_149674_3_, p_149674_4_, 300 + b0, p_149674_5_, l, EAST ); + this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ - 1, p_149674_4_, 250 + b0, p_149674_5_, l, UP ); + this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_ + 1, p_149674_4_, 250 + b0, p_149674_5_, l, DOWN ); + this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ - 1, 300 + b0, p_149674_5_, l, SOUTH); + this.tryCatchFire(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_ + 1, 300 + b0, p_149674_5_, l, NORTH); + + for (int i1 = p_149674_2_ - 1; i1 <= p_149674_2_ + 1; ++i1) + { + for (int j1 = p_149674_4_ - 1; j1 <= p_149674_4_ + 1; ++j1) + { + for (int k1 = p_149674_3_ - 1; k1 <= p_149674_3_ + 4; ++k1) + { + if (i1 != p_149674_2_ || k1 != p_149674_3_ || j1 != p_149674_4_) + { + int l1 = 100; + + if (k1 > p_149674_3_ + 1) + { + l1 += (k1 - (p_149674_3_ + 1)) * 100; + } + + int i2 = this.getChanceOfNeighborsEncouragingFire(p_149674_1_, i1, k1, j1); + + if (i2 > 0) + { + int j2 = (i2 + 40 + p_149674_1_.difficultySetting.getDifficultyId() * 7) / (l + 30); + + if (flag1) + { + j2 /= 2; + } + + if (j2 > 0 && p_149674_5_.nextInt(l1) <= j2 && (!p_149674_1_.isRaining() || !p_149674_1_.canLightningStrikeAt(i1, k1, j1)) && !p_149674_1_.canLightningStrikeAt(i1 - 1, k1, p_149674_4_) && !p_149674_1_.canLightningStrikeAt(i1 + 1, k1, j1) && !p_149674_1_.canLightningStrikeAt(i1, k1, j1 - 1) && !p_149674_1_.canLightningStrikeAt(i1, k1, j1 + 1)) + { + int k2 = l + p_149674_5_.nextInt(5) / 4; + + if (k2 > 15) + { + k2 = 15; + } + + p_149674_1_.setBlock(i1, k1, j1, Blocks.fire, k2, 3); + } + } + } + } + } + } + } + } + } + + if(p_149674_5_.nextInt(10)<=2)p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.fire); + //p_149674_1_.scheduleBlockUpdate(p_149674_2_, p_149674_3_, p_149674_4_, this, 4); + + } + + public int tickRate(World p_149738_1_) + { + return 30; + } + + private void tryCatchFire(World p_149841_1_, int p_149841_2_, int p_149841_3_, int p_149841_4_, int p_149841_5_, Random p_149841_6_, int p_149841_7_, ForgeDirection face) + { + int j1 = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_).getFlammability(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, face); + + if (p_149841_6_.nextInt(p_149841_5_) < j1) + { + boolean flag = p_149841_1_.getBlock(p_149841_2_, p_149841_3_, p_149841_4_) == Blocks.tnt; + + if (p_149841_6_.nextInt(p_149841_7_ + 10) < 5 && !p_149841_1_.canLightningStrikeAt(p_149841_2_, p_149841_3_, p_149841_4_)) + { + int k1 = p_149841_7_ + p_149841_6_.nextInt(5) / 4; + + if (k1 > 15) + { + k1 = 15; + } + + p_149841_1_.setBlock(p_149841_2_, p_149841_3_, p_149841_4_, Blocks.fire, k1, 3); + } + else + { + p_149841_1_.setBlockToAir(p_149841_2_, p_149841_3_, p_149841_4_); + } + + if (flag) + { + Blocks.tnt.onBlockDestroyedByPlayer(p_149841_1_, p_149841_2_, p_149841_3_, p_149841_4_, 1); + } + } + } + + private boolean canNeighborBurn(World p_149847_1_, int p_149847_2_, int p_149847_3_, int p_149847_4_) + { + return this.canCatchFire(p_149847_1_, p_149847_2_ + 1, p_149847_3_, p_149847_4_, WEST ) || + this.canCatchFire(p_149847_1_, p_149847_2_ - 1, p_149847_3_, p_149847_4_, EAST ) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ - 1, p_149847_4_, UP ) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_ + 1, p_149847_4_, DOWN ) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ - 1, SOUTH) || + this.canCatchFire(p_149847_1_, p_149847_2_, p_149847_3_, p_149847_4_ + 1, NORTH); + } + + private int getChanceOfNeighborsEncouragingFire(World p_149845_1_, int p_149845_2_, int p_149845_3_, int p_149845_4_) + { + byte b0 = 0; + + if (!p_149845_1_.isAirBlock(p_149845_2_, p_149845_3_, p_149845_4_)) + { + return 0; + } + else + { + int l = b0; + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ + 1, p_149845_3_, p_149845_4_, l, WEST ); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_ - 1, p_149845_3_, p_149845_4_, l, EAST ); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ - 1, p_149845_4_, l, UP ); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_ + 1, p_149845_4_, l, DOWN ); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ - 1, l, SOUTH); + l = this.getChanceToEncourageFire(p_149845_1_, p_149845_2_, p_149845_3_, p_149845_4_ + 1, l, NORTH); + return l; + } + } + + //ss2 + + private void addFuel(World world, int x, int y, int z, Random p_149674_5_){ + + + TileEntity t = world.getTileEntity(x, y + 1, z); + + if(t instanceof TileEntityFurnace){ + + TileEntityFurnace furnace = (TileEntityFurnace)t; + + boolean f = furnace.currentItemBurnTime==0; + + furnace.currentItemBurnTime = furnace.furnaceBurnTime = 800; + + if(f)world.markBlockForUpdate(x, y + 1, z); + + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockBoardingBuoy.java b/src/main/java/shift/sextiarysector/block/BlockBoardingBuoy.java new file mode 100644 index 0000000..126ae11 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockBoardingBuoy.java @@ -0,0 +1,282 @@ +package shift.sextiarysector.block; + +import java.math.BigDecimal; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import shift.sextiarysector.SSItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBoardingBuoy extends BlockPoweredBuoy { + + //private final boolean powered; + + private IIcon[] blockIcons_a; + + public BlockBoardingBuoy() { + super(); + //this.powered = par2; + + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + if (world.getBlockMetadata(x, y, z) >= 8) { + return (int) (15.0F * 1.0f); + } + return 0; + } + + @Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + + if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().getItem() == SSItems.ironSpanner) { + int i = par1World.getBlockMetadata(par2, par3, par4); + + if (this.ispowered(par1World, par2, par3, par4)) { + + if (i < 15) { + i += 1; + } else { + i = 8; + } + + } else { + + if (i < 7) { + i += 1; + } else { + i = 0; + } + + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, i, 1); + par1World.markBlockForUpdate(par2, par3, par4); + return true; + } + return false; + + } + + @Override + public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) + { + if (par1World.getBlockMetadata(par2, par3, par4) < 8) { + if (par5Entity instanceof EntityBoat) { + + double mX = par5Entity.motionX; + double mZ = par5Entity.motionZ; + + BigDecimal bdX = new BigDecimal(mX); + BigDecimal bdZ = new BigDecimal(mZ); + + //mX = Math.ceil(mX); + //mZ = Math.ceil(mZ); + + BigDecimal bdX2 = bdX.setScale(1, BigDecimal.ROUND_HALF_UP); + BigDecimal bdZ2 = bdZ.setScale(1, BigDecimal.ROUND_HALF_UP); + + mX = bdX2.doubleValue(); + mZ = bdZ2.doubleValue(); + + if (mX > 0) { + mX = mX - 0.1; + } + if (mX < 0) { + mX = mX + 0.1; + } + + if (mZ > 0) { + mZ = mZ - 0.1; + } + if (mZ < 0) { + mZ = mZ + 0.1; + } + + par5Entity.motionX = mX; + par5Entity.motionZ = mZ; + //par5Entity.motionY = 0; + + par5Entity.prevPosX = par2; + //par5Entity.prevPosY = par3; + par5Entity.prevPosZ = par4; + + return; + } + + } + + if (par5Entity instanceof EntityBoat) { + + int x = 0; + int z = 0; + + int y = 0; + + int i = par1World.getBlockMetadata(par2, par3, par4) - 8; + + switch (i) { + + /* + case 0 : z = -1; break; + case 1 : x = 1; break; + case 2 : z = 1; break; + case 3 : x = -1; break; + + case 4 : x = -1; z = -1 ; break; + case 5 : x = 1;z = -1 ; break; + case 6 : x = 1;z = 1 ; break; + case 7 : x = -1; z = 1 ; break; + */ + + case 0: + z = -1; + break; + case 2: + x = 1; + break; + case 4: + z = 1; + break; + case 6: + x = -1; + break; + + case 1: + x = 1; + z = -1; + break; + case 3: + x = 1; + z = 1; + break; + case 5: + x = -1; + z = 1; + break; + case 7: + x = -1; + z = -1; + break; + + //case 9 : y = 1;break; + + } + + par5Entity.motionX += x; + par5Entity.motionZ += z; + par5Entity.motionY += y; + //par5Entity.motionY += 1; + //par5Entity.motionZ += 1; + //moveFlying(1, 1, 1); + //par5Entity.setPositionAndRotation2(2,2,2,1,1,1); + } + + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + if (this.ispowered(par1World, par2, par3, par4) && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this, 4); + } + else if (!this.ispowered(par1World, par2, par3, par4) && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) + { + int i = par1World.getBlockMetadata(par2, par3, par4); + if (i <= 7) { + par1World.setBlock(par2, par3, par4, this, i + 8, 2); + } + + } + } + } + + @Override + public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, Block par5) + { + if (!par1World.isRemote) + { + if (this.ispowered(par1World, par2, par3, par4) && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this, 4); + } + else if (!this.ispowered(par1World, par2, par3, par4) && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) + { + int i = par1World.getBlockMetadata(par2, par3, par4); + if (i <= 7) { + par1World.setBlock(par2, par3, par4, this, i + 8, 2); + } + } + } + } + + @Override + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if (!par1World.isRemote && this.ispowered(par1World, par2, par3, par4) && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) + { + int i = par1World.getBlockMetadata(par2, par3, par4); + if (i > 7) { + par1World.setBlock(par2, par3, par4, this, i - 8, 2); + } + } + } + + public boolean ispowered(World par1World, int par2, int par3, int par4) + { + return par1World.getBlockMetadata(par2, par3, par4) > 7; + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return Item.getItemFromBlock(this); + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(int par1, int par2) + { + if (par2 > 7) { + return blockIcons_a[par2 - 8]; + } + return blockIcons[par2]; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + blockIcons = new IIcon[8]; + blockIcons_a = new IIcon[8]; + + for (int i = 0; i < 8; i++) { + blockIcons[i] = par1IconRegister.registerIcon(this.getTextureName() + "_" + i); + + } + + for (int i = 0; i < 8; i++) { + blockIcons_a[i] = par1IconRegister.registerIcon(this.getTextureName() + "_" + i + "_active"); + + } + + this.blockIcon = blockIcons[0];//par1IconRegister.registerIcon(this.getTextureName()); + + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockBottle.java b/src/main/java/shift/sextiarysector/block/BlockBottle.java new file mode 100644 index 0000000..3c63f49 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockBottle.java @@ -0,0 +1,98 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.item.ItemBlockBottle; +import shift.sextiarysector.tileentity.TileEntityBlockBottle; + +public class BlockBottle extends BlockContainer { + + public BlockBottle() { + super(Material.glass); + this.setHardness(0.4F); + this.setStepSound(soundTypeGlass); + this.setBlockBounds(2.0f / 16.0f, 0, 2.0f / 16.0f, 14.0f / 16.0f, 1, 14.0f / 16.0f); + this.setCreativeTab(SextiarySectorAPI.TabSSFluid); + } + + @Override + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + TileEntityBlockBottle tileEntity = (TileEntityBlockBottle) world.getTileEntity(x, y, z); + + if (par5EntityPlayer.isSneaking()) { + + if (!world.isRemote) { + + ItemStack stack; + + if (tileEntity.hasFluid()) { + stack = new ItemStack(this, 1, tileEntity.getFluidID()); + ((ItemBlockBottle) stack.getItem()).fill(stack, tileEntity.getFluidStack(), true); + } else { + stack = new ItemStack(this, 1); + } + + EntityItem item = new EntityItem(world, x + 0.5d, y + 0.5d, z + 0.5d, stack); + + world.spawnEntityInWorld(item); + + world.setBlockToAir(x, y, z); + world.removeTileEntity(x, y, z); + + } else { + return true; + } + + } + + return false; + + } + + public ItemStack getFluidItem(FluidStack resource) { + + ItemStack stack = new ItemStack(this, 1, resource.getFluid().getID()); + ((ItemBlockBottle) stack.getItem()).fill(stack, resource, true); + + return stack; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int quantityDropped(Random p_149745_1_) + { + return 0; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.bottleType; + } + + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) { + return new TileEntityBlockBottle(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockBuoyBase.java b/src/main/java/shift/sextiarysector/block/BlockBuoyBase.java new file mode 100644 index 0000000..3417c5e --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockBuoyBase.java @@ -0,0 +1,84 @@ +package shift.sextiarysector.block; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; +import shift.sextiarysector.api.SextiarySectorAPI; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBuoyBase extends Block { + + public String itemIcon; + + public BlockBuoyBase() { + super(Material.plants); + //this.slipperiness = 2.6F; + this.setHardness(0.2f); + float f = 0.5F; + float f1 = 0.015625F; + this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + this.setCreativeTab(SextiarySectorAPI.TabSSTransport); + //this.setCreativeTab(SextiarySector.tabsSextiarySector); + } + + @Override + public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) + { + return super.canPlaceBlockAt(par1World, par2, par3, par4) && canBlockStay(par1World, par2, par3, par4); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + return null; + } + + @Override + public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) + { + if (par7Entity == null || !(par7Entity instanceof EntityBoat)) + { + super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } + } + + @Override + public boolean canBlockStay(World par1World, int par2, int par3, int par4) + { + return par3 >= 0 && par3 < 256 ? par1World.getBlock(par2, par3 - 1, par4).getMaterial() == Material.water && par1World.getBlockMetadata(par2, par3 - 1, par4) == 0 : false; + } + + @Override + public Block setBlockTextureName(String p_149658_1_) + { + this.textureName = p_149658_1_; + this.itemIcon = p_149658_1_; + return this; + } + + @Override + @SideOnly(Side.CLIENT) + public String getItemIconName() + { + return itemIcon; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockCraftFurnace.java b/src/main/java/shift/sextiarysector/block/BlockCraftFurnace.java new file mode 100644 index 0000000..2f1331c --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockCraftFurnace.java @@ -0,0 +1,356 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntityCraftFurnace; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockCraftFurnace extends BlockDirection{ + + private final Random furnaceRand = new Random(); + + private static boolean keepFurnaceInventory; + + @SideOnly(Side.CLIENT) + private IIcon furnaceIconTop; + @SideOnly(Side.CLIENT) + private IIcon[] furnaceIconFront = new IIcon[2]; + + private int GUIID; + + public BlockCraftFurnace() { + super(Material.rock); + this.setHardness(1.0F); + } + + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + TileEntityCraftFurnace tileentityfurnace = (TileEntityCraftFurnace)world.getTileEntity(x, y, z); + if(tileentityfurnace.isFuel() || tileentityfurnace.isLarge())return 15; + return 0; + } + + /* + @Override + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + + this.setBlockBounds(-1, -1, -1, 2, 2, 2); + } + + //蠖薙◆繧雁愛螳壹ゅし繝懊ユ繝ウ繧繧ス繧ヲ繝ォ繧オ繝ウ繝峨r蜿り縺ォ縺吶k縺ィ濶ッ縺縲ゅさ繧ウ縺ョ險ュ螳壹r縺吶k縺ィ縲{nEntityCollidedWithBlock縺悟他縺ー繧後k繧医≧縺ォ縺ェ繧 + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + return AxisAlignedBB.getBoundingBox(par2-1, par3-1, par4-1, par2+2, par3+2, par4+2); + } + + //繝悶Ο繝繧ッ縺ォ隕也せ繧貞粋繧上○縺滓凾縺ォ蜃コ縺ヲ縺上k鮟偵>邱壹ョ繧「繝ャ + @Override + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); + return AxisAlignedBB.getBoundingBox(par2-1, par3-1, par4-1, par2+2, par3+2, par4+2); + }*/ + + @Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityCraftFurnace tileentityfurnace = (TileEntityCraftFurnace)par1World.getTileEntity(par2, par3, par4); + + if (tileentityfurnace != null) + { + + if(!tileentityfurnace.isLarge())return true; + + par5EntityPlayer.openGui(SextiarySector.instance, 5, par1World, par2, par3, par4); + } + + return true; + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); + this.setDefaultDirection(par1World, par2, par3, par4); + } + + /** + * set a blocks direction + */ + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + Block block = par1World.getBlock(par2, par3, par4 - 1); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); + + TileEntityCraftFurnace tileEntity = (TileEntityCraftFurnace)par1World.getTileEntity(par2, par3, par4); + + + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); + tileEntity.direction = ForgeDirection.getOrientation(b0); + } + } + + @Override + @SideOnly(Side.CLIENT) + + /** + * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata + */ + public IIcon getIcon(int par1, int par2) + { + + return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != 3 ? this.blockIcon : this.furnaceIconFront[1])); + + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess p_149673_1_, int x, int y, int z, int side) + { + //System.out.println("Icon"); + TileEntityCraftFurnace tileEntity = (TileEntityCraftFurnace)p_149673_1_.getTileEntity(x, y, z); + + int meta = p_149673_1_.getBlockMetadata(x, y, z); + + return side == 1 ? this.furnaceIconTop : (side == 0 ? this.furnaceIconTop : (side != meta ? this.blockIcon : (tileEntity.isFuel() ? this.furnaceIconFront[0] : this.furnaceIconFront[1]))); + + + } + + @Override + @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 registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon("furnace_side"); + this.furnaceIconFront[0] = par1IconRegister.registerIcon("furnace_front_on"); + this.furnaceIconFront[1] = par1IconRegister.registerIcon("furnace_front_off"); + this.furnaceIconTop = par1IconRegister.registerIcon("sextiarysector:furnace_top"); + } + + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + @Override + public TileEntity createNewTileEntity(World par1World, int p_149915_2_) + { + return new TileEntityCraftFurnace(); + } + + /** + * Called when the block is placed in the world. + */ + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntityCraftFurnace tileEntity = (TileEntityCraftFurnace)par1World.getTileEntity(par2, par3, par4); + + if (l == 0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[2]; + } + + if (l == 1) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[5]; + } + + if (l == 2) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[3]; + } + + if (l == 3) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[4]; + } + + } + + @Override + public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) + { + if (!keepFurnaceInventory) + { + TileEntityCraftFurnace tileentityfurnace = (TileEntityCraftFurnace)par1World.getTileEntity(par2, par3, par4); + + if (tileentityfurnace != null) + { + for (int j1 = 0; j1 < tileentityfurnace.getSizeInventory(); ++j1) + { + ItemStack itemstack = tileentityfurnace.getStackInSlot(j1); + + this.dropItem(itemstack, par1World, par2, par3, par4); + + } + + for (int j1 = 0; j1 < tileentityfurnace.craftMatrix.getSizeInventory(); ++j1) + { + ItemStack itemstack = tileentityfurnace.craftMatrix.getStackInSlot(j1); + + this.dropItem(itemstack, par1World, par2, par3, par4); + } + + par1World.func_147453_f(par2, par3, par4, par5); + } + } + + super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + + private void dropItem(ItemStack itemstack ,World par1World,int par2, int par3, int par4){ + + if (itemstack != null) + { + float f = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + float f1 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + float f2 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int k1 = this.furnaceRand.nextInt(21) + 10; + + if (k1 > itemstack.stackSize) + { + k1 = itemstack.stackSize; + } + + itemstack.stackSize -= k1; + EntityItem entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float)this.furnaceRand.nextGaussian() * f3; + entityitem.motionY = (float)this.furnaceRand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float)this.furnaceRand.nextGaussian() * f3; + par1World.spawnEntityInWorld(entityitem); + } + } + + } + + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) + { + TileEntityCraftFurnace tileentityfurnace = (TileEntityCraftFurnace)p_149734_1_.getTileEntity(p_149734_2_, p_149734_3_, p_149734_4_); + + + if (tileentityfurnace.isFuel()) + { + int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + float f = (float)p_149734_2_ + 0.5F; + float f1 = (float)p_149734_3_ + 0.0F + p_149734_5_.nextFloat() * 6.0F / 16.0F; + float f2 = (float)p_149734_4_ + 0.5F; + float f3 = 0.52F; + float f4 = p_149734_5_.nextFloat() * 0.6F - 0.3F; + + if (l == 4) + { + p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + } + else if (l == 5) + { + p_149734_1_.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + } + else if (l == 2) + { + p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); + } + else if (l == 3) + { + p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); + } + } + } + + @Override + public boolean hasComparatorInputOverride() + { + return true; + } + + /** + * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal + * strength when this block inputs to a comparator. + */ + @Override + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + return Container.calcRedstoneFromInventory((IInventory)par1World.getTileEntity(par2, par3, par4)); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockDetectorBuoy.java b/src/main/java/shift/sextiarysector/block/BlockDetectorBuoy.java new file mode 100644 index 0000000..dfdc8dc --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockDetectorBuoy.java @@ -0,0 +1,169 @@ +package shift.sextiarysector.block; + +import java.util.List; +import java.util.Random; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockDetectorBuoy extends BlockBuoyBase { + + @SideOnly(Side.CLIENT) + private IIcon[] iconArray; + + private int ProvidePower; + + public BlockDetectorBuoy() { + super(); + this.setTickRandomly(true); + // TODO 閾ェ蜍慕函謌舌&繧後◆繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ繝シ繝サ繧ケ繧ソ繝 + } + + @Override + public int tickRate(World par1World) + { + return 20; + } + + @Override + public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) + { + if (!par1World.isRemote) + { + int l = par1World.getBlockMetadata(par2, par3, par4); + + if ((l & 8) == 0) + { + this.setStateIfMineboatInteractsWithRail(par1World, par2, par3, par4, l); + } + } + } + + /* + @Override + public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) + { + if(par5Entity instanceof EntityBoat){ + + par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 1); + System.out.println("kokodayo2"); + + } + + + } + */ + + @Override + public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if (!par1World.isRemote) + { + int l = par1World.getBlockMetadata(par2, par3, par4); + + if (l != 0) + { + this.setStateIfMineboatInteractsWithRail(par1World, par2, par3, par4, l); + + } + } + } + + private void setStateIfMineboatInteractsWithRail(World par1World, int par2, int par3, int par4, int par5) + { + boolean flag = (par5 & 8) != 0; + boolean flag1 = false; + float f = -0.125F; + List list = par1World.getEntitiesWithinAABB(EntityBoat.class, AxisAlignedBB.getBoundingBox(par2 + f, par3, par4 + f, par2 + 1 - f, par3 + 1 - f, par4 + 1 - f)); + + if (!list.isEmpty()) + { + flag1 = true; + } + + if (flag1 && !flag) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 3); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this); + par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + + if (!flag1 && flag) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 & 7, 3); + par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this); + par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this); + par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } + + if (flag1) + { + par1World.scheduleBlockUpdate(par2, par3, par4, this, this.tickRate(par1World)); + } + + //par1World.setBlock(par2, par3, par4, this); + + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); + this.setStateIfMineboatInteractsWithRail(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4)); + } + + @Override + public boolean canProvidePower() + { + return true; + } + + @Override + public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) != 0 ? 15 : 0; + } + + @Override + public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 0 ? 0 : (par5 == 1 ? 15 : 0); + } + + /* + public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + return par1IBlockAccess.getBlockMetadata(par2, par3, par4) >=1 ? 15 : 0 ; + } + + public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + return par1IBlockAccess.getBlockMetadata(par2, par3, par4) >=1 ? 15 : 0 ; + } + */ + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.iconArray = new IIcon[2]; + this.iconArray[0] = par1IconRegister.registerIcon(this.textureName); + this.iconArray[1] = par1IconRegister.registerIcon(this.textureName + "_powered"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int par1, int par2) + { + return (par2 & 8) != 0 ? this.iconArray[1] : this.iconArray[0]; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockDirection.java b/src/main/java/shift/sextiarysector/block/BlockDirection.java index b9f790b..7e2a171 100644 --- a/src/main/java/shift/sextiarysector/block/BlockDirection.java +++ b/src/main/java/shift/sextiarysector/block/BlockDirection.java @@ -2,44 +2,89 @@ import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -import shift.sextiarysector.api.machine.item.IHammer; +import shift.sextiarysector.api.gearforce.item.IHammer; import shift.sextiarysector.tileentity.TileEntityDirection; -public abstract class BlockDirection extends BlockContainer{ +public abstract class BlockDirection extends BlockContainer { protected BlockDirection(Material p_i45386_1_) { super(p_i45386_1_); + this.setHarvestLevel("hammer", 0); } @Override - public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6,float par7, float par8, float par9) { + public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - ItemStack item = par5EntityPlayer.getCurrentEquippedItem(); + ItemStack item = par5EntityPlayer.getCurrentEquippedItem(); - if(item == null || !(item.getItem() instanceof IHammer))return false; + if (item == null || !(item.getItem() instanceof IHammer)) return false; - if(!((IHammer)item.getItem()).canUse(item))return false; + if (par1World.isRemote) return true; + + if (!par5EntityPlayer.isSneaking()) { + this.changeToHammer(par1World, x, y, z, par5EntityPlayer, item); + } else { + this.breakToHammer(par1World, x, y, z, par5EntityPlayer, item); + } + + return true; + } + + /* + @Override + public void onBlockClicked(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer) { + + ItemStack item = par5EntityPlayer.getCurrentEquippedItem(); + + if (item == null || !(item.getItem() instanceof IHammer)) return; + + if (par1World.isRemote) return; + + this.breakToHammer(par1World, x, y, z, par5EntityPlayer, item); + + return; + + }*/ + + private void changeToHammer(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, ItemStack item) { + + if (!((IHammer) item.getItem()).canUse(item, par5EntityPlayer, 2)) return; TileEntityDirection t = (TileEntityDirection) par1World.getTileEntity(x, y, z); ForgeDirection d = t.getDirection(); - if(d.ordinal()>4){ + if (d.ordinal() > 4) { t.direction = d.getOrientation(0); - }else{ - t.direction = d.getOrientation(d.ordinal()+1); + } else { + t.direction = d.getOrientation(d.ordinal() + 1); } - ((IHammer)item.getItem()).use(item); + ((IHammer) item.getItem()).use(item, par5EntityPlayer, 2); par1World.playSoundEffect(x, y, z, this.stepSound.getStepResourcePath(), 1.0F, par1World.rand.nextFloat() * 0.1F + 0.6F); par1World.markBlockForUpdate(x, y, z); - return true; + } + + private void breakToHammer(World par1World, int x, int y, int z, EntityPlayer player, ItemStack item) { + + if (!((IHammer) item.getItem()).canUse(item, player, 10)) return; + + EntityItem eItem = new EntityItem(player.worldObj, x + 0.5d, y + 0.5d, z + 0.5d, new ItemStack(this, 1)); + + player.worldObj.spawnEntityInWorld(eItem); + + ((IHammer) item.getItem()).use(item, player, 10); + + player.worldObj.setBlockToAir(x, y, z); + player.worldObj.removeTileEntity(x, y, z); + } } diff --git a/src/main/java/shift/sextiarysector/block/BlockElectricMotor.java b/src/main/java/shift/sextiarysector/block/BlockElectricMotor.java new file mode 100644 index 0000000..753d99e --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockElectricMotor.java @@ -0,0 +1,21 @@ +package shift.sextiarysector.block; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.plugin.PluginIC2; +import shift.sextiarysector.tileentity.TileEntityElectricMotor; + +public class BlockElectricMotor extends BlockMotor{ + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityElectricMotor(); + } + + @Override + public int getRenderType() + { + return PluginIC2.electricMotorType; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockFan.java b/src/main/java/shift/sextiarysector/block/BlockFan.java new file mode 100644 index 0000000..aa215cb --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockFan.java @@ -0,0 +1,42 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.tileentity.TileEntityFan; + +public class BlockFan extends BlockDirection{ + + public BlockFan() { + super(Material.iron); + this.setBlockTextureName("planks_oak"); + this.setHardness(1.0F); + this.setStepSound(soundTypeStone); + this.setCreativeTab(SextiarySectorAPI.TabSSIndustry); + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.fanType; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityFan(); + } + + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockFigure.java b/src/main/java/shift/sextiarysector/block/BlockFigure.java new file mode 100644 index 0000000..5721839 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockFigure.java @@ -0,0 +1,284 @@ +package shift.sextiarysector.block; + +import java.util.ArrayList; +import java.util.List; + +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.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntityFigure; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockFigure extends BlockContainer { + + // private TileEntityFigure tile; + + @SideOnly(Side.CLIENT) + private IIcon side; + + public BlockFigure() { + super(Material.wood); + float f = 1.0f / 16.0f; + this.setBlockBounds(f * 2, 0, f * 2, f * 14, f * 4, f * 14); + this.setHardness(0.3f); + // this.setBlockUnbreakable(); + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int par1, int par2) { + + if (par1 == 0 || par1 == 1) { + return this.blockIcon; + } else { + return this.side; + } + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) { + super.registerBlockIcons(par1IconRegister); + this.side = par1IconRegister.registerIcon(this.getTextureName() + + "_side"); + } + + @Override + @SideOnly(Side.CLIENT) + public String getItemIconName() { + return this.getTextureName(); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + ItemStack itemstack = new ItemStack(p_149666_1_, 1, 0); + + setFigureItem(itemstack, new ItemStack(Blocks.dirt, 1, 0), "creative"); + + p_149666_3_.add(itemstack); + + ItemStack itemstack2 = new ItemStack(p_149666_1_, 1, 0); + + setFigureItem(itemstack2, new ItemStack(SSItems.ironSpanner, 1, 0), "creative"); + + p_149666_3_.add(itemstack2); + + ItemStack itemstack3 = new ItemStack(p_149666_1_, 1, 0); + ItemStack itemstack4 = new ItemStack(p_149666_1_, 1, 0); + + setFigureItem(itemstack3, new ItemStack(SSItems.ironSpanner, 1, 0), "creative"); + setFigureItem(itemstack4, itemstack3, "creative"); + + p_149666_3_.add(itemstack4); + + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityFigure(); + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) { + super.onBlockAdded(par1World, par2, par3, par4); + + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) { + + if (!par1World.isRemote) { + + Block block = par1World.getBlock(par2, par3, par4 - 1); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); + + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) { + b0 = 4; + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); + tileEntity.direction = ForgeDirection.getOrientation(b0); + + } + + } + + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + if (l == 0) { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + tileEntity.direction = ForgeDirection.getOrientation(2); + } + + if (l == 1) { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + tileEntity.direction = ForgeDirection.getOrientation(5); + } + + if (l == 2) { + ///par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + tileEntity.direction = ForgeDirection.getOrientation(3); + } + + if (l == 3) { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + tileEntity.direction = ForgeDirection.getOrientation(4); + } + + } + + @Override + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, + int p_149749_4_, Block p_149749_5_, int p_149749_6_) { + // ItemInWorldManager a = new ItemInWorldManager(); + // if( ItemInWorldManager.isCreative()); + // tile = (TileEntityFigure) p_149749_1_.getTileEntity(p_149749_2_, + // p_149749_3_, p_149749_4_); + // this.dropBlockAsItem(p_149749_1_, p_149749_2_, p_149749_3_, + // p_149749_4_, 0, 0); + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, + p_149749_5_, p_149749_6_); + } + + @Override + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) { + if (!p_149681_6_.capabilities.isCreativeMode) { + this.dropBlockAsItem(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, 0); + } + + super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { + + ArrayList ret = new ArrayList(); + + TileEntity t = world.getTileEntity(x, y, z); + + if (t != null && t instanceof TileEntityFigure) { + + Item item = getItemDropped(metadata, world.rand, fortune); + ItemStack itemstack = new ItemStack(item, 1); + setFigureItem(itemstack, ((TileEntityFigure) t).getFigure(), ((TileEntityFigure) t).getEdition()); + + ret.add(itemstack); + + } + + return ret; + } + + @Override + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + + ItemStack stack = new ItemStack(this, 1); + + TileEntityFigure tile = (TileEntityFigure) world.getTileEntity(x, y, z); + + if (tile.getFigure() != null) { + setFigureItem(stack, tile.getFigure(), tile.getEdition()); + } + + return stack; + } + + public static ItemStack setFigureItem(ItemStack item, ItemStack setItem, String edition) { + + if (setItem == null) return item; + + NBTTagCompound nbt = item.stackTagCompound; + + if (nbt == null) { + nbt = new NBTTagCompound(); + item.setTagCompound(nbt); + } + + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + setItem.writeToNBT(nbttagcompound1); + nbt.setTag("figure", nbttagcompound1); + nbt.setString("edition", edition); + + return item; + } + + public static ItemStack getFigureItem(ItemStack item) { + + NBTTagCompound nbt = item.stackTagCompound; + + if (nbt == null) { + return null; + } + + if (nbt.hasKey("figure")) { + return ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("figure")); + } + + return null; + } + + public static String getEdition(ItemStack item) { + + NBTTagCompound nbt = item.stackTagCompound; + + if (nbt == null) { + return null; + } + + if (nbt.hasKey("edition")) { + return nbt.getString("edition"); + } + + return null; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockFluidCrafter.java b/src/main/java/shift/sextiarysector/block/BlockFluidCrafter.java new file mode 100644 index 0000000..2ef44a3 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockFluidCrafter.java @@ -0,0 +1,52 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.tileentity.TileEntityFluidCrafter; + +public class BlockFluidCrafter extends BlockContainer{ + + public BlockFluidCrafter() { + super(Material.glass); + this.setHardness(0.4F); + this.setStepSound(soundTypeGlass); + this.setBlockBounds(4.0f/16.0f, 4.0f/16.0f, 4.0f/16.0f, 12.0f/16.0f, 12.0f/16.0f, 12.0f/16.0f); + this.setCreativeTab(SextiarySectorAPI.TabSSFluid); + } + + /* + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + if(par6ItemStack.getItemDamage()!=0){ + TileEntityFluidCrafter tileEntity = (TileEntityFluidCrafter)par1World.getTileEntity(par2, par3, par4); + tileEntity.f = new FluidStack(FluidRegistry.getFluid(par6ItemStack.getItemDamage()),1000); + } + + }*/ + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.fluidCrafterType; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityFluidCrafter(); + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockFluidFGFMachine.java b/src/main/java/shift/sextiarysector/block/BlockFluidFGFMachine.java new file mode 100644 index 0000000..3b1f3b1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockFluidFGFMachine.java @@ -0,0 +1,326 @@ +package shift.sextiarysector.block; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSMaterials; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.recipe.RecipeSimpleFluid; +import shift.sextiarysector.tileentity.TileEntityFluidFGFMachineBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockFluidFGFMachine extends BlockContainer { + + private final Random furnaceRand = new Random(); + private final String IconName; + @SideOnly(Side.CLIENT) + private IIcon iconTop; + @SideOnly(Side.CLIENT) + private IIcon iconUnder; + private final String frontIcon; + @SideOnly(Side.CLIENT) + private IIcon iconFront; + + private final int guiID; + private final RecipeSimpleFluid recipe; + private String guiuUnlocalizedName; + private final int type; + + public BlockFluidFGFMachine(String iconFront, int gui, RecipeSimpleFluid recipe, int type) { + super(SSMaterials.machine); + this.setHardness(3.0F); + this.frontIcon = iconFront; + this.guiID = gui; + this.recipe = recipe; + this.type = type; + this.setHarvestLevel("hammer", 1); + IconName = ("sextiarysector:machine/machine"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + int d = ((TileEntityFluidFGFMachineBase) par1IBlockAccess.getTileEntity(par2, par3, par4)).direction.ordinal(); + + if (par5 == 1) + { + return this.iconTop; + } + else if (par5 == 0) + { + return this.iconUnder; + } + else if (par5 == d) + { + return this.iconFront; + } else + { + return this.blockIcon; + } + + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(int par1, int par2) + { + + if (par1 == 1) + { + return this.iconTop; + } + else if (par1 == 0) + { + return this.iconUnder; + } + else if (par1 == 3) + { + return this.iconFront; + } else + { + return this.blockIcon; + } + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(IconName); + this.iconTop = par1IconRegister.registerIcon(IconName + "_top"); + this.iconUnder = par1IconRegister.registerIcon(IconName + "_under"); + + //iconFront = new Icon[SimpleMachine.values().length]; + + this.iconFront = par1IconRegister.registerIcon("sextiarysector:machine/" + this.frontIcon); + + /* + for(int i =0;i 0) + { + int k1 = this.furnaceRand.nextInt(21) + 10; + + if (k1 > itemstack.stackSize) + { + k1 = itemstack.stackSize; + } + + itemstack.stackSize -= k1; + EntityItem entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float) this.furnaceRand.nextGaussian() * f3; + entityitem.motionY = (float) this.furnaceRand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float) this.furnaceRand.nextGaussian() * f3; + par1World.spawnEntityInWorld(entityitem); + } + } + + } + + @Override + public Block setBlockName(String p_149663_1_) + { + super.setBlockName(p_149663_1_); + this.guiuUnlocalizedName = p_149663_1_; + return this; + } + + public String getGUIUnlocalizedName() + { + return this.guiuUnlocalizedName; + } + + public ItemStack getResult(ItemStack itemstack) { + return this.recipe.getResult(itemstack); + } + + public FluidStack getFluidResult(ItemStack itemstack) { + return this.recipe.getFluidResult(itemstack); + } + + @Override + public TileEntity createNewTileEntity(World world, int i) { + return new TileEntityFluidFGFMachineBase(type); + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockFluidFurnace.java b/src/main/java/shift/sextiarysector/block/BlockFluidFurnace.java new file mode 100644 index 0000000..5a3468d --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockFluidFurnace.java @@ -0,0 +1,278 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.gearforce.item.IHammer; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntityFluidFurnace; +import shift.sextiarysector.tileentity.TileEntityFluidMachineBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockFluidFurnace extends BlockFluidMachineBase { + + private final Random furnaceRand = new Random(); + + private static boolean keepFurnaceInventory; + + @SideOnly(Side.CLIENT) + private IIcon furnaceIconTop; + @SideOnly(Side.CLIENT) + private IIcon[] furnaceIconFront; + @SideOnly(Side.CLIENT) + private IIcon furnaceIconTopOn; + + public BlockFluidFurnace() { + super(Material.rock); + this.setHardness(1.0F); + this.setStepSound(soundTypeStone); + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + TileEntityFluidMachineBase tileentityfurnace = (TileEntityFluidMachineBase) world.getTileEntity(x, y, z); + if (tileentityfurnace.isFuel()) return 15; + return 0; + } + + @Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer player, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityFluidFurnace tileentityfurnace = (TileEntityFluidFurnace) par1World.getTileEntity(par2, par3, par4); + + if (player.getCurrentEquippedItem() != null) { + + Item item = player.getCurrentEquippedItem().getItem(); + + if (item instanceof IHammer && ((IHammer) item).canUse(player.getCurrentEquippedItem(), player, 2)) { + + tileentityfurnace.on = !tileentityfurnace.on; + ((IHammer) player.getCurrentEquippedItem().getItem()).use(player.getCurrentEquippedItem(), player, 2); + par1World.markBlockForUpdate(par2, par3, par4); + return true; + + } + } + + if (tileentityfurnace != null) + { + player.openGui(SextiarySector.instance, 1, par1World, par2, par3, par4); + } + + return true; + } + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + Block block = par1World.getBlock(par2, par3, par4 - 1); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); + + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } + + //par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); + tileEntity.direction = ForgeDirection.getOrientation(b0); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int par1, int par2) + { + + return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != 3 ? this.blockIcon : this.furnaceIconFront[1])); + + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess p_149673_1_, int x, int y, int z, int side) + { + + TileEntityFluidMachineBase tileEntity = (TileEntityFluidMachineBase) p_149673_1_.getTileEntity(x, y, z); + + int meta = tileEntity.getDirection().ordinal();//p_149673_1_.getBlockMetadata(x, y, z); + + return side == 1 ? (tileEntity.on ? this.furnaceIconTopOn : this.furnaceIconTop) : (side == 0 ? this.furnaceIconTop : (side != meta ? this.blockIcon : (tileEntity.isFuel() ? this.furnaceIconFront[0] : this.furnaceIconFront[1]))); + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon("furnace_side"); + this.furnaceIconFront = new IIcon[2]; + this.furnaceIconFront[0] = par1IconRegister.registerIcon("furnace_front_on"); + this.furnaceIconFront[1] = par1IconRegister.registerIcon("furnace_front_off"); + this.furnaceIconTop = par1IconRegister.registerIcon("sextiarysector:fluid_furnace_top"); + this.furnaceIconTopOn = par1IconRegister.registerIcon("sextiarysector:fluid_furnace_top_on"); + } + + @Override + public TileEntity createNewTileEntity(World par1World, int p_149915_2_) + { + return new TileEntityFluidFurnace(); + } + + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + if (l == 0) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[2]; + } + + if (l == 1) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[5]; + } + + if (l == 2) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[3]; + } + + if (l == 3) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[4]; + } + + } + + @Override + public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) + { + if (!keepFurnaceInventory) + { + TileEntityFluidMachineBase tileentityfurnace = (TileEntityFluidMachineBase) par1World.getTileEntity(par2, par3, par4); + + if (tileentityfurnace != null) + { + for (int j1 = 0; j1 < tileentityfurnace.getSizeInventory(); ++j1) + { + ItemStack itemstack = tileentityfurnace.getStackInSlot(j1); + + this.dropItem(itemstack, par1World, par2, par3, par4); + + } + + par1World.func_147453_f(par2, par3, par4, par5); + } + } + + super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + + private void dropItem(ItemStack itemstack, World par1World, int par2, int par3, int par4) { + + if (itemstack != null) + { + float f = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + float f1 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + float f2 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int k1 = this.furnaceRand.nextInt(21) + 10; + + if (k1 > itemstack.stackSize) + { + k1 = itemstack.stackSize; + } + + itemstack.stackSize -= k1; + EntityItem entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float) this.furnaceRand.nextGaussian() * f3; + entityitem.motionY = (float) this.furnaceRand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float) this.furnaceRand.nextGaussian() * f3; + par1World.spawnEntityInWorld(entityitem); + } + } + + } + + @Override + public boolean hasComparatorInputOverride() + { + return true; + } + + @Override + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + return Container.calcRedstoneFromInventory((IInventory) par1World.getTileEntity(par2, par3, par4)); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockFluidMachineBase.java b/src/main/java/shift/sextiarysector/block/BlockFluidMachineBase.java new file mode 100644 index 0000000..18093a1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockFluidMachineBase.java @@ -0,0 +1,303 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +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.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.gearforce.item.IHammer; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntityFluidMachineBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public abstract class BlockFluidMachineBase extends BlockContainer { + + private final Random furnaceRand = new Random(); + + private static boolean keepFurnaceInventory; + + @SideOnly(Side.CLIENT) + private IIcon furnaceIconTop; + @SideOnly(Side.CLIENT) + private IIcon[] furnaceIconFront; + @SideOnly(Side.CLIENT) + private IIcon furnaceIconTopOn; + + public BlockFluidMachineBase(Material material) { + super(material); + this.setHardness(1.0F); + } + + @Override + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + TileEntityFluidMachineBase tileentityfurnace = (TileEntityFluidMachineBase) world.getTileEntity(x, y, z); + if (tileentityfurnace.isFuel()) return 15; + return 0; + } + + @Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer player, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityFluidMachineBase tileentityfurnace = (TileEntityFluidMachineBase) par1World.getTileEntity(par2, par3, par4); + + if (player.getCurrentEquippedItem() != null) { + if (player.getCurrentEquippedItem().getItem() instanceof IHammer && ((IHammer) player.getCurrentEquippedItem().getItem()).canUse(player.getCurrentEquippedItem(), player, 2)) { + + tileentityfurnace.on = !tileentityfurnace.on; + ((IHammer) player.getCurrentEquippedItem().getItem()).use(player.getCurrentEquippedItem(), player, 2); + par1World.markBlockForUpdate(par2, par3, par4); + return true; + + } + } + + if (tileentityfurnace != null) + { + player.openGui(SextiarySector.instance, 1, par1World, par2, par3, par4); + } + + return true; + } + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + Block block = par1World.getBlock(par2, par3, par4 - 1); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); + + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } + + //par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); + tileEntity.direction = ForgeDirection.getOrientation(b0); + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int par1, int par2) + { + + return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != 3 ? this.blockIcon : this.furnaceIconFront[1])); + + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess p_149673_1_, int x, int y, int z, int side) + { + + TileEntityFluidMachineBase tileEntity = (TileEntityFluidMachineBase) p_149673_1_.getTileEntity(x, y, z); + + int meta = tileEntity.getDirection().ordinal();//p_149673_1_.getBlockMetadata(x, y, z); + + return side == 1 ? (tileEntity.on ? this.furnaceIconTopOn : this.furnaceIconTop) : (side == 0 ? this.furnaceIconTop : (side != meta ? this.blockIcon : (tileEntity.isFuel() ? this.furnaceIconFront[0] : this.furnaceIconFront[1]))); + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon("furnace_side"); + this.furnaceIconFront = new IIcon[2]; + this.furnaceIconFront[0] = par1IconRegister.registerIcon("furnace_front_on"); + this.furnaceIconFront[1] = par1IconRegister.registerIcon("furnace_front_off"); + this.furnaceIconTop = par1IconRegister.registerIcon("sextiarysector:fluid_furnace_top"); + this.furnaceIconTopOn = par1IconRegister.registerIcon("sextiarysector:fluid_furnace_top_on"); + } + + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + if (l == 0) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[2]; + } + + if (l == 1) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[5]; + } + + if (l == 2) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[3]; + } + + if (l == 3) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[4]; + } + + } + + @Override + public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) + { + if (!keepFurnaceInventory) + { + TileEntityFluidMachineBase tileentityfurnace = (TileEntityFluidMachineBase) par1World.getTileEntity(par2, par3, par4); + + if (tileentityfurnace != null) + { + for (int j1 = 0; j1 < tileentityfurnace.getSizeInventory(); ++j1) + { + ItemStack itemstack = tileentityfurnace.getStackInSlot(j1); + + this.dropItem(itemstack, par1World, par2, par3, par4); + + } + + par1World.func_147453_f(par2, par3, par4, par5); + } + } + + super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + + private void dropItem(ItemStack itemstack, World par1World, int par2, int par3, int par4) { + + if (itemstack != null) + { + float f = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + float f1 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + float f2 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int k1 = this.furnaceRand.nextInt(21) + 10; + + if (k1 > itemstack.stackSize) + { + k1 = itemstack.stackSize; + } + + itemstack.stackSize -= k1; + EntityItem entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float) this.furnaceRand.nextGaussian() * f3; + entityitem.motionY = (float) this.furnaceRand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float) this.furnaceRand.nextGaussian() * f3; + par1World.spawnEntityInWorld(entityitem); + } + } + + } + + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) + { + TileEntityFluidMachineBase tileentityfurnace = (TileEntityFluidMachineBase) p_149734_1_.getTileEntity(p_149734_2_, p_149734_3_, p_149734_4_); + + if (tileentityfurnace.isFuel()) + { + int l = tileentityfurnace.getDirection().ordinal(); + float f = p_149734_2_ + 0.5F; + float f1 = p_149734_3_ + 0.0F + p_149734_5_.nextFloat() * 6.0F / 16.0F; + float f2 = p_149734_4_ + 0.5F; + float f3 = 0.52F; + float f4 = p_149734_5_.nextFloat() * 0.6F - 0.3F; + + if (l == 4) + { + p_149734_1_.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + } + else if (l == 5) + { + p_149734_1_.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + } + else if (l == 2) + { + p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + } + else if (l == 3) + { + p_149734_1_.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + } + } + } + + @Override + public boolean hasComparatorInputOverride() + { + return true; + } + + @Override + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + return Container.calcRedstoneFromInventory((IInventory) par1World.getTileEntity(par2, par3, par4)); + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockFoodSmokers.java b/src/main/java/shift/sextiarysector/block/BlockFoodSmokers.java new file mode 100644 index 0000000..6233deb --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockFoodSmokers.java @@ -0,0 +1,149 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +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; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.gearforce.item.IHammer; +import shift.sextiarysector.tileentity.TileEntityFluidMachineBase; +import shift.sextiarysector.tileentity.TileEntityFoodSmokers; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockFoodSmokers extends BlockFluidMachineBase { + + @SideOnly(Side.CLIENT) + private IIcon furnaceIconTop; + @SideOnly(Side.CLIENT) + private IIcon[] furnaceIconFront; + @SideOnly(Side.CLIENT) + private IIcon furnaceIconTopOn; + + public BlockFoodSmokers() { + super(Material.iron); + this.setHardness(1.0F); + this.setStepSound(soundTypeMetal); + } + + @Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityFluidMachineBase tileentityfurnace = (TileEntityFluidMachineBase) par1World.getTileEntity(par2, par3, par4); + + if (par5EntityPlayer.getCurrentEquippedItem() != null) { + if (par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof IHammer && ((IHammer) par5EntityPlayer.getCurrentEquippedItem().getItem()).canUse(par5EntityPlayer.getCurrentEquippedItem(), par5EntityPlayer, 2)) { + + tileentityfurnace.on = !tileentityfurnace.on; + ((IHammer) par5EntityPlayer.getCurrentEquippedItem().getItem()).use(par5EntityPlayer.getCurrentEquippedItem(), par5EntityPlayer, 2); + par1World.markBlockForUpdate(par2, par3, par4); + return true; + + } + } + + if (tileentityfurnace != null) + { + par5EntityPlayer.openGui(SextiarySector.instance, 2, par1World, par2, par3, par4); + } + + return true; + } + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int par1, int par2) + { + + return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != 3 ? this.blockIcon : this.furnaceIconFront[1])); + + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess p_149673_1_, int x, int y, int z, int side) + { + + TileEntityFoodSmokers tileEntity = (TileEntityFoodSmokers) p_149673_1_.getTileEntity(x, y, z); + + int meta = tileEntity.getDirection().ordinal();//p_149673_1_.getBlockMetadata(x, y, z); + + return side == 1 ? (tileEntity.on ? this.furnaceIconTopOn : this.furnaceIconTop) : (side == 0 ? this.furnaceIconTop : (side != meta ? this.blockIcon : (tileEntity.isFuel() ? this.furnaceIconFront[0] : this.furnaceIconFront[1]))); + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon("sextiarysector:food_smokers_side"); + this.furnaceIconFront = new IIcon[2]; + this.furnaceIconFront[0] = par1IconRegister.registerIcon("sextiarysector:food_smokers_front_on"); + this.furnaceIconFront[1] = par1IconRegister.registerIcon("sextiarysector:food_smokers_front_off"); + this.furnaceIconTop = par1IconRegister.registerIcon("sextiarysector:food_smokers_top"); + this.furnaceIconTopOn = par1IconRegister.registerIcon("sextiarysector:food_smokers_top_on"); + } + + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) + { + TileEntityFluidMachineBase tileentityfurnace = (TileEntityFluidMachineBase) p_149734_1_.getTileEntity(p_149734_2_, p_149734_3_, p_149734_4_); + + if (tileentityfurnace.isFuel()) + { + int l = tileentityfurnace.getDirection().ordinal(); + + for (int i = 0; i < 5; i++) { + + float f = p_149734_2_ + 0.5F; + float f1 = p_149734_3_ + 0.0F + p_149734_5_.nextFloat() * 6.0F / 16.0F; + float f2 = p_149734_4_ + 0.5F; + float f3 = 0.52F; + float f4 = p_149734_5_.nextFloat() * 0.6F - 0.3F; + + if (l == 4) + { + p_149734_1_.spawnParticle("explode", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + } + else if (l == 5) + { + p_149734_1_.spawnParticle("explode", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D); + } + else if (l == 2) + { + p_149734_1_.spawnParticle("explode", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D); + } + else if (l == 3) + { + p_149734_1_.spawnParticle("explode", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D); + } + + } + + } + } + + @Override + public TileEntity createNewTileEntity(World par1World, int p_149915_2_) + { + return new TileEntityFoodSmokers(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockFreezer.java b/src/main/java/shift/sextiarysector/block/BlockFreezer.java new file mode 100644 index 0000000..de590c8 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockFreezer.java @@ -0,0 +1,31 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.tileentity.TileEntityFreezer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockFreezer extends BlockSimpleFurnace{ + + public BlockFreezer() { + super(6); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + @Override + public TileEntity createNewTileEntity(World par1World, int p_149915_2_) + { + return new TileEntityFreezer(); + } + + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) + { + + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockFunnel.java b/src/main/java/shift/sextiarysector/block/BlockFunnel.java new file mode 100644 index 0000000..101aad8 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockFunnel.java @@ -0,0 +1,99 @@ +package shift.sextiarysector.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; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntityFunnel; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockFunnel extends BlockContainer { + + private IIcon field_149923_M; + private IIcon field_149921_b; + private IIcon field_149924_N; + + public BlockFunnel() { + super(Material.iron); + this.setHardness(0.7f); + } + + @Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityFunnel tileentityfurnace = (TileEntityFunnel) par1World.getTileEntity(par2, par3, par4); + + if (tileentityfurnace != null) + { + par5EntityPlayer.openGui(SextiarySector.instance, 11, par1World, par2, par3, par4); + } + + return true; + } + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.funnelType; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { + return p_149691_1_ == 1 ? this.field_149923_M : this.field_149921_b; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) + { + this.blockIcon = p_149651_1_.registerIcon(this.textureName + "_outside"); + this.field_149921_b = p_149651_1_.registerIcon(this.textureName + "_outside"); + this.field_149923_M = p_149651_1_.registerIcon(this.textureName + "_top"); + this.field_149924_N = p_149651_1_.registerIcon(this.textureName + "_inside"); + } + + @Override + @SideOnly(Side.CLIENT) + public String getItemIconName() + { + return this.textureName; + } + + @SideOnly(Side.CLIENT) + public IIcon getFunnelIcon(String p_149916_0_) + { + return p_149916_0_.equals("funnel_outside") ? this.field_149921_b : (p_149916_0_.equals("funnel_inside") ? this.field_149924_N : null); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityFunnel(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockGFDynamo.java b/src/main/java/shift/sextiarysector/block/BlockGFDynamo.java new file mode 100644 index 0000000..be5f7ab --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockGFDynamo.java @@ -0,0 +1,37 @@ +package shift.sextiarysector.block; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.SSMaterials; +import shift.sextiarysector.plugin.PluginRF; +import shift.sextiarysector.tileentity.TileEntityGFDynamo; + +public class BlockGFDynamo extends BlockDirection { + + public BlockGFDynamo() { + super(SSMaterials.machine); + this.setHardness(3.0F); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityGFDynamo(); + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return PluginRF.gfDynamoType; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockGFTank.java b/src/main/java/shift/sextiarysector/block/BlockGFTank.java index 81ba02b..0ac10bf 100644 --- a/src/main/java/shift/sextiarysector/block/BlockGFTank.java +++ b/src/main/java/shift/sextiarysector/block/BlockGFTank.java @@ -14,7 +14,7 @@ import net.minecraftforge.common.util.ForgeDirection; import shift.sextiarysector.SextiarySector; import shift.sextiarysector.api.SextiarySectorAPI; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; import shift.sextiarysector.tileentity.TileEntityDirection; import shift.sextiarysector.tileentity.TileEntityGFTank; import cpw.mods.fml.relauncher.Side; @@ -35,7 +35,7 @@ public BlockGFTank(Material p_i45386_1_, int gui,int type) { this.guiID = gui; this.type = type; this.setHardness(0.8F); - this.setCreativeTab(SextiarySectorAPI.TabSSMachine); + this.setCreativeTab(SextiarySectorAPI.TabSSIndustry); } @Override @@ -71,7 +71,7 @@ public IIcon getIcon(IBlockAccess par1IBlockAccess, int par2, int par3, int par4 TileEntity t = par1IBlockAccess.getTileEntity(par2 + d.offsetX, par3 + d.offsetY, par4 + d.offsetZ); - if(t instanceof IEnergyHandler && ((IEnergyHandler) t).canInterface(d.getOpposite()))return in; + if(t instanceof IGearForceHandler && ((IGearForceHandler) t).canInterface(d.getOpposite()))return in; return this.blockIcon; } diff --git a/src/main/java/shift/sextiarysector/block/BlockGearBox.java b/src/main/java/shift/sextiarysector/block/BlockGearBox.java index e5a1e6e..f46a257 100644 --- a/src/main/java/shift/sextiarysector/block/BlockGearBox.java +++ b/src/main/java/shift/sextiarysector/block/BlockGearBox.java @@ -12,7 +12,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import shift.sextiarysector.api.SextiarySectorAPI; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; import shift.sextiarysector.tileentity.TileEntityDirection; import shift.sextiarysector.tileentity.TileEntityGearBox; import cpw.mods.fml.relauncher.Side; @@ -30,7 +30,7 @@ public BlockGearBox(Material p_i45386_1_,int type) { super(p_i45386_1_); this.type = type; this.setHardness(1.0F); - this.setCreativeTab(SextiarySectorAPI.TabSSMachine); + this.setCreativeTab(SextiarySectorAPI.TabSSIndustry); } @Override @@ -47,7 +47,7 @@ public IIcon getIcon(IBlockAccess par1IBlockAccess, int par2, int par3, int par4 TileEntity t = par1IBlockAccess.getTileEntity(par2 + d.offsetX, par3 + d.offsetY, par4 + d.offsetZ); - if(t instanceof IEnergyHandler && ((IEnergyHandler) t).canInterface(d.getOpposite()))return out; + if(t instanceof IGearForceHandler && ((IGearForceHandler) t).canInterface(d.getOpposite()))return out; return this.blockIcon; } diff --git a/src/main/java/shift/sextiarysector/block/BlockGearShaft.java b/src/main/java/shift/sextiarysector/block/BlockGearShaft.java new file mode 100644 index 0000000..97e05d5 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockGearShaft.java @@ -0,0 +1,169 @@ +package shift.sextiarysector.block; + +import java.util.List; + +import net.minecraft.block.material.Material; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntityGearShaft; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockGearShaft extends BlockDirection { + + private int type; + + public BlockGearShaft(int type) { + super(Material.wood); + this.setType(type); + this.setHardness(0.8F); + this.setCreativeTab(SextiarySectorAPI.TabSSIndustry); + + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.GearShaftRenderType; + } + + @Override + public int damageDropped(int p_149692_1_) + { + return p_149692_1_; + } + + /* + public int damageDropped(int p_149692_1_) + { + return p_149692_1_; + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) + { + for(int i=0;i<5;i++){ + p_149666_3_.add(new ItemStack(p_149666_1_,1,i)); + } + }*/ + + @Override + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + + double[] i = getBoxFromPool(par1IBlockAccess.getTileEntity(par2, par3, par4).getWorldObj(), par2, par3, par4); + + float x = (float) i[0]; + float y = (float) i[1]; + float z = (float) i[2]; + + this.setBlockBounds((0.0F + x), (0.0F + y), (0.0F + z), (1.0F - x), (1.0F - y), (1.0F - z)); + } + + //蠖薙◆繧雁愛螳壹ゅし繝懊ユ繝ウ繧繧ス繧ヲ繝ォ繧オ繝ウ繝峨r蜿り縺ォ縺吶k縺ィ濶ッ縺縲ゅさ繧ウ縺ョ險ュ螳壹r縺吶k縺ィ縲{nEntityCollidedWithBlock縺悟他縺ー繧後k繧医≧縺ォ縺ェ繧 + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + double[] i = getBoxFromPool(par1World, par2, par3, par4); + + double x = i[0]; + double y = i[1]; + double z = i[2]; + + return AxisAlignedBB.getBoundingBox(par2 + x, par3 + y, par4 + z, (par2 + 1) - x, (par3 + 1) - y, (par4 + 1) - z); + } + + //繝悶Ο繝繧ッ縺ォ隕也せ繧貞粋繧上○縺滓凾縺ォ蜃コ縺ヲ縺上k鮟偵>邱壹ョ繧「繝ャ + @Override + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + double[] i = getBoxFromPool(par1World, par2, par3, par4); + + double x = i[0]; + double y = i[1]; + double z = i[2]; + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + + return AxisAlignedBB.getBoundingBox(par2 + x, par3 + y, par4 + z, (par2 + 1) - x, (par3 + 1) - y, (par4 + 1) - z); + } + + public double[] getBoxFromPool(World par1World, int par2, int par3, int par4) + { + double[] i = new double[3]; + + i[0] = 0;//x + i[1] = 0;//y + i[2] = 0;//z + + if (!(par1World.getTileEntity(par2, par3, par4) instanceof TileEntityDirection)) return i; + + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + if (tileEntity == null) { + return i; + } + + ForgeDirection d = tileEntity.direction; + + if (d.ordinal() == 0 || d.ordinal() == 1) { + i[0] = 0.3125; + i[2] = 0.3125; + } + if (d.ordinal() == 2 || d.ordinal() == 3) { + i[0] = 0.3125; + i[1] = 0.3125; + } + if (d.ordinal() == 4 || d.ordinal() == 5) { + i[1] = 0.3125; + i[2] = 0.3125; + } + + return i; + } + + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) { + return new TileEntityGearShaft(this.getType()); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) + { + + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockHole.java b/src/main/java/shift/sextiarysector/block/BlockHole.java index 524a291..039f6a8 100644 --- a/src/main/java/shift/sextiarysector/block/BlockHole.java +++ b/src/main/java/shift/sextiarysector/block/BlockHole.java @@ -1,5 +1,6 @@ package shift.sextiarysector.block; +import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; @@ -13,11 +14,13 @@ import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SSAchievement; +import shift.sextiarysector.SSBlocks; import shift.sextiarysector.SextiarySector; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockHole extends Block{ +public class BlockHole extends Block { public BlockHole() { super(Material.grass); @@ -47,6 +50,7 @@ public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727 }else if(itemstack.getItem() == Items.water_bucket && p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_)==0){ this.addWater(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); + p_149727_5_.addStat(SSAchievement.paddy, 1); return true; } @@ -56,7 +60,7 @@ public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727 public void addWater(World w, int x, int y, int z){ - w.setBlockMetadataWithNotify(x, y, z, 1, 4); + w.setBlock(x, y, z, SSBlocks.paddy); w.markBlockForUpdate(x, y, z); for(int i = 2;i<6;i++){ @@ -92,6 +96,15 @@ public void drawWater(World w, int x, int y, int z){ } + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + ret.add(new ItemStack(Blocks.dirt, 1)); + + return ret; + } + //蠖薙◆繧雁愛螳 public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) { diff --git a/src/main/java/shift/sextiarysector/block/BlockHotSprings.java b/src/main/java/shift/sextiarysector/block/BlockHotSprings.java new file mode 100644 index 0000000..fd54cc4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockHotSprings.java @@ -0,0 +1,42 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraftforge.fluids.Fluid; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockHotSprings extends BlockSSFluid{ + + public BlockHotSprings(Fluid fluid) { + super(fluid); + } + + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) + { + + if (p_149734_1_.isAirBlock(p_149734_2_, p_149734_3_ + 1, p_149734_4_) && p_149734_5_.nextInt(3)==0) + { + + float f = (float)p_149734_2_ + 0.5F; + float f1 = (float)p_149734_3_ + 0.0F + p_149734_5_.nextFloat() * 6.0F / 16.0F; + float f2 = (float)p_149734_4_ + 0.5F; + float f3 = 0.52F; + float f4 = p_149734_5_.nextFloat() * 0.6F - 0.3F; + + + p_149734_1_.spawnParticle("explode", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.05D, 0.0D); + + p_149734_1_.spawnParticle("explode", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.05D, 0.0D); + + p_149734_1_.spawnParticle("explode", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.05D, 0.0D); + + p_149734_1_.spawnParticle("explode", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.05D, 0.0D); + + + } + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockLargeFurnace.java b/src/main/java/shift/sextiarysector/block/BlockLargeFurnace.java index f29caa2..3aabc9b 100644 --- a/src/main/java/shift/sextiarysector/block/BlockLargeFurnace.java +++ b/src/main/java/shift/sextiarysector/block/BlockLargeFurnace.java @@ -33,7 +33,7 @@ public class BlockLargeFurnace extends BlockContainer{ @SideOnly(Side.CLIENT) private IIcon furnaceIconTop; @SideOnly(Side.CLIENT) - private IIcon[] furnaceIconFront = new IIcon[2]; + private IIcon[] furnaceIconFront; private int GUIID; @@ -42,6 +42,13 @@ public BlockLargeFurnace() { this.setHardness(1.0F); } + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + TileEntityLargeFurnace tileentityfurnace = (TileEntityLargeFurnace)world.getTileEntity(x, y, z); + if(tileentityfurnace.isBurning())return 15; + return 0; + } + @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { @@ -121,10 +128,6 @@ private void setDefaultDirection(World par1World, int par2, int par3, int par4) @Override @SideOnly(Side.CLIENT) - - /** - * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata - */ public IIcon getIcon(int par1, int par2) { @@ -132,6 +135,7 @@ public IIcon getIcon(int par1, int par2) } + @Override @SideOnly(Side.CLIENT) public IIcon getIcon(IBlockAccess p_149673_1_, int x, int y, int z, int side) { @@ -147,14 +151,10 @@ public IIcon getIcon(IBlockAccess p_149673_1_, int x, int y, int z, int side) @Override @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 registerBlockIcons(IIconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon("furnace_side"); + this.furnaceIconFront = new IIcon[2]; this.furnaceIconFront[0] = par1IconRegister.registerIcon("furnace_front_on"); this.furnaceIconFront[1] = par1IconRegister.registerIcon("furnace_front_off"); this.furnaceIconTop = par1IconRegister.registerIcon("sextiarysector:furnace_top"); diff --git a/src/main/java/shift/sextiarysector/block/BlockLargeOre.java b/src/main/java/shift/sextiarysector/block/BlockLargeOre.java new file mode 100644 index 0000000..1f96fce --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockLargeOre.java @@ -0,0 +1,82 @@ +package shift.sextiarysector.block; + +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public class BlockLargeOre extends BlockSSOreBase { + + private final Item oreItem; + private final Block oreBlock; + + public BlockLargeOre(Item item, Block block, int level) { + super(level); + this.oreItem = item; + this.oreBlock = block; + this.setResistance(5.0F); + this.setHardness(3.0F); + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + return oreItem; + } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + int count = quantityDropped(metadata, fortune, world.rand); + for (int i = 0; i < count; i++) + { + Item item = getItemDropped(metadata, world.rand, fortune); + if (item != null) + { + ret.add(new ItemStack(item, 1, damageDropped(metadata))); + if (oreBlock == Blocks.coal_ore) { + ret.add(new ItemStack(Items.coal, 2)); + } else { + ret.add(new ItemStack(oreBlock, 1, damageDropped(metadata))); + } + + } + } + return ret; + } + + /* + public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) + { + if(!willHarvest){ + return super.removedByPlayer(world, player, x, y, z, willHarvest); + }else if(world.getBlockMetadata(x, y, z)==0){ + return world.setBlock(x, y, z, oreBlock); + } + + return world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)-1, 4); + + } + + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) + { + for(int i=0;i<4;i++){ + p_149666_3_.add(new ItemStack(p_149666_1_,1,i)); + } + }*/ + + @Override + protected boolean canSilkHarvest() + { + return false; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockLargeWindmill.java b/src/main/java/shift/sextiarysector/block/BlockLargeWindmill.java new file mode 100644 index 0000000..dcf5e01 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockLargeWindmill.java @@ -0,0 +1,131 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntityLargeWindmill; + +public class BlockLargeWindmill extends BlockContainer { + + public BlockLargeWindmill() { + super(Material.wood); + this.setHardness(0.8F); + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); + this.setDefaultDirection(par1World, par2, par3, par4); + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + Block block = par1World.getBlock(par2, par3, par4 - 1); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); + + //TileEntityWindmill tileEntity = (TileEntityWindmill)par1World.getTileEntity(par2, par3, par4); + + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } + + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(b0); + + //par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); + } + } + + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, + ItemStack par6ItemStack) + { + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + + if (l == 0) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(2); + } + + if (l == 1) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(5); + + } + + if (l == 2) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(3); + + } + + if (l == 3) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(4); + + } + + par1World.markBlockForUpdate(par2, par3, par4); + + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.windMillType; + } + + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) { + return new TileEntityLargeWindmill(); + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockLeaf.java b/src/main/java/shift/sextiarysector/block/BlockLeaf.java new file mode 100644 index 0000000..bf01474 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockLeaf.java @@ -0,0 +1,21 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; + +public class BlockLeaf extends Block { + + public BlockLeaf() { + super(Material.leaves); + this.setHardness(0.2F); + this.setLightOpacity(1); + this.setStepSound(soundTypeGrass); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockLeafBed.java b/src/main/java/shift/sextiarysector/block/BlockLeafBed.java new file mode 100644 index 0000000..751be0f --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockLeafBed.java @@ -0,0 +1,348 @@ +package shift.sextiarysector.block; + +import java.util.Iterator; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockDirectional; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.SextiarySector; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockLeafBed extends BlockDirectional +{ + public static final int[][] field_149981_a = new int[][] { { 0, 1 }, { -1, 0 }, { 0, -1 }, { 1, 0 } }; + + @SideOnly(Side.CLIENT) + protected IIcon[] blockIcons; + + public BlockLeafBed() { + super(Material.wood); + //this.setLightOpacity(255); + this.setLightOpacity(1); + this.setStepSound(soundTypeGrass); + this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 4.0f / 16.0f, 1.0f); + this.setHardness(1.2f); + this.setStepSound(soundTypeWood); + this.useNeighborBrightness = true; + } + + @Override + public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) + { + if (p_149727_1_.isRemote) + { + return true; + } + else + { + int i1 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + + if (!isBlockHeadOfBed(i1)) + { + int j1 = getDirection(i1); + p_149727_2_ += field_149981_a[j1][0]; + p_149727_4_ += field_149981_a[j1][1]; + + if (p_149727_1_.getBlock(p_149727_2_, p_149727_3_, p_149727_4_) != this) + { + return true; + } + + i1 = p_149727_1_.getBlockMetadata(p_149727_2_, p_149727_3_, p_149727_4_); + } + + if (p_149727_1_.provider.canRespawnHere() && p_149727_1_.getBiomeGenForCoords(p_149727_2_, p_149727_4_) != BiomeGenBase.hell) + { + if (func_149976_c(i1)) + { + EntityPlayer entityplayer1 = null; + Iterator iterator = p_149727_1_.playerEntities.iterator(); + + while (iterator.hasNext()) + { + EntityPlayer entityplayer2 = (EntityPlayer) iterator.next(); + + if (entityplayer2.isPlayerSleeping()) + { + ChunkCoordinates chunkcoordinates = entityplayer2.playerLocation; + + if (chunkcoordinates.posX == p_149727_2_ && chunkcoordinates.posY == p_149727_3_ && chunkcoordinates.posZ == p_149727_4_) + { + entityplayer1 = entityplayer2; + } + } + } + + if (entityplayer1 != null) + { + p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.occupied", new Object[0])); + return true; + } + + func_149979_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, false); + } + + EntityPlayer.EnumStatus enumstatus = p_149727_5_.sleepInBedAt(p_149727_2_, p_149727_3_, p_149727_4_); + + if (enumstatus == EntityPlayer.EnumStatus.OK) + { + func_149979_a(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_, true); + return true; + } + else + { + if (enumstatus == EntityPlayer.EnumStatus.NOT_POSSIBLE_NOW) + { + p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.noSleep", new Object[0])); + } + else if (enumstatus == EntityPlayer.EnumStatus.NOT_SAFE) + { + p_149727_5_.addChatComponentMessage(new ChatComponentTranslation("tile.bed.notSafe", new Object[0])); + } + + return true; + } + } + else + { + double d2 = p_149727_2_ + 0.5D; + double d0 = p_149727_3_ + 0.5D; + double d1 = p_149727_4_ + 0.5D; + p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_); + int k1 = getDirection(i1); + p_149727_2_ += field_149981_a[k1][0]; + p_149727_4_ += field_149981_a[k1][1]; + + if (p_149727_1_.getBlock(p_149727_2_, p_149727_3_, p_149727_4_) == this) + { + p_149727_1_.setBlockToAir(p_149727_2_, p_149727_3_, p_149727_4_); + d2 = (d2 + p_149727_2_ + 0.5D) / 2.0D; + d0 = (d0 + p_149727_3_ + 0.5D) / 2.0D; + d1 = (d1 + p_149727_4_ + 0.5D) / 2.0D; + } + + p_149727_1_.newExplosion((Entity) null, p_149727_2_ + 0.5F, p_149727_3_ + 0.5F, p_149727_4_ + 0.5F, 5.0F, true, true); + return true; + } + } + } + + @Override + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) + { + int l = p_149695_1_.getBlockMetadata(p_149695_2_, p_149695_3_, p_149695_4_); + int i1 = getDirection(l); + + if (isBlockHeadOfBed(l)) + { + if (p_149695_1_.getBlock(p_149695_2_ - field_149981_a[i1][0], p_149695_3_, p_149695_4_ - field_149981_a[i1][1]) != this) + { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + } + } + else if (p_149695_1_.getBlock(p_149695_2_ + field_149981_a[i1][0], p_149695_3_, p_149695_4_ + field_149981_a[i1][1]) != this) + { + p_149695_1_.setBlockToAir(p_149695_2_, p_149695_3_, p_149695_4_); + + if (!p_149695_1_.isRemote) + { + this.dropBlockAsItem(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, l, 0); + } + } + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) + { + /** + * Returns whether or not this bed block is the head of the bed. + */ + return isBlockHeadOfBed(p_149650_1_) ? Item.getItemById(0) : SSItems.leafBed; + } + + public static boolean isBlockHeadOfBed(int p_149975_0_) + { + return (p_149975_0_ & 8) != 0; + } + + public static boolean func_149976_c(int p_149976_0_) + { + return (p_149976_0_ & 4) != 0; + } + + public static void func_149979_a(World p_149979_0_, int p_149979_1_, int p_149979_2_, int p_149979_3_, boolean p_149979_4_) + { + int l = p_149979_0_.getBlockMetadata(p_149979_1_, p_149979_2_, p_149979_3_); + + if (p_149979_4_) + { + l |= 4; + } + else + { + l &= -5; + } + + p_149979_0_.setBlockMetadataWithNotify(p_149979_1_, p_149979_2_, p_149979_3_, l, 4); + } + + public static ChunkCoordinates func_149977_a(World p_149977_0_, int p_149977_1_, int p_149977_2_, int p_149977_3_, int p_149977_4_) + { + int i1 = p_149977_0_.getBlockMetadata(p_149977_1_, p_149977_2_, p_149977_3_); + int j1 = BlockDirectional.getDirection(i1); + + for (int k1 = 0; k1 <= 1; ++k1) + { + int l1 = p_149977_1_ - field_149981_a[j1][0] * k1 - 1; + int i2 = p_149977_3_ - field_149981_a[j1][1] * k1 - 1; + int j2 = l1 + 2; + int k2 = i2 + 2; + + for (int l2 = l1; l2 <= j2; ++l2) + { + for (int i3 = i2; i3 <= k2; ++i3) + { + if (World.doesBlockHaveSolidTopSurface(p_149977_0_, l2, p_149977_2_ - 1, i3) && !p_149977_0_.getBlock(l2, p_149977_2_, i3).getMaterial().isOpaque() && !p_149977_0_.getBlock(l2, p_149977_2_ + 1, i3).getMaterial().isOpaque()) + { + if (p_149977_4_ <= 0) + { + return new ChunkCoordinates(l2, p_149977_2_, i3); + } + + --p_149977_4_; + } + } + } + } + + return null; + } + + @Override + public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_) + { + if (!isBlockHeadOfBed(p_149690_5_)) + { + super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, 0); + } + } + + @Override + public int getMobilityFlag() + { + return 1; + } + + @Override + @SideOnly(Side.CLIENT) + public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) + { + return SSItems.leafBed; + } + + @Override + public void onBlockHarvested(World p_149681_1_, int p_149681_2_, int p_149681_3_, int p_149681_4_, int p_149681_5_, EntityPlayer p_149681_6_) + { + if (p_149681_6_.capabilities.isCreativeMode && isBlockHeadOfBed(p_149681_5_)) + { + int i1 = getDirection(p_149681_5_); + p_149681_2_ -= field_149981_a[i1][0]; + p_149681_4_ -= field_149981_a[i1][1]; + + if (p_149681_1_.getBlock(p_149681_2_, p_149681_3_, p_149681_4_) == this) + { + p_149681_1_.setBlockToAir(p_149681_2_, p_149681_3_, p_149681_4_); + } + } + } + + //Forge + + @Override + public boolean isBed(IBlockAccess world, int x, int y, int z, EntityLivingBase player) + { + return true; + } + + @Override + public ChunkCoordinates getBedSpawnPosition(IBlockAccess world, int x, int y, int z, EntityPlayer player) + { + if (world instanceof World) + return this.func_149977_a((World) world, x, y, z, 0); + return null; + } + + @Override + public void setBedOccupied(IBlockAccess world, int x, int y, int z, EntityPlayer player, boolean occupied) + { + if (world instanceof World) + this.func_149979_a((World) world, x, y, z, occupied); + } + + @Override + public int getBedDirection(IBlockAccess world, int x, int y, int z) + { + return this.getDirection(world.getBlockMetadata(x, y, z)); + } + + @Override + public boolean isBedFoot(IBlockAccess world, int x, int y, int z) + { + return this.isBlockHeadOfBed(world.getBlockMetadata(x, y, z)); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) + { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_0"); + + blockIcons = new IIcon[3]; + + for (int i = 0; i < blockIcons.length; i++) { + blockIcons[i] = p_149651_1_.registerIcon(this.getTextureName() + "_" + i); + } + + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { + if (p_149691_2_ > 2) return this.blockIcon; + return this.blockIcons[p_149691_2_]; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.leafBedType; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockMachineFrame.java b/src/main/java/shift/sextiarysector/block/BlockMachineFrame.java new file mode 100644 index 0000000..4c56a75 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockMachineFrame.java @@ -0,0 +1,44 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import shift.sextiarysector.SSMaterials; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockMachineFrame extends Block { + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + public BlockMachineFrame() { + super(SSMaterials.machine); + this.setHardness(0.3f); + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(int par1, int par2) + { + + if (par1 == 1 || par1 == 0) + { + return this.iconTop; + } else + { + return this.blockIcon; + } + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(this.textureName); + this.iconTop = par1IconRegister.registerIcon(this.textureName + "_top"); + + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockMagiFurnace.java b/src/main/java/shift/sextiarysector/block/BlockMagiFurnace.java new file mode 100644 index 0000000..6646ac7 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockMagiFurnace.java @@ -0,0 +1,22 @@ +package shift.sextiarysector.block; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.tileentity.TileEntityMagicFurnace; + +public class BlockMagiFurnace extends BlockSimpleFurnace{ + + public BlockMagiFurnace() { + super(90); + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + */ + @Override + public TileEntity createNewTileEntity(World par1World, int p_149915_2_) + { + return new TileEntityMagicFurnace(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockMonitor.java b/src/main/java/shift/sextiarysector/block/BlockMonitor.java index b0ea436..576f0f7 100644 --- a/src/main/java/shift/sextiarysector/block/BlockMonitor.java +++ b/src/main/java/shift/sextiarysector/block/BlockMonitor.java @@ -29,7 +29,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockMonitor extends BlockContainer{ +public class BlockMonitor extends BlockContainer { public BlockMonitor() { super(Material.iron); @@ -41,18 +41,18 @@ public BlockMonitor() { @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - TileEntityMonitor tileEntity = (TileEntityMonitor)world.getTileEntity(x, y, z); + TileEntityMonitor tileEntity = (TileEntityMonitor) world.getTileEntity(x, y, z); - if(par5EntityPlayer.getCurrentEquippedItem()==null){ + if (par5EntityPlayer.getCurrentEquippedItem() == null) { - if(par5EntityPlayer.isSneaking()){ + if (par5EntityPlayer.isSneaking()) { tileEntity.changeON(); world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); return true; - }else if(tileEntity.on){ + } else if (tileEntity.on) { MCEconomyAPI.openShopGui(tileEntity.type.getList(world).id, par5EntityPlayer, world, x, y, z); @@ -61,40 +61,41 @@ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p return true; } + if (!world.isRemote && par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().getItem() == SSItems.ironSpanner) { - if(!world.isRemote && par5EntityPlayer.getCurrentEquippedItem()!=null && par5EntityPlayer.getCurrentEquippedItem().getItem()==SSItems.hammer){ - - EntityItem item = new EntityItem(world, x+0.5d, y+0.5d, z+0.5d, new ItemStack(this,1,tileEntity.type.ordinal())); + EntityItem item = new EntityItem(world, x + 0.5d, y + 0.5d, z + 0.5d, new ItemStack(this, 1, tileEntity.type.ordinal())); world.spawnEntityInWorld(item); world.setBlockToAir(x, y, z); + world.removeTileEntity(x, y, z); return true; } return false; } + @Override public int getLightValue(IBlockAccess world, int x, int y, int z) - { - if(world.getBlockMetadata(x, y, z)==1)return 15; + { + if (world.getBlockMetadata(x, y, z) == 1) return 15; return 0; - } + } - public enum MonitorType{ + public enum MonitorType { - creeper("creeper","creeper"), - robot("robot","robot"), - unknown("",""); + creeper("creeper", "creeper"), + robot("robot", "robot"), + unknown("", ""); public String name; private ResourceLocation resource; private SSProductList list; private SSProductList[] sList; - MonitorType(String name,String resource){ + MonitorType(String name, String resource) { this.name = name; - this.setResource(new ResourceLocation("sextiarysector:textures/models/monitor_"+resource + ".png")); + this.setResource(new ResourceLocation("sextiarysector:textures/models/monitor_" + resource + ".png")); } public ResourceLocation getResource() { @@ -107,7 +108,7 @@ private void setResource(ResourceLocation resource) { public SSProductList getList(World world) { - if(world==null||sList==null)return this.getList(); + if (world == null || sList == null) return this.getList(); return sList[SeasonAPI.getSeason(world).ordinal()]; } @@ -122,21 +123,23 @@ public void setList(SSProductList list) { public void setList(SSProductList[] list) { this.sList = list; + this.list = list[0]; } } - public static ItemStack getMonitor(MonitorType t){ - return new ItemStack(SSBlocks.monitor,1,t.ordinal()); + public static ItemStack getMonitor(MonitorType t) { + return new ItemStack(SSBlocks.monitor, 1, t.ordinal()); } + @Override @SideOnly(Side.CLIENT) - public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) - { - for(int i=0;i getDrops(World world, int x, int y, int z, int metadata, int fortune) + { + ArrayList ret = new ArrayList(); + + ret.add(new ItemStack(Blocks.dirt, 1)); + + return ret; + } + + //繝悶Ο繝繧ッ縺ョ邱 + @Override + public void setBlockBoundsForItemRender() + { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.paddyType; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityPaddy(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockPipe.java b/src/main/java/shift/sextiarysector/block/BlockPipe.java new file mode 100644 index 0000000..f232870 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockPipe.java @@ -0,0 +1,192 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.EnumColor; +import shift.sextiarysector.api.IColorItem; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.tileentity.TileEntityPipe; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockPipe extends BlockContainer { + + public double one = 1.0d / 16.0d; + + public BlockPipe() { + super(Material.iron); + this.setHardness(0.8F); + //this.setBlockBounds(0.0625f, 0.0f, 0.0625f, 0.9375f, 0.875f, 0.9375f); + this.setCreativeTab(SextiarySectorAPI.TabSSCore); + } + + @Override + public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { + + ItemStack item = par5EntityPlayer.getCurrentEquippedItem(); + + if (item == null || !(item.getItem() instanceof IColorItem)) return false; + + if (!((IColorItem) item.getItem()).canUse(item)) return false; + + if (par1World.isRemote) return true; + + return this.changeColor(par1World, x, y, z, par5EntityPlayer, item); + + //return true; + } + + public boolean changeColor(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, ItemStack itemStack) { + + TileEntityPipe t = (TileEntityPipe) par1World.getTileEntity(x, y, z); + + IColorItem item = ((IColorItem) itemStack.getItem()); + + if (t.color.ordinal() == item.getColor(itemStack).ordinal()) return false; + + t.color = item.getColor(itemStack); + item.useItem(itemStack); + + par1World.markBlockForUpdate(x, y, z); + return true; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityPipe(); + } + + @Override + public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) + { + float[] defaultSize = new float[] { (float) (one * 4), (float) (one * 12), (float) (one * 4), (float) (one * 12), (float) (one * 4), (float) (one * 12) }; + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + + float setX = 0.5f; + float setY = 0.5f; + float setZ = 0.5f; + + if (d.offsetX != 0 && this.canConnect(par1IBlockAccess, par2, par3, par4, d)) { + defaultSize[d.ordinal()] = (float) (setX + 0.5 * d.offsetX); + } + + if (d.offsetY != 0 && this.canConnect(par1IBlockAccess, par2, par3, par4, d)) { + defaultSize[d.ordinal()] = (float) (setY + 0.5 * d.offsetY); + } + + if (d.offsetZ != 0 && this.canConnect(par1IBlockAccess, par2, par3, par4, d)) { + defaultSize[d.ordinal()] = (float) (setZ + 0.5 * d.offsetZ); + } + + } + + this.setBlockBounds(0 + defaultSize[4], 0 + defaultSize[0], 0 + defaultSize[2], 0 + defaultSize[5], 0 + defaultSize[1], 0 + defaultSize[3]); + } + + //蠖薙◆繧雁愛螳壹ゅし繝懊ユ繝ウ繧繧ス繧ヲ繝ォ繧オ繝ウ繝峨r蜿り縺ォ縺吶k縺ィ濶ッ縺縲ゅさ繧ウ縺ョ險ュ螳壹r縺吶k縺ィ縲{nEntityCollidedWithBlock縺悟他縺ー繧後k繧医≧縺ォ縺ェ繧 + @Override + public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + + double[] defaultSize = new double[] { one * 4, one * 12, one * 4, one * 12, one * 4, one * 12 }; + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + + double setX = 0.5d; + double setY = 0.5d; + double setZ = 0.5d; + + if (d.offsetX != 0 && this.canConnect(par1World, par2, par3, par4, d)) { + defaultSize[d.ordinal()] = setX + 0.5 * d.offsetX; + } + + if (d.offsetY != 0 && this.canConnect(par1World, par2, par3, par4, d)) { + defaultSize[d.ordinal()] = setY + 0.5 * d.offsetY; + } + + if (d.offsetZ != 0 && this.canConnect(par1World, par2, par3, par4, d)) { + defaultSize[d.ordinal()] = setZ + 0.5 * d.offsetZ; + } + + } + + return AxisAlignedBB.getBoundingBox(par2 + defaultSize[4], par3 + defaultSize[0], par4 + defaultSize[2], par2 + defaultSize[5], par3 + defaultSize[1], par4 + defaultSize[3]); + } + + //繝悶Ο繝繧ッ縺ォ隕也せ繧貞粋繧上○縺滓凾縺ォ蜃コ縺ヲ縺上k鮟偵>邱壹ョ繧「繝ャ + @Override + @SideOnly(Side.CLIENT) + public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) + { + + double[] defaultSize = new double[] { one * 4, one * 12, one * 4, one * 12, one * 4, one * 12 }; + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + + double setX = 0.5d; + double setY = 0.5d; + double setZ = 0.5d; + + if (d.offsetX != 0 && this.canConnect(par1World, par2, par3, par4, d)) { + defaultSize[d.ordinal()] = setX + 0.5 * d.offsetX; + } + + if (d.offsetY != 0 && this.canConnect(par1World, par2, par3, par4, d)) { + defaultSize[d.ordinal()] = setY + 0.5 * d.offsetY; + } + + if (d.offsetZ != 0 && this.canConnect(par1World, par2, par3, par4, d)) { + defaultSize[d.ordinal()] = setZ + 0.5 * d.offsetZ; + } + + } + + return AxisAlignedBB.getBoundingBox(par2 + defaultSize[4], par3 + defaultSize[0], par4 + defaultSize[2], par2 + defaultSize[5], par3 + defaultSize[1], par4 + defaultSize[3]); + } + + public static boolean canConnect(IBlockAccess world, int x, int y, int z, ForgeDirection d) { + + TileEntity t = world.getTileEntity(x + d.offsetX, y + d.offsetY, z + d.offsetZ); + + if (t != null && t instanceof IFluidHandler) { + + if (!(t instanceof TileEntityPipe)) return true; + + TileEntityPipe tP1 = (TileEntityPipe) world.getTileEntity(x, y, z); + if (tP1 == null) return false; + TileEntityPipe tP2 = (TileEntityPipe) t; + + if (tP1.color.ordinal() == EnumColor.Unknown.ordinal() || tP2.color.ordinal() == EnumColor.Unknown.ordinal()) return true; + if (tP1.color.ordinal() == tP2.color.ordinal()) return true; + + } + + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.pipeType; + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockPowerStone.java b/src/main/java/shift/sextiarysector/block/BlockPowerStone.java index 105016e..53a9d4c 100644 --- a/src/main/java/shift/sextiarysector/block/BlockPowerStone.java +++ b/src/main/java/shift/sextiarysector/block/BlockPowerStone.java @@ -2,8 +2,6 @@ import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -14,168 +12,174 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockPowerStone extends Block{ +public class BlockPowerStone extends BlockSSOreBase { - public BlockPowerStone() { - super(Material.rock); + public BlockPowerStone(int level) { + super(level); this.setTickRandomly(true); this.setResistance(5.0F); - this.setStepSound(Block.soundTypeStone); this.setHardness(3.0F); } @Override public int getLightValue(IBlockAccess world, int x, int y, int z) - { - if(this.isGlowing(world, x, y, z)){ - return (int)(15.0F * 0.725F); + { + if (this.isGlowing(world, x, y, z)) { + return (int) (15.0F * 0.725F); } return 0; - } + } public boolean isGlowing(IBlockAccess world, int par2, int par3, int par4) - { - return world.getBlockMetadata(par2, par3, par4)!=0; - } + { + return world.getBlockMetadata(par2, par3, par4) != 0; + } - @Override + @Override public int tickRate(World par1World) - { - return 30; - } + { + return 30; + } - @Override + @Override public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) - { - this.glow(par1World, par2, par3, par4); - super.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer); - } + { + this.glow(par1World, par2, par3, par4); + super.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer); + } - @Override + @Override public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) - { - this.glow(par1World, par2, par3, par4); - super.onEntityWalking(par1World, par2, par3, par4, par5Entity); - } + { + this.glow(par1World, par2, par3, par4); + super.onEntityWalking(par1World, par2, par3, par4, par5Entity); + } - @Override + @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) - { - this.glow(par1World, par2, par3, par4); - return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - - private void glow(World par1World, int par2, int par3, int par4) - { - this.sparkle(par1World, par2, par3, par4); - - if (0 == par1World.getBlockMetadata(par2, par3, par4)) - { - par1World.setBlock(par2, par3, par4, this,1,1); - } - } - - @Override + { + this.glow(par1World, par2, par3, par4); + return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); + } + + private void glow(World par1World, int par2, int par3, int par4) + { + this.sparkle(par1World, par2, par3, par4); + + if (0 == par1World.getBlockMetadata(par2, par3, par4)) + { + par1World.setBlock(par2, par3, par4, this, 1, 1); + } + } + + @Override public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) - { - if (this.isGlowing(par1World, par2, par3, par4)) - { - par1World.setBlock(par2, par3, par4, this,0,2); - } - } - - @Override + { + if (this.isGlowing(par1World, par2, par3, par4)) + { + par1World.setBlock(par2, par3, par4, this, 0, 2); + } + } + + @Override public Item getItemDropped(int par1, Random par2Random, int par3) - { - if(this==SSBlocks.blueStoneOre){ - return SSItems.blueStoneDust; - }else{ - return SSItems.yellowStoneDust; - } + { + if (this == SSBlocks.blueStoneOre) { + return SSItems.blueStoneDust; + } else { + return SSItems.yellowStoneDust; + } - } + } - @Override + @Override public int quantityDroppedWithBonus(int par1, Random par2Random) - { - return this.quantityDropped(par2Random) + par2Random.nextInt(par1 + 1); - } + { + return this.quantityDropped(par2Random) + par2Random.nextInt(par1 + 1); + } - @Override + @Override public int quantityDropped(Random par1Random) - { - return 4 + par1Random.nextInt(2); - } + { + return 4 + par1Random.nextInt(2); + } - @Override + @Override public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) - { - super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); + { + super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); - } + } - @Override + @Override @SideOnly(Side.CLIENT) - public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) - { - if (this.isGlowing(par1World, par2, par3, par4)) - { - this.sparkle(par1World, par2, par3, par4); - } - } - - private void sparkle(World par1World, int par2, int par3, int par4) - { - Random random = par1World.rand; - double d0 = 0.0625D; - - for (int l = 0; l < 6; ++l) - { - double d1 = (double)((float)par2 + random.nextFloat()); - double d2 = (double)((float)par3 + random.nextFloat()); - double d3 = (double)((float)par4 + random.nextFloat()); - - if (l == 0 && !par1World.getBlock(par2, par3 + 1, par4).isOpaqueCube()) - { - d2 = (double)(par3 + 1) + d0; - } - - if (l == 1 && !par1World.getBlock(par2, par3 - 1, par4).isOpaqueCube()) - { - d2 = (double)(par3 + 0) - d0; - } - - if (l == 2 && !par1World.getBlock(par2, par3, par4 + 1).isOpaqueCube()) - { - d3 = (double)(par4 + 1) + d0; - } - - if (l == 3 && !par1World.getBlock(par2, par3, par4 - 1).isOpaqueCube()) - { - d3 = (double)(par4 + 0) - d0; - } - - if (l == 4 && !par1World.getBlock(par2 + 1, par3, par4).isOpaqueCube()) - { - d1 = (double)(par2 + 1) + d0; - } - - if (l == 5 && !par1World.getBlock(par2 - 1, par3, par4).isOpaqueCube()) - { - d1 = (double)(par2 + 0) - d0; - } - - if (d1 < (double)par2 || d1 > (double)(par2 + 1) || d2 < 0.0D || d2 > (double)(par3 + 1) || d3 < (double)par4 || d3 > (double)(par4 + 1)) - { - if(this==SSBlocks.blueStoneOre){ - par1World.spawnParticle("reddust", d1, d2, d3, -0.3D, 0.0D, 1.0D); - }else{ - par1World.spawnParticle("reddust", d1, d2, d3, 0.0D, 0.8D, 0.0D); - } - } - - } - } + public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) + { + if (this.isGlowing(par1World, par2, par3, par4)) + { + this.sparkle(par1World, par2, par3, par4); + } + } + + private void sparkle(World par1World, int par2, int par3, int par4) + { + Random random = par1World.rand; + double d0 = 0.0625D; + + for (int l = 0; l < 6; ++l) + { + double d1 = par2 + random.nextFloat(); + double d2 = par3 + random.nextFloat(); + double d3 = par4 + random.nextFloat(); + + if (l == 0 && !par1World.getBlock(par2, par3 + 1, par4).isOpaqueCube()) + { + d2 = par3 + 1 + d0; + } + + if (l == 1 && !par1World.getBlock(par2, par3 - 1, par4).isOpaqueCube()) + { + d2 = par3 + 0 - d0; + } + + if (l == 2 && !par1World.getBlock(par2, par3, par4 + 1).isOpaqueCube()) + { + d3 = par4 + 1 + d0; + } + + if (l == 3 && !par1World.getBlock(par2, par3, par4 - 1).isOpaqueCube()) + { + d3 = par4 + 0 - d0; + } + + if (l == 4 && !par1World.getBlock(par2 + 1, par3, par4).isOpaqueCube()) + { + d1 = par2 + 1 + d0; + } + + if (l == 5 && !par1World.getBlock(par2 - 1, par3, par4).isOpaqueCube()) + { + d1 = par2 + 0 - d0; + } + + if (d1 < par2 || d1 > par2 + 1 || d2 < 0.0D || d2 > par3 + 1 || d3 < par4 || d3 > par4 + 1) + { + if (this == SSBlocks.blueStoneOre) { + par1World.spawnParticle("reddust", d1, d2, d3, -0.3D, 0.0D, 1.0D); + } else { + par1World.spawnParticle("reddust", d1, d2, d3, 0.0D, 0.8D, 0.0D); + } + } + + } + } + + @Override + public boolean isToolEffective(String type, int metadata) + { + if ("pickaxe".equals(type)) return false; + return super.isToolEffective(type, metadata); + } } diff --git a/src/main/java/shift/sextiarysector/block/BlockPoweredBuoy.java b/src/main/java/shift/sextiarysector/block/BlockPoweredBuoy.java new file mode 100644 index 0000000..4df63b1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockPoweredBuoy.java @@ -0,0 +1,188 @@ +package shift.sextiarysector.block; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import shift.sextiarysector.SSItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockPoweredBuoy extends BlockBuoyBase { + + protected IIcon blockIcons[]; + + public BlockPoweredBuoy() { + super(); + } + + @Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + + if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().getItem() == SSItems.ironSpanner) { + int i = par1World.getBlockMetadata(par2, par3, par4); + if (i < 7) { + i += 1; + } else { + i = 0; + } + par1World.setBlockMetadataWithNotify(par2, par3, par4, i, 1); + par1World.markBlockForUpdate(par2, par3, par4); + return true; + } + return false; + + } + + /* + @Override + public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) + { + int i = par1World.getBlockMetadata(par2,par3,par4); + if(!(i>=9)){ + i += 1; + }else{ + i = 0; + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, i, 1); + }*/ + + @Override + public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) + { + if (par5Entity instanceof EntityBoat) { + + int x = 0; + int z = 0; + + int y = 0; + + int i = par1World.getBlockMetadata(par2, par3, par4); + + switch (i) { + + /* + case 1 : z = -1; break; + case 2 : x = 1; break; + case 3 : z = 1; break; + case 4 : x = -1; break; + + case 5 : x = -1; z = -1 ; break; + case 6 : x = 1;z = -1 ; break; + case 7 : x = 1;z = 1 ; break; + case 8 : x = -1; z = 1 ; break; + */ + + case 0: + z = -1; + break; + case 2: + x = 1; + break; + case 4: + z = 1; + break; + case 6: + x = -1; + break; + + case 1: + x = 1; + z = -1; + break; + case 3: + x = 1; + z = 1; + break; + case 5: + x = -1; + z = 1; + break; + case 7: + x = -1; + z = -1; + break; + + //case 9 : y = 1;break; + + } + + par5Entity.motionX += x; + par5Entity.motionZ += z; + par5Entity.motionY += y; + //par5Entity.motionY += 1; + //par5Entity.motionZ += 1; + //moveFlying(1, 1, 1); + //par5Entity.setPositionAndRotation2(2,2,2,1,1,1); + } + + } + + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + //TileEntityLargeFurnace tileEntity = (TileEntityLargeFurnace)par1World.getBlockTileEntity(par2, par3, par4); + + if (l == 0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + //tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[2]; + } + + if (l == 1) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 6, 2); + //tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[5]; + } + + if (l == 2) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 2); + //tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[3]; + } + + if (l == 3) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + //tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[4]; + } + + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(int par1, int par2) + { + /* + for(int i = 1;i<9;i++){ + if(par2==i){ + return blockIcons[i-1]; + } + }*/ + return blockIcons[par2]; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + blockIcons = new IIcon[8]; + + for (int i = 0; i < 8; i++) { + blockIcons[i] = par1IconRegister.registerIcon(this.getTextureName() + "_" + i); + + } + + this.blockIcon = blockIcons[0];//par1IconRegister.registerIcon(this.getTextureName()); + + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockPump.java b/src/main/java/shift/sextiarysector/block/BlockPump.java new file mode 100644 index 0000000..cb81c93 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockPump.java @@ -0,0 +1,153 @@ +package shift.sextiarysector.block; + +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.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntityPump; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockPump extends BlockContainer { + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + @SideOnly(Side.CLIENT) + private IIcon iconUnder; + @SideOnly(Side.CLIENT) + private IIcon iconFront; + + public BlockPump() { + super(Material.wood); + this.setHardness(1.0F); + this.setStepSound(soundTypeStone); + this.setCreativeTab(SextiarySectorAPI.TabSSIndustry); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess p_149673_1_, int x, int y, int z, int side) { + + int d = ((TileEntityDirection) p_149673_1_.getTileEntity(x, y, z)).direction.ordinal(); + + if (side == 1) { + return this.iconTop; + } else if (side == 0) { + return this.iconUnder; + } else if (side == d) { + return this.iconFront; + } else { + return this.blockIcon; + } + + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(int par1, int par2) { + + if (par1 == 1) { + return this.iconTop; + } else if (par1 == 0) { + return this.iconUnder; + } else if (par1 == 3) { + return this.iconFront; + } else { + return this.blockIcon; + } + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) { + this.blockIcon = par1IconRegister.registerIcon(this.getTextureName()); + + this.iconTop = par1IconRegister.registerIcon(this.getTextureName()+ "_top"); + this.iconUnder = par1IconRegister.registerIcon(this.getTextureName()); + + this.iconFront = par1IconRegister.registerIcon(this.getTextureName()+ "_front"); + + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) { + super.onBlockAdded(par1World, par2, par3, par4); + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) { + if (!par1World.isRemote) { + Block block = par1World.getBlock(par2, par3, par4 - 1); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); + + TileEntityDirection tileEntity = (TileEntityDirection) par1World + .getTileEntity(par2, par3, par4); + + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) { + b0 = 4; + } + + // par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); + tileEntity.direction = ForgeDirection.getOrientation(b0); + } + } + + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + if (l == 0) { + // par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[2]; + } + + if (l == 1) { + // par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[5]; + } + + if (l == 2) { + // par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[3]; + } + + if (l == 3) { + // par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[4]; + } + + } + + @Override + public TileEntity createNewTileEntity(World par1World, int p_149915_2_) { + return new TileEntityPump(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSSCauldron.java b/src/main/java/shift/sextiarysector/block/BlockSSCauldron.java new file mode 100644 index 0000000..b0c4c46 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSSCauldron.java @@ -0,0 +1,42 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.Block; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.tileentity.TileEmptyCauldron; + +public class BlockSSCauldron extends Block implements ITileEntityProvider +{ + + protected BlockSSCauldron(Material p_i45386_1_) + { + super(p_i45386_1_); + this.isBlockContainer = true; + } + + public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) + { + super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); + } + + public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) + { + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + } + + public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) + { + super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); + TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); + return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEmptyCauldron(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSSCrop.java b/src/main/java/shift/sextiarysector/block/BlockSSCrop.java index 737e5a0..4353fac 100644 --- a/src/main/java/shift/sextiarysector/block/BlockSSCrop.java +++ b/src/main/java/shift/sextiarysector/block/BlockSSCrop.java @@ -33,16 +33,18 @@ public class BlockSSCrop extends BlockBush implements ITileEntityProvider{ private CropType type; private Item drop; private CropStatus status; + private Block farmland; private boolean re_harvest; private static Random r = new Random(); - public BlockSSCrop(CropType type, CropStatus status, Item drop, Boolean re_harvest) + public BlockSSCrop(CropType type, CropStatus status,Block farmland, Item drop, Boolean re_harvest) { this.setTickRandomly(true); this.type = type; this.drop = drop; this.status = status; + this.farmland = farmland; this.re_harvest = re_harvest; if(type.equals(CropType.Normal)){ @@ -64,9 +66,24 @@ public BlockSSCrop(CropType type, CropStatus status, Item drop, Boolean re_harve @Override public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6,float par7, float par8, float par9) { - //if(par1World.isRemote)return true; + if(par5EntityPlayer.getCurrentEquippedItem()!= null && par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemShears){ - if(par1World.getBlockMetadata(x, y, z)==3&&par5EntityPlayer.getCurrentEquippedItem()!= null&&par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemShears){ + return this.doHarvestFromShears(par1World, x, y, z, par5EntityPlayer); + + } + + + if(this.hasFarmland(par1World, x, y, z)){ + return par1World.getBlock(x, y-1, z).onBlockActivated(par1World, x, y-1, z, par5EntityPlayer, par6, par7, par8, par9); + } + + return false; + + } + + private boolean doHarvestFromShears(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer){ + + if(this.re_harvest && this.getStatus().isReHarvest() && par1World.getBlockMetadata(x, y, z)==3){ ItemStack item = this.getAfter(par1World, x, y, z); @@ -101,18 +118,17 @@ public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlay } + return false; + } - if(this.hasFarmland(par1World, x, y, z)){ - return par1World.getBlock(x, y-1, z).onBlockActivated(par1World, x, y-1, z, par5EntityPlayer, par6, par7, par8, par9); - } - - return false; - + public boolean canBlockStay(World p_149718_1_, int p_149718_2_, int p_149718_3_, int p_149718_4_) + { + return p_149718_1_.getBlock(p_149718_2_, p_149718_3_ - 1, p_149718_4_) == this.farmland; } protected boolean canPlaceBlockOn(Block p_149854_1_) { - return /*p_149854_1_ == Blocks.farmland ||*/ p_149854_1_ == SSBlocks.farmland; + return p_149854_1_ == this.farmland; } @Override @@ -136,6 +152,10 @@ public String getItemIconName() @SideOnly(Side.CLIENT) public IIcon getIcon(int p_149691_1_, int p_149691_2_) { + if(this.field_149867_a.length == 3 && p_149691_2_ == 4){ + return this.field_149867_a[3]; + } + return this.field_149867_a[p_149691_2_]; } @@ -154,7 +174,12 @@ public void registerBlockIcons(IIconRegister p_149651_1_) public int getRenderType() { - return 6; + if(type.equals(CropType.Normal)){ + return 6; + }else{ + return 1; + } + } protected Item func_149866_i() @@ -278,21 +303,33 @@ public enum CropType{ public static class CropStatus{ - public int i[] ;//= new int[3]; + private int days[] ;//= new int[3]; public Season[] season; public CropStatus(int[] i1,Season... s){ - this.i= i1; + this.days= i1; this.season= s; } - public Season[] getSeason() { + public synchronized int[] getDays() { + return days; + } + + private synchronized void setDay(int[] day) { + this.days = day; + } + + public Season[] getSeason() { return season; } + public boolean isReHarvest(){ + return this.days.length == 4; + } + } diff --git a/src/main/java/shift/sextiarysector/block/BlockSSFarmland.java b/src/main/java/shift/sextiarysector/block/BlockSSFarmland.java index 3f752f3..ef57ed6 100644 --- a/src/main/java/shift/sextiarysector/block/BlockSSFarmland.java +++ b/src/main/java/shift/sextiarysector/block/BlockSSFarmland.java @@ -11,89 +11,72 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSFluids; import shift.sextiarysector.SextiarySector; import shift.sextiarysector.module.FertilizerManager; import shift.sextiarysector.tileentity.TileEntityFarmland; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockSSFarmland extends BlockFarmland implements ITileEntityProvider{ +public class BlockSSFarmland extends BlockFarmland implements ITileEntityProvider { public BlockSSFarmland() - { - super(); - this.setTickRandomly(false); - this.setHardness(0.6F); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, (1.0f/16.0f)*14 , 1.0F); - this.setStepSound(soundTypeGravel); - this.setLightOpacity(255); - this.useNeighborBrightness = true; - } + { + super(); + this.setTickRandomly(false); + this.setHardness(0.6F); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, (1.0f / 16.0f) * 14, 1.0F); + this.setStepSound(soundTypeGravel); + this.setLightOpacity(255); + this.useNeighborBrightness = true; + } @Override - public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6,float par7, float par8, float par9) { - - if(FertilizerManager.getFertilizer(par5EntityPlayer.getCurrentEquippedItem())!=null && par1World.isAirBlock(x, y+1, z)){ - - TileEntityFarmland t = (TileEntityFarmland) par1World.getTileEntity(x, y, z); - - if(t.getFertilizer()!=null){ - return false; - } - - t.setFertilizer(FertilizerManager.getFertilizer(par5EntityPlayer.getCurrentEquippedItem()).getFertilizer()); - - if (!par5EntityPlayer.capabilities.isCreativeMode && !par1World.isRemote) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; - } + public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - par1World.markBlockForUpdate(x, y, z); + if (FertilizerManager.getFertilizer(par5EntityPlayer.getCurrentEquippedItem()) != null && par1World.isAirBlock(x, y + 1, z)) { - return true; + return this.setFertilizer(par1World, x, y, z, par5EntityPlayer); } - if(par5EntityPlayer.getCurrentEquippedItem()!=null){ + if (par5EntityPlayer.getCurrentEquippedItem() != null) { FluidStack f = FluidContainerRegistry.getFluidForFilledItem(par5EntityPlayer.getCurrentEquippedItem()); - if(f!=null){ + if (f != null) { TileEntityFarmland t = (TileEntityFarmland) par1World.getTileEntity(x, y, z); - if(t.fill(ForgeDirection.getOrientation(par6), f, true)>0){ + if (t.fill(ForgeDirection.getOrientation(par6), f, true) > 0) { ItemStack item = par5EntityPlayer.getCurrentEquippedItem().getItem().getContainerItem(par5EntityPlayer.getCurrentEquippedItem()); if (!par5EntityPlayer.capabilities.isCreativeMode && !par1World.isRemote) - { - --par5EntityPlayer.getCurrentEquippedItem().stackSize; + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; - if(item!=null){ + if (item != null) { - if(par5EntityPlayer.getCurrentEquippedItem().stackSize==0){ + if (par5EntityPlayer.getCurrentEquippedItem().stackSize == 0) { - par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, item); - - - }else if (!par5EntityPlayer.inventory.addItemStackToInventory(item)) - { - par5EntityPlayer.dropPlayerItemWithRandomChoice(item,false); - } + par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, item); + } else if (!par5EntityPlayer.inventory.addItemStackToInventory(item)) + { + par5EntityPlayer.dropPlayerItemWithRandomChoice(item, false); + } } - } + } return true; } - }else{ + } else { return false; } @@ -102,41 +85,66 @@ public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlay return false; } - public boolean addWater(World par1World, int x, int y, int z){ + private boolean setFertilizer(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer) { TileEntityFarmland t = (TileEntityFarmland) par1World.getTileEntity(x, y, z); - return t.fill(ForgeDirection.UP, new FluidStack(FluidRegistry.WATER, 1000), true) > 0; + if (t.getFertilizer() != null) { + return false; + } + + t.setFertilizer(FertilizerManager.getFertilizer(par5EntityPlayer.getCurrentEquippedItem()).getFertilizer()); + + if (!par5EntityPlayer.capabilities.isCreativeMode && !par1World.isRemote) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + par1World.markBlockForUpdate(x, y, z); + + return true; } + public boolean addWater(World par1World, int x, int y, int z) { + + TileEntityFarmland t = (TileEntityFarmland) par1World.getTileEntity(x, y, z); + + return t.fill(ForgeDirection.UP, new FluidStack(SSFluids.drinkingWater, 1000), true) > 0; + + } + + @Override public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) - { - super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); - p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); - } - - public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) - { - super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); - TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); - return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false; - } + { + super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_); + p_149749_1_.removeTileEntity(p_149749_2_, p_149749_3_, p_149749_4_); + } + + @Override + public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) + { + super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); + TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); + return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false; + } @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new TileEntityFarmland(); } + @Override @SideOnly(Side.CLIENT) - public IIcon getIcon(int p_149691_1_, int p_149691_2_) - { + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { return Blocks.farmland.getIcon(p_149691_1_, p_149691_2_); - } + } + @Override public int getRenderType() - { - return SextiarySector.proxy.farmlandType; - } + { + return SextiarySector.proxy.farmlandType; + } } diff --git a/src/main/java/shift/sextiarysector/block/BlockSSFluid.java b/src/main/java/shift/sextiarysector/block/BlockSSFluid.java new file mode 100644 index 0000000..d66e4c9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSSFluid.java @@ -0,0 +1,58 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.material.MaterialLiquid; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.fluids.BlockFluidClassic; +import net.minecraftforge.fluids.Fluid; +import shift.sextiarysector.api.SextiarySectorAPI; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockSSFluid extends BlockFluidClassic { + + public static final Material water = new SSMaterial(); + + public BlockSSFluid(Fluid fluid) { + super(fluid, Material.water); + this.setCreativeTab(SextiarySectorAPI.TabSSFluid); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { + if (p_149691_2_ == 0) { + return this.getFluid().getStillIcon(); + } else { + return this.getFluid().getFlowingIcon(); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) + { + //this.blockIcon = p_149651_1_.registerIcon(this.getTextureName()); + } + + @Override + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) + { + return this.getFluid().getColor(); + } + + public static class SSMaterial extends MaterialLiquid { + + public SSMaterial() { + super(MapColor.waterColor); + this.setNoPushMobility(); + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSSOre.java b/src/main/java/shift/sextiarysector/block/BlockSSOre.java index 2165a77..b6fa40d 100644 --- a/src/main/java/shift/sextiarysector/block/BlockSSOre.java +++ b/src/main/java/shift/sextiarysector/block/BlockSSOre.java @@ -1,77 +1,27 @@ package shift.sextiarysector.block; -import java.util.ArrayList; import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import shift.sextiarysector.api.SextiarySectorAPI; +import net.minecraft.util.IIcon; -public class BlockSSOre extends Block{ +public class BlockSSOre extends BlockSSOreBase { - private Item oreItem; - private Block oreBlock; + private final Item oreItem; - public BlockSSOre(Item item,Block block, int level) { - super(Material.rock); + public IIcon stone; + + public BlockSSOre(Item item, int level) { + super(level); this.oreItem = item; - this.oreBlock = block; - this.setHarvestLevel("pickaxe", level); this.setResistance(5.0F); - this.setStepSound(Block.soundTypeStone); this.setHardness(3.0F); - this.setCreativeTab(SextiarySectorAPI.TabSSCore); } + @Override public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) - { - return oreItem; - } - - public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) - { - ArrayList ret = new ArrayList(); - - int count = quantityDropped(metadata, fortune, world.rand); - for(int i = 0; i < count; i++) - { - Item item = getItemDropped(metadata, world.rand, fortune); - if (item != null) - { - ret.add(new ItemStack(item, 1, damageDropped(metadata))); - ret.add(new ItemStack(oreBlock, 1, damageDropped(metadata))); - } - } - return ret; - } - - /* - public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) - { - if(!willHarvest){ - return super.removedByPlayer(world, player, x, y, z, willHarvest); - }else if(world.getBlockMetadata(x, y, z)==0){ - return world.setBlock(x, y, z, oreBlock); - } - - return world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z)-1, 4); - - } - - @SideOnly(Side.CLIENT) - public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) - { - for(int i=0;i<4;i++){ - p_149666_3_.add(new ItemStack(p_149666_1_,1,i)); - } - }*/ - - protected boolean canSilkHarvest() - { - return false; - } + { + return oreItem != null ? this.oreItem : super.getItemDropped(p_149650_1_, p_149650_2_, p_149650_3_); + } } diff --git a/src/main/java/shift/sextiarysector/block/BlockSSOreBase.java b/src/main/java/shift/sextiarysector/block/BlockSSOreBase.java new file mode 100644 index 0000000..b203307 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSSOreBase.java @@ -0,0 +1,61 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class BlockSSOreBase extends Block { + + public IIcon stone; + + public BlockSSOreBase(int level) { + super(Material.rock); + this.setHarvestLevel("pickaxe", level); + this.setStepSound(Block.soundTypeStone); + this.setCreativeTab(SextiarySectorAPI.TabSSMining); + this.useNeighborBrightness = true; + this.setLightOpacity(255); + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.oreStoneType; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean isNormalCube(IBlockAccess world, int x, int y, int z) + { + return true;//getMaterial().isOpaque() && renderAsNormalBlock() && !canProvidePower(); + } + + /* + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { + if (p_149691_2_ == 8) { + return this.blockIcon; + } + + return this.stone; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) + { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName()); + this.stone = p_149651_1_.registerIcon("stone"); + }*/ + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSandpit.java b/src/main/java/shift/sextiarysector/block/BlockSandpit.java new file mode 100644 index 0000000..a005622 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSandpit.java @@ -0,0 +1,188 @@ +package shift.sextiarysector.block; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class BlockSandpit extends Block{ + + public BlockSandpit() { + super(Material.sand); + + this.setCreativeTab(SextiarySectorAPI.TabSSFishery); + this.setHarvestLevel("scoop", 0); + this.setHardness(0.5F); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, (1.0f/16.0f)*1 , 1.0F); + this.setStepSound(soundTypeSand); + this.setLightOpacity(0); + this.useNeighborBrightness = true; + } + + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int meta, int fortune) + { + ArrayList ret = new ArrayList(); + if (world.rand.nextInt(3) != 0) return ret; + ItemStack shell = getShell(world); + if (shell != null) ret.add(shell); + return ret; + } + + public boolean isOpaqueCube() + { + return false; + } + + public boolean renderAsNormalBlock() + { + return false; + } + + public boolean canBlockStay(World p_149718_1_, int x, int y, int z) + { + return p_149718_1_.getBlock(x, y - 1, z).isOpaqueCube() && !p_149718_1_.getBlock(x, y - 1, z).isAir(p_149718_1_, x, y-1, z); + } + + public boolean canPlaceBlockAt(World p_149742_1_, int x, int y, int z) + { + return p_149742_1_.getBlock(x, y - 1, z).isOpaqueCube() && !p_149742_1_.getBlock(x, y - 1, z).isAir(p_149742_1_, x, y-1, z); + } + + public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) + { + this.func_150155_m(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_); + } + + private boolean func_150155_m(World p_150155_1_, int p_150155_2_, int p_150155_3_, int p_150155_4_) + { + if (!this.canPlaceBlockAt(p_150155_1_, p_150155_2_, p_150155_3_, p_150155_4_)) + { + p_150155_1_.setBlockToAir(p_150155_2_, p_150155_3_, p_150155_4_); + return false; + } + else + { + return true; + } + } + + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) + { + return true; + } + + public boolean canHarvestBlock(EntityPlayer player, int meta) + { + + ItemStack stack = player.inventory.getCurrentItem(); + String tool = this.getHarvestTool(meta); + if (stack == null || tool == null) + { + return player.canHarvestBlock(this); + } + + int toolLevel = stack.getItem().getHarvestLevel(stack, tool); + if (toolLevel < 0) + { + return player.canHarvestBlock(this); + } + + return toolLevel >= this.getHarvestLevel(meta); + + } + + public int getMobilityFlag() + { + return 1; + } + + public static void addShell(ItemStack seed, int weight) + { + addShell(new ShellEntry(seed, weight)); + } + + public static void addShell(ShellEntry shellEntry){ + shellList.add(shellEntry); + } + + public static class ShellEntry extends WeightedRandom.Item + { + public final ItemStack shell; + private float damage; + private boolean enchant; + + public ShellEntry(ItemStack seed, int weight) + { + super(weight); + this.shell = seed; + } + + public ItemStack addCustom(Random p_150708_1_) + { + ItemStack itemstack = this.shell.copy(); + + if (this.damage > 0.0F) + { + int i = (int)(this.damage * (float)this.shell.getMaxDamage()); + int j = itemstack.getMaxDamage() - p_150708_1_.nextInt(p_150708_1_.nextInt(i) + 1); + + if (j > i) + { + j = i; + } + + if (j < 1) + { + j = 1; + } + + itemstack.setItemDamage(j); + } + + if (this.enchant) + { + EnchantmentHelper.addRandomEnchantment(p_150708_1_, itemstack, 30); + } + + return itemstack; + } + + public ShellEntry setDamage(float p_150709_1_) + { + this.damage = p_150709_1_; + return this; + } + + public ShellEntry setEnchant() + { + this.enchant = true; + return this; + } + + } + static final List shellList = new ArrayList(); + + public static ItemStack getShell(World world) + { + ShellEntry entry = (ShellEntry)WeightedRandom.getRandomItem(world.rand, shellList); + if (entry == null || entry.shell == null) + { + return null; + } + + return entry.addCustom(world.rand); + + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSaw.java b/src/main/java/shift/sextiarysector/block/BlockSaw.java new file mode 100644 index 0000000..de55e43 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSaw.java @@ -0,0 +1,40 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.tileentity.TileEntitySaw; + +public class BlockSaw extends BlockDirection{ + + public BlockSaw() { + super(Material.iron); + this.setBlockTextureName("planks_oak"); + this.setHardness(1.0F); + this.setStepSound(soundTypeStone); + this.setCreativeTab(SextiarySectorAPI.TabSSIndustry); + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.sawType; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntitySaw(); + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSeasonFluid.java b/src/main/java/shift/sextiarysector/block/BlockSeasonFluid.java new file mode 100644 index 0000000..1ecded0 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSeasonFluid.java @@ -0,0 +1,96 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.material.MaterialTransparent; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.fluids.BlockFluidFinite; +import net.minecraftforge.fluids.Fluid; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockSeasonFluid extends BlockFluidFinite { + + public static final Material season = new SSMaterial(); + + public BlockSeasonFluid(Fluid fluid) { + super(fluid, season); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { + if (p_149691_2_ == 0) { + return this.getFluid().getStillIcon(); + } else { + return this.getFluid().getFlowingIcon(); + } + } + + @Override + @SideOnly(Side.CLIENT) + public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) + { + return this.getFluid().getColor(); + } + + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) + { + + if (p_149734_5_.nextInt(12) == 0) + { + + float f = p_149734_2_ + 0.5F; + float f1 = p_149734_3_ + 0.0F + p_149734_5_.nextFloat() * 6.0F / 16.0F; + float f2 = p_149734_4_ + 0.5F; + float f3 = 0.52F; + float f4 = p_149734_5_.nextFloat() * 0.6F - 0.3F; + + p_149734_1_.spawnParticle("explode", f - f3, f1, f2 + f4, 0.0D, 0.05D, 0.0D); + + p_149734_1_.spawnParticle("explode", f + f3, f1, f2 + f4, 0.0D, 0.05D, 0.0D); + + p_149734_1_.spawnParticle("explode", f + f4, f1, f2 - f3, 0.0D, 0.05D, 0.0D); + + p_149734_1_.spawnParticle("explode", f + f4, f1, f2 + f3, 0.0D, 0.05D, 0.0D); + + } + } + + //Material + public static class SSMaterial extends MaterialTransparent { + + public SSMaterial() { + super(MapColor.airColor); + this.setNoPushMobility(); + } + + } + + /* + @Override + public boolean isAir(IBlockAccess world, int x, int y, int z) + { + return true;//getMaterial() == Material.air; + }*/ + + /* + @Override + public boolean isReplaceable(IBlockAccess world, int x, int y, int z) + { + return true;//blockMaterial.isReplaceable(); + } + + @Override + public boolean isBlockSolid(IBlockAccess p_149747_1_, int p_149747_2_, int p_149747_3_, int p_149747_4_, int p_149747_5_) + { + return false;//p_149747_1_.getBlock(p_149747_2_, p_149747_3_, p_149747_4_).getMaterial().isSolid(); + }*/ +} diff --git a/src/main/java/shift/sextiarysector/block/BlockShaft.java b/src/main/java/shift/sextiarysector/block/BlockShaft.java index c6f3bf0..243c98b 100644 --- a/src/main/java/shift/sextiarysector/block/BlockShaft.java +++ b/src/main/java/shift/sextiarysector/block/BlockShaft.java @@ -11,11 +11,12 @@ import shift.sextiarysector.SextiarySector; import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.fmp.IShaft; import shift.sextiarysector.tileentity.TileEntityShaft; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockShaft extends BlockDirection{ +public class BlockShaft extends BlockDirection { private int type; @@ -23,7 +24,7 @@ public BlockShaft(int type) { super(Material.wood); this.setType(type); this.setHardness(0.8F); - this.setCreativeTab(SextiarySectorAPI.TabSSMachine); + this.setCreativeTab(SextiarySectorAPI.TabSSIndustry); } @@ -39,23 +40,23 @@ public boolean isOpaqueCube() { @Override public int getRenderType() - { - return SextiarySector.proxy.ShaftRenderType; - } + { + return SextiarySector.proxy.ShaftRenderType; + } /* public int damageDropped(int p_149692_1_) - { - return p_149692_1_; - } + { + return p_149692_1_; + } @SideOnly(Side.CLIENT) - public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) - { + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) + { for(int i=0;i<5;i++){ p_149666_3_.add(new ItemStack(p_149666_1_,1,i)); } - }*/ + }*/ @Override public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) @@ -63,11 +64,11 @@ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, double[] i = getBoxFromPool(par1IBlockAccess.getTileEntity(par2, par3, par4).getWorldObj(), par2, par3, par4); - float x = (float)i[0] ; - float y = (float)i[1] ; - float z = (float)i[2] ; + float x = (float) i[0]; + float y = (float) i[1]; + float z = (float) i[2]; - this.setBlockBounds((0.0F+x),(0.0F+y), (0.0F+z), (1.0F-x), (1.0F-y), (1.0F-z)); + this.setBlockBounds((0.0F + x), (0.0F + y), (0.0F + z), (1.0F - x), (1.0F - y), (1.0F - z)); } //蠖薙◆繧雁愛螳壹ゅし繝懊ユ繝ウ繧繧ス繧ヲ繝ォ繧オ繝ウ繝峨r蜿り縺ォ縺吶k縺ィ濶ッ縺縲ゅさ繧ウ縺ョ險ュ螳壹r縺吶k縺ィ縲{nEntityCollidedWithBlock縺悟他縺ー繧後k繧医≧縺ォ縺ェ繧 @@ -76,11 +77,11 @@ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, { double[] i = getBoxFromPool(par1World, par2, par3, par4); - double x = i[0] ; - double y = i[1] ; - double z = i[2] ; + double x = i[0]; + double y = i[1]; + double z = i[2]; - return AxisAlignedBB.getBoundingBox(par2+x, par3+y, par4+z, (par2 + 1)-x, (par3 + 1)-y, (par4 + 1)-z); + return AxisAlignedBB.getBoundingBox(par2 + x, par3 + y, par4 + z, (par2 + 1) - x, (par3 + 1) - y, (par4 + 1) - z); } //繝悶Ο繝繧ッ縺ォ隕也せ繧貞粋繧上○縺滓凾縺ォ蜃コ縺ヲ縺上k鮟偵>邱壹ョ繧「繝ャ @@ -90,44 +91,51 @@ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, i { double[] i = getBoxFromPool(par1World, par2, par3, par4); - double x = i[0] ; - double y = i[1] ; - double z = i[2] ; + double x = i[0]; + double y = i[1]; + double z = i[2]; GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); - return AxisAlignedBB.getBoundingBox(par2+x, par3+y, par4+z, (par2 + 1)-x, (par3 + 1)-y, (par4 + 1)-z); + return AxisAlignedBB.getBoundingBox(par2 + x, par3 + y, par4 + z, (par2 + 1) - x, (par3 + 1) - y, (par4 + 1) - z); } public double[] getBoxFromPool(World par1World, int par2, int par3, int par4) { double[] i = new double[3]; - i[0]=0;//x - i[1]=0;//y - i[2]=0;//z + i[0] = 0;//x + i[1] = 0;//y + i[2] = 0;//z + + if (!(par1World.getTileEntity(par2, par3, par4) instanceof IShaft)) { + i[0] = 0.25f; + i[1] = 0.25f; + i[2] = 0.25f; + return i; + } - TileEntityShaft tileEntity = (TileEntityShaft)par1World.getTileEntity(par2, par3, par4); + IShaft tileEntity = (IShaft) par1World.getTileEntity(par2, par3, par4); - if(tileEntity==null){ - return i ; + if (tileEntity == null) { + return i; } - ForgeDirection d = tileEntity.direction; + ForgeDirection d = tileEntity.getDirection(); - if(d.ordinal()==0||d.ordinal()==1){ - i[0]=0.3125; - i[2]=0.3125; + if (d.ordinal() == 0 || d.ordinal() == 1) { + i[0] = 0.25; + i[2] = 0.25; } - if(d.ordinal()==2||d.ordinal()==3){ - i[0]=0.3125; - i[1]=0.3125; + if (d.ordinal() == 2 || d.ordinal() == 3) { + i[0] = 0.25; + i[1] = 0.25; } - if(d.ordinal()==4||d.ordinal()==5){ - i[1]=0.3125; - i[2]=0.3125; + if (d.ordinal() == 4 || d.ordinal() == 5) { + i[1] = 0.25; + i[2] = 0.25; } - return i ; + return i; } @Override @@ -143,5 +151,4 @@ public void setType(int type) { this.type = type; } - } diff --git a/src/main/java/shift/sextiarysector/block/BlockShippingBox.java b/src/main/java/shift/sextiarysector/block/BlockShippingBox.java index b2339c5..81acb1a 100644 --- a/src/main/java/shift/sextiarysector/block/BlockShippingBox.java +++ b/src/main/java/shift/sextiarysector/block/BlockShippingBox.java @@ -1,39 +1,87 @@ package shift.sextiarysector.block; import net.minecraft.block.Block; -import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import shift.mceconomy2.api.MCEconomyAPI; -import shift.sextiarysector.SSItems; -import shift.sextiarysector.module.ModuleAchievement; +import shift.sextiarysector.SSMaterials; +import shift.sextiarysector.SextiarySector; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class BlockShippingBox extends Block{ +public class BlockShippingBox extends Block {//extends BlockContainer { private IIcon top; public BlockShippingBox() { - super(Material.wood); - this.setBlockUnbreakable(); + super(SSMaterials.machine); + this.setHardness(0.9f); + this.setHarvestLevel("hammer", 1); + //this.setBlockUnbreakable(); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - if(par5EntityPlayer.getCurrentEquippedItem()==null){ - return false; + + if (world.isRemote) + { + return true; + } + else + { + par5EntityPlayer.openGui(SextiarySector.instance, 210, world, x, y, z); + + return true; + } + + /* + TileEntityShippingBox s = (TileEntityShippingBox) world.getTileEntity(x, y, z); + ItemStack pItem = par5EntityPlayer.getCurrentEquippedItem(); + + if (!par5EntityPlayer.isSneaking() && pItem == null) { + + String name = par5EntityPlayer.getDisplayName(); + + if (s.player == null) { + + s.setPlayer(par5EntityPlayer); + + if (!world.isRemote) par5EntityPlayer.addChatMessage(new ChatComponentText("Set Owner : " + name)); + + } else if (s.player.equals(par5EntityPlayer.getGameProfile().getId())) { + + s.player = null; + + if (!world.isRemote) par5EntityPlayer.addChatMessage(new ChatComponentText("Delete Owner : " + name)); + + } + + return true; } - if(!world.isRemote && par5EntityPlayer.getCurrentEquippedItem().getItem()==SSItems.hammer){ + if (par5EntityPlayer.isSneaking() && pItem == null && (s.player == null || s.player.equals(par5EntityPlayer.getGameProfile().getId()))) { - EntityItem item = new EntityItem(world, x+0.5d, y+0.5d, z+0.5d, new ItemStack(this,1)); + int mp = (int) s.mp; + + if (mp == 0) return true; + + MCEconomyAPI.addPlayerMP(par5EntityPlayer, mp, false); + s.mp -= mp; + par5EntityPlayer.worldObj.playSoundAtEntity(par5EntityPlayer, "mceconomy2:coin", 0.6f, 0.8f); + + return true; + + } + + if (pItem == null) return false; + + if (!world.isRemote && pItem.getItem() == SSItems.hammer) { + + if (s.player != null && !s.player.equals(par5EntityPlayer.getGameProfile().getId())) return false; + + EntityItem item = new EntityItem(world, x + 0.5d, y + 0.5d, z + 0.5d, new ItemStack(this, 1)); world.spawnEntityInWorld(item); @@ -41,42 +89,54 @@ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p return true; } - ItemStack item = par5EntityPlayer.getCurrentEquippedItem(); - - int i = MCEconomyAPI.getPurchase(item); - if(i==-2){ + int i = MCEconomyAPI.getPurchase(pItem); + if (i == -2) { return false; } - if(i==-1){ + if (i == -1) { return false; } - - MCEconomyAPI.addPlayerMP(par5EntityPlayer, i,false); - par5EntityPlayer.addStat(ModuleAchievement.objectSellStats[Item.getIdFromItem(item.getItem())], 1); - par5EntityPlayer.addStat(ModuleAchievement.shipping, 1); - item.stackSize--; - world.playSoundAtEntity(par5EntityPlayer, "damage.fallsmall", 1.0F, 1.0F); + */ + + /* + MCEconomyAPI.addPlayerMP(par5EntityPlayer, i, false); + par5EntityPlayer.addStat(ModuleStatistics.objectSellStats[Item.getIdFromItem(item.getItem())], 1); + par5EntityPlayer.addStat(SSAchievement.shipping, 1); + */ + + /* + s.setInventorySlotContents(0, pItem.copy()); + pItem.stackSize = 0; + //item.stackSize--; + world.playSoundAtEntity(par5EntityPlayer, "game.neutral.hurt.fall.small", 1.0F, 1.0F); return true; + */ } @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister par1IconRegister) - { - this.blockIcon = par1IconRegister.registerIcon(this.getTextureName()); - this.top = par1IconRegister.registerIcon(this.getTextureName()+"_top"); + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(this.getTextureName()); + this.top = par1IconRegister.registerIcon(this.getTextureName() + "_top"); - } + } @Override public IIcon getIcon(int par1, int par2) - { - if(par1==0||par1==1){ + { + if (par1 == 0 || par1 == 1) { return this.top; } - return this.blockIcon; - } + return this.blockIcon; + } + + /* + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityShippingBox(); + }*/ } diff --git a/src/main/java/shift/sextiarysector/block/BlockSimpleFurnace.java b/src/main/java/shift/sextiarysector/block/BlockSimpleFurnace.java new file mode 100644 index 0000000..986e080 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSimpleFurnace.java @@ -0,0 +1,310 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +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.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntitySimpleFurnace; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public abstract class BlockSimpleFurnace extends BlockContainer{ + + private final Random furnaceRand = new Random(); + + private static boolean keepFurnaceInventory; + + @SideOnly(Side.CLIENT) + private IIcon furnaceIconTop; + @SideOnly(Side.CLIENT) + private IIcon[] furnaceIconFront; + + private int GUIID; + + public BlockSimpleFurnace(int guiID) { + super(Material.rock); + this.setHardness(1.0F); + this.setStepSound(soundTypeStone); + this.GUIID = guiID; + } + + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + TileEntitySimpleFurnace tileentityfurnace = (TileEntitySimpleFurnace)world.getTileEntity(x, y, z); + if(tileentityfurnace.isFuel())return 15; + return 0; + }@Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntitySimpleFurnace tileentityfurnace = (TileEntitySimpleFurnace)par1World.getTileEntity(par2, par3, par4); + + if (tileentityfurnace != null) + { + par5EntityPlayer.openGui(SextiarySector.instance, this.GUIID, par1World, par2, par3, par4); + } + + return true; + } + } + + /** + * Called whenever the block is added into the world. Args: world, x, y, z + */ + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); + //this.setDefaultDirection(par1World, par2, par3, par4); + } + + /** + * set a blocks direction + */ + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + Block block = par1World.getBlock(par2, par3, par4 - 1); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); + + TileEntityDirection tileEntity = (TileEntityDirection)par1World.getTileEntity(par2, par3, par4); + + + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); + tileEntity.direction = ForgeDirection.getOrientation(b0); + } + } + + @Override + @SideOnly(Side.CLIENT) + + /** + * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata + */ + public IIcon getIcon(int par1, int par2) + { + + return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != 3 ? this.blockIcon : this.furnaceIconFront[1])); + + } + + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess p_149673_1_, int x, int y, int z, int side) + { + //System.out.println("Icon"); + TileEntitySimpleFurnace tileEntity = (TileEntitySimpleFurnace)p_149673_1_.getTileEntity(x, y, z); + + int meta = p_149673_1_.getBlockMetadata(x, y, z); + + return side == 1 ? this.furnaceIconTop : (side == 0 ? this.furnaceIconTop : (side != meta ? this.blockIcon : (tileEntity.isFuel() ? this.furnaceIconFront[0] : this.furnaceIconFront[1]))); + + + } + + @Override + @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 registerBlockIcons(IIconRegister par1IconRegister) + { + this.blockIcon = par1IconRegister.registerIcon(this.getTextureName()+"_side"); + this.furnaceIconFront = new IIcon[2]; + this.furnaceIconFront[0] = par1IconRegister.registerIcon(this.getTextureName()+"_front_on"); + this.furnaceIconFront[1] = par1IconRegister.registerIcon(this.getTextureName()+"_front_off"); + this.furnaceIconTop = par1IconRegister.registerIcon(this.getTextureName()+"_top"); + } + + /** + * Called when the block is placed in the world. + */ + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) + { + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + TileEntityDirection tileEntity = (TileEntityDirection)par1World.getTileEntity(par2, par3, par4); + + if (l == 0) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[2]; + } + + if (l == 1) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[5]; + } + + if (l == 2) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[3]; + } + + if (l == 3) + { + par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + tileEntity.direction = ForgeDirection.VALID_DIRECTIONS[4]; + } + + } + + @Override + public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) + { + if (!keepFurnaceInventory) + { + TileEntitySimpleFurnace tileentityfurnace = (TileEntitySimpleFurnace)par1World.getTileEntity(par2, par3, par4); + + if (tileentityfurnace != null) + { + for (int j1 = 0; j1 < tileentityfurnace.getSizeInventory(); ++j1) + { + ItemStack itemstack = tileentityfurnace.getStackInSlot(j1); + + this.dropItem(itemstack, par1World, par2, par3, par4); + + } + + par1World.func_147453_f(par2, par3, par4, par5); + } + } + + super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + + private void dropItem(ItemStack itemstack ,World par1World,int par2, int par3, int par4){ + + if (itemstack != null) + { + float f = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + float f1 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + float f2 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int k1 = this.furnaceRand.nextInt(21) + 10; + + if (k1 > itemstack.stackSize) + { + k1 = itemstack.stackSize; + } + + itemstack.stackSize -= k1; + EntityItem entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float)this.furnaceRand.nextGaussian() * f3; + entityitem.motionY = (float)this.furnaceRand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float)this.furnaceRand.nextGaussian() * f3; + par1World.spawnEntityInWorld(entityitem); + } + } + + } + + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) + { + TileEntitySimpleFurnace tileentityfurnace = (TileEntitySimpleFurnace)p_149734_1_.getTileEntity(p_149734_2_, p_149734_3_, p_149734_4_); + + + if (tileentityfurnace.isFuel()) + { + int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_); + float f = (float)p_149734_2_ + 0.5F; + float f1 = (float)p_149734_3_ + 0.0F + p_149734_5_.nextFloat() * 6.0F / 16.0F; + float f2 = (float)p_149734_4_ + 0.5F; + float f3 = 0.52F; + float f4 = p_149734_5_.nextFloat() * 0.6F - 0.3F; + + if (l == 4) + { + p_149734_1_.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + } + else if (l == 5) + { + p_149734_1_.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + } + else if (l == 2) + { + p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); + } + else if (l == 3) + { + p_149734_1_.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); + p_149734_1_.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); + } + } + } + + @Override + public boolean hasComparatorInputOverride() + { + return true; + } + + @Override + public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) + { + return Container.calcRedstoneFromInventory((IInventory)par1World.getTileEntity(par2, par3, par4)); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSimpleMachine.java b/src/main/java/shift/sextiarysector/block/BlockSimpleMachine.java index b7bb78b..c1f0702 100644 --- a/src/main/java/shift/sextiarysector/block/BlockSimpleMachine.java +++ b/src/main/java/shift/sextiarysector/block/BlockSimpleMachine.java @@ -1,22 +1,25 @@ package shift.sextiarysector.block; import java.util.List; +import java.util.Random; 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.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SSMaterials; import shift.sextiarysector.SextiarySector; import shift.sextiarysector.recipe.RecipeSimpleMachine; import shift.sextiarysector.tileentity.TileEntitySimpleMachine; @@ -25,36 +28,37 @@ public class BlockSimpleMachine extends BlockContainer { + private final Random furnaceRand = new Random(); private final String IconName; @SideOnly(Side.CLIENT) private IIcon iconTop; @SideOnly(Side.CLIENT) private IIcon iconUnder; - private String frontIcon; + private final String frontIcon; @SideOnly(Side.CLIENT) private IIcon iconFront; - private int guiID; - private RecipeSimpleMachine recipe; + private final int guiID; + private final RecipeSimpleMachine recipe; private String guiuUnlocalizedName; - private int type; + private final int type; - public BlockSimpleMachine(String iconFront,int gui,RecipeSimpleMachine recipe,int type) { - super( Material.wood); + public BlockSimpleMachine(String iconFront, int gui, RecipeSimpleMachine recipe, int type) { + super(SSMaterials.machine); this.setHardness(3.0F); this.frontIcon = iconFront; this.guiID = gui; - this.recipe=recipe; - this.type =type; + this.recipe = recipe; + this.type = type; + this.setHarvestLevel("hammer", 1); IconName = ("sextiarysector:machine/machine"); } @Override @SideOnly(Side.CLIENT) - - public IIcon getIcon(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) - { - int d = ((TileEntitySimpleMachine)par1IBlockAccess.getTileEntity(par2, par3, par4)).direction.ordinal(); + public IIcon getIcon(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) + { + int d = ((TileEntitySimpleMachine) par1IBlockAccess.getTileEntity(par2, par3, par4)).direction.ordinal(); if (par5 == 1) { @@ -67,13 +71,12 @@ else if (par5 == 0) else if (par5 == d) { return this.iconFront; - }else + } else { return this.blockIcon; } - - } + } @SideOnly(Side.CLIENT) @Override @@ -91,7 +94,7 @@ else if (par1 == 0) else if (par1 == 3) { return this.iconFront; - }else + } else { return this.blockIcon; } @@ -103,12 +106,12 @@ else if (par1 == 3) public void registerBlockIcons(IIconRegister par1IconRegister) { this.blockIcon = par1IconRegister.registerIcon(IconName); - this.iconTop = par1IconRegister.registerIcon(IconName+"_top"); - this.iconUnder = par1IconRegister.registerIcon(IconName+"_under"); + this.iconTop = par1IconRegister.registerIcon(IconName + "_top"); + this.iconUnder = par1IconRegister.registerIcon(IconName + "_under"); //iconFront = new Icon[SimpleMachine.values().length]; - this.iconFront = par1IconRegister.registerIcon("sextiarysector:machine/"+this.frontIcon); + this.iconFront = par1IconRegister.registerIcon("sextiarysector:machine/" + this.frontIcon); /* for(int i =0;i 0) + { + int k1 = this.furnaceRand.nextInt(21) + 10; + + if (k1 > itemstack.stackSize) + { + k1 = itemstack.stackSize; + } + + itemstack.stackSize -= k1; + EntityItem entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float) this.furnaceRand.nextGaussian() * f3; + entityitem.motionY = (float) this.furnaceRand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float) this.furnaceRand.nextGaussian() * f3; + par1World.spawnEntityInWorld(entityitem); + } + } + + } + + @Override public Block setBlockName(String p_149663_1_) - { + { super.setBlockName(p_149663_1_); - this.guiuUnlocalizedName = p_149663_1_; - return this; - } + this.guiuUnlocalizedName = p_149663_1_; + return this; + } public String getGUIUnlocalizedName() - { - return this.guiuUnlocalizedName; - } + { + return this.guiuUnlocalizedName; + } - public ItemStack getResult(ItemStack itemstack){ + public ItemStack getResult(ItemStack itemstack) { return this.recipe.getResult(itemstack); } @Override - public TileEntity createNewTileEntity(World world,int i) { + public TileEntity createNewTileEntity(World world, int i) { return new TileEntitySimpleMachine(type); } diff --git a/src/main/java/shift/sextiarysector/block/BlockSmallWaterwheel.java b/src/main/java/shift/sextiarysector/block/BlockSmallWaterwheel.java new file mode 100644 index 0000000..1780928 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSmallWaterwheel.java @@ -0,0 +1,129 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntitySmallWaterwheel; + +public class BlockSmallWaterwheel extends BlockContainer{ + + public BlockSmallWaterwheel() { + super(Material.wood); + this.setHardness(0.8F); + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) + { + super.onBlockAdded(par1World, par2, par3, par4); + this.setDefaultDirection(par1World, par2, par3, par4); + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) + { + if (!par1World.isRemote) + { + Block block = par1World.getBlock(par2, par3, par4 - 1); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); + + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } + + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(b0); + + //par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); + } + } + + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, + ItemStack par6ItemStack) + { + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + + if (l == 0) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(2); + } + + if (l == 1) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(5); + + } + + if (l == 2) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(3); + + } + + if (l == 3) + { + //par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); + ((TileEntityDirection) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection + .getOrientation(4); + + } + + par1World.markBlockForUpdate(par2, par3, par4); + + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.smallWaterwheel; + } + + @Override + public TileEntity createNewTileEntity(World world, int p_149915_2_) { + return new TileEntitySmallWaterwheel(); + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSmallWindmill.java b/src/main/java/shift/sextiarysector/block/BlockSmallWindmill.java index e9c941a..655791f 100644 --- a/src/main/java/shift/sextiarysector/block/BlockSmallWindmill.java +++ b/src/main/java/shift/sextiarysector/block/BlockSmallWindmill.java @@ -12,7 +12,7 @@ import shift.sextiarysector.SextiarySector; import shift.sextiarysector.tileentity.TileEntitySmallWindmill; -public class BlockSmallWindmill extends BlockContainer{ +public class BlockSmallWindmill extends BlockContainer { public BlockSmallWindmill() { super(Material.wood); @@ -31,38 +31,39 @@ private void setDefaultDirection(World par1World, int par2, int par3, int par4) if (!par1World.isRemote) { Block block = par1World.getBlock(par2, par3, par4 - 1); - Block block1 = par1World.getBlock(par2, par3, par4 + 1); - Block block2 = par1World.getBlock(par2 - 1, par3, par4); - Block block3 = par1World.getBlock(par2 + 1, par3, par4); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); - TileEntitySmallWindmill tileEntity = (TileEntitySmallWindmill)par1World.getTileEntity(par2, par3, par4); + TileEntitySmallWindmill tileEntity = (TileEntitySmallWindmill) par1World.getTileEntity(par2, par3, par4); + byte b0 = 3; - byte b0 = 3; + if (block.func_149730_j() && !block1.func_149730_j()) + { + b0 = 3; + } - if (block.func_149730_j() && !block1.func_149730_j()) - { - b0 = 3; - } + if (block1.func_149730_j() && !block.func_149730_j()) + { + b0 = 2; + } - if (block1.func_149730_j() && !block.func_149730_j()) - { - b0 = 2; - } + if (block2.func_149730_j() && !block3.func_149730_j()) + { + b0 = 5; + } - if (block2.func_149730_j() && !block3.func_149730_j()) - { - b0 = 5; - } - - if (block3.func_149730_j() && !block2.func_149730_j()) - { - b0 = 4; - } + if (block3.func_149730_j() && !block2.func_149730_j()) + { + b0 = 4; + } ((TileEntitySmallWindmill) par1World.getTileEntity(par2, par3, par4)).direction = ForgeDirection .getOrientation(b0); + par1World.markBlockForUpdate(par2, par3, par4); + //par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); } } @@ -120,14 +121,13 @@ public boolean isOpaqueCube() { @Override public int getRenderType() - { - return SextiarySector.proxy.smallWindMillType; - } + { + return SextiarySector.proxy.smallWindMillType; + } @Override public TileEntity createNewTileEntity(World world, int p_149915_2_) { return new TileEntitySmallWindmill(); } - } diff --git a/src/main/java/shift/sextiarysector/block/BlockSquare.java b/src/main/java/shift/sextiarysector/block/BlockSquare.java new file mode 100644 index 0000000..8df7ab4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSquare.java @@ -0,0 +1,41 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.tileentity.TileEntitySquare; + +public class BlockSquare extends BlockDirection{ + + + public BlockSquare() { + super(Material.wood); + this.setHardness(0.8F); + this.setBlockBounds(0.0625f, 0.0f, 0.0625f, 0.9375f, 0.875f, 0.9375f); + this.setCreativeTab(SextiarySectorAPI.TabSSCore); + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntitySquare(); + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.squareType; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSteamMotor.java b/src/main/java/shift/sextiarysector/block/BlockSteamMotor.java new file mode 100644 index 0000000..fb52251 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSteamMotor.java @@ -0,0 +1,81 @@ +package shift.sextiarysector.block; + +import java.util.Random; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntitySteamMotor; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockSteamMotor extends BlockMotor{ + + @Override + public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + if(super.onBlockActivated(par1World, x, y, z, par5EntityPlayer, par6, par7, par8, par9)){ + return true; + } + + if (par1World.isRemote) + { + return true; + } + else + { + TileEntitySteamMotor tileentityfurnace = (TileEntitySteamMotor)par1World.getTileEntity(x, y, z); + if (tileentityfurnace != null) + { + par5EntityPlayer.openGui(SextiarySector.instance, 60, par1World, x, y, z); + } + + return true; + } + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntitySteamMotor(); + } + + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_, Random p_149734_5_) + { + TileEntitySteamMotor tileentityfurnace = (TileEntitySteamMotor)p_149734_1_.getTileEntity(p_149734_2_, p_149734_3_, p_149734_4_); + + + if (tileentityfurnace.canWork()) + { + int l = tileentityfurnace.getDirection().ordinal(); + + for(int i=0;i<2;i++){ + + float f = (float)p_149734_2_ + 0.5F; + float f1 = (float)p_149734_3_ + 0.0F + p_149734_5_.nextFloat() * 6.0F / 16.0F; + float f2 = (float)p_149734_4_ + 0.5F; + float f3 = 0.52F; + float f4 = p_149734_5_.nextFloat() * 0.6F - 0.3F; + + + p_149734_1_.spawnParticle("explode", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + + p_149734_1_.spawnParticle("explode", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D); + + p_149734_1_.spawnParticle("explode", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D); + + p_149734_1_.spawnParticle("explode", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D); + + + } + + } + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.steamMotorType; + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockStoneFrame.java b/src/main/java/shift/sextiarysector/block/BlockStoneFrame.java new file mode 100644 index 0000000..07c11b5 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockStoneFrame.java @@ -0,0 +1,83 @@ +package shift.sextiarysector.block; + +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; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntityCraftFurnace; +import shift.sextiarysector.tileentity.TileEntityStoneFrame; + +public class BlockStoneFrame extends BlockContainer{ + + public BlockStoneFrame() { + super(Material.rock); + } + + @Override + public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) + { + if (par1World.isRemote) + { + return true; + } + else + { + TileEntityStoneFrame tileentityfurnace = (TileEntityStoneFrame)par1World.getTileEntity(par2, par3, par4); + + System.out.println("AAA"); + + if (tileentityfurnace != null) + { + + if(!tileentityfurnace.large)return true; + + System.out.println("BBB"); + + par5EntityPlayer.openGui(SextiarySector.instance, 5, par1World, tileentityfurnace.largeX, tileentityfurnace.largeY, tileentityfurnace.largeZ); + } + + return true; + } + } + + public int getLightValue(IBlockAccess world, int x, int y, int z) + { + + TileEntityStoneFrame stoneFrame = (TileEntityStoneFrame)world.getTileEntity(x, y, z); + + if(!stoneFrame.large)return 0; + + TileEntityCraftFurnace tileentityfurnace = stoneFrame.getCraftFurnace(); + + if(tileentityfurnace==null ||tileentityfurnace instanceof TileEntityCraftFurnace){ + stoneFrame.large = false; + return 0; + } + + if(tileentityfurnace.isFuel())return 15; + return 0; + } + + @Override + public void breakBlock(World world, int x, int y, int z, Block par5, int par6) + { + TileEntityStoneFrame stoneFrame = (TileEntityStoneFrame)world.getTileEntity(x, y, z); + + if(!stoneFrame.large)return; + + stoneFrame.breakLarge(); + + super.breakBlock(world, x, y, z, par5, par6); + + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityStoneFrame(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockSuctionMachine.java b/src/main/java/shift/sextiarysector/block/BlockSuctionMachine.java new file mode 100644 index 0000000..24f1cfc --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockSuctionMachine.java @@ -0,0 +1,75 @@ +package shift.sextiarysector.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.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntitySuctionMachine; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockSuctionMachine extends BlockContainer { + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + @SideOnly(Side.CLIENT) + private IIcon iconUnder; + + public BlockSuctionMachine() { + super(Material.wood); + this.setHardness(1.0F); + this.setStepSound(soundTypeStone); + this.setCreativeTab(SextiarySectorAPI.TabSSIndustry); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(IBlockAccess p_149673_1_, int x, int y, int z, int side) { + + int d = ((TileEntityDirection) p_149673_1_.getTileEntity(x, y, z)).direction.ordinal(); + + if (side == 1) { + return this.iconTop; + } else if (side == 0) { + return this.iconTop; + } else { + return this.blockIcon; + } + + } + + @SideOnly(Side.CLIENT) + @Override + public IIcon getIcon(int par1, int par2) { + + if (par1 == 1) { + return this.iconTop; + } else if (par1 == 0) { + return this.iconTop; + } else { + return this.blockIcon; + } + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) { + this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_up"); + + this.iconTop = par1IconRegister.registerIcon(this.getTextureName() + "_top"); + this.iconUnder = par1IconRegister.registerIcon(this.getTextureName()); + + } + + @Override + public TileEntity createNewTileEntity(World par1World, int p_149915_2_) { + return new TileEntitySuctionMachine(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockTank.java b/src/main/java/shift/sextiarysector/block/BlockTank.java new file mode 100644 index 0000000..d269d8a --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockTank.java @@ -0,0 +1,148 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntityTank; + +public class BlockTank extends BlockContainer { + + public BlockTank() { + super(Material.glass); + float b = 1.0f / 16.0f; + this.setBlockBounds(b, 0, b, 1.0f - b, 1, 1.0f - b); + this.setHardness(0.4f); + this.setStepSound(soundTypeGlass); + } + + //繝励Ξ繧、繝、繝シ縺ョ蜿ウ繧ッ繝ェ繝繧ッ蜃ヲ逅 + @Override + public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) + { + + ItemStack itemstack = player.inventory.getCurrentItem(); + TileEntityTank tank = (TileEntityTank) par1World.getTileEntity(x, y, z); + + if (tank == null) return false; + if (!FluidContainerRegistry.isContainer(itemstack)) return false; + + FluidStack fluid = tank.getFluidStack(); + + if (FluidContainerRegistry.isFilledContainer(itemstack)) { + return this.addFluid(par1World, x, y, z, itemstack, tank, player); + } + else if (fluid != null && fluid.getFluid() != null && FluidContainerRegistry.isContainer(itemstack)) { + return this.drainFluid(par1World, x, y, z, itemstack, tank, player); + } + + return false; + + } + + public boolean addFluid(World world, int x, int y, int z, ItemStack itemstack, TileEntityTank tank, EntityPlayer player) { + + FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(itemstack); + int put = tank.fill(ForgeDirection.UNKNOWN, fluid, false); + + if (put != fluid.amount) return false; + + tank.fill(ForgeDirection.UNKNOWN, fluid, true); + this.addContainerItemToPlayer(itemstack, FluidContainerRegistry.drainFluidContainer(itemstack), player); + + tank.markDirty(); + world.markBlockForUpdate(x, y, z); + + world.playSoundAtEntity(player, "random.pop", 0.4F, 1.8F); + + return true; + + } + + public boolean drainFluid(World world, int x, int y, int z, ItemStack empty, TileEntityTank tank, EntityPlayer player) { + + for (FluidContainerData f : FluidContainerRegistry.getRegisteredFluidContainerData()) { + + if (!(f.emptyContainer.isItemEqual(empty) && f.fluid.isFluidEqual(tank.getFluidStack()) && f.fluid.amount <= tank.tank.getFluidAmount())) continue; + + this.addContainerItemToPlayer(empty, FluidContainerRegistry.fillFluidContainer(tank.getFluidStack(), empty), player); + tank.tank.drain(f.fluid.amount, true); + + tank.markDirty(); + world.markBlockForUpdate(x, y, z); + + world.playSoundAtEntity(player, "random.pop", 0.4F, 1.8F); + + return true; + + } + + return false; + + } + + public void addContainerItemToPlayer(ItemStack itemstack, ItemStack newstack, EntityPlayer player) { + + if (player.capabilities.isCreativeMode) return; + + if (itemstack.stackSize == 1 && player.worldObj.isRemote) return; + + --itemstack.stackSize; + + ItemStack emptyContainer = newstack; + + if (emptyContainer != null) + { + + if (!player.capabilities.isCreativeMode) { + + if (itemstack.stackSize <= 0) { + + player.inventory.setInventorySlotContents(player.inventory.currentItem, emptyContainer); + + } else { + + if (!player.inventory.addItemStackToInventory(emptyContainer)) { + player.dropPlayerItemWithRandomChoice(emptyContainer, false); + + } + + player.inventory.markDirty(); + + } + + } + + } + + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.tankType; + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityTank(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockTofuMotor.java b/src/main/java/shift/sextiarysector/block/BlockTofuMotor.java new file mode 100644 index 0000000..65d7310 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockTofuMotor.java @@ -0,0 +1,20 @@ +package shift.sextiarysector.block; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import shift.sextiarysector.plugin.PluginTofu; +import shift.sextiarysector.tileentity.TileEntityTofuMotor; + +public class BlockTofuMotor extends BlockMotor{ + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityTofuMotor(); + } + + @Override + public int getRenderType() + { + return PluginTofu.tofuMotorType; + } +} diff --git a/src/main/java/shift/sextiarysector/block/BlockTrap.java b/src/main/java/shift/sextiarysector/block/BlockTrap.java new file mode 100644 index 0000000..2671da9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockTrap.java @@ -0,0 +1,147 @@ +package shift.sextiarysector.block; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import shift.sextiarysector.tileentity.TileEntityTrap; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockTrap extends BlockContainer { + + public static double one = 1.0d / 64.0d; + private IIcon grass; + + public BlockTrap() { + super(Material.wood); + this.setTickRandomly(true); + } + + @Override + public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) + { + if (p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_) == 0) return; + + p_149674_1_.scheduleBlockUpdate(p_149674_2_, p_149674_3_, p_149674_4_, this, this.tickRate(p_149674_1_) + p_149674_5_.nextInt(100)); + + //ModuleTrap.spawnTrap(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_); + } + + @Override + public int tickRate(World p_149738_1_) + { + return 200; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int par1, int par2) + { + + if (par2 == 1) { + return this.grass; + } + + return this.blockIcon; + + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister par1IconRegister) + { + super.registerBlockIcons(par1IconRegister); + this.grass = par1IconRegister.registerIcon("sextiarysector:trap"); + } + + @Override + public void addCollisionBoxesToList(World p_149743_1_, int x, int y, int z, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) + { + AxisAlignedBB axisalignedbb1 = AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.one, z + this.maxZ); + + if (axisalignedbb1 != null && p_149743_5_.intersectsWith(axisalignedbb1)) + { + p_149743_6_.add(axisalignedbb1); + } + + AxisAlignedBB axisalignedbb2 = AxisAlignedBB.getBoundingBox(x + this.minX, y + this.maxY - this.one, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); + + if (axisalignedbb2 != null && p_149743_5_.intersectsWith(axisalignedbb2)) + { + p_149743_6_.add(axisalignedbb2); + } + + AxisAlignedBB axisalignedbb3 = AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.one, y + this.maxY, z + this.maxZ); + + if (axisalignedbb3 != null && p_149743_5_.intersectsWith(axisalignedbb3)) + { + p_149743_6_.add(axisalignedbb3); + } + + AxisAlignedBB axisalignedbb4 = AxisAlignedBB.getBoundingBox(x + this.maxX - this.one, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); + + if (axisalignedbb4 != null && p_149743_5_.intersectsWith(axisalignedbb4)) + { + p_149743_6_.add(axisalignedbb4); + } + + AxisAlignedBB axisalignedbb5 = AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.one); + + if (axisalignedbb5 != null && p_149743_5_.intersectsWith(axisalignedbb5)) + { + p_149743_6_.add(axisalignedbb5); + } + + AxisAlignedBB axisalignedbb6 = AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.maxZ - this.one, x + this.maxX, y + this.maxY, z + this.maxZ); + + if (axisalignedbb6 != null && p_149743_5_.intersectsWith(axisalignedbb6)) + { + p_149743_6_.add(axisalignedbb6); + } + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() + { + return 0; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) { + + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0)); + p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1)); + + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityTrap(); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockWood.java b/src/main/java/shift/sextiarysector/block/BlockWood.java new file mode 100644 index 0000000..7384eeb --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockWood.java @@ -0,0 +1,167 @@ +package shift.sextiarysector.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.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSFluids; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.module.FertilizerManager; +import shift.sextiarysector.tileentity.TileEntityFarmland; +import shift.sextiarysector.tileentity.TileEntityWood; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockWood extends BlockContainer { + + private IIcon blockTopIcon; + private IIcon blockTop2Icon; + + public BlockWood() { + super(Material.wood); + this.setLightOpacity(255); + this.setStepSound(soundTypeGrass); + this.setBlockBounds(2.0f / 16.0f, 0.0f, 2.0f / 16.0f, 14.0f / 16.0f, 15.0f / 16.0f, 14.0f / 16.0f); + this.setHardness(1.2f); + this.setStepSound(soundTypeWood); + this.useNeighborBrightness = true; + } + + @Override + public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { + + if (FertilizerManager.getFertilizer(par5EntityPlayer.getCurrentEquippedItem()) != null && par1World.isAirBlock(x, y + 1, z)) { + + return this.setFertilizer(par1World, x, y, z, par5EntityPlayer); + + } + + if (par5EntityPlayer.getCurrentEquippedItem() != null) { + + FluidStack f = FluidContainerRegistry.getFluidForFilledItem(par5EntityPlayer.getCurrentEquippedItem()); + + if (f != null) { + + TileEntityWood t = (TileEntityWood) par1World.getTileEntity(x, y, z); + + if (t.fill(ForgeDirection.getOrientation(par6), f, true) > 0) { + + ItemStack item = par5EntityPlayer.getCurrentEquippedItem().getItem().getContainerItem(par5EntityPlayer.getCurrentEquippedItem()); + + if (!par5EntityPlayer.capabilities.isCreativeMode && !par1World.isRemote) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + + if (item != null) { + + if (par5EntityPlayer.getCurrentEquippedItem().stackSize == 0) { + + par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, item); + + } else if (!par5EntityPlayer.inventory.addItemStackToInventory(item)) + { + par5EntityPlayer.dropPlayerItemWithRandomChoice(item, false); + } + + } + + } + + return true; + + } + + } else { + return false; + } + + } + + return false; + } + + private boolean setFertilizer(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer) { + + TileEntityWood t = (TileEntityWood) par1World.getTileEntity(x, y, z); + + if (t.getFertilizer() != null) { + return false; + } + + t.setFertilizer(FertilizerManager.getFertilizer(par5EntityPlayer.getCurrentEquippedItem()).getFertilizer()); + + if (!par5EntityPlayer.capabilities.isCreativeMode && !par1World.isRemote) + { + --par5EntityPlayer.getCurrentEquippedItem().stackSize; + } + + par1World.markBlockForUpdate(x, y, z); + + return true; + + } + + public boolean addWater(World par1World, int x, int y, int z) { + + TileEntityFarmland t = (TileEntityFarmland) par1World.getTileEntity(x, y, z); + + return t.fill(ForgeDirection.UP, new FluidStack(SSFluids.drinkingWater, 1000), true) > 0; + + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileEntityWood(); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) + { + this.blockIcon = p_149651_1_.registerIcon(this.getTextureName()); + this.blockTopIcon = p_149651_1_.registerIcon(this.getTextureName() + "_top"); + this.blockTop2Icon = p_149651_1_.registerIcon(this.getTextureName() + "_top2"); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { + if (p_149691_1_ != 0 && p_149691_1_ != 1) { + return this.blockIcon; + } + + if (p_149691_2_ == 0) { + return this.blockTopIcon; + } else { + return this.blockTop2Icon; + } + + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.woodType; + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockWoodHopper.java b/src/main/java/shift/sextiarysector/block/BlockWoodHopper.java new file mode 100644 index 0000000..d57b7a1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockWoodHopper.java @@ -0,0 +1,58 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.BlockHopper; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.SextiarySectorAPI; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockWoodHopper extends BlockHopper { + + private IIcon field_149923_M; + private IIcon field_149921_b; + private IIcon field_149924_N; + + public BlockWoodHopper() { + this.setHardness(0.5f); + this.setStepSound(soundTypeWood); + this.setCreativeTab(SextiarySectorAPI.TabSSCore); + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.woodHopperType; + } + + @Override + @SideOnly(Side.CLIENT) + public String getItemIconName() + { + return "sextiarysector:wood_hopper"; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(int p_149691_1_, int p_149691_2_) + { + return p_149691_1_ == 1 ? this.field_149923_M : this.field_149921_b; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) + { + this.field_149921_b = p_149651_1_.registerIcon("sextiarysector:wood_hopper_outside"); + this.field_149923_M = p_149651_1_.registerIcon("sextiarysector:wood_hopper_top"); + this.field_149924_N = p_149651_1_.registerIcon("sextiarysector:wood_hopper_inside"); + } + + @SideOnly(Side.CLIENT) + public IIcon getHopperIcon2(String p_149916_0_) + { + return p_149916_0_.equals("hopper_outside") ? this.field_149921_b : (p_149916_0_.equals("hopper_inside") ? this.field_149924_N : null); + } + +} diff --git a/src/main/java/shift/sextiarysector/block/BlockWoodenGutter.java b/src/main/java/shift/sextiarysector/block/BlockWoodenGutter.java new file mode 100644 index 0000000..f9b41d6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/block/BlockWoodenGutter.java @@ -0,0 +1,114 @@ +package shift.sextiarysector.block; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntityDirection; +import shift.sextiarysector.tileentity.TileEntityWoodenGutter; + +public class BlockWoodenGutter extends BlockContainer { + + protected BlockWoodenGutter() { + super(Material.wood); + this.setLightOpacity(255); + this.setStepSound(this.soundTypeWood); + this.useNeighborBrightness = true; + } + + @Override + public void onBlockAdded(World par1World, int par2, int par3, int par4) { + super.onBlockAdded(par1World, par2, par3, par4); + + } + + private void setDefaultDirection(World par1World, int par2, int par3, int par4) { + + if (!par1World.isRemote) { + + Block block = par1World.getBlock(par2, par3, par4 - 1); + Block block1 = par1World.getBlock(par2, par3, par4 + 1); + Block block2 = par1World.getBlock(par2 - 1, par3, par4); + Block block3 = par1World.getBlock(par2 + 1, par3, par4); + + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + byte b0 = 3; + + if (block.func_149730_j() && !block1.func_149730_j()) { + b0 = 3; + } + + if (block1.func_149730_j() && !block.func_149730_j()) { + b0 = 2; + } + + if (block2.func_149730_j() && !block3.func_149730_j()) { + b0 = 5; + } + + if (block3.func_149730_j() && !block2.func_149730_j()) { + b0 = 4; + } + + par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2); + tileEntity.direction = ForgeDirection.getOrientation(b0); + + } + + } + + @Override + public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { + + int l = MathHelper.floor_double(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + + TileEntityDirection tileEntity = (TileEntityDirection) par1World.getTileEntity(par2, par3, par4); + + if (l == 0) { + tileEntity.direction = ForgeDirection.getOrientation(2); + } + + if (l == 1) { + tileEntity.direction = ForgeDirection.getOrientation(5); + } + + if (l == 2) { + tileEntity.direction = ForgeDirection.getOrientation(3); + } + + if (l == 3) { + tileEntity.direction = ForgeDirection.getOrientation(4); + } + + } + + @Override + public TileEntity createNewTileEntity(World par1World, int p_149915_2_) + { + return new TileEntityWoodenGutter(); + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public int getRenderType() + { + return SextiarySector.proxy.woodenGutterType; + } + +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerCraftFurnace.java b/src/main/java/shift/sextiarysector/container/ContainerCraftFurnace.java new file mode 100644 index 0000000..ce34ae0 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerCraftFurnace.java @@ -0,0 +1,186 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.inventory.SlotFurnace; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.tileentity.TileEntityCraftFurnace; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ContainerCraftFurnace extends Container +{ + private TileEntityCraftFurnace tileFurnace; + private InventoryFurnaceCrafting craftMatrix; + private int lastCookTime; + private int lastBurnTime; + private int lastItemBurnTime; + + public ContainerCraftFurnace(InventoryPlayer p_i1812_1_, TileEntityCraftFurnace p_i1812_2_) + { + this.tileFurnace = p_i1812_2_; + this.craftMatrix = p_i1812_2_.craftMatrix; + this.addSlotToContainer(new Slot(p_i1812_2_, 0, 15, 46));//0 + this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 1, 135, 35));//1 + int i; + + for (i = 0; i < 3; ++i)//2-10 + { + for (int j = 0; j < 3; ++j) + { + this.addSlotToContainer(new Slot(this.craftMatrix, i + j * 3, 41 + i * 18, 17 + j * 18)); + } + } + + for (i = 0; i < 3; ++i)//11-37 + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1812_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i)//38-46 + { + this.addSlotToContainer(new Slot(p_i1812_1_, i, 8 + i * 18, 142)); + } + + + + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.tileFurnace.machineWorkProgressTime); + p_75132_1_.sendProgressBarUpdate(this, 1, this.tileFurnace.fuel); + p_75132_1_.sendProgressBarUpdate(this, 2, this.tileFurnace.fuelMax); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.lastCookTime != this.tileFurnace.machineWorkProgressTime) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.machineWorkProgressTime); + } + + if (this.lastBurnTime != this.tileFurnace.fuel) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.fuel); + } + + if (this.lastItemBurnTime != this.tileFurnace.fuelMax) + { + icrafting.sendProgressBarUpdate(this, 2, this.tileFurnace.fuelMax); + } + } + + this.lastCookTime = this.tileFurnace.machineWorkProgressTime; + this.lastBurnTime = this.tileFurnace.fuel; + this.lastItemBurnTime = this.tileFurnace.fuelMax; + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ == 0) + { + this.tileFurnace.machineWorkProgressTime = p_75137_2_; + } + + if (p_75137_1_ == 1) + { + this.tileFurnace.fuel = p_75137_2_; + } + + if (p_75137_1_ == 2) + { + this.tileFurnace.fuelMax = p_75137_2_; + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return this.tileFurnace.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ == 1) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if ( !(1<=p_82846_2_&& p_82846_2_ <= 10)) + { + if (tileFurnace.isItemFuel(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (p_82846_2_ >= 11 && p_82846_2_ < 38) + { + if (!this.mergeItemStack(itemstack1, 38, 46, false)) + { + return null; + } + } + else if (p_82846_2_ >= 38 && p_82846_2_ < 46 && !this.mergeItemStack(itemstack1, 11, 38, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 11, 46, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(p_82846_1_, itemstack1); + } + + return itemstack; + } +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerFluidGFMachineBase.java b/src/main/java/shift/sextiarysector/container/ContainerFluidGFMachineBase.java new file mode 100644 index 0000000..0be6b7e --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerFluidGFMachineBase.java @@ -0,0 +1,219 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.inventory.SlotFurnace; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.item.GearForceItemAPI; +import shift.sextiarysector.tileentity.TileEntityFluidFGFMachineBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ContainerFluidGFMachineBase extends Container +{ + private final TileEntityFluidFGFMachineBase tileFurnace; + private int lastWorkTime; + private int lastInPower; + private int lastInSpeed; + private int lastPower; + private int lastSpeed; + + //private int lastFluid; + //private int lastFluidID; + + public ContainerFluidGFMachineBase(InventoryPlayer p_i1812_1_, TileEntityFluidFGFMachineBase p_i1812_2_) + { + this.tileFurnace = p_i1812_2_; + this.addSlotToContainer(new Slot(p_i1812_2_, 0, 56, 17)); + this.addSlotToContainer(new SlotGF(p_i1812_2_, 1, 56, 53, this.tileFurnace.getMaxPowerStored(ForgeDirection.UP))); + this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 2, 107, 53)); + this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 3, 125, 53)); + this.addSlotToContainer(new SlotFluid(p_i1812_2_, 4, 152, 17)); + this.addSlotToContainer(new SlotFluid(p_i1812_2_, 5, 152, 53)); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1812_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1812_1_, i, 8 + i * 18, 142)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting par1ICrafting) + { + super.addCraftingToCrafters(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.machineWorkProgressTime); + par1ICrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.inPower); + par1ICrafting.sendProgressBarUpdate(this, 2, this.tileFurnace.inSpeed); + par1ICrafting.sendProgressBarUpdate(this, 3, this.tileFurnace.storage.getPowerStored()); + par1ICrafting.sendProgressBarUpdate(this, 4, this.tileFurnace.storage.getSpeedStored()); + } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + + if (this.lastWorkTime != this.tileFurnace.machineWorkProgressTime) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.machineWorkProgressTime); + } + + if (this.lastInPower != this.tileFurnace.inPower) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.inPower); + } + + if (this.lastInSpeed != this.tileFurnace.inSpeed) + { + icrafting.sendProgressBarUpdate(this, 2, this.tileFurnace.inSpeed); + } + + if (this.lastPower != this.tileFurnace.storage.getPowerStored()) + { + icrafting.sendProgressBarUpdate(this, 3, this.tileFurnace.storage.getPowerStored()); + } + + if (this.lastSpeed != this.tileFurnace.storage.getSpeedStored()) + { + icrafting.sendProgressBarUpdate(this, 4, this.tileFurnace.storage.getSpeedStored()); + } + + } + + this.lastWorkTime = this.tileFurnace.machineWorkProgressTime; + this.lastInPower = this.tileFurnace.inPower; + this.lastInSpeed = this.tileFurnace.inSpeed; + this.lastPower = this.tileFurnace.storage.getPowerStored(); + this.lastSpeed = this.tileFurnace.storage.getSpeedStored(); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) + { + if (par1 == 0) + { + this.tileFurnace.machineWorkProgressTime = par2; + } + + if (par1 == 1) + { + this.tileFurnace.inPower = par2; + } + + if (par1 == 2) + { + this.tileFurnace.inSpeed = par2; + } + + if (par1 == 3) + { + this.tileFurnace.storage.setPowerStored(par2); + } + + if (par1 == 4) + { + this.tileFurnace.storage.setEnergyStored(par2); + } + + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return this.tileFurnace.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (p_82846_2_ != 1 && p_82846_2_ != 0) + { + if (tileFurnace.getResult(itemstack1) != null) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (GearForceItemAPI.manager.isGearForceItem(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) + { + return null; + } + } + else if (p_82846_2_ >= 6 && p_82846_2_ < 33) + { + if (!this.mergeItemStack(itemstack1, 33, 42, false)) + { + return null; + } + } + else if (p_82846_2_ >= 33 && p_82846_2_ < 42 && !this.mergeItemStack(itemstack1, 6, 33, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 6, 42, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack) null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(p_82846_1_, itemstack1); + } + + return itemstack; + } +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerFluidMachineBase.java b/src/main/java/shift/sextiarysector/container/ContainerFluidMachineBase.java new file mode 100644 index 0000000..d202735 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerFluidMachineBase.java @@ -0,0 +1,218 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.inventory.SlotFurnace; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.FurnaceRecipes; +import net.minecraft.tileentity.TileEntityFurnace; +import shift.sextiarysector.tileentity.TileEntityFluidMachineBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ContainerFluidMachineBase extends Container +{ + private final TileEntityFluidMachineBase tileFurnace; + private int lastFuel; + private int lastFuelMax; + private int workProgress; + + //private int lastFluid; + //private int lastFluidID; + + public ContainerFluidMachineBase(InventoryPlayer p_i1812_1_, TileEntityFluidMachineBase p_i1812_2_) + { + this.tileFurnace = p_i1812_2_; + this.addSlotToContainer(new Slot(p_i1812_2_, 0, 56, 17)); + this.addSlotToContainer(new Slot(p_i1812_2_, 1, 56, 53)); + this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 2, 107, 53)); + this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 3, 125, 53)); + this.addSlotToContainer(new SlotFluid(p_i1812_2_, 4, 152, 17)); + this.addSlotToContainer(new SlotFluid(p_i1812_2_, 5, 152, 53)); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1812_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1812_1_, i, 8 + i * 18, 142)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.tileFurnace.fuel); + p_75132_1_.sendProgressBarUpdate(this, 1, this.tileFurnace.fuelMax); + p_75132_1_.sendProgressBarUpdate(this, 2, this.tileFurnace.machineWorkProgressTime); + p_75132_1_.sendProgressBarUpdate(this, 3, this.tileFurnace.getTank().getFluidAmount()); + if (this.tileFurnace.getTank().getFluid() != null) { + p_75132_1_.sendProgressBarUpdate(this, 4, this.tileFurnace.getTank().getFluid().getFluid().getID()); + } else { + p_75132_1_.sendProgressBarUpdate(this, 4, 0); + } + + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + + if (this.lastFuel != this.tileFurnace.fuel) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.fuel); + } + + if (this.lastFuelMax != this.tileFurnace.fuelMax) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.fuelMax); + } + + if (this.workProgress != this.tileFurnace.machineWorkProgressTime) + { + icrafting.sendProgressBarUpdate(this, 2, this.tileFurnace.machineWorkProgressTime); + } + + /*if (this.lastFluid != this.tileFurnace.getTank().getFluidAmount()) + { + icrafting.sendProgressBarUpdate(this, 3, this.tileFurnace.getTank().getFluidAmount()); + + ////if(this.tileFurnace.getTank().getFluidAmount()>0){ + // icrafting.sendProgressBarUpdate(this, 4, this.tileFurnace.getTank().getFluid().fluidID); + // } + + }*/ + } + + this.lastFuel = this.tileFurnace.fuel; + this.lastFuelMax = this.tileFurnace.fuelMax; + this.workProgress = this.tileFurnace.machineWorkProgressTime; + //this.lastFluid = this.tileFurnace.getTank().getFluidAmount(); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ == 0) + { + this.tileFurnace.fuel = p_75137_2_; + } + + if (p_75137_1_ == 1) + { + this.tileFurnace.fuelMax = p_75137_2_; + } + + if (p_75137_1_ == 2) + { + this.tileFurnace.machineWorkProgressTime = p_75137_2_; + } + + /*if (p_75137_1_ == 3) + { + this.tileFurnace.amount = p_75137_2_; + }*/ + + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return this.tileFurnace.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (p_82846_2_ != 1 && p_82846_2_ != 0) + { + if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (TileEntityFurnace.isItemFuel(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) + { + return null; + } + } + else if (p_82846_2_ >= 6 && p_82846_2_ < 33) + { + if (!this.mergeItemStack(itemstack1, 33, 42, false)) + { + return null; + } + } + else if (p_82846_2_ >= 33 && p_82846_2_ < 42 && !this.mergeItemStack(itemstack1, 6, 33, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 6, 42, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack) null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(p_82846_1_, itemstack1); + } + + return itemstack; + } +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerFreezer.java b/src/main/java/shift/sextiarysector/container/ContainerFreezer.java new file mode 100644 index 0000000..ff46830 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerFreezer.java @@ -0,0 +1,182 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.inventory.SlotFurnace; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.tileentity.TileEntityFreezer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ContainerFreezer extends Container +{ + private TileEntityFreezer tileFurnace; + private int lastCookTime; + private int lastBurnTime; + private int lastItemBurnTime; + + public ContainerFreezer(InventoryPlayer p_i1812_1_, TileEntityFreezer p_i1812_2_) + { + this.tileFurnace = p_i1812_2_; + this.addSlotToContainer(new Slot(p_i1812_2_, 0, 56, 53)); + this.addSlotToContainer(new Slot(p_i1812_2_, 1, 56, 17)); + this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 2, 116, 35)); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1812_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1812_1_, i, 8 + i * 18, 142)); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.tileFurnace.machineWorkProgressTime); + p_75132_1_.sendProgressBarUpdate(this, 1, this.tileFurnace.fuel); + p_75132_1_.sendProgressBarUpdate(this, 2, this.tileFurnace.fuelMax); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.lastCookTime != this.tileFurnace.machineWorkProgressTime) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.machineWorkProgressTime); + } + + if (this.lastBurnTime != this.tileFurnace.fuel) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.fuel); + } + + if (this.lastItemBurnTime != this.tileFurnace.fuelMax) + { + icrafting.sendProgressBarUpdate(this, 2, this.tileFurnace.fuelMax); + } + } + + this.lastCookTime = this.tileFurnace.machineWorkProgressTime; + this.lastBurnTime = this.tileFurnace.fuel; + this.lastItemBurnTime = this.tileFurnace.fuelMax; + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ == 0) + { + this.tileFurnace.machineWorkProgressTime = p_75137_2_; + } + + if (p_75137_1_ == 1) + { + this.tileFurnace.fuel = p_75137_2_; + } + + if (p_75137_1_ == 2) + { + this.tileFurnace.fuelMax = p_75137_2_; + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return this.tileFurnace.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (p_82846_2_ != 1 && p_82846_2_ != 0) + { + if (SSRecipes.freezer.getResult(itemstack1) != null) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (tileFurnace.isItemFuel(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) + { + return null; + } + } + else if (p_82846_2_ >= 3 && p_82846_2_ < 30) + { + if (!this.mergeItemStack(itemstack1, 30, 39, false)) + { + return null; + } + } + else if (p_82846_2_ >= 30 && p_82846_2_ < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 3, 39, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(p_82846_1_, itemstack1); + } + + return itemstack; + } +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerFunnel.java b/src/main/java/shift/sextiarysector/container/ContainerFunnel.java new file mode 100644 index 0000000..3296490 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerFunnel.java @@ -0,0 +1,210 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.tileentity.TileEntityFunnel; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ContainerFunnel extends Container +{ + private final TileEntityFunnel tileFurnace; + + //private int lastFluid; + private int lastFluidID; + private int lastFluidAmount; + + public ContainerFunnel(InventoryPlayer p_i1812_1_, TileEntityFunnel p_i1812_2_) + { + this.tileFurnace = p_i1812_2_; + //this.addSlotToContainer(new Slot(p_i1812_2_, 0, 56, 17)); + //this.addSlotToContainer(new Slot(p_i1812_2_, 1, 56, 53)); + //this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 2, 107, 53)); + //this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 3, 125, 53)); + this.addSlotToContainer(new SlotFluid(p_i1812_2_, 0, 26, 20)); + this.addSlotToContainer(new SlotFluid(p_i1812_2_, 1, 134, 20)); + int i; + + byte b0 = 51; + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1812_1_, j + i * 9 + 9, 8 + j * 18, i * 18 + b0)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1812_1_, i, 8 + i * 18, 58 + b0)); + } + } + + @Override + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + if (this.tileFurnace.getFluidStack() == null) { + p_75132_1_.sendProgressBarUpdate(this, 0, 0); + p_75132_1_.sendProgressBarUpdate(this, 1, 0); + } else { + p_75132_1_.sendProgressBarUpdate(this, 0, this.tileFurnace.getFluidStack().getFluid().getID()); + p_75132_1_.sendProgressBarUpdate(this, 1, this.tileFurnace.getFluidStack().amount); + } + + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + + if (this.lastFluidAmount != this.tileFurnace.tank.getFluidAmount()) + { + if (this.tileFurnace.getFluidStack() == null) { + icrafting.sendProgressBarUpdate(this, 0, 0); + icrafting.sendProgressBarUpdate(this, 1, 0); + } else { + icrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.getFluidStack().getFluid().getID()); + icrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.getFluidStack().amount); + } + } + + } + + this.lastFluidAmount = this.tileFurnace.tank.getFluidAmount(); + + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + + if (p_75137_1_ == 0 || p_75137_1_ == 1) + { + + if (p_75137_2_ == 0) { + this.tileFurnace.tank.setFluid(null); + return; + } + + if (this.tileFurnace.getFluidStack() == null) { + + if (p_75137_1_ == 0) { + + this.tileFurnace.tank.setFluid(new FluidStack(p_75137_2_, 1)); + + } else if (p_75137_1_ == 1) { + + this.tileFurnace.tank.setFluid(new FluidStack(1, p_75137_2_)); + + } + + } else { + + if (p_75137_1_ == 0) { + + //this.tileFurnace.tank.getFluid(). = p_75137_2_; + this.tileFurnace.tank.setFluid(new FluidStack(p_75137_2_, 1)); + + } else if (p_75137_1_ == 1) { + + this.tileFurnace.tank.getFluid().amount = p_75137_2_; + + } + + } + + } + + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return this.tileFurnace.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ == 1) + { + if (!this.mergeItemStack(itemstack1, 2, 38, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (p_82846_2_ != 1 && p_82846_2_ != 0) + { + if (FluidContainerRegistry.isContainer(itemstack)) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (p_82846_2_ >= 2 && p_82846_2_ < 29) + { + if (!this.mergeItemStack(itemstack1, 29, 38, false)) + { + return null; + } + } + else if (p_82846_2_ >= 29 && p_82846_2_ < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 2, 38, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack) null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(p_82846_1_, itemstack1); + } + + return itemstack; + } +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerGFTank.java b/src/main/java/shift/sextiarysector/container/ContainerGFTank.java index a9207c1..f77d86b 100644 --- a/src/main/java/shift/sextiarysector/container/ContainerGFTank.java +++ b/src/main/java/shift/sextiarysector/container/ContainerGFTank.java @@ -6,7 +6,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -import shift.sextiarysector.api.machine.item.GearForceItem; +import shift.sextiarysector.api.gearforce.item.GearForceItemAPI; import shift.sextiarysector.tileentity.TileEntityGFTank; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -189,7 +189,7 @@ else if (par2 != 1 && par2 != 0) return null; } } - else */if (GearForceItem.manager.isGearForceItem(itemstack1)) + else */if (GearForceItemAPI.manager.isGearForceItem(itemstack1)) { if (!this.mergeItemStack(itemstack1, 1, 2, false)) { diff --git a/src/main/java/shift/sextiarysector/container/ContainerLargeFurnace.java b/src/main/java/shift/sextiarysector/container/ContainerLargeFurnace.java index 53a8f7a..8b831fd 100644 --- a/src/main/java/shift/sextiarysector/container/ContainerLargeFurnace.java +++ b/src/main/java/shift/sextiarysector/container/ContainerLargeFurnace.java @@ -12,228 +12,240 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ContainerLargeFurnace extends Container{ +public class ContainerLargeFurnace extends Container { public InventoryFurnaceCrafting craftMatrix;// = new InventoryCrafting(this, 3, 3); public InventoryBuffer buffer; private final TileEntityLargeFurnace furnace; - private int lastCookTime; - private int lastBurnTime; - private int lastItemBurnTime; - - public ContainerLargeFurnace(InventoryPlayer par1InventoryPlayer, TileEntityLargeFurnace par2TileEntityFurnace) - { - this.furnace = par2TileEntityFurnace; - this.craftMatrix = par2TileEntityFurnace.craftMatrix; - this.buffer = par2TileEntityFurnace.buffer; - this.craftMatrix.setEventHandler(this); - //this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 56, 17)); - //2 1 - this.addSlotToContainer(new Slot(par2TileEntityFurnace, 18, 15, 46));//1 - this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityFurnace, 19, 135, 35));//2 - int i; - - //9 10 - for (int l = 0; l < 3; ++l) - { - for (int i1 = 0; i1 < 3; ++i1) - { - this.addSlotToContainer(new Slot(this.craftMatrix, i1 + l * 3, 41 + i1 * 18, 17 + l * 18)); - } - } - - //Buffer 18 28 - for (i = 0; i < 9; ++i) - { - this.addSlotToContainer(new Slot(buffer, i, 8 + i * 18, 88)); - } - for (i = 9; i < 18; ++i) - { - this.addSlotToContainer(new Slot(buffer, i, 8 + (i-9) * 18, 108)); - } - - //27 55 - for (i = 0; i < 3; ++i) - { - for (int j = 0; j < 9; ++j) - { - this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84+56 + i * 18)); - } - } - - //9 64 - for (i = 0; i < 9; ++i) - { - this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142+56)); - } - } - - @Override + private int lastCookTime; + private int lastBurnTime; + private int lastItemBurnTime; + + public ContainerLargeFurnace(InventoryPlayer par1InventoryPlayer, TileEntityLargeFurnace par2TileEntityFurnace) + { + this.furnace = par2TileEntityFurnace; + this.craftMatrix = par2TileEntityFurnace.craftMatrix; + this.buffer = par2TileEntityFurnace.buffer; + this.craftMatrix.setEventHandler(this); + //this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 56, 17)); + //2 1 + this.addSlotToContainer(new Slot(par2TileEntityFurnace, 18, 15, 46));//1 + this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityFurnace, 19, 135, 35));//2 + int i; + + //9 10 + for (int l = 0; l < 3; ++l) + { + for (int i1 = 0; i1 < 3; ++i1) + { + this.addSlotToContainer(new Slot(this.craftMatrix, i1 + l * 3, 41 + i1 * 18, 17 + l * 18)); + } + } + + //Buffer 18 28 + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(buffer, i, 8 + i * 18, 88)); + } + for (i = 9; i < 18; ++i) + { + this.addSlotToContainer(new Slot(buffer, i, 8 + (i - 9) * 18, 108)); + } + + //27 55 + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + 56 + i * 18)); + } + } + + //9 64 + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142 + 56)); + } + } + + @Override public void addCraftingToCrafters(ICrafting par1ICrafting) - { - super.addCraftingToCrafters(par1ICrafting); - par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); - par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); - par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); - } - - /** - * Looks for changes made in the container, sends them to every listener. - */ - @Override + { + super.addCraftingToCrafters(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); + par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); + par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + @Override public void detectAndSendChanges() - { - super.detectAndSendChanges(); - - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - - if (this.lastCookTime != this.furnace.furnaceCookTime) - { - icrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); - } - - if (this.lastBurnTime != this.furnace.furnaceBurnTime) - { - icrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); - } - - if (this.lastItemBurnTime != this.furnace.currentItemBurnTime) - { - icrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); - } - } - - this.lastCookTime = this.furnace.furnaceCookTime; - this.lastBurnTime = this.furnace.furnaceBurnTime; - this.lastItemBurnTime = this.furnace.currentItemBurnTime; - } - - @Override + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + + if (this.lastCookTime != this.furnace.furnaceCookTime) + { + icrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); + } + + if (this.lastBurnTime != this.furnace.furnaceBurnTime) + { + icrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); + } + + if (this.lastItemBurnTime != this.furnace.currentItemBurnTime) + { + icrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); + } + } + + this.lastCookTime = this.furnace.furnaceCookTime; + this.lastBurnTime = this.furnace.furnaceBurnTime; + this.lastItemBurnTime = this.furnace.currentItemBurnTime; + } + + @Override @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) - { - if (par1 == 0) - { - this.furnace.furnaceCookTime = par2; - } - - if (par1 == 1) - { - this.furnace.furnaceBurnTime = par2; - } - - if (par1 == 2) - { - this.furnace.currentItemBurnTime = par2; - } - } - - @Override + public void updateProgressBar(int par1, int par2) + { + if (par1 == 0) + { + this.furnace.furnaceCookTime = par2; + } + + if (par1 == 1) + { + this.furnace.furnaceBurnTime = par2; + } + + if (par1 == 2) + { + this.furnace.currentItemBurnTime = par2; + } + } + + @Override public boolean canInteractWith(EntityPlayer par1EntityPlayer) - { - return this.furnace.isUseableByPlayer(par1EntityPlayer); - } - - /** - * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. - */ - @Override + { + return this.furnace.isUseableByPlayer(par1EntityPlayer); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + @Override public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) - { - ItemStack itemstack = null; - Slot slot = (Slot)this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) - { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - - if (par2 == 1) - { - if (!this.mergeItemStack(itemstack1, 29, 65, true)) - { - return null; - } - - slot.onSlotChange(itemstack1, itemstack); - } - else if (par2 >= 11 && par2 <= 64) - { - if (TileEntityFurnace.isItemFuel(itemstack1)) - { - - - if(par2<=19){ - if (!this.mergeItemStack(itemstack1, 0, 1, false)) - { - return null; - } - } - else if (!this.mergeItemStack(itemstack1, 11, 20, false)) - { - if (!this.mergeItemStack(itemstack1, 20, 65, false)) - { - return null; - } - } - } - else if (par2 >= 11 && par2 <= 28) - { - if (!this.mergeItemStack(itemstack1, 29, 65, false)) - { - return null; - } - }else if (par2 >= 29 && par2 <= 55) - { - if (!this.mergeItemStack(itemstack1, 11, 20, false)) - { - - if (!this.mergeItemStack(itemstack1, 56, 65, false)) - { - return null; - } - - } - }else if (par2 >= 56 && par2 <= 64) - { - if (!this.mergeItemStack(itemstack1, 11,20, false)) - { - - if (!this.mergeItemStack(itemstack1, 29, 56, false)) - { - return null; - } - - } - } - } - else if (!this.mergeItemStack(itemstack1, 29, 65, false)) - { - return null; - } - - if (itemstack1.stackSize == 0) - { - slot.putStack((ItemStack)null); - } - else - { - slot.onSlotChanged(); - } - - - if (itemstack1.stackSize == itemstack.stackSize) - { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - - return itemstack; - } + { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(par2); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (par2 == 1) + { + if (!this.mergeItemStack(itemstack1, 29, 65, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (par2 >= 11 && par2 <= 64) + { + if (TileEntityFurnace.isItemFuel(itemstack1)) + { + + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + //else if (!this.mergeItemStack(itemstack1, 11, 20, false)) { + + // return null; + + //} + + // if (par2 <= 19) { + // if (!this.mergeItemStack(itemstack1, 0, 1, false)) + // { + // return null; + // } + // } + // else if (!this.mergeItemStack(itemstack1, 11, 65, false)) { + // return null; + // } + // else if (!this.mergeItemStack(itemstack1, 11, 20, false)) + // { + // if (!this.mergeItemStack(itemstack1, 20, 65, false)) + // { + // return null; + // } + // } + + } + else if (par2 >= 11 && par2 <= 28) + { + if (!this.mergeItemStack(itemstack1, 29, 65, false)) + { + return null; + } + } else if (par2 >= 29 && par2 <= 55) + { + if (!this.mergeItemStack(itemstack1, 11, 20, false)) + { + + if (!this.mergeItemStack(itemstack1, 56, 65, false)) + { + return null; + } + + } + } else if (par2 >= 56 && par2 <= 64) + { + if (!this.mergeItemStack(itemstack1, 11, 20, false)) + { + + if (!this.mergeItemStack(itemstack1, 29, 56, false)) + { + return null; + } + + } + } + } + else if (!this.mergeItemStack(itemstack1, 29, 65, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack) null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(par1EntityPlayer, itemstack1); + } + + return itemstack; + } } diff --git a/src/main/java/shift/sextiarysector/container/ContainerMPRepair.java b/src/main/java/shift/sextiarysector/container/ContainerMPRepair.java new file mode 100644 index 0000000..797f2e4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerMPRepair.java @@ -0,0 +1,465 @@ +package shift.sextiarysector.container; + +import java.lang.reflect.Field; +import java.util.Iterator; +import java.util.Map; + +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.ContainerRepair; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; +import shift.mceconomy2.api.MCEconomyAPI; +import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ContainerMPRepair extends ContainerRepair { + + private final Field _outputSlot = ReflectionHelper.findField(ContainerRepair.class, "outputSlot", "field_82852_f"); + private final Field _inputSlots = ReflectionHelper.findField(ContainerRepair.class, "inputSlots", "field_82853_g"); + private final Field _materialCost = ReflectionHelper.findField(ContainerRepair.class, "materialCost", "stackSizeToBeUsedInRepair", "field_82856_l"); + private final EntityPlayer thePlayer; + + private final IInventory outputSlot, inputSlots; + private final int materialCost; + + public ContainerMPRepair(InventoryPlayer p_i1800_1_, final World p_i1800_2_, final int p_i1800_3_, final int p_i1800_4_, final int p_i1800_5_, EntityPlayer p_i1800_6_) + { + super(p_i1800_1_, p_i1800_2_, p_i1800_3_, p_i1800_4_, p_i1800_5_, p_i1800_6_); + this.thePlayer = p_i1800_6_; + + try { + outputSlot = (IInventory) _outputSlot.get(this); + inputSlots = (IInventory) _inputSlots.get(this); + materialCost = _materialCost.getInt(this); + } catch (Exception e) { + throw new RuntimeException(e); + } + + this.addSlotToContainer(new Slot(this.inputSlots, 0, 27, 47)); + this.addSlotToContainer(new Slot(this.inputSlots, 1, 76, 47)); + this.addSlotToContainer(new Slot(this.outputSlot, 2, 134, 47) + { + private static final String __OBFID = "CL_00001734"; + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + @Override + public boolean isItemValid(ItemStack p_75214_1_) + { + return false; + } + + /** + * Return whether this slot's stack can be taken from this slot. + */ + @Override + public boolean canTakeStack(EntityPlayer p_82869_1_) + { + return (p_82869_1_.capabilities.isCreativeMode || MCEconomyAPI.getPlayerMP(p_82869_1_) >= ContainerMPRepair.this.maximumCost) && ContainerMPRepair.this.maximumCost > 0 && this.getHasStack(); + } + + @Override + public void onPickupFromSlot(EntityPlayer p_82870_1_, ItemStack p_82870_2_) + { + if (!p_82870_1_.capabilities.isCreativeMode) + { + //p_82870_1_.addExperienceLevel(-ContainerMPRepair.this.maximumCost); + MCEconomyAPI.reducePlayerMP(p_82870_1_, ContainerMPRepair.this.maximumCost, false); + } + + float breakChance = ForgeHooks.onAnvilRepair(p_82870_1_, p_82870_2_, ContainerMPRepair.this.inputSlots.getStackInSlot(0), ContainerMPRepair.this.inputSlots.getStackInSlot(1)); + + ContainerMPRepair.this.inputSlots.setInventorySlotContents(0, (ItemStack) null); + + if (ContainerMPRepair.this.stackSizeToBeUsedInRepair > 0) + { + ItemStack itemstack1 = ContainerMPRepair.this.inputSlots.getStackInSlot(1); + + if (itemstack1 != null && itemstack1.stackSize > ContainerMPRepair.this.stackSizeToBeUsedInRepair) + { + itemstack1.stackSize -= ContainerMPRepair.this.stackSizeToBeUsedInRepair; + ContainerMPRepair.this.inputSlots.setInventorySlotContents(1, itemstack1); + } + else + { + ContainerMPRepair.this.inputSlots.setInventorySlotContents(1, (ItemStack) null); + } + } + else + { + ContainerMPRepair.this.inputSlots.setInventorySlotContents(1, (ItemStack) null); + } + + ContainerMPRepair.this.maximumCost = 0; + + if (!p_82870_1_.capabilities.isCreativeMode && !p_i1800_2_.isRemote && p_i1800_2_.getBlock(p_i1800_3_, p_i1800_4_, p_i1800_5_) == Blocks.anvil && p_82870_1_.getRNG().nextFloat() < breakChance) + { + int i1 = p_i1800_2_.getBlockMetadata(p_i1800_3_, p_i1800_4_, p_i1800_5_); + int k = i1 & 3; + int l = i1 >> 2; + ++l; + + if (l > 2) + { + p_i1800_2_.setBlockToAir(p_i1800_3_, p_i1800_4_, p_i1800_5_); + p_i1800_2_.playAuxSFX(1020, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0); + } + else + { + p_i1800_2_.setBlockMetadataWithNotify(p_i1800_3_, p_i1800_4_, p_i1800_5_, k | l << 2, 2); + p_i1800_2_.playAuxSFX(1021, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0); + } + } + else if (!p_i1800_2_.isRemote) + { + p_i1800_2_.playAuxSFX(1021, p_i1800_3_, p_i1800_4_, p_i1800_5_, 0); + } + } + }); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1800_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1800_1_, i, 8 + i * 18, 142)); + } + } + + /** + * Callback for when the crafting matrix is changed. + */ + @Override + public void onCraftMatrixChanged(IInventory p_75130_1_) + { + super.onCraftMatrixChanged(p_75130_1_); + + if (p_75130_1_ == this.inputSlots) + { + this.updateRepairOutput(); + } + } + + /** + * called when the Anvil Input Slot changes, calculates the new result and puts it in the output slot + */ + @Override + public void updateRepairOutput() + { + ItemStack itemstack = this.inputSlots.getStackInSlot(0); + this.maximumCost = 0; + int i = 0; + byte b0 = 0; + int j = 0; + + if (itemstack == null) + { + this.outputSlot.setInventorySlotContents(0, (ItemStack) null); + this.maximumCost = 0; + } + else + { + ItemStack itemstack1 = itemstack.copy(); + ItemStack itemstack2 = this.inputSlots.getStackInSlot(1); + Map map = EnchantmentHelper.getEnchantments(itemstack1); + boolean flag = false; + int k2 = b0 + itemstack.getRepairCost() + (itemstack2 == null ? 0 : itemstack2.getRepairCost()); + this.stackSizeToBeUsedInRepair = 0; + int k; + int l; + int i1; + int k1; + int l1; + Iterator iterator1; + Enchantment enchantment; + + if (itemstack2 != null) + { + //if (!ForgeHooks.onAnvilChange(this, itemstack, itemstack2, outputSlot, repairedItemName, k2)) return; + flag = itemstack2.getItem() == Items.enchanted_book && Items.enchanted_book.func_92110_g(itemstack2).tagCount() > 0; + + if (itemstack1.isItemStackDamageable() && itemstack1.getItem().getIsRepairable(itemstack, itemstack2)) + { + k = Math.min(itemstack1.getItemDamageForDisplay(), itemstack1.getMaxDamage() / 4); + + if (k <= 0) + { + this.outputSlot.setInventorySlotContents(0, (ItemStack) null); + this.maximumCost = 0; + return; + } + + for (l = 0; k > 0 && l < itemstack2.stackSize; ++l) + { + i1 = itemstack1.getItemDamageForDisplay() - k; + itemstack1.setItemDamage(i1); + i += Math.max(1, k / 100) + map.size(); + k = Math.min(itemstack1.getItemDamageForDisplay(), itemstack1.getMaxDamage() / 4); + } + + this.stackSizeToBeUsedInRepair = l; + } + else + { + if (!flag && (itemstack1.getItem() != itemstack2.getItem() || !itemstack1.isItemStackDamageable())) + { + this.outputSlot.setInventorySlotContents(0, (ItemStack) null); + this.maximumCost = 0; + return; + } + + if (itemstack1.isItemStackDamageable() && !flag) + { + k = itemstack.getMaxDamage() - itemstack.getItemDamageForDisplay(); + l = itemstack2.getMaxDamage() - itemstack2.getItemDamageForDisplay(); + i1 = l + itemstack1.getMaxDamage() * 12 / 100; + int j1 = k + i1; + k1 = itemstack1.getMaxDamage() - j1; + + if (k1 < 0) + { + k1 = 0; + } + + if (k1 < itemstack1.getItemDamage()) + { + itemstack1.setItemDamage(k1); + i += Math.max(1, i1 / 100); + } + } + + Map map1 = EnchantmentHelper.getEnchantments(itemstack2); + iterator1 = map1.keySet().iterator(); + + while (iterator1.hasNext()) + { + i1 = ((Integer) iterator1.next()).intValue(); + enchantment = Enchantment.enchantmentsList[i1]; + k1 = map.containsKey(Integer.valueOf(i1)) ? ((Integer) map.get(Integer.valueOf(i1))).intValue() : 0; + l1 = ((Integer) map1.get(Integer.valueOf(i1))).intValue(); + int i3; + + if (k1 == l1) + { + ++l1; + i3 = l1; + } + else + { + i3 = Math.max(l1, k1); + } + + l1 = i3; + int i2 = l1 - k1; + boolean flag1 = enchantment.canApply(itemstack); + + if (this.thePlayer.capabilities.isCreativeMode || itemstack.getItem() == Items.enchanted_book) + { + flag1 = true; + } + + Iterator iterator = map.keySet().iterator(); + + while (iterator.hasNext()) + { + int j2 = ((Integer) iterator.next()).intValue(); + + if (j2 != i1 && !enchantment.canApplyTogether(Enchantment.enchantmentsList[j2])) + { + flag1 = false; + i += i2; + } + } + + if (flag1) + { + if (l1 > enchantment.getMaxLevel()) + { + l1 = enchantment.getMaxLevel(); + } + + map.put(Integer.valueOf(i1), Integer.valueOf(l1)); + int l2 = 0; + + switch (enchantment.getWeight()) + { + case 1: + l2 = 8; + break; + case 2: + l2 = 4; + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + default: + break; + case 5: + l2 = 2; + break; + case 10: + l2 = 1; + } + + if (flag) + { + l2 = Math.max(1, l2 / 2); + } + + i += l2 * i2; + } + } + } + } + /* + if (StringUtils.isBlank(this.repairedItemName)) + { + if (itemstack.hasDisplayName()) + { + j = itemstack.isItemStackDamageable() ? 7 : itemstack.stackSize * 5; + i += j; + itemstack1.func_135074_t(); + } + } + else if (!this.repairedItemName.equals(itemstack.getDisplayName())) + { + j = itemstack.isItemStackDamageable() ? 7 : itemstack.stackSize * 5; + i += j; + + if (itemstack.hasDisplayName()) + { + k2 += j / 2; + } + + itemstack1.setStackDisplayName(this.repairedItemName); + }*/ + + k = 0; + + for (iterator1 = map.keySet().iterator(); iterator1.hasNext(); k2 += k + k1 * l1) + { + i1 = ((Integer) iterator1.next()).intValue(); + enchantment = Enchantment.enchantmentsList[i1]; + k1 = ((Integer) map.get(Integer.valueOf(i1))).intValue(); + l1 = 0; + ++k; + + switch (enchantment.getWeight()) + { + case 1: + l1 = 8; + break; + case 2: + l1 = 4; + case 3: + case 4: + case 6: + case 7: + case 8: + case 9: + default: + break; + case 5: + l1 = 2; + break; + case 10: + l1 = 1; + } + + if (flag) + { + l1 = Math.max(1, l1 / 2); + } + } + + if (flag) + { + k2 = Math.max(1, k2 / 2); + } + + if (flag && !itemstack1.getItem().isBookEnchantable(itemstack1, itemstack2)) itemstack1 = null; + + this.maximumCost = k2 + i; + this.maximumCost *= 100; + + if (i <= 0) + { + itemstack1 = null; + } + + if (j == i && j > 0 && this.maximumCost >= 10000) + { + this.maximumCost = 9999; + } + + if (this.maximumCost >= 10000 && !this.thePlayer.capabilities.isCreativeMode) + { + itemstack1 = null; + } + + if (itemstack1 != null) + { + l = itemstack1.getRepairCost(); + + if (itemstack2 != null && l < itemstack2.getRepairCost()) + { + l = itemstack2.getRepairCost(); + } + + if (itemstack1.hasDisplayName()) + { + l -= 9; + } + + if (l < 0) + { + l = 0; + } + + l += 2; + itemstack1.setRepairCost(l); + EnchantmentHelper.setEnchantments(map, itemstack1); + } + + this.outputSlot.setInventorySlotContents(0, itemstack1); + this.detectAndSendChanges(); + } + } + + @Override + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 1, this.maximumCost); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ == 1) + { + this.maximumCost = p_75137_2_; + } + } + +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerMagicFurnace.java b/src/main/java/shift/sextiarysector/container/ContainerMagicFurnace.java new file mode 100644 index 0000000..fd3aaa5 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerMagicFurnace.java @@ -0,0 +1,182 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.inventory.SlotFurnace; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.tileentity.TileEntityMagicFurnace; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ContainerMagicFurnace extends Container +{ + private TileEntityMagicFurnace tileFurnace; + private int lastCookTime; + private int lastBurnTime; + private int lastItemBurnTime; + + public ContainerMagicFurnace(InventoryPlayer p_i1812_1_, TileEntityMagicFurnace p_i1812_2_) + { + this.tileFurnace = p_i1812_2_; + this.addSlotToContainer(new Slot(p_i1812_2_, 0, 56, 17)); + this.addSlotToContainer(new Slot(p_i1812_2_, 1, 56, 53)); + this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 2, 116, 35)); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1812_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1812_1_, i, 8 + i * 18, 142)); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + p_75132_1_.sendProgressBarUpdate(this, 0, this.tileFurnace.machineWorkProgressTime); + p_75132_1_.sendProgressBarUpdate(this, 1, this.tileFurnace.fuel); + p_75132_1_.sendProgressBarUpdate(this, 2, this.tileFurnace.fuelMax); + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting)this.crafters.get(i); + + if (this.lastCookTime != this.tileFurnace.machineWorkProgressTime) + { + icrafting.sendProgressBarUpdate(this, 0, this.tileFurnace.machineWorkProgressTime); + } + + if (this.lastBurnTime != this.tileFurnace.fuel) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileFurnace.fuel); + } + + if (this.lastItemBurnTime != this.tileFurnace.fuelMax) + { + icrafting.sendProgressBarUpdate(this, 2, this.tileFurnace.fuelMax); + } + } + + this.lastCookTime = this.tileFurnace.machineWorkProgressTime; + this.lastBurnTime = this.tileFurnace.fuel; + this.lastItemBurnTime = this.tileFurnace.fuelMax; + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + if (p_75137_1_ == 0) + { + this.tileFurnace.machineWorkProgressTime = p_75137_2_; + } + + if (p_75137_1_ == 1) + { + this.tileFurnace.fuel = p_75137_2_; + } + + if (p_75137_1_ == 2) + { + this.tileFurnace.fuelMax = p_75137_2_; + } + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return this.tileFurnace.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (p_82846_2_ != 1 && p_82846_2_ != 0) + { + if (SSRecipes.magicFurnace.getResult(itemstack1) != null) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (tileFurnace.isItemFuel(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) + { + return null; + } + } + else if (p_82846_2_ >= 3 && p_82846_2_ < 30) + { + if (!this.mergeItemStack(itemstack1, 30, 39, false)) + { + return null; + } + } + else if (p_82846_2_ >= 30 && p_82846_2_ < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 3, 39, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(p_82846_1_, itemstack1); + } + + return itemstack; + } +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerPlayerNext.java b/src/main/java/shift/sextiarysector/container/ContainerPlayerNext.java new file mode 100644 index 0000000..bc34789 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerPlayerNext.java @@ -0,0 +1,347 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; +import shift.sextiarysector.player.EntityPlayerManager; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ContainerPlayerNext extends Container { + + public InventoryPlayerNext equipment; + private EntityPlayer player; + + public ContainerPlayerNext(InventoryPlayer par1InventoryPlayer, EntityPlayer p_i1819_3_) + { + //this.equipment = par2TileEntityFurnace; + this.player = p_i1819_3_; + this.equipment = EntityPlayerManager.getEquipmentStats(p_i1819_3_).inventory; + + /* + int c = 0 ; + for(int i = 0;i<5;i++){ + + for(int j =0;j<4;j++){ + this.addSlotToContainer(new Slot(this.equipment,c, 80 + i * 18, 8 + j * 18)); + c++; + } + + }*/ + + //繝舌ル繝ゥ + + int i; + + //0 + for (i = 0; i < 4; ++i) + { + final int k = i; + this.addSlotToContainer(new Slot(par1InventoryPlayer, par1InventoryPlayer.getSizeInventory() - 1 - i, 8, 8 + i * 18) + { + private static final String __OBFID = "CL_00001755"; + + /** + * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 + * in the case of armor slots) + */ + @Override + public int getSlotStackLimit() + { + return 1; + } + + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + @Override + public boolean isItemValid(ItemStack p_75214_1_) + { + if (p_75214_1_ == null) return false; + return p_75214_1_.getItem().isValidArmor(p_75214_1_, k, player); + } + + /** + * Returns the icon index on items.png that is used as background image of the slot. + */ + @Override + @SideOnly(Side.CLIENT) + public IIcon getBackgroundIconIndex() + { + return ItemArmor.func_94602_b(k); + } + }); + } + + //4 + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142)); + } + + //13 + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + //40 + + this.addSlotToContainer(new SlotEquipment(EquipmentType.DecorationHelmet, this.equipment, 0, 80 + 0 * 18, 8 + 0 * 18) { + + @Override + public int getSlotStackLimit() + { + return 1; + } + + @Override + public boolean isItemValid(ItemStack p_75214_1_) + { + if (p_75214_1_ == null) return false; + return p_75214_1_.getItem().isValidArmor(p_75214_1_, 0, player); + } + + @Override + public boolean canTakeStack(EntityPlayer player) { + return true; + } + + }); + + this.addSlotToContainer(new SlotEquipment(EquipmentType.DecorationPlate, this.equipment, 1, 80 + 0 * 18, 8 + 1 * 18) { + + @Override + public int getSlotStackLimit() + { + return 1; + } + + @Override + public boolean isItemValid(ItemStack p_75214_1_) + { + if (p_75214_1_ == null) return false; + return p_75214_1_.getItem().isValidArmor(p_75214_1_, 1, player); + } + + @Override + public boolean canTakeStack(EntityPlayer player) { + return true; + } + + }); + this.addSlotToContainer(new SlotEquipment(EquipmentType.DecorationLegs, this.equipment, 2, 80 + 0 * 18, 8 + 2 * 18) { + + @Override + public int getSlotStackLimit() + { + return 1; + } + + @Override + public boolean isItemValid(ItemStack p_75214_1_) + { + if (p_75214_1_ == null) return false; + return p_75214_1_.getItem().isValidArmor(p_75214_1_, 2, player); + } + + @Override + public boolean canTakeStack(EntityPlayer player) { + return true; + } + + }); + this.addSlotToContainer(new SlotEquipment(EquipmentType.DecorationBoots, this.equipment, 3, 80 + 0 * 18, 8 + 3 * 18) { + + @Override + public int getSlotStackLimit() + { + return 1; + } + + @Override + public boolean isItemValid(ItemStack p_75214_1_) + { + if (p_75214_1_ == null) return false; + return p_75214_1_.getItem().isValidArmor(p_75214_1_, 3, player); + } + + @Override + public boolean canTakeStack(EntityPlayer player) { + return true; + } + + }); + + //this.addSlotToContainer(new SlotEquipment(EquipmentType.Necklace, this.equipment, 4, 80 + 1 * 18, 8 + 0 * 18)); + //this.addSlotToContainer(new Slot(this.equipment,0, 80 + 0 * 18, 8 + 0 * 18)); + + //this.addSlotToContainer(new SlotEquipment(EquipmentType.Ring, this.equipment, 5, 80 + 1 * 18, 8 + 1 * 18)); + //this.addSlotToContainer(new SlotEquipment(EquipmentType.Ring, this.equipment, 6, 80 + 1 * 18, 8 + 2 * 18)); + //this.addSlotToContainer(new SlotEquipment(EquipmentType.Ring, this.equipment, 7, 80 + 1 * 18, 8 + 3 * 18)); + + this.addSlotToContainer(new SlotEquipment(EquipmentType.Face, this.equipment, 4, 80 + 1 * 18, 8 + 0 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Bag, this.equipment, 5, 80 + 1 * 18, 8 + 1 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Hand, this.equipment, 6, 80 + 1 * 18, 8 + 2 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Belt, this.equipment, 7, 80 + 1 * 18, 8 + 3 * 18)); + + this.addSlotToContainer(new SlotEquipment(EquipmentType.Unit, this.equipment, 8, 80 + 2 * 18, 8 + 0 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Unit, this.equipment, 9, 80 + 2 * 18, 8 + 1 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Unit, this.equipment, 10, 80 + 2 * 18, 8 + 2 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Unit, this.equipment, 11, 80 + 2 * 18, 8 + 3 * 18)); + + this.addSlotToContainer(new SlotEquipment(EquipmentType.Unit, this.equipment, 12, 80 + 3 * 18, 8 + 0 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Unit, this.equipment, 13, 80 + 3 * 18, 8 + 1 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Unit, this.equipment, 14, 80 + 3 * 18, 8 + 2 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Unit, this.equipment, 15, 80 + 3 * 18, 8 + 3 * 18)); + + this.addSlotToContainer(new SlotEquipment(EquipmentType.Other, this.equipment, 16, 80 + 4 * 18, 8 + 0 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Other, this.equipment, 17, 80 + 4 * 18, 8 + 1 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Other, this.equipment, 18, 80 + 4 * 18, 8 + 2 * 18)); + this.addSlotToContainer(new SlotEquipment(EquipmentType.Other, this.equipment, 19, 80 + 4 * 18, 8 + 3 * 18)); + + //60 + + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + + /* + public ItemStack slotClick(int p_75144_1_, int p_75144_2_, int p_75144_3_, EntityPlayer p_75144_4_) + { + return super.slotClick(p_75144_1_, p_75144_2_, p_75144_3_, p_75144_4_); + }*/ + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (!((0 <= p_82846_2_ && p_82846_2_ <= 3) || (40 <= p_82846_2_ && p_82846_2_ <= 60))) { + + if (itemstack.getItem() instanceof ItemArmor && !((Slot) this.inventorySlots.get(0 + ((ItemArmor) itemstack.getItem()).armorType)).getHasStack()) + { + int j = 0 + ((ItemArmor) itemstack.getItem()).armorType; + + if (!this.mergeItemStack(itemstack1, j, j + 1, false)) + { + return null; + } + } + else if (itemstack.getItem() instanceof ItemArmor && !((Slot) this.inventorySlots.get(40 + ((ItemArmor) itemstack.getItem()).armorType)).getHasStack()) + { + int j = 40 + ((ItemArmor) itemstack.getItem()).armorType; + + if (!this.mergeItemStack(itemstack1, j, j + 1, false)) + { + return null; + } + } + else if (itemstack.getItem() instanceof IEquipment && ((IEquipment) itemstack.getItem()).isItemValid(EquipmentType.Face, itemstack)) + { + + if (!this.mergeItemStack(itemstack1, 44, 45, false)) + { + return null; + } + + } else if (itemstack.getItem() instanceof IEquipment && ((IEquipment) itemstack.getItem()).isItemValid(EquipmentType.Bag, itemstack)) + { + + if (!this.mergeItemStack(itemstack1, 45, 46, false)) + { + return null; + } + + } + else if (itemstack.getItem() instanceof IEquipment && ((IEquipment) itemstack.getItem()).isItemValid(EquipmentType.Hand, itemstack)) + { + + if (!this.mergeItemStack(itemstack1, 46, 47, false)) + { + return null; + } + + } + else if (itemstack.getItem() instanceof IEquipment && ((IEquipment) itemstack.getItem()).isItemValid(EquipmentType.Belt, itemstack)) + { + + if (!this.mergeItemStack(itemstack1, 47, 48, false)) + { + return null; + } + + } + else if (itemstack.getItem() instanceof IEquipment && ((IEquipment) itemstack.getItem()).isItemValid(EquipmentType.Unit, itemstack)) + { + + if (!this.mergeItemStack(itemstack1, 48, 56, false)) + { + return null; + } + + } + else if (itemstack.getItem() instanceof IEquipment && ((IEquipment) itemstack.getItem()).isItemValid(EquipmentType.Other, itemstack)) + { + + if (!this.mergeItemStack(itemstack1, 56, 60, false)) + { + return null; + } + + } else if (p_82846_2_ >= 4 && p_82846_2_ < 13) + { + if (!this.mergeItemStack(itemstack1, 13, 40, false)) + { + return null; + } + } + else if (p_82846_2_ >= 13 && p_82846_2_ < 40 && !this.mergeItemStack(itemstack1, 4, 13, false)) + { + return null; + } + + } else if (!this.mergeItemStack(itemstack1, 4, 40, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack) null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(p_82846_1_, itemstack1); + } + + return itemstack; + } + +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerRucksack.java b/src/main/java/shift/sextiarysector/container/ContainerRucksack.java new file mode 100644 index 0000000..1edcca0 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerRucksack.java @@ -0,0 +1,132 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSItems; + +public class ContainerRucksack extends Container +{ + private InventoryRucksack inventory; + + public ContainerRucksack(InventoryPlayer inventoryPlayer) + { + inventory = new InventoryRucksack(inventoryPlayer); + inventory.openInventory(); + + int i =0; + + for (int j = 0; j < 3; ++j) + { + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(inventory, k + j * 9, 8 + k * 18, 17 + j * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new SlotRucksack(inventoryPlayer, i, 8 + i * 18, 142)); + } + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new SlotRucksack(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + } + + public ContainerRucksack(InventoryPlayer inventoryPlayer, InventoryPlayerNext inventoryPlayerN) + { + inventory = new InventoryRucksack(inventoryPlayerN); + inventory.openInventory(); + + int i =0; + + for (int j = 0; j < 3; ++j) + { + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(inventory, k + j * 9, 8 + k * 18, 17 + j * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new SlotRucksack(inventoryPlayer, i, 8 + i * 18, 142)); + } + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new SlotRucksack(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + } + + /* + Container縺碁幕縺縺ヲ繧峨l繧九° + */ + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true; + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ < this.inventory.getSizeInventory()) + { + if (!this.mergeItemStack(itemstack1, this.inventory.getSizeInventory(), this.inventorySlots.size(), true)) + { + return null; + } + } + //繧キ繝輔ヨ繧ッ繝ェ繝繧ッ譎ゅ↓縲√%縺ョ繧「繧、繝繝縺縺」縺溘i蜍輔°縺輔↑縺縲 + else if(slot.getStack() != null && slot.getStack().getItem() == SSItems.rucksack) + { + return null; + } + else if (!this.mergeItemStack(itemstack1, 0, this.inventory.getSizeInventory(), false)) + { + return null; + } + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + /* + Container繧帝哩縺倥k縺ィ縺阪↓蜻シ縺ー繧後k + */ + @Override + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + this.inventory.closeInventory(); + } +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerShippingBox.java b/src/main/java/shift/sextiarysector/container/ContainerShippingBox.java new file mode 100644 index 0000000..5d24ead --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerShippingBox.java @@ -0,0 +1,95 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.player.EntityPlayerManager; + +public class ContainerShippingBox extends Container { + + public InventoryShippingBox shippingBox; + private final EntityPlayer player; + private final int numRows; + private static final String __OBFID = "CL_00001742"; + + public ContainerShippingBox(InventoryPlayer par1InventoryPlayer, EntityPlayer p_i1819_3_) + { + this.player = p_i1819_3_; + this.shippingBox = EntityPlayerManager.getShippingBoxStats(p_i1819_3_).inventory; + this.numRows = 3; + + int i = 0; + + for (int j = 0; j < 3; ++j) + { + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(shippingBox, k + j * 9, 8 + k * 18, 17 + j * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new SlotRucksack(par1InventoryPlayer, i, 8 + i * 18, 142)); + } + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new SlotRucksack(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return true;//this.lowerChestInventory.isUseableByPlayer(p_75145_1_); + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ < this.numRows * 9) + { + if (!this.mergeItemStack(itemstack1, this.numRows * 9, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 0, this.numRows * 9, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack) null); + } + else + { + slot.onSlotChanged(); + } + } + + return itemstack; + } + + @Override + public void onContainerClosed(EntityPlayer p_75134_1_) + { + super.onContainerClosed(p_75134_1_); + } + +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerSimpleMachine.java b/src/main/java/shift/sextiarysector/container/ContainerSimpleMachine.java index c321023..45098c5 100644 --- a/src/main/java/shift/sextiarysector/container/ContainerSimpleMachine.java +++ b/src/main/java/shift/sextiarysector/container/ContainerSimpleMachine.java @@ -7,204 +7,205 @@ import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotFurnace; import net.minecraft.item.ItemStack; -import shift.sextiarysector.api.machine.item.GearForceItem; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.item.GearForceItemAPI; import shift.sextiarysector.tileentity.TileEntitySimpleMachine; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ContainerSimpleMachine extends Container{ +public class ContainerSimpleMachine extends Container { private final TileEntitySimpleMachine machine; - private int lastWorkTime; - private int lastInPower; - private int lastInSpeed; - private int lastPower; - private int lastSpeed; + private int lastWorkTime; + private int lastInPower; + private int lastInSpeed; + private int lastPower; + private int lastSpeed; public ContainerSimpleMachine(InventoryPlayer par1InventoryPlayer, TileEntitySimpleMachine par2TileEntityFurnace) - { - this.machine = par2TileEntityFurnace; - this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 56, 17)); - this.addSlotToContainer(new SlotGF(par2TileEntityFurnace, 1, 56, 53,1)); - this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityFurnace, 2, 116, 35)); - int i; - - for (i = 0; i < 3; ++i) - { - for (int j = 0; j < 9; ++j) - { - this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (i = 0; i < 9; ++i) - { - this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142)); - } - } + { + this.machine = par2TileEntityFurnace; + this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 56, 17)); + this.addSlotToContainer(new SlotGF(par2TileEntityFurnace, 1, 56, 53, this.machine.getMaxPowerStored(ForgeDirection.UP))); + this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityFurnace, 2, 116, 35)); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(par1InventoryPlayer, i, 8 + i * 18, 142)); + } + } @Override public void addCraftingToCrafters(ICrafting par1ICrafting) - { - super.addCraftingToCrafters(par1ICrafting); - par1ICrafting.sendProgressBarUpdate(this, 0, this.machine.machineWorkProgressTime); - par1ICrafting.sendProgressBarUpdate(this, 1, this.machine.inPower); - par1ICrafting.sendProgressBarUpdate(this, 2, this.machine.inSpeed); - par1ICrafting.sendProgressBarUpdate(this, 3, this.machine.storage.getPowerStored()); - par1ICrafting.sendProgressBarUpdate(this, 4, (int) this.machine.storage.getSpeedStored()); - } + { + super.addCraftingToCrafters(par1ICrafting); + par1ICrafting.sendProgressBarUpdate(this, 0, this.machine.machineWorkProgressTime); + par1ICrafting.sendProgressBarUpdate(this, 1, this.machine.inPower); + par1ICrafting.sendProgressBarUpdate(this, 2, this.machine.inSpeed); + par1ICrafting.sendProgressBarUpdate(this, 3, this.machine.storage.getPowerStored()); + par1ICrafting.sendProgressBarUpdate(this, 4, this.machine.storage.getSpeedStored()); + } @Override public void detectAndSendChanges() - { - super.detectAndSendChanges(); - - for (int i = 0; i < this.crafters.size(); ++i) - { - ICrafting icrafting = (ICrafting)this.crafters.get(i); - - if (this.lastWorkTime != this.machine.machineWorkProgressTime) - { - icrafting.sendProgressBarUpdate(this, 0, this.machine.machineWorkProgressTime); - } - - if (this.lastInPower != this.machine.inPower) - { - icrafting.sendProgressBarUpdate(this, 1, this.machine.inPower); - } - - if (this.lastInSpeed != this.machine.inSpeed) - { - icrafting.sendProgressBarUpdate(this, 2, this.machine.inSpeed); - } - - if (this.lastPower != this.machine.storage.getPowerStored()) - { - icrafting.sendProgressBarUpdate(this, 3, this.machine.storage.getPowerStored()); - } - - if (this.lastSpeed != this.machine.storage.getSpeedStored()) - { - icrafting.sendProgressBarUpdate(this, 4, (int) this.machine.storage.getSpeedStored()); - } - - } - - this.lastWorkTime = this.machine.machineWorkProgressTime; - this.lastInPower = this.machine.inPower; - this.lastInSpeed = this.machine.inSpeed; - this.lastPower = this.machine.storage.getPowerStored(); - this.lastSpeed = (int) this.machine.storage.getSpeedStored(); - } + { + super.detectAndSendChanges(); + + for (int i = 0; i < this.crafters.size(); ++i) + { + ICrafting icrafting = (ICrafting) this.crafters.get(i); + + if (this.lastWorkTime != this.machine.machineWorkProgressTime) + { + icrafting.sendProgressBarUpdate(this, 0, this.machine.machineWorkProgressTime); + } + + if (this.lastInPower != this.machine.inPower) + { + icrafting.sendProgressBarUpdate(this, 1, this.machine.inPower); + } + + if (this.lastInSpeed != this.machine.inSpeed) + { + icrafting.sendProgressBarUpdate(this, 2, this.machine.inSpeed); + } + + if (this.lastPower != this.machine.storage.getPowerStored()) + { + icrafting.sendProgressBarUpdate(this, 3, this.machine.storage.getPowerStored()); + } + + if (this.lastSpeed != this.machine.storage.getSpeedStored()) + { + icrafting.sendProgressBarUpdate(this, 4, this.machine.storage.getSpeedStored()); + } + + } + + this.lastWorkTime = this.machine.machineWorkProgressTime; + this.lastInPower = this.machine.inPower; + this.lastInSpeed = this.machine.inSpeed; + this.lastPower = this.machine.storage.getPowerStored(); + this.lastSpeed = this.machine.storage.getSpeedStored(); + } @Override @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) - { - if (par1 == 0) - { - this.machine.machineWorkProgressTime = par2; - } - - if (par1 == 1) - { - this.machine.inPower = par2; - } - - if (par1 == 2) - { - this.machine.inSpeed = par2; - } - - if (par1 == 3) - { - this.machine.storage.setPowerStored(par2); - } - - if (par1 == 4) - { - this.machine.storage.setEnergyStored(par2); - } - - } + public void updateProgressBar(int par1, int par2) + { + if (par1 == 0) + { + this.machine.machineWorkProgressTime = par2; + } + + if (par1 == 1) + { + this.machine.inPower = par2; + } + + if (par1 == 2) + { + this.machine.inSpeed = par2; + } + + if (par1 == 3) + { + this.machine.storage.setPowerStored(par2); + } + + if (par1 == 4) + { + this.machine.storage.setEnergyStored(par2); + } + + } @Override public boolean canInteractWith(EntityPlayer par1EntityPlayer) - { - return this.machine.isUseableByPlayer(par1EntityPlayer); - } + { + return this.machine.isUseableByPlayer(par1EntityPlayer); + } @Override public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) - { - ItemStack itemstack = null; - Slot slot = (Slot)this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) - { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - - if (par2 == 2) - { - if (!this.mergeItemStack(itemstack1, 3, 39, true)) - { - return null; - } - - slot.onSlotChange(itemstack1, itemstack); - } - else if (par2 != 1 && par2 != 0) - { - if (machine.getResult(itemstack1) != null) - { - if (!this.mergeItemStack(itemstack1, 0, 1, false)) - { - return null; - } - } - else if (GearForceItem.manager.isGearForceItem(itemstack1)) - { - if (!this.mergeItemStack(itemstack1, 1, 2, false)) - { - return null; - } - } - else if (par2 >= 3 && par2 < 30) - { - if (!this.mergeItemStack(itemstack1, 30, 39, false)) - { - return null; - } - } - else if (par2 >= 30 && par2 < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) - { - return null; - } - } - else if (!this.mergeItemStack(itemstack1, 3, 39, false)) - { - return null; - } - - if (itemstack1.stackSize == 0) - { - slot.putStack((ItemStack)null); - } - else - { - slot.onSlotChanged(); - } - - if (itemstack1.stackSize == itemstack.stackSize) - { - return null; - } - - slot.onPickupFromSlot(par1EntityPlayer, itemstack1); - } - - return itemstack; - } + { + ItemStack itemstack = null; + Slot slot = (Slot) this.inventorySlots.get(par2); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (par2 == 2) + { + if (!this.mergeItemStack(itemstack1, 3, 39, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (par2 != 1 && par2 != 0) + { + if (machine.getResult(itemstack1) != null) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (GearForceItemAPI.manager.isGearForceItem(itemstack1)) + { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) + { + return null; + } + } + else if (par2 >= 3 && par2 < 30) + { + if (!this.mergeItemStack(itemstack1, 30, 39, false)) + { + return null; + } + } + else if (par2 >= 30 && par2 < 39 && !this.mergeItemStack(itemstack1, 3, 30, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 3, 39, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack) null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(par1EntityPlayer, itemstack1); + } + + return itemstack; + } } diff --git a/src/main/java/shift/sextiarysector/container/ContainerSteamMotor.java b/src/main/java/shift/sextiarysector/container/ContainerSteamMotor.java new file mode 100644 index 0000000..333473d --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerSteamMotor.java @@ -0,0 +1,137 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidContainerRegistry; +import shift.sextiarysector.tileentity.TileEntitySteamMotor; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ContainerSteamMotor extends Container +{ + private TileEntitySteamMotor tileFurnace; + //private int lastFluid; + + public ContainerSteamMotor(InventoryPlayer p_i1812_1_, TileEntitySteamMotor p_i1812_2_) + { + this.tileFurnace = p_i1812_2_; + //this.addSlotToContainer(new Slot(p_i1812_2_, 0, 56, 17)); + //this.addSlotToContainer(new Slot(p_i1812_2_, 1, 56, 53)); + //this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 2, 107, 53)); + //this.addSlotToContainer(new SlotFurnace(p_i1812_1_.player, p_i1812_2_, 3, 125, 53)); + this.addSlotToContainer(new SlotFluid(p_i1812_2_, 0, 44, 17)); + this.addSlotToContainer(new SlotFluid(p_i1812_2_, 1, 44, 53)); + int i; + + for (i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(p_i1812_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + + for (i = 0; i < 9; ++i) + { + this.addSlotToContainer(new Slot(p_i1812_1_, i, 8 + i * 18, 142)); + } + } + + public void addCraftingToCrafters(ICrafting p_75132_1_) + { + super.addCraftingToCrafters(p_75132_1_); + + } + + /** + * Looks for changes made in the container, sends them to every listener. + */ + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int p_75137_1_, int p_75137_2_) + { + + } + + public boolean canInteractWith(EntityPlayer p_75145_1_) + { + return this.tileFurnace.isUseableByPlayer(p_75145_1_); + } + + /** + * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. + */ + public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(p_82846_2_); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (p_82846_2_ == 1) + { + if (!this.mergeItemStack(itemstack1, 2, 38, true)) + { + return null; + } + + slot.onSlotChange(itemstack1, itemstack); + } + else if (p_82846_2_ != 1 && p_82846_2_ != 0) + { + if (FluidContainerRegistry.isFilledContainer(itemstack)) + { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) + { + return null; + } + } + else if (p_82846_2_ >= 2 && p_82846_2_ < 29) + { + if (!this.mergeItemStack(itemstack1, 29, 38, false)) + { + return null; + } + } + else if (p_82846_2_ >= 29 && p_82846_2_ < 38 && !this.mergeItemStack(itemstack1, 2, 29, false)) + { + return null; + } + } + else if (!this.mergeItemStack(itemstack1, 2, 38, false)) + { + return null; + } + + if (itemstack1.stackSize == 0) + { + slot.putStack((ItemStack)null); + } + else + { + slot.onSlotChanged(); + } + + if (itemstack1.stackSize == itemstack.stackSize) + { + return null; + } + + slot.onPickupFromSlot(p_82846_1_, itemstack1); + } + + return itemstack; + } +} diff --git a/src/main/java/shift/sextiarysector/container/ContainerTabWorkbench.java b/src/main/java/shift/sextiarysector/container/ContainerTabWorkbench.java new file mode 100644 index 0000000..8201269 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/ContainerTabWorkbench.java @@ -0,0 +1,20 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerWorkbench; +import net.minecraft.world.World; + +public class ContainerTabWorkbench extends ContainerWorkbench{ + + public ContainerTabWorkbench(InventoryPlayer p_i1808_1_, World p_i1808_2_,int p_i1808_3_, int p_i1808_4_, int p_i1808_5_) { + super(p_i1808_1_, p_i1808_2_, p_i1808_3_, p_i1808_4_, p_i1808_5_); + // TODO 閾ェ蜍慕函謌舌&繧後◆繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ繝シ繝サ繧ケ繧ソ繝 + } + + @Override + public boolean canInteractWith(EntityPlayer p_75145_1_) { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/container/InventoryPlayerNext.java b/src/main/java/shift/sextiarysector/container/InventoryPlayerNext.java new file mode 100644 index 0000000..f28fa33 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/InventoryPlayerNext.java @@ -0,0 +1,125 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; + +public class InventoryPlayerNext implements IInventory { + + ItemBox items = new ItemBox("Base", 20, 1); + + //private final EntityPlayer player; + + public InventoryPlayerNext() { + //this.player = player; + } + + @Override + public int getSizeInventory() { + return items.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int i) { + return items.getStackInSlot(i); + } + + @Override + public ItemStack decrStackSize(int i, int j) { + return items.decrStackSize(i, j); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return items.getStackInSlotOnClosing(i); + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + items.setInventorySlotContents(i, itemstack); + } + + @Override + public String getInventoryName() { + return "gui"; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return items.getInventoryStackLimit(); + } + + @Override + public void markDirty() { + items.onInventoryChanged(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return true; + } + + @Override + public void openInventory() { + this.markDirty(); + } + + @Override + public void closeInventory() { + this.markDirty(); + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + + return true; + } + + public void dropAllItems(EntityPlayer player) + { + int i; + + for (i = 0; i < this.items.getSizeInventory(); ++i) + { + + ItemStack item = this.items.getStackInSlot(i); + + if (item == null) continue; + + if (item.getItem() instanceof IEquipment) { + + if (!((IEquipment) item.getItem()).canDrop(EquipmentType.getEquipmentTypeFromSlot(i), item, player)) continue; + player.func_146097_a(item, true, false); + this.items.setInventorySlotContents(i, null); + + } else { + player.func_146097_a(item, true, false); + this.items.setInventorySlotContents(i, null); + } + + } + + } + + //NBT + public NBTTagCompound writeToNBT(NBTTagCompound nbt) + { + this.items.writeToNBT(nbt); + ; + return nbt; + } + + public void readFromNBT(NBTTagCompound nbt) + { + this.items.readFromNBT(nbt); + } + +} diff --git a/src/main/java/shift/sextiarysector/container/InventoryRucksack.java b/src/main/java/shift/sextiarysector/container/InventoryRucksack.java new file mode 100644 index 0000000..d733909 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/InventoryRucksack.java @@ -0,0 +1,189 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import shift.sextiarysector.api.equipment.EquipmentType; + +public class InventoryRucksack implements IInventory +{ + private final IInventory inventoryPlayer; + private final ItemStack currentItem; + private final ItemStack[] items; + + public InventoryRucksack(InventoryPlayer inventory) + { + inventoryPlayer = inventory; + currentItem = ((InventoryPlayer) inventoryPlayer).getCurrentItem(); + + //InventorySize + items = new ItemStack[27]; + } + + public InventoryRucksack(InventoryPlayerNext inventory) + { + inventoryPlayer = inventory; + currentItem = inventoryPlayer.getStackInSlot(EquipmentType.Bag.getSlots()[0]); + + //InventorySize + items = new ItemStack[27]; + } + + @Override + public int getSizeInventory() + { + return items.length; + } + + @Override + public ItemStack getStackInSlot(int slot) + { + return items[slot]; + } + + @Override + public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) + { + if (this.items[p_70298_1_] != null) + { + ItemStack itemstack; + + if (this.items[p_70298_1_].stackSize <= p_70298_2_) + { + itemstack = this.items[p_70298_1_]; + this.items[p_70298_1_] = null; + this.markDirty(); + return itemstack; + } + else + { + itemstack = this.items[p_70298_1_].splitStack(p_70298_2_); + + if (this.items[p_70298_1_].stackSize == 0) + { + this.items[p_70298_1_] = null; + } + + this.markDirty(); + return itemstack; + } + } + return null; + } + + @Override + public ItemStack getStackInSlotOnClosing(int p_70304_1_) + { + if (this.items[p_70304_1_] != null) + { + ItemStack itemstack = this.items[p_70304_1_]; + this.items[p_70304_1_] = null; + return itemstack; + } + return null; + } + + @Override + public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) + { + this.items[p_70299_1_] = p_70299_2_; + + if (p_70299_2_ != null && p_70299_2_.stackSize > this.getInventoryStackLimit()) + { + p_70299_2_.stackSize = this.getInventoryStackLimit(); + } + + this.markDirty(); + } + + @Override + public String getInventoryName() + { + return "InventoryItem"; + } + + @Override + public boolean hasCustomInventoryName() + { + return false; + } + + @Override + public int getInventoryStackLimit() + { + return 64; + } + + @Override + public void markDirty() { + } + + @Override + public boolean isUseableByPlayer(EntityPlayer p_70300_1_) + { + return true; + } + + /* + Container縺碁幕縺九l縺溘ち繧、繝溘Φ繧ー縺ァItemStack縺ョ謖√▲縺ヲ縺繧起BT縺九i繧「繧、繝繝繧定ェュ縺ソ霎シ繧薙〒縺繧 + */ + @Override + public void openInventory() + { + if (!currentItem.hasTagCompound()) + { + currentItem.setTagCompound(new NBTTagCompound()); + currentItem.getTagCompound().setTag("Items", new NBTTagList()); + } + NBTTagList tags = (NBTTagList) currentItem.getTagCompound().getTag("Items"); + + for (int i = 0; i < tags.tagCount(); i++) + { + NBTTagCompound tagCompound = tags.getCompoundTagAt(i); + int slot = tagCompound.getByte("Slot"); + if (slot >= 0 && slot < items.length) + { + items[slot] = ItemStack.loadItemStackFromNBT(tagCompound); + } + } + } + + /* + Container繧帝哩縺倥k縺ィ縺阪↓菫晏ュ + */ + @Override + public void closeInventory() + { + NBTTagList tagList = new NBTTagList(); + for (int i = 0; i < items.length; i++) + { + if (items[i] != null) + { + NBTTagCompound compound = new NBTTagCompound(); + compound.setByte("Slot", (byte) i); + items[i].writeToNBT(compound); + tagList.appendTag(compound); + } + } + ItemStack result = new ItemStack(currentItem.getItem(), 1); + result.setTagCompound(new NBTTagCompound()); + result.getTagCompound().setTag("Items", tagList); + + //ItemStack繧偵そ繝繝医☆繧九NBT縺ッ蜿ウ繧ッ繝ェ繝繧ッ遲峨ョ繧ソ繧、繝溘Φ繧ー縺ァ縺励°菫晏ュ倥&繧後↑縺縺溘a蜀阪そ繝繝医〒菫晏ュ倥@縺ヲ縺繧九 + if (inventoryPlayer instanceof InventoryPlayer) { + ((InventoryPlayer) inventoryPlayer).mainInventory[((InventoryPlayer) inventoryPlayer).currentItem] = result; + } else if (inventoryPlayer instanceof InventoryPlayerNext) { + inventoryPlayer.setInventorySlotContents(EquipmentType.Bag.getSlots()[0], result); + } + + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) + { + return true; + } +} diff --git a/src/main/java/shift/sextiarysector/container/InventoryShippingBox.java b/src/main/java/shift/sextiarysector/container/InventoryShippingBox.java new file mode 100644 index 0000000..772e529 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/InventoryShippingBox.java @@ -0,0 +1,92 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class InventoryShippingBox implements IInventory { + + ItemBox items = new ItemBox("Base", 27); + + public InventoryShippingBox() { + } + + @Override + public int getSizeInventory() { + return items.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int i) { + return items.getStackInSlot(i); + } + + @Override + public ItemStack decrStackSize(int i, int j) { + return items.decrStackSize(i, j); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return items.getStackInSlotOnClosing(i); + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + items.setInventorySlotContents(i, itemstack); + } + + @Override + public String getInventoryName() { + return "gui"; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return items.getInventoryStackLimit(); + } + + @Override + public void markDirty() { + items.onInventoryChanged(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return true; + } + + @Override + public void openInventory() { + this.markDirty(); + } + + @Override + public void closeInventory() { + this.markDirty(); + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + + return true; + } + + //NBT + public NBTTagCompound writeToNBT(NBTTagCompound nbt) + { + this.items.writeToNBT(nbt); + return nbt; + } + + public void readFromNBT(NBTTagCompound nbt) + { + this.items.readFromNBT(nbt); + } +} diff --git a/src/main/java/shift/sextiarysector/container/ItemBox.java b/src/main/java/shift/sextiarysector/container/ItemBox.java index d49a897..e27cf7e 100644 --- a/src/main/java/shift/sextiarysector/container/ItemBox.java +++ b/src/main/java/shift/sextiarysector/container/ItemBox.java @@ -12,7 +12,7 @@ public class ItemBox{ public ItemBox(String name,int size){ - this(name,size,64); + this(name, size, 64); } diff --git a/src/main/java/shift/sextiarysector/container/SlotEquipment.java b/src/main/java/shift/sextiarysector/container/SlotEquipment.java new file mode 100644 index 0000000..2a6a8b6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/SlotEquipment.java @@ -0,0 +1,46 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlotEquipment extends Slot{ + + private EquipmentType equipment; + + public SlotEquipment(EquipmentType type,IInventory p_i1824_1_, int p_i1824_2_, int x,int y) { + super(p_i1824_1_, p_i1824_2_, x, y); + equipment = type; + } + + @Override + public boolean isItemValid(ItemStack stack) { + + return stack.getItem() instanceof IEquipment &&((IEquipment)stack.getItem()).isItemValid(this.equipment, stack); + + } + + @Override + public boolean canTakeStack(EntityPlayer player) { + + return this.getStack()!=null && ((IEquipment)this.getStack().getItem()).canTakeStack(equipment, this.getStack(), player); + } + + @Override + public int getSlotStackLimit() + { + return 1; + } + + @SideOnly(Side.CLIENT) + public IIcon getBackgroundIconIndex() + { + return equipment.getIcon(); + } +} diff --git a/src/main/java/shift/sextiarysector/container/SlotFluid.java b/src/main/java/shift/sextiarysector/container/SlotFluid.java new file mode 100644 index 0000000..7af1ef8 --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/SlotFluid.java @@ -0,0 +1,33 @@ +package shift.sextiarysector.container; + +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.IFluidContainerItem; +import shift.sextiarysector.event.ClientEventHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class SlotFluid extends Slot { + + public SlotFluid(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { + super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); + } + + @Override + public boolean isItemValid(ItemStack stack) { + + return FluidContainerRegistry.isContainer(stack) || (stack != null && stack.getItem() instanceof IFluidContainerItem); + + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getBackgroundIconIndex() + { + return ClientEventHandler.slotFluid; + } + +} diff --git a/src/main/java/shift/sextiarysector/container/SlotGF.java b/src/main/java/shift/sextiarysector/container/SlotGF.java index 6a3b6b6..f79c17e 100644 --- a/src/main/java/shift/sextiarysector/container/SlotGF.java +++ b/src/main/java/shift/sextiarysector/container/SlotGF.java @@ -4,7 +4,7 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import shift.sextiarysector.api.machine.item.IGearForceItem; +import shift.sextiarysector.api.gearforce.item.IGearForceItem; import shift.sextiarysector.event.ClientEventHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/src/main/java/shift/sextiarysector/container/SlotRucksack.java b/src/main/java/shift/sextiarysector/container/SlotRucksack.java new file mode 100644 index 0000000..1aeea8f --- /dev/null +++ b/src/main/java/shift/sextiarysector/container/SlotRucksack.java @@ -0,0 +1,23 @@ +package shift.sextiarysector.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import shift.sextiarysector.SSItems; + +public class SlotRucksack extends Slot +{ + public SlotRucksack(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) + { + super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); + } + + /* + 縺薙ョ繧「繧、繝繝縺ッ蜍輔°縺帙↑縺縲√▽縺九a縺ェ縺繧医≧縺ォ縺吶k縲 + */ + @Override + public boolean canTakeStack(EntityPlayer p_82869_1_) + { + return !(getHasStack() && getStack().getItem() == SSItems.rucksack); + } +} diff --git a/src/main/java/shift/sextiarysector/entity/EntityMineboat.java b/src/main/java/shift/sextiarysector/entity/EntityMineboat.java new file mode 100644 index 0000000..adb88a6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/entity/EntityMineboat.java @@ -0,0 +1,173 @@ +package shift.sextiarysector.entity; + +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityBoat; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityMineboat extends EntityBoat{ + + protected String entityName;; + + public EntityMineboat(World par1World) { + super(par1World); + + } + + public EntityMineboat(World par1World, double par2, double par4, double par6) { + super(par1World, par2, par4, par6); + + } + + protected void entityInit() + { + super.entityInit(); + this.dataWatcher.addObject(20, new Integer(0)); + this.dataWatcher.addObject(21, new Integer(6)); + this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); + } + + @Override + public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else if (!this.worldObj.isRemote && !this.isDead) + { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() + par2 * 10.0F); + this.setBeenAttacked(); + boolean flag = par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer)par1DamageSource.getEntity()).capabilities.isCreativeMode; + + if (flag || this.getDamageTaken() > 40.0F) + { + if (this.riddenByEntity != null) + { + this.riddenByEntity.mountEntity(this); + } + + if (flag && !this.isInvNameLocalized()) + { + this.setDead(); + } + else + { + this.killMineBoat(par1DamageSource); + } + } + + return true; + } + else + { + return true; + } + } + + public void killMineBoat(DamageSource par1DamageSource) + { + this.setDead(); + ItemStack itemstack = new ItemStack(Items.boat, 1); + + if (this.entityName != null) + { + itemstack.setStackDisplayName(this.entityName); + } + + this.entityDropItem(itemstack, 0.0F); + } + + public boolean isInvNameLocalized() + { + return this.entityName != null; + } + + public Block getDisplayTile() + { + if (!this.hasDisplayTile()) + { + return this.getDefaultDisplayTile(); + } + else + { + int i = this.getDataWatcher().getWatchableObjectInt(20) & 65535; + return Block.getBlockById(i); + } + } + + public Block getDefaultDisplayTile() + { + return null; + } + + public int getDisplayTileData() + { + return !this.hasDisplayTile() ? this.getDefaultDisplayTileData() : this.getDataWatcher().getWatchableObjectInt(20) >> 16; + } + + public int getDefaultDisplayTileData() + { + return 0; + } + + public int getDisplayTileOffset() + { + return !this.hasDisplayTile() ? this.getDefaultDisplayTileOffset() : this.getDataWatcher().getWatchableObjectInt(21); + } + + public int getDefaultDisplayTileOffset() + { + return 6; + } + + public void setDisplayTile(int par1) + { + this.getDataWatcher().updateObject(20, Integer.valueOf(par1 & 65535 | this.getDisplayTileData() << 16)); + this.setHasDisplayTile(true); + } + + public void setDisplayTileData(int par1) + { + this.getDataWatcher().updateObject(20, Integer.valueOf(Block.getIdFromBlock(this.getDisplayTile()) & 65535 | par1 << 16)); + this.setHasDisplayTile(true); + } + + public void setDisplayTileOffset(int par1) + { + this.getDataWatcher().updateObject(21, Integer.valueOf(par1)); + this.setHasDisplayTile(true); + } + + public boolean hasDisplayTile() + { + //return false;//this.getDataWatcher().getWatchableObjectByte(22) == 1; + return this.getDataWatcher().getWatchableObjectByte(22) == 1; + } + + public void setHasDisplayTile(boolean par1) + { + this.getDataWatcher().updateObject(22, Byte.valueOf((byte)(par1 ? 1 : 0))); + } + + public void setMineboatName(String par1Str) + { + this.entityName = par1Str; + } + + public String getCommandSenderName() + { + return this.entityName != null ? this.entityName : super.getCommandSenderName(); + } + + public String func_95999_t() + { + return this.entityName; + } + +} diff --git a/src/main/java/shift/sextiarysector/entity/EntityMineboatChest.java b/src/main/java/shift/sextiarysector/entity/EntityMineboatChest.java new file mode 100644 index 0000000..9dadfd9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/entity/EntityMineboatChest.java @@ -0,0 +1,52 @@ +package shift.sextiarysector.entity; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + +public class EntityMineboatChest extends EntityMineboatContainer{ + + public EntityMineboatChest(World par1World) { + super(par1World); + + } + + public EntityMineboatChest(World par1World, double par2, double par4, double par6) { + super(par1World, par2, par4, par6); + + } + + @Override + public void killMineBoat(DamageSource par1DamageSource) + { + super.killMineBoat(par1DamageSource); + this.func_145778_a(Item.getItemFromBlock(Blocks.chest), 1, 0.0F); + } + + @Override + public int getSizeInventory() + { + return 27; + } + + @Override + public String getInventoryName() + { + return this.isInvNameLocalized() ? this.func_95999_t() : "container.mineboat_chest"; + } + + @Override + public Block getDefaultDisplayTile() + { + return Blocks.chest; + } + + @Override + public int getDefaultDisplayTileOffset() + { + return 8; + } + +} diff --git a/src/main/java/shift/sextiarysector/entity/EntityMineboatContainer.java b/src/main/java/shift/sextiarysector/entity/EntityMineboatContainer.java new file mode 100644 index 0000000..e277993 --- /dev/null +++ b/src/main/java/shift/sextiarysector/entity/EntityMineboatContainer.java @@ -0,0 +1,228 @@ +package shift.sextiarysector.entity; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import shift.sextiarysector.container.ItemBox; + +public class EntityMineboatContainer extends EntityMineboat implements IInventory{ + + //private ItemStack[] mineboatContainerItems = new ItemStack[36]; + protected ItemBox items = new ItemBox("Base", 36); + + private boolean dropContentsWhenDead = true; + + public EntityMineboatContainer(World par1World) { + super(par1World); + + } + + public EntityMineboatContainer(World par1World, double par2, double par4, double par6) { + super(par1World, par2, par4, par6); + + } + + @Override + public void killMineBoat(DamageSource par1DamageSource) + { + super.killMineBoat(par1DamageSource); + + for (int i = 0; i < this.getSizeInventory(); ++i) + { + ItemStack itemstack = this.getStackInSlot(i); + + if (itemstack != null) + { + float f = this.rand.nextFloat() * 0.8F + 0.1F; + float f1 = this.rand.nextFloat() * 0.8F + 0.1F; + float f2 = this.rand.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j = this.rand.nextInt(21) + 10; + + if (j > itemstack.stackSize) + { + j = itemstack.stackSize; + } + + itemstack.stackSize -= j; + EntityItem entityitem = new EntityItem(this.worldObj, this.posX + f, this.posY + f1, this.posZ + f2, new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage())); + float f3 = 0.05F; + entityitem.motionX = (float)this.rand.nextGaussian() * f3; + entityitem.motionY = (float)this.rand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float)this.rand.nextGaussian() * f3; + this.worldObj.spawnEntityInWorld(entityitem); + } + } + } + } + + @Override + public int getSizeInventory() { + return this.items.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int par1) + { + return this.items.getStackInSlot(par1); + } + + @Override + public ItemStack decrStackSize(int par1, int par2) + { + return this.items.decrStackSize(par1, par2); + } + + @Override + public ItemStack getStackInSlotOnClosing(int par1) + { + return this.getStackInSlotOnClosing(par1); + } + + @Override + public void setInventorySlotContents(int par1, ItemStack par2ItemStack) + { + this.items.setInventorySlotContents(par1, par2ItemStack); + } + + @Override + public void openInventory() {} + + @Override + public void closeInventory() {} + + @Override + public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) + { + return this.isDead ? false : par1EntityPlayer.getDistanceSqToEntity(this) <= 64.0D; + } + + @Override + public boolean isInvNameLocalized() + { + return this.entityName != null; + } + + @Override + public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) + { + return true; + } + + @Override + public String getInventoryName() + { + return this.isInvNameLocalized() ? this.func_95999_t() : "container.mineboat"; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public void markDirty() { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public int getInventoryStackLimit() + { + return 64; + } + + @Override + public void travelToDimension(int par1) + { + this.dropContentsWhenDead = false; + super.travelToDimension(par1); + } + + @Override + public void setDead() + { + if (this.dropContentsWhenDead) + { + for (int i = 0; i < this.getSizeInventory(); ++i) + { + ItemStack itemstack = this.getStackInSlot(i); + + if (itemstack != null) + { + float f = this.rand.nextFloat() * 0.8F + 0.1F; + float f1 = this.rand.nextFloat() * 0.8F + 0.1F; + float f2 = this.rand.nextFloat() * 0.8F + 0.1F; + + while (itemstack.stackSize > 0) + { + int j = this.rand.nextInt(21) + 10; + + if (j > itemstack.stackSize) + { + j = itemstack.stackSize; + } + + itemstack.stackSize -= j; + EntityItem entityitem = new EntityItem(this.worldObj, this.posX + f, this.posY + f1, this.posZ + f2, new ItemStack(itemstack.getItem(), j, itemstack.getItemDamage())); + + if (itemstack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); + } + + float f3 = 0.05F; + entityitem.motionX = (float)this.rand.nextGaussian() * f3; + entityitem.motionY = (float)this.rand.nextGaussian() * f3 + 0.2F; + entityitem.motionZ = (float)this.rand.nextGaussian() * f3; + this.worldObj.spawnEntityInWorld(entityitem); + } + } + } + } + + super.setDead(); + } + + @Override + protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + items.writeToNBT(par1NBTTagCompound); + } + + @Override + protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + items.readFromNBT(par1NBTTagCompound); + } + + @Override + //縺薙%縺ォ驥崎ヲ√↑莠九′縺ゅk縲 + public boolean interactFirst(EntityPlayer par1EntityPlayer) + { + /* + if(MinecraftForge.EVENT_BUS.post(new MinecartInteractEvent((EntityMinecart)this, par1EntityPlayer))) + { + return true; + } + */ + + if (!this.worldObj.isRemote) + { + + + par1EntityPlayer.displayGUIChest(this); + } + + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/entity/EntityMineboatTank.java b/src/main/java/shift/sextiarysector/entity/EntityMineboatTank.java new file mode 100644 index 0000000..8d9deaf --- /dev/null +++ b/src/main/java/shift/sextiarysector/entity/EntityMineboatTank.java @@ -0,0 +1,198 @@ +package shift.sextiarysector.entity; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.SSBlocks; + +public class EntityMineboatTank extends EntityMineboat implements IFluidHandler { + + protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 32); + private int lastID = 0; + private int lastAmount = 0; + + public EntityMineboatTank(World par1World) { + super(par1World); + + } + + public EntityMineboatTank(World par1World, double par2, double par4, double par6) { + super(par1World, par2, par4, par6); + } + + @Override + protected void entityInit() + { + + super.entityInit(); + this.dataWatcher.addObject(23, new Integer(0)); + this.dataWatcher.addObject(24, new Integer(0)); + + } + + @Override + public void onUpdate() + { + super.onUpdate(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + + if (this.lastID != this.getFluidID()) { + + if (this.getFluidID() == 0) { + this.tank.setFluid(null); + } else { + this.tank.setFluid(new FluidStack(this.getFluidID(), this.getFluidAmount())); + } + + this.lastID = this.getFluidID(); + this.lastAmount = this.getFluidAmount(); + + } + + if (this.lastAmount != this.getFluidAmount()) { + this.tank.getFluid().amount = this.getFluidAmount(); + + this.lastID = this.getFluidID(); + this.lastAmount = this.getFluidAmount(); + + } + + } + + private void updateServerEntity() { + + if (this.lastAmount != this.tank.getFluidAmount()) { + + this.dataWatcher.updateObject(24, this.tank.getFluidAmount()); + + if (this.tank.getFluidAmount() == 0) { + this.dataWatcher.updateObject(23, 0); + } else { + this.dataWatcher.updateObject(23, this.tank.getFluid().getFluid().getID()); + } + + this.lastAmount = this.tank.getFluidAmount(); + + } + + } + + private int getFluidID() { + return this.dataWatcher.getWatchableObjectInt(23); + } + + private int getFluidAmount() { + return this.dataWatcher.getWatchableObjectInt(24); + } + + public float getRendererAmount() { + return (float) this.tank.getFluidAmount() / (float) this.tank.getCapacity(); + } + + public boolean hasFluidStack() { + return tank.getFluidAmount() > 0; + } + + public FluidStack getFluidStack() { + return tank.getFluid(); + } + + @Override + public Block getDefaultDisplayTile() + { + return SSBlocks.tank; + } + + @Override + public void killMineBoat(DamageSource par1DamageSource) + { + super.killMineBoat(par1DamageSource); + this.func_145778_a(Item.getItemFromBlock(SSBlocks.tank), 1, 0.0F); + } + + @Override + //縺薙%縺ォ驥崎ヲ√↑莠九′縺ゅk縲 + public boolean interactFirst(EntityPlayer par1EntityPlayer) + { + return true; + } + + /* IFluidHandler */ + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + return tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + return tank.drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return tank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } + + //NBT + @Override + protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + tank.writeToNBT(par1NBTTagCompound); + } + + @Override + protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + tank.readFromNBT(par1NBTTagCompound); + if (par1NBTTagCompound.hasKey("Empty") && tank.getFluidAmount() > 0) this.tank.setFluid(null); + } + +} diff --git a/src/main/java/shift/sextiarysector/event/AchievementEventHandler.java b/src/main/java/shift/sextiarysector/event/AchievementEventHandler.java new file mode 100644 index 0000000..3afa6b2 --- /dev/null +++ b/src/main/java/shift/sextiarysector/event/AchievementEventHandler.java @@ -0,0 +1,57 @@ +package shift.sextiarysector.event; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.Achievement; +import net.minecraftforge.event.entity.player.AchievementEvent; +import shift.mceconomy2.api.MCEconomyAPI; +import shift.mceconomy2.api.shop.ShopBuyEvent; +import shift.sextiarysector.SSAchievement; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.block.BlockFigure; +import shift.sextiarysector.item.ItemBlockCrop; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class AchievementEventHandler { + + @SubscribeEvent + public void useEvent(ShopBuyEvent event) { + if (event.buy.getItem() instanceof ItemBlockCrop) event.entityPlayer.addStat(SSAchievement.seed, 1); + } + + @SubscribeEvent + public void onAchievementEvent(AchievementEvent event) { + + Achievement achievement = event.achievement; + EntityPlayer player = event.entityPlayer; + ItemStack item = achievement.theItemStack; + + if (item == null) return; + + if (((EntityPlayerMP) player).func_147099_x().hasAchievementUnlocked(achievement)) return; + if (!((EntityPlayerMP) player).func_147099_x().canUnlockAchievement(achievement)) return; + + ItemStack f = new ItemStack(SSBlocks.figure); + BlockFigure.setFigureItem(f, item.copy(), "achievement"); + + /* + if (!player.inventory.addItemStackToInventory(f)) + { + System.out.println("AA"); + player.dropPlayerItemWithRandomChoice(f, false); + }*/ + + MCEconomyAPI.addPlayerMP(player, 500, false); + + EntityItem eItem = new EntityItem(player.worldObj, player.posX + 0.5d, player.posY + 0.5d, player.posZ + 0.5d, f); + eItem.lifespan = 12000; + + player.worldObj.spawnEntityInWorld(eItem); + + //player.inventory.markDirty(); + + } + +} diff --git a/src/main/java/shift/sextiarysector/event/ClientEventHandler.java b/src/main/java/shift/sextiarysector/event/ClientEventHandler.java index 92fe8ba..819a196 100644 --- a/src/main/java/shift/sextiarysector/event/ClientEventHandler.java +++ b/src/main/java/shift/sextiarysector/event/ClientEventHandler.java @@ -5,41 +5,83 @@ import java.util.List; import net.minecraft.block.BlockLeaves; +import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; import net.minecraft.client.gui.GuiIngameMenu; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.IProgressMeter; +import net.minecraft.client.gui.achievement.GuiAchievements; import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderBiped; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.client.event.EntityViewRenderEvent.FogColors; +import net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity; import net.minecraftforge.client.event.GuiOpenEvent; +import net.minecraftforge.client.event.RenderBlockOverlayEvent; +import net.minecraftforge.client.event.RenderPlayerEvent.SetArmorModel; import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.event.entity.player.ItemTooltipEvent; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SSItems; import shift.sextiarysector.api.agriculture.AgricultureAPI; import shift.sextiarysector.api.agriculture.IFertilizer; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.gearforce.item.IGearForceGridItem; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; +import shift.sextiarysector.gui.GuiAchievementsNext; import shift.sextiarysector.gui.GuiStatsNext; import shift.sextiarysector.item.TextureSeason; import shift.sextiarysector.module.FertilizerManager; import shift.sextiarysector.module.SeasonManager; +import shift.sextiarysector.player.EntityPlayerManager; +import shift.sextiarysector.player.EquipmentStats; +import shift.sextiarysector.renderer.entity.ModelDecoration; import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.ObfuscationReflectionHelper; import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; public class ClientEventHandler { - public static Minecraft mc = FMLClientHandler.instance().getClient(); + @SideOnly(Side.CLIENT) + public static Minecraft mc = FMLClientHandler.instance().getClient(); - @SubscribeEvent - public void onGuiOpenEvent(GuiOpenEvent event) { + @SubscribeEvent + @SideOnly(Side.CLIENT) + public void onGuiOpenEvent(GuiOpenEvent event) { - if(event.gui instanceof GuiStats&&!(event.gui instanceof GuiStatsNext)){ + if (event.gui instanceof GuiStats && !(event.gui instanceof GuiStatsNext)) { - /* - Class c = GuiStats.class; + /* + Class c = GuiStats.class; - Field f1; - GuiScreen m = null; + Field f1; + GuiScreen m = null; try { f1 = c.getDeclaredField( "parentGui" ); f1.setAccessible( true ); @@ -58,89 +100,116 @@ public void onGuiOpenEvent(GuiOpenEvent event) { e.printStackTrace(); }*/ - event.gui = new GuiStatsNext(new GuiIngameMenu(),mc.thePlayer.getStatFileWriter()); + event.gui = new GuiStatsNext(new GuiIngameMenu(), mc.thePlayer.getStatFileWriter()); + + //System.out.println("GuiOpenEvent"); + } + + if (event.gui instanceof GuiAchievements && !(event.gui instanceof GuiAchievementsNext)) { + + ((IProgressMeter) event.gui).func_146509_g(); + GuiScreen gui = ObfuscationReflectionHelper.getPrivateValue(GuiAchievements.class, (GuiAchievements) event.gui, "field_146562_a"); + event.gui = new GuiAchievementsNext(gui, mc.thePlayer.getStatFileWriter()); + + } + } + @SubscribeEvent + public void onItemTooltipEvent(ItemTooltipEvent event) { - //System.out.println("GuiOpenEvent"); - } + ItemStack itemStack = event.itemStack; + List toolTip = event.toolTip; - } + if (itemStack.getItem() == Items.clock) { + toolTip.add(SeasonManager.getInstance().getTime2(this.mc.theWorld)); + } - @SubscribeEvent - public void onItemTooltipEvent(ItemTooltipEvent event) { + } + public static IIcon slotGF; + public static IIcon slotFluid; - ItemStack itemStack = event.itemStack; - List toolTip = event.toolTip; + public static IIcon[] itemGF; - if(itemStack.getItem()==Items.clock){ - toolTip.add(SeasonManager.getInstance().getTime2(this.mc.theWorld)); - } + public static IIcon waterFlow; + public static IIcon waterStill; - } + public static IIcon portal; - public static IIcon slotGF; + public static IIcon lavaFlow; + public static IIcon lavaStill; - public static IIcon[] itemGF; + public static IIcon breakIcon; - @SubscribeEvent - public void PreTextureStitchEvent(TextureStitchEvent.Pre event){ + @SubscribeEvent + public void PreTextureStitchEvent(TextureStitchEvent.Pre event) { - //Item - if(event.map.getTextureType()==1){ + //Item + if (event.map.getTextureType() == 1) { + slotGF = event.map.registerIcon("sextiarysector:gui/slot_gf"); + slotFluid = event.map.registerIcon("sextiarysector:gui/slot_fluid"); - slotGF = event.map.registerIcon("sextiarysector:gui/slot_gf"); + itemGF = new IIcon[2]; + itemGF[0] = event.map.registerIcon("sextiarysector:damage/damage_0"); + itemGF[1] = event.map.registerIcon("sextiarysector:damage/damage_1"); - itemGF = new IIcon[2]; - itemGF[0] = event.map.registerIcon("sextiarysector:damage/damage_0"); - itemGF[1] = event.map.registerIcon("sextiarysector:damage/damage_1"); + for (EquipmentType type : EquipmentType.values()) { + type.registerIcon(event.map); + } - } + } else { + waterFlow = event.map.registerIcon("sextiarysector:fluid/water_flow"); + waterStill = event.map.registerIcon("sextiarysector:fluid/water_still"); + portal = event.map.registerIcon("sextiarysector:fluid/portal"); + lavaFlow = event.map.registerIcon("sextiarysector:fluid/lava_flow"); + lavaStill = event.map.registerIcon("sextiarysector:fluid/lava_still"); - } + breakIcon = event.map.registerIcon("sextiarysector:break"); - @SubscribeEvent - public void preFertilizerTextureStitchEvent(TextureStitchEvent.Pre event){ + } - if(event.map.getTextureType()==0){ + } - for(IFertilizer f : ((FertilizerManager)AgricultureAPI.fertilizerManager).fertilizers){ - f.registerFertilizerIcons(event.map); - } + @SubscribeEvent + public void preFertilizerTextureStitchEvent(TextureStitchEvent.Pre event) { - } + if (event.map.getTextureType() == 0) { - } + for (IFertilizer f : ((FertilizerManager) AgricultureAPI.fertilizerManager).fertilizerIcons) { + f.registerFertilizerIcons(event.map); + } - @SubscribeEvent - public void preVanillaTextureStitchEvent(TextureStitchEvent.Pre event){ + } - //Item - if(event.map.getTextureType()==0){ + } - IIcon icon = new TextureSeason("sextiarysector:vanilla/leaves_birch"); + @SubscribeEvent + public void preVanillaTextureStitchEvent(TextureStitchEvent.Pre event) { - ((TextureMap)event.map).setTextureEntry("sextiarysector:vanilla/leaves_birch", (TextureAtlasSprite)icon); + //Item + if (event.map.getTextureType() == 0) { + IIcon icon = new TextureSeason("sextiarysector:vanilla/leaves_birch"); + event.map.setTextureEntry("sextiarysector:vanilla/leaves_birch", (TextureAtlasSprite) icon); try { Field f; - BlockLeaves birch = (BlockLeaves) Blocks.leaves; - Class c = BlockLeaves.class; + BlockLeaves birch = Blocks.leaves; + Class c = BlockLeaves.class; f = c.getDeclaredField("field_150129_M"); f.setAccessible(true); - IIcon[] a = (IIcon[])Array.get(f.get(birch), 0); + IIcon[] a = (IIcon[]) Array.get(f.get(birch), 0); - Array.set(a, 2, icon); + Array.set(a, 2, icon); - //System.out.println("AAAAA"); + //System.out.println("AAAAA"); } catch (SecurityException e) { e.printStackTrace(); @@ -157,11 +226,607 @@ public void preVanillaTextureStitchEvent(TextureStitchEvent.Pre event){ e.printStackTrace(); } + } + + } + + //豌エ縺ョ荳ュ + @SubscribeEvent + public void onFogDensity(FogDensity event) { + + if (event.block.getMaterial() == Material.water) { + + if (event.entity instanceof EntityPlayer) { + + EntityPlayer player = (EntityPlayer) event.entity; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats(player); + + if (e.inventory.getStackInSlot(EquipmentType.Face.getSlot(0)) != null) { + + if (e.inventory.getStackInSlot(EquipmentType.Face.getSlot(0)).getItem() == SSItems.waterContactLenses) { + event.density = 0.0F; + event.setCanceled(true); + } + + } + } + + } + } + + //豌エ縺ョ荳ュ2 + @SubscribeEvent + public void onRenderBlockOverlay(RenderBlockOverlayEvent event) { + + if (event.overlayType == RenderBlockOverlayEvent.OverlayType.WATER) { + + if (event.player instanceof EntityPlayer) { + + EntityPlayer player = event.player; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats(player); + + if (e.inventory.getStackInSlot(EquipmentType.Face.getSlot(0)) != null) { + + if (e.inventory.getStackInSlot(EquipmentType.Face.getSlot(0)).getItem() == SSItems.waterContactLenses) { + event.setCanceled(true); + } + + } + } + + } + + } + + //豌エ縺ョ荳ュ3 + @SubscribeEvent + public void onFogColors(FogColors event) { + + if (!(event.entity instanceof EntityPlayer)) return; + + if (event.block.getMaterial() != Material.water) return; + + EntityPlayer player = (EntityPlayer) event.entity; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats(player); + + if (e.inventory.getStackInSlot(EquipmentType.Face.getSlot(0)) != null) { + + if (e.inventory.getStackInSlot(EquipmentType.Face.getSlot(0)).getItem() == SSItems.waterContactLenses) { + + if (!player.isPotionActive(Potion.nightVision)) + { + float f11; + float f6; + + f11 = 200;//event.renderer.getNightVisionBrightness(this.mc.thePlayer, (float) event.renderPartialTicks); + f6 = 1.0F / event.red; + + if (f6 > 1.0F / event.green) + { + f6 = 1.0F / event.green; + } + + if (f6 > 1.0F / event.blue) + { + f6 = 1.0F / event.blue; + } + + event.red = event.red * (1.0F - f11) + event.red * f6 * f11; + event.green = event.green * (1.0F - f11) + event.green * f6 * f11; + event.blue = event.blue * (1.0F - f11) + event.blue * f6 * f11; + } + + } + + } + } - } + public static ModelDecoration decoration; - } + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + @SubscribeEvent + public void setArmorModel(SetArmorModel event) { + + ModelBase renderPassModel = this.setArmorModel2(event); + int i = 3 - event.slot; + + int j = event.result; + + if (j > 0) + { + + EntityPlayer p_77032_1_ = event.entityPlayer; + float p_76986_9_ = event.partialRenderTick; + + float f2 = this.interpolateRotation(p_77032_1_.prevRenderYawOffset, p_77032_1_.renderYawOffset, p_76986_9_); + float f3 = this.interpolateRotation(p_77032_1_.prevRotationYawHead, p_77032_1_.rotationYawHead, p_76986_9_); + float f4; + + if (p_77032_1_.isRiding() && p_77032_1_.ridingEntity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase1 = (EntityLivingBase) p_77032_1_.ridingEntity; + f2 = this.interpolateRotation(entitylivingbase1.prevRenderYawOffset, entitylivingbase1.renderYawOffset, p_76986_9_); + f4 = MathHelper.wrapAngleTo180_float(f3 - f2); + + if (f4 < -85.0F) + { + f4 = -85.0F; + } + + if (f4 >= 85.0F) + { + f4 = 85.0F; + } + + f2 = f3 - f4; + + if (f4 * f4 > 2500.0F) + { + f2 += f4 * 0.2F; + } + } + + float f13 = p_77032_1_.prevRotationPitch + (p_77032_1_.rotationPitch - p_77032_1_.prevRotationPitch) * p_76986_9_; + f4 = this.handleRotationFloat(p_77032_1_, p_76986_9_); + float f5 = 0.0625F; + float f6 = p_77032_1_.prevLimbSwingAmount + (p_77032_1_.limbSwingAmount - p_77032_1_.prevLimbSwingAmount) * p_76986_9_; + float f7 = p_77032_1_.limbSwing - p_77032_1_.limbSwingAmount * (1.0F - p_76986_9_); + + if (p_77032_1_.isChild()) + { + f7 *= 3.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + renderPassModel.setLivingAnimations(p_77032_1_, f7, f6, p_76986_9_); + renderPassModel.render(p_77032_1_, f7, f6, f4, f3 - f2, f13, f5); + + //int j; + float f8; + float f9; + float f10; + + if ((j & 240) == 16) + { + this.func_82408_c(p_77032_1_, i, p_76986_9_); + renderPassModel.render(p_77032_1_, f7, f6, f4, f3 - f2, f13, f5); + } + + if ((j & 15) == 15) + { + f8 = p_77032_1_.ticksExisted + p_76986_9_; + RenderManager.instance.renderEngine.bindTexture(this.RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + f9 = 0.5F; + GL11.glColor4f(f9, f9, f9, 1.0F); + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDepthMask(false); + + for (int k = 0; k < 2; ++k) + { + GL11.glDisable(GL11.GL_LIGHTING); + f10 = 0.76F; + GL11.glColor4f(0.5F * f10, 0.25F * f10, 0.8F * f10, 1.0F); + GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + float f11 = f8 * (0.001F + k * 0.003F) * 20.0F; + float f12 = 0.33333334F; + GL11.glScalef(f12, f12, f12); + GL11.glRotatef(30.0F - k * 60.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, f11, 0.0F); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + renderPassModel.render(p_77032_1_, f7, f6, f4, f3 - f2, f13, f5); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glDepthMask(true); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + if (event.result != -1) event.result = -2; + + } + + //shift縺ョ蟶ス蟄 + public ModelBase setArmorModel2(SetArmorModel event) { + + if (decoration == null) decoration = new ModelDecoration(); + + EquipmentStats e = EntityPlayerManager.getEquipmentStats(event.entityPlayer); + int p_77032_2_ = 3 - event.slot; + float p_76986_9_ = event.partialRenderTick; + + //Item item = SSItems.shiftHat; + EntityPlayer p_77032_1_ = event.entityPlayer; + ItemStack itemstack = e.inventory.getStackInSlot(p_77032_2_); + if (itemstack == null) return null; + Item item = itemstack.getItem(); + + if (item instanceof ItemArmor) + { + ItemArmor itemarmor = (ItemArmor) item; + //event.renderer.bindTexture(RenderBiped.getArmorResource(p_77032_1_, itemstack, p_77032_2_, null)); + ResourceLocation resource = RenderBiped.getArmorResource(p_77032_1_, itemstack, p_77032_2_, null); + + RenderManager.instance.renderEngine.bindTexture(resource); + ModelBiped modelbiped = p_77032_2_ == 2 ? event.renderer.modelArmor : event.renderer.modelArmorChestplate; + modelbiped.bipedHead.showModel = p_77032_2_ == 0; + modelbiped.bipedHeadwear.showModel = p_77032_2_ == 0; + modelbiped.bipedBody.showModel = p_77032_2_ == 1 || p_77032_2_ == 2; + modelbiped.bipedRightArm.showModel = p_77032_2_ == 1; + modelbiped.bipedLeftArm.showModel = p_77032_2_ == 1; + modelbiped.bipedRightLeg.showModel = p_77032_2_ == 2 || p_77032_2_ == 3; + modelbiped.bipedLeftLeg.showModel = p_77032_2_ == 2 || p_77032_2_ == 3; + modelbiped = net.minecraftforge.client.ForgeHooksClient.getArmorModel(p_77032_1_, itemstack, p_77032_2_, modelbiped); + event.renderer.setRenderPassModel(modelbiped); + modelbiped.onGround = event.renderer.modelBipedMain.onGround; + modelbiped.isRiding = event.renderer.modelBipedMain.isRiding; + modelbiped.isChild = event.renderer.modelBipedMain.isChild; + + //Move outside if to allow for more then just CLOTH + int j = itemarmor.getColor(itemstack); + if (j != -1) + { + + float f1 = (j >> 16 & 255) / 255.0F; + float f2 = (j >> 8 & 255) / 255.0F; + float f3 = (j & 255) / 255.0F; + GL11.glColor3f(f1, f2, f3); + + if (itemstack.isItemEnchanted()) + { + event.result = 31; + return modelbiped; + } + + event.result = 16; + return modelbiped; + + /* + GL11.glColor3f(1.0F, 1.0F, 1.0F); + + float f2 = this.interpolateRotation(p_77032_1_.prevRenderYawOffset, p_77032_1_.renderYawOffset, p_76986_9_); + float f3 = this.interpolateRotation(p_77032_1_.prevRotationYawHead, p_77032_1_.rotationYawHead, p_76986_9_); + float f4; + + if (p_77032_1_.isRiding() && p_77032_1_.ridingEntity instanceof EntityLivingBase) + { + EntityLivingBase entitylivingbase1 = (EntityLivingBase) p_77032_1_.ridingEntity; + f2 = this.interpolateRotation(entitylivingbase1.prevRenderYawOffset, entitylivingbase1.renderYawOffset, p_76986_9_); + f4 = MathHelper.wrapAngleTo180_float(f3 - f2); + + if (f4 < -85.0F) + { + f4 = -85.0F; + } + + if (f4 >= 85.0F) + { + f4 = 85.0F; + } + + f2 = f3 - f4; + + if (f4 * f4 > 2500.0F) + { + f2 += f4 * 0.2F; + } + } + + float f13 = p_77032_1_.prevRotationPitch + (p_77032_1_.rotationPitch - p_77032_1_.prevRotationPitch) * p_76986_9_; + f4 = this.handleRotationFloat(p_77032_1_, p_76986_9_); + //this.rotateCorpse((AbstractClientPlayer) p_77032_1_, f4, f2, p_76986_9_); + float f5 = 0.0625F; + //GL11.glEnable(GL12.GL_RESCALE_NORMAL); + //GL11.glScalef(-1.0F, -1.0F, 1.0F); + //this.preRenderCallback(p_77032_1_, p_76986_9_); + //GL11.glTranslatef(0.0F, -24.0F * f5 - 0.0078125F, 0.0F); + float f6 = p_77032_1_.prevLimbSwingAmount + (p_77032_1_.limbSwingAmount - p_77032_1_.prevLimbSwingAmount) * p_76986_9_; + float f7 = p_77032_1_.limbSwing - p_77032_1_.limbSwingAmount * (1.0F - p_76986_9_); + + if (p_77032_1_.isChild()) + { + f7 *= 3.0F; + } + + if (f6 > 1.0F) + { + f6 = 1.0F; + } + + this.func_82408_c(p_77032_1_, p_77032_2_, itemstack); + + modelbiped.render(p_77032_1_, f7, f6, f4, f3 - f2, f13, f5); + + RenderManager.instance.renderEngine.bindTexture(resource); + //this.func_82408_c(p_77032_1_, p_77032_2_, itemstack); + //event.renderer.setRenderPassModel(modelbiped); + + float c1 = (j >> 16 & 255) / 255.0F; + float c2 = (j >> 8 & 255) / 255.0F; + float c3 = (j & 255) / 255.0F; + GL11.glColor3f(c1, c2, c3); + + //GL11.glColor3f(1.0F, 1.0F, 1.0F); + + if (itemstack.isItemEnchanted()) + { + event.result = 15; + return modelbiped; + } + + //return 1; + event.result = 1; + return modelbiped; + */ + + } + + GL11.glColor3f(1.0F, 1.0F, 1.0F); + + if (itemstack.isItemEnchanted()) + { + event.result = 15; + return modelbiped; + } + + //return 1; + event.result = 1; + + return modelbiped; + } + + return null; + + } + + protected void func_82408_c(EntityLivingBase p_82408_1_, int p_82408_2_, float p_82408_3_) + { + //ItemStack itemstack = p_82408_1_.inventory.armorItemInSlot(3 - p_82408_2_); + EquipmentStats e = EntityPlayerManager.getEquipmentStats((EntityPlayer) p_82408_1_); + //ItemStack itemstack = e.inventory.getStackInSlot(3 - p_82408_2_); + ItemStack itemstack = e.inventory.getStackInSlot(p_82408_2_); + + if (itemstack != null) + { + Item item = itemstack.getItem(); + + if (item instanceof ItemArmor) + { + RenderManager.instance.renderEngine.bindTexture(RenderBiped.getArmorResource(p_82408_1_, itemstack, p_82408_2_, "overlay")); + GL11.glColor3f(1.0F, 1.0F, 1.0F); + } + } + } + + private float interpolateRotation(float p_77034_1_, float p_77034_2_, float p_77034_3_) + { + float f3; + + for (f3 = p_77034_2_ - p_77034_1_; f3 < -180.0F; f3 += 360.0F) + { + ; + } + + while (f3 >= 180.0F) + { + f3 -= 360.0F; + } + + return p_77034_1_ + p_77034_3_ * f3; + } + + protected float handleRotationFloat(EntityLivingBase p_77044_1_, float p_77044_2_) + { + return p_77044_1_.ticksExisted + p_77044_2_; + } + + protected void rotateCorpse(AbstractClientPlayer p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) + { + if (p_77043_1_.isEntityAlive() && p_77043_1_.isPlayerSleeping()) + { + GL11.glRotatef(p_77043_1_.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F); + GL11.glRotatef(this.getDeathMaxRotation(p_77043_1_), 0.0F, 0.0F, 1.0F); + GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F); + } + else + { + this.rotateCorpse2(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_); + } + } + + protected void rotateCorpse2(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) + { + GL11.glRotatef(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); + + if (p_77043_1_.deathTime > 0) + { + float f3 = (p_77043_1_.deathTime + p_77043_4_ - 1.0F) / 20.0F * 1.6F; + f3 = MathHelper.sqrt_float(f3); + + if (f3 > 1.0F) + { + f3 = 1.0F; + } + + GL11.glRotatef(f3 * this.getDeathMaxRotation(p_77043_1_), 0.0F, 0.0F, 1.0F); + } + else + { + String s = EnumChatFormatting.getTextWithoutFormattingCodes(p_77043_1_.getCommandSenderName()); + + if ((s.equals("Dinnerbone") || s.equals("Grumm")) && (!(p_77043_1_ instanceof EntityPlayer) || !((EntityPlayer) p_77043_1_).getHideCape())) + { + GL11.glTranslatef(0.0F, p_77043_1_.height + 0.1F, 0.0F); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + } + } + } + + protected float getDeathMaxRotation(EntityLivingBase p_77037_1_) + { + return 90.0F; + } + + //霆願サク縺ョ邱壹ョ謠丞 + @SubscribeEvent + public void onDrawBlockHighlight(DrawBlockHighlightEvent event) { + + EntityPlayer player = event.player; + ItemStack itemstack = event.currentItem; + MovingObjectPosition target = event.target; + + if (player == null) + { + return; + } + + //if(itemstack == null) + //{ + // return; + // } + + if (EntityPlayerManager.getCustomPlayerData(player).getEquipmentStats().inventory.getStackInSlot(EquipmentType.Face.getSlots()[0]) == null) { + return; + } + + if (!(EntityPlayerManager.getCustomPlayerData(player).getEquipmentStats().inventory.getStackInSlot(EquipmentType.Face.getSlots()[0]).getItem() instanceof IGearForceGridItem)) + { + return; + } + + if (target.typeOfHit != MovingObjectType.BLOCK) + { + return; + } + // + if (!(player.worldObj.getTileEntity(target.blockX, target.blockY, target.blockZ) instanceof IGearForceGrid)) { + return; + } + + double x = target.blockX; + double y = target.blockY; + double z = target.blockZ; + + IGearForceGrid tileEntity = (IGearForceGrid) player.worldObj.getTileEntity(target.blockX, target.blockY, target.blockZ); + + //if(tileEntity==null){ + // return ; + //}/ + + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + //GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + GL11.glLineWidth(2.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDepthMask(false); + + double d0 = player.lastTickPosX + (player.posX - player.lastTickPosX) * event.partialTicks; + double d1 = player.lastTickPosY + (player.posY - player.lastTickPosY) * event.partialTicks; + double d2 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.partialTicks; + + float f1 = 0.002F; + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + if (tileEntity.canIn(d)) { + this.drawInFromDirection((int) x, (int) y, (int) z, d0, d1, d2, d); + } + } + + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + if (tileEntity.canOut(d)) { + this.drawOutFromDirection((int) x, (int) y, (int) z, d0, d1, d2, d); + } + } + + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + + } + + private void drawOutFromDirection(int x, int y, int z, double d0, double d1, double d2, ForgeDirection d) { + + float f1 = 0.002F; + + GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.8F); + double x1 = x + d.offsetX; + double y1 = y + d.offsetY; + double z1 = z + d.offsetZ; + AxisAlignedBB axisAlignedBB = AxisAlignedBB.getBoundingBox(x1, y1, z1, x1 + 1.0D, y1 + 1.0D, z1 + 1.0D); + axisAlignedBB = axisAlignedBB.expand(f1, f1, f1).getOffsetBoundingBox(-d0, -d1, -d2); + this.drawOutlinedBoundingBox(axisAlignedBB); + + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + + } + + private void drawInFromDirection(int x, int y, int z, double d0, double d1, double d2, ForgeDirection d) { + + float f1 = 0.002F; + + GL11.glColor4f(0.0F, 1.0F, 0.0F, 0.7F); + double x2 = x + d.offsetX; + double y2 = y + d.offsetY; + double z2 = z + d.offsetZ; + AxisAlignedBB axisAlignedBB2 = AxisAlignedBB.getBoundingBox(x2, y2, z2, x2 + 1.0D, y2 + 1.0D, z2 + 1.0D); + axisAlignedBB2 = axisAlignedBB2.expand(f1, f1, f1).getOffsetBoundingBox(-d0, -d1, -d2); + this.drawOutlinedBoundingBox(axisAlignedBB2); + + GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); + + } + + private void drawOutlinedBoundingBox(AxisAlignedBB par1AxisAlignedBB) + { + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawing(3); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); + tessellator.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); + tessellator.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); + tessellator.draw(); + tessellator.startDrawing(3); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); + tessellator.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); + tessellator.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); + tessellator.draw(); + tessellator.startDrawing(1); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); + tessellator.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); + tessellator.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); + tessellator.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ); + tessellator.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ); + tessellator.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); + tessellator.draw(); + } } diff --git a/src/main/java/shift/sextiarysector/event/CommonEventHandler.java b/src/main/java/shift/sextiarysector/event/CommonEventHandler.java index d9e28d4..caee708 100644 --- a/src/main/java/shift/sextiarysector/event/CommonEventHandler.java +++ b/src/main/java/shift/sextiarysector/event/CommonEventHandler.java @@ -1,61 +1,216 @@ package shift.sextiarysector.event; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLeavesBase; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntitySquid; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.ItemShears; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; import net.minecraft.world.World; -import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.common.BiomeDictionary.Type; +import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; +import net.minecraftforge.event.world.BlockEvent; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSAchievement; import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SSFluids.SSFluid; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.api.event.BlockBottleEvent; import shift.sextiarysector.block.BlockMonitor; import shift.sextiarysector.block.BlockMonitor.MonitorType; -import shift.sextiarysector.module.ModuleAchievement; +import shift.sextiarysector.item.ItemKnife; import cpw.mods.fml.common.eventhandler.SubscribeEvent; - public class CommonEventHandler { @SubscribeEvent public void useEvent(PlayerInteractEvent event) { - ItemStack item = event.entityPlayer.getCurrentEquippedItem(); EntityPlayer p = event.entityPlayer; - if(item!=null && item.getItem()==Items.fireworks && item.stackTagCompound !=null){ + if (item != null && item.getItem() == Items.fireworks && item.stackTagCompound != null) { NBTTagCompound nbt = item.getTagCompound().getCompoundTag("Fireworks"); if (nbt != null) - { + { NBTTagList nbttaglist = nbt.getTagList("Explosions", 10); if (nbttaglist != null && nbttaglist.tagCount() > 0) - { + { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(0); byte b0 = nbttagcompound1.getByte("Type"); - if(b0==3){ - p.addStat(ModuleAchievement.creeperFirework, 1); + if (b0 == 3) { + p.addStat(SSAchievement.creeperFirework, 1); + } + + } + + } + + } + + } + + /*辟。逅縺ァ縺励◆(笊ケ笳。笊ケ) + @SubscribeEvent + public void useBottleEvent(PlayerInteractEvent event) { + + ItemStack item = event.entityPlayer.getCurrentEquippedItem(); + EntityPlayer p = event.entityPlayer; + World w = event.world; + + if (item == null) return; + + if (item.getItem() != Items.glass_bottle) return; + + //if(w.isRemote)return; + + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(w, p, true); + + if (movingobjectposition == null) + { + return; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!w.canMineBlock(p, i, j, k)) + { + return; + } + + if (!p.canPlayerEdit(i, j, k, movingobjectposition.sideHit, item)) + { + return; + } + + if (w.getBlock(i, j, k) == SSBlocks.drinkingWater) + { + --item.stackSize; + event.useItem = Result.DENY; + if (event.action.equals(Action.RIGHT_CLICK_AIR)) { + event.setCanceled(true); + event.useItem = Result.DEFAULT; } - } + //event.setResult(Result.DENY); - } + if (item.stackSize <= 0) + { + p.inventory.setInventorySlotContents(p.inventory.currentItem, new ItemStack(SSItems.drinkingWaterBottle)); + return; + //return new ItemStack(SSItems.drinkingWaterSmallBottle); + } + if (!p.inventory.addItemStackToInventory(new ItemStack(SSItems.drinkingWaterBottle))) + { + p.dropPlayerItemWithRandomChoice(new ItemStack(SSItems.drinkingWaterBottle, 1, 0), false); + } + } + } + return; } + }*/ + + protected MovingObjectPosition getMovingObjectPositionFromPlayer(World p_77621_1_, EntityPlayer p_77621_2_, boolean p_77621_3_) + { + float f = 1.0F; + float f1 = p_77621_2_.prevRotationPitch + (p_77621_2_.rotationPitch - p_77621_2_.prevRotationPitch) * f; + float f2 = p_77621_2_.prevRotationYaw + (p_77621_2_.rotationYaw - p_77621_2_.prevRotationYaw) * f; + double d0 = p_77621_2_.prevPosX + (p_77621_2_.posX - p_77621_2_.prevPosX) * f; + double d1 = p_77621_2_.prevPosY + (p_77621_2_.posY - p_77621_2_.prevPosY) * f + (p_77621_1_.isRemote ? p_77621_2_.getEyeHeight() - p_77621_2_.getDefaultEyeHeight() : p_77621_2_.getEyeHeight()); // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences + double d2 = p_77621_2_.prevPosZ + (p_77621_2_.posZ - p_77621_2_.prevPosZ) * f; + Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); + float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 5.0D; + if (p_77621_2_ instanceof EntityPlayerMP) + { + d3 = ((EntityPlayerMP) p_77621_2_).theItemInWorldManager.getBlockReachDistance(); + } + Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); + return p_77621_1_.func_147447_a(vec3, vec31, p_77621_3_, !p_77621_3_, false); } /**繧ッ繝ェ繝シ繝代シ繝√ぉ繧ケ繝*/ @SubscribeEvent + public void LivingSleepingEvent(PlayerWakeUpEvent event) { + + if (event.entityPlayer.worldObj.isRemote) { + return; + } + + if (!(event.entityPlayer instanceof EntityPlayerMP)) { + return; + } + + EntityPlayerMP player = (EntityPlayerMP) event.entityLiving; + + if (!player.func_147099_x().hasAchievementUnlocked(SSAchievement.creeperFirework) || player.func_147099_x().hasAchievementUnlocked(SSAchievement.creeperChest)) { + return; + } + + int x = (int) player.posX; + int y = (int) player.posY; + int z = (int) player.posZ; + World world = player.worldObj; + + int range = 1; + for (int i = -range; i < range; i++) { + for (int j = -range; j < range; j++) { + for (int k = -range; k < range; k++) { + if (world.isAirBlock(x + i, y + k, z + j)) { + if (generateChest(world, x + i, y + k, z + j)) { + player.addStat(SSAchievement.creeperChest, 1); + return; + } + } + } + } + } + + } + + /**繧ッ繝ェ繝シ繝代シ繝√ぉ繧ケ繝*/ + /* + @SubscribeEvent public void livingSleepingEvent(LivingUpdateEvent event) { if (event.entityLiving.worldObj.isRemote) { return; @@ -69,7 +224,7 @@ public void livingSleepingEvent(LivingUpdateEvent event) { EntityPlayerMP player = (EntityPlayerMP) event.entityLiving; - if(!player.func_147099_x().hasAchievementUnlocked(ModuleAchievement.creeperFirework)||player.func_147099_x().hasAchievementUnlocked(ModuleAchievement.creeperChest)){ + if(!player.func_147099_x().hasAchievementUnlocked(SSAchievement.creeperFirework)||player.func_147099_x().hasAchievementUnlocked(SSAchievement.creeperChest)){ return; } @@ -88,7 +243,7 @@ public void livingSleepingEvent(LivingUpdateEvent event) { for(int k = -range; k < range; k++){ if (world.isAirBlock(x + i, y + k, z + j)) { if (generateChest(world, x + i, y + k, z + j)) { - player.addStat(ModuleAchievement.creeperChest, 1); + player.addStat(SSAchievement.creeperChest, 1); return; } } @@ -99,48 +254,223 @@ public void livingSleepingEvent(LivingUpdateEvent event) { } - } + }*/ protected boolean generateChest(World world, int x, int y, int z) { - boolean isGen = world.setBlock(x, y, z,SSBlocks.creeperChest); - if (isGen) - { - TileEntityChest tileEntityChest = (TileEntityChest)world.getTileEntity(x, y, z); - if (tileEntityChest != null) { - - tileEntityChest.setInventorySlotContents(0,new ItemStack(SSBlocks.shippingBox)); - tileEntityChest.setInventorySlotContents(1,BlockMonitor.getMonitor(MonitorType.creeper)); - tileEntityChest.setInventorySlotContents(2,new ItemStack(Items.gunpowder,16)); - tileEntityChest.setInventorySlotContents(3,new ItemStack(Items.diamond,4)); - - return true; - - } - } - return false; + boolean isGen = world.setBlock(x, y, z, SSBlocks.creeperChest); + if (isGen) + { + TileEntityChest tileEntityChest = (TileEntityChest) world.getTileEntity(x, y, z); + if (tileEntityChest != null) { + + tileEntityChest.setInventorySlotContents(0, new ItemStack(SSBlocks.shippingBox)); + tileEntityChest.setInventorySlotContents(1, BlockMonitor.getMonitor(MonitorType.creeper)); + tileEntityChest.setInventorySlotContents(2, new ItemStack(Items.gunpowder, 16)); + tileEntityChest.setInventorySlotContents(3, new ItemStack(Items.diamond, 4)); + + return true; + + } + } + return false; } @SubscribeEvent - public void onSpawn(LivingSpawnEvent.CheckSpawn event) - { - /* + public void onSpawn(LivingSpawnEvent.CheckSpawn event) + { + World world = event.world; - EntityLivingBase living = event.entityLiving; + EntityLivingBase living = event.entityLiving; + + if (world.rand.nextInt(12) != 0) return; + + if (living instanceof IMob) + { + int x = (int) event.x; + int y = (int) event.y; + int z = (int) event.z; + + if (!world.getBlock(x, y, z).isAir(world, x, y, z)) return; + + if (world.getBlock(x, y - 1, z) != Blocks.sand) return; + + if (!BiomeDictionary.isBiomeOfType(world.getBiomeGenForCoords(x, z), Type.BEACH)) return; + + world.setBlock(x, y, z, SSBlocks.sandpit); + + } + } + + @SubscribeEvent + public void onSpawns(WorldEvent.PotentialSpawns event) + { + + World world = event.world; + + if (world.rand.nextInt(6) != 0) return; - if (living instanceof IMob) - { - int x = (int)event.x; - int y = (int)event.y; - int z = (int)event.z; + int x = event.x; + int y = event.y; + int z = event.z; - System.out.println( x+" : "+ y + " : "+ z); + if (!world.getBlock(x, y, z).isAir(world, x, y, z)) return; + + if (world.getBlock(x, y - 1, z) != Blocks.sand) return; + + if (!BiomeDictionary.isBiomeOfType(world.getBiomeGenForCoords(x, z), Type.BEACH)) return; + + world.setBlock(x, y, z, SSBlocks.sandpit); + + } + + /** */ + @SubscribeEvent + public void onPlayerEatenEvent(BlockBottleEvent event) { + + FluidStack fluid = event.fluid; + EntityPlayer player = (EntityPlayer) event.entity; + + if (fluid.getFluid() instanceof SSFluid) { + + SextiarySectorAPI.playerManager.addMoistureStats(player, ((SSFluid) fluid.getFluid()).moisture, ((SSFluid) fluid.getFluid()).moistureSaturation); + + } + + } + + @SubscribeEvent + public void onLivingDrops(LivingDropsEvent event) + { + + if (event.source.getSourceOfDamage() == null || event.source.getEntity() == null) { + return; + } + + Entity entity = event.source.getEntity(); + + if (entity instanceof EntityPlayer) + { + EntityPlayer p = (EntityPlayer) entity; + + ItemStack item = p.getCurrentEquippedItem(); + + if (item == null) { + return; + } + + if (item.getItem() instanceof ItemKnife) { + + double x = event.entityLiving.posX; + double y = event.entityLiving.posY; + double z = event.entityLiving.posZ; + + if (event.entityLiving instanceof EntityCreeper) { + event.drops.add(new EntityItem(event.entityLiving.worldObj, x, y, z, new ItemStack(Items.skull, 1, 4))); + } + + } + + } + + } + + //闡峨▲縺ア + @SubscribeEvent + public void DecayEvent(BlockEvent.HarvestDropsEvent event) + { + + if (event.isSilkTouching) return; + + if (!(event.block instanceof BlockLeavesBase)) return; + + if (event.harvester != null && event.harvester.getCurrentEquippedItem() != null && event.harvester.getCurrentEquippedItem().getItem() instanceof ItemShears) return; + + if (event.world.rand.nextBoolean()) event.drops.add(new ItemStack(Items.stick, event.world.rand.nextInt(1) + 1)); + if (event.world.rand.nextBoolean()) event.drops.add(new ItemStack(SSItems.leaf, event.world.rand.nextInt(2) + 1)); + + byte b0 = 2; + int i1 = b0 + 1; + + if (event.world.checkChunksExist(event.x - i1, event.y - i1, event.z - i1, event.x + i1, event.y + i1, event.z + i1)) + { + for (int j1 = -b0; j1 <= b0; ++j1) + { + for (int k1 = -b0; k1 <= b0; ++k1) + { + for (int l1 = -b0; l1 <= b0; ++l1) + { + Block block = event.world.getBlock(event.x + j1, event.y + k1, event.z + l1); + if (block.isLeaves(event.world, event.x + j1, event.y + k1, event.z + l1)) + { + //block.updateTick(event.world, event.x + j1, event.y + k1, event.z + l1, event.world.rand); + event.world.scheduleBlockUpdate(event.x + j1, event.y + k1, event.z + l1, block, 20 + event.world.rand.nextInt(8)); + } + } + } + } + } + + //for (int i = 0; i < 2; i++) { + // this.updateLeavesTick(event); + //} + + } + + /* + @SubscribeEvent + public void DecayEvent(BlockEvent.BreakEvent event) + { + + byte b0 = 2; + int i1 = b0 + 1; + + if (event.world.checkChunksExist(event.x - i1, event.y - i1, event.z - i1, event.x + i1, event.y + i1, event.z + i1)) + { + for (int j1 = -b0; j1 <= b0; ++j1) + { + for (int k1 = -b0; k1 <= b0; ++k1) + { + for (int l1 = -b0; l1 <= b0; ++l1) + { + Block block = event.world.getBlock(event.x + j1, event.y + k1, event.z + l1); + if (block.isLeaves(event.world, event.x + j1, event.y + k1, event.z + l1)) + { + block.updateTick(event.world, event.x + j1, event.y + k1, event.z + l1, event.world.rand); + } + } + } + } + } + }*/ + + //蜍慕黄縺ョ繝峨Ο繝繝励r蠅励d縺 + @SubscribeEvent + public void onLivingAnimalDrops(LivingDropsEvent event) + { + + if (event.source.getSourceOfDamage() == null || event.source.getEntity() == null) { + return; + } + + double x = event.entityLiving.posX; + double y = event.entityLiving.posY; + double z = event.entityLiving.posZ; + + Random r = event.entityLiving.worldObj.rand; + + if (event.entityLiving instanceof EntitySquid) { + event.drops.add(new EntityItem(event.entityLiving.worldObj, x, y, z, new ItemStack(SSItems.squidSashimi, r.nextInt(5) + 1))); + } + + } + + /* + @SubscribeEvent + public void onFluidRegisterEvent(FluidRegisterEvent event) { - if(world.getBlock(x, y-1, z)!=Blocks.stone){ - world.setBlock(x, y, z, Blocks.stone); - } + FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid(event.fluidID), new ItemStack(SSBlocks.fluidCrafter,1,event.fluidID), new ItemStack(SSBlocks.fluidCrafter,1,0)); - }*/ - } + }*/ } diff --git a/src/main/java/shift/sextiarysector/event/HUDEventHandler.java b/src/main/java/shift/sextiarysector/event/HUDEventHandler.java index 815e6ea..c15a228 100644 --- a/src/main/java/shift/sextiarysector/event/HUDEventHandler.java +++ b/src/main/java/shift/sextiarysector/event/HUDEventHandler.java @@ -9,229 +9,326 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.GuiIngameForge; import net.minecraftforge.client.event.RenderGameOverlayEvent; -import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; -import net.minecraftforge.common.ForgeHooks; + +import org.lwjgl.opengl.GL11; + import shift.sextiarysector.player.EntityPlayerManager; import shift.sextiarysector.player.MoistureStats; import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class HUDEventHandler { public static final ResourceLocation icons = new ResourceLocation("sextiarysector:textures/guis/icons.png"); + public static final ResourceLocation progress = new ResourceLocation("sextiarysector:textures/guis/progress.png"); + + public static int left_height = 39; + public static int right_height = 39; + + protected final Random rand = new Random(); + + public static boolean visibleStamina = false; + public static boolean visibleMoisture = false; + //private boolean ARMOR = false; + + public static Minecraft mc = FMLClientHandler.instance().getClient(); + + //public static boolean isPM = false; + + //謠丞吶ョEvent + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onRenderGameOverlayEventPre(RenderGameOverlayEvent.Pre event) { - public static int left_height = 39; - public static int right_height = 39; - - protected final Random rand = new Random(); - - - private boolean ARMOR = false; + int width = event.resolution.getScaledWidth(); + int height = event.resolution.getScaledHeight(); - public static Minecraft mc = FMLClientHandler.instance().getClient(); + /*if(event.type == ElementType.FOOD && mc.playerController.shouldDrawHUD()){ + renderMoisture( width, height); - //謠丞吶ョEvent - @SubscribeEvent - public void onRenderGameOverlayEvent(RenderGameOverlayEvent event) { + renderStamina( width, height); - int width = event.resolution.getScaledWidth(); - int height = event.resolution.getScaledHeight(); + //renderSeason( width, height); - if(event.type == ElementType.FOOD && mc.playerController.shouldDrawHUD()){ - renderMoisture( width, height); + }*/ - renderStamina( width, height); + /* + if(event.type == ElementType.ARMOR&&ForgeHooks.getTotalArmorValue(mc.thePlayer)>0){ + //System.out.println("AIR"); - //renderSeason( width, height); + if(!ARMOR){ - } + GuiIngameForge.left_height+=(left_height-29); - if(event.type == ElementType.ARMOR&&ForgeHooks.getTotalArmorValue(mc.thePlayer)>0){ - //System.out.println("AIR"); + ARMOR =false; + }else{ + GuiIngameForge.left_height-=(left_height-29); + ARMOR =true; + } + }*/ - if(!ARMOR){ + if (event.type == RenderGameOverlayEvent.ElementType.ALL) + { + visibleStamina = GuiIngameForge.renderFood | GuiIngameForge.renderHealthMount | GuiIngameForge.renderHealth; + visibleMoisture = GuiIngameForge.renderFood | GuiIngameForge.renderHealthMount | GuiIngameForge.renderHealth; + } + else if (event.type == RenderGameOverlayEvent.ElementType.ARMOR) + { + if (visibleStamina) + { + renderStamina(width, height); + visibleStamina = false; + } + } + else if ((event.type == RenderGameOverlayEvent.ElementType.HOTBAR) && (mc.playerController.shouldDrawHUD())) + { + if (visibleMoisture) + { + renderMoisture(width, height); + visibleMoisture = false; + } + if (visibleStamina) + { + renderStamina(width, height); + visibleStamina = false; + } + } - GuiIngameForge.left_height+=(left_height-29); + //HUDMP.isRenderer = false; + //isPM = true; - ARMOR =false; - }else{ - GuiIngameForge.left_height-=(left_height-29); - ARMOR =true; - } - } + } + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onRenderGameOverlayEventPost(RenderGameOverlayEvent.Post event) { + int width = event.resolution.getScaledWidth(); + int height = event.resolution.getScaledHeight(); - } + if ((event.type == RenderGameOverlayEvent.ElementType.FOOD) || (event.type == RenderGameOverlayEvent.ElementType.HEALTHMOUNT)) + { + if (visibleMoisture) { + renderMoisture(width, height); + visibleMoisture = false; + } + if (visibleStamina) { + renderStamina(width, height); + visibleStamina = false; + } - //繧「繧、繝繝繝繧ュ繧ケ繝医★繧峨@ - @SubscribeEvent - public void onRenderGameOverlayEventPost(RenderGameOverlayEvent.Post event) { + /* + if (!visibleMoisture && isPM) { + HUDMP.renderMoney(width, height); + HUDMP.renderAddMoney(width, height); + isPM = false; + HUDMP.isRenderer = false; + }*/ - /*if(event.type == ElementType.EXPERIENCE||event.type == ElementType.JUMPBAR){ + } - }*/ + if (event.type == RenderGameOverlayEvent.ElementType.CROSSHAIRS) { + //renderProgress(width, height); + } + + } - } - - - protected void renderMoisture(int width, int height) - { - - //mc.thePlayer.addStat(StatList.distanceByBoatStat, 2); + //繧「繧、繝繝繝繧ュ繧ケ繝医★繧峨@ + //@SubscribeEvent + //public void onRenderGameOverlayEventPost(RenderGameOverlayEvent.Post event) { + + /*if(event.type == ElementType.EXPERIENCE||event.type == ElementType.JUMPBAR){ + + }*/ + + //} + + protected void renderMoisture(int width, int height) + { + + if (!visibleMoisture) return; + visibleMoisture = false; + + //mc.thePlayer.addStat(StatList.distanceByBoatStat, 2); //System.out.println("StatList"); - mc.mcProfiler.startSection("moisture"); - - bind(icons); - - int updateCounter = mc.ingameGUI.getUpdateCounter()+2; + mc.mcProfiler.startSection("moisture"); - int left = width / 2 + 91; - int top = height - right_height -10; - //right_height += 10; - boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic + bind(icons); + int updateCounter = mc.ingameGUI.getUpdateCounter() + 2; + int left = width / 2 + 91; + //int top = height - right_height -10; + int top = height - GuiIngameForge.right_height; - MoistureStats stats = EntityPlayerManager.getMoistureStats(mc.thePlayer); - int level = EntityPlayerManager.getPrevMoistureLevel(mc.thePlayer); - //int levelLast = stats.getPrevFoodLevel(); + GuiIngameForge.right_height += 10; + //right_height += 10; + boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic - //System.out.println("BBB "+level+" : "+stats.getMoistureLevel()+" : "+stats.getSaturationLevel()); + MoistureStats stats = EntityPlayerManager.getMoistureStats(mc.thePlayer); + int level = EntityPlayerManager.getPrevMoistureLevel(mc.thePlayer); + //int levelLast = stats.getPrevFoodLevel(); - for (int i = 0; i < 10; ++i) - { - int idx = i * 2 + 1; - int x = left - i * 8 - 9; - int y = top; - int icon = 0; - byte backgound = 0; + //System.out.println("BBB "+level+" : "+stats.getMoistureLevel()+" : "+stats.getSaturationLevel()); - int iconY = 0; - int iconX = 0; + for (int i = 0; i < 10; ++i) + { + int idx = i * 2 + 1; + int x = left - i * 8 - 9; + int y = top; + int icon = 0; + byte backgound = 0; + + int iconY = 0; + int iconX = 0; + + if (mc.thePlayer.isPotionActive(Potion.hunger)) + { + iconX += 27; + backgound = 3; + } + + if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this + + if (stats.getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0) + { + y = top + (rand.nextInt(3) - 1); + } - if (mc.thePlayer.isPotionActive(Potion.hunger)) - { - iconX += 27; - backgound = 3; - } + drawTexturedModalRect(x, y, iconX, iconY, 9, 9); - if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this + /* + if (unused) + { + if (idx < levelLast) + drawTexturedModalRect(x, y, icon , iconY, 9, 9); + else if (idx == levelLast) + drawTexturedModalRect(x, y, icon + 9, iconY, 9, 9); + }*/ + + if (idx < level) { + drawTexturedModalRect(x, y, iconX + 9, iconY, 9, 9); + } else if (idx == level) { + drawTexturedModalRect(x, y, iconX + 18, iconY, 9, 9); + } + } - if (stats.getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0) - { - y = top + (rand.nextInt(3) - 1); - } + mc.mcProfiler.endSection(); + bind(Gui.icons); - drawTexturedModalRect(x, y, iconX , iconY, 9, 9); + } + + protected void renderStamina(int width, int height) + { - /* - if (unused) - { - if (idx < levelLast) - drawTexturedModalRect(x, y, icon , iconY, 9, 9); - else if (idx == levelLast) - drawTexturedModalRect(x, y, icon + 9, iconY, 9, 9); - }*/ - - if (idx < level){ - drawTexturedModalRect(x, y, iconX +9, iconY, 9, 9); - }else if (idx == level){ - drawTexturedModalRect(x, y, iconX +18, iconY, 9, 9); - } - } - - mc.mcProfiler.endSection(); - bind(Gui.icons); - - } - - protected void renderStamina(int width, int height) - { - - mc.mcProfiler.startSection("stamina"); - - bind(icons); - - int updateCounter = mc.ingameGUI.getUpdateCounter()+1; - - int left = width / 2 - 82; - int top = height - left_height -10; - //right_height += 10; - boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic - - - int level = EntityPlayerManager.getPrevStaminaLevel(mc.thePlayer); - - for (int i = 0; i < 10; ++i) - { - int idx = i * 2 + 1; - int x = left + i * 8 - 9; - int y = top; - int icon = 0; - byte backgound = 0; - - int iconY = 9; - int iconX = 0; - - /* - if (mc.thePlayer.isPotionActive(Potion.hunger)) - { - icon += 36; - backgound = 13; - }*/ - if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this - - /* - if (mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0) - { - y = top + (rand.nextInt(3) - 1); - } - */ - - drawTexturedModalRect(x, y, icon + backgound * 9, iconY, 9, 9); - - /* - if (unused) - { - if (idx < levelLast) - drawTexturedModalRect(x, y, icon , iconY, 9, 9); - else if (idx == levelLast) - drawTexturedModalRect(x, y, icon + 9, iconY, 9, 9); - }*/ - - if (idx < level){ - drawTexturedModalRect(x, y, icon +9, iconY, 9, 9); - }else if (idx == level){ - drawTexturedModalRect(x, y, icon +18, iconY, 9, 9); - } - } - - mc.mcProfiler.endSection(); - bind(Gui.icons); - - } - - private void bind(ResourceLocation res) - { - FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); - } - - /** 謠丞吩ス阪〒縺ョX Y 繝繧ッ繧ケ繝√Ε縺ァ縺ョX Y 螟ァ縺阪& X Y */ - public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) - { - float zLevel = -90.0F; - - float f = 0.00390625F; - float f1 = 0.00390625F; - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((par1 + 0), (par2 + par6), zLevel, ((par3 + 0) * f), ((par4 + par6) * f1)); - tessellator.addVertexWithUV((par1 + par5), (par2 + par6), zLevel, ((par3 + par5) * f), ((par4 + par6) * f1)); - tessellator.addVertexWithUV((par1 + par5), (par2 + 0), zLevel, ((par3 + par5) * f), ((par4 + 0) * f1)); - tessellator.addVertexWithUV((par1 + 0), (par2 + 0), zLevel, ((par3 + 0) * f), ((par4 + 0) * f1)); - tessellator.draw(); - } + if (!visibleStamina) return; + visibleStamina = false; + + mc.mcProfiler.startSection("stamina"); + + bind(icons); + + int updateCounter = mc.ingameGUI.getUpdateCounter() + 1; + + int left = width / 2 - 82; + int top = height - GuiIngameForge.left_height;//left_height -10; + GuiIngameForge.left_height += 10; + //right_height += 10; + boolean unused = false;// Unused flag in vanilla, seems to be part of a 'fade out' mechanic + + int level = EntityPlayerManager.instance.getStaminaLevel(mc.thePlayer);//getPrevStaminaLevel(mc.thePlayer); + + for (int i = 0; i < 10; ++i) + { + //int idx = i * 2 + 1; + int idx = (i + 1) * 10; + int idx2 = level % 10; + int x = left + i * 8 - 9; + int y = top; + int icon = 0; + byte backgound = 0; + + int iconY = 9; + int iconX = 0; + + /* + if (mc.thePlayer.isPotionActive(Potion.hunger)) + { + icon += 36; + backgound = 13; + }*/ + if (unused) backgound = 1; //Probably should be a += 1 but vanilla never uses this + + /* + if (mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0) + { + y = top + (rand.nextInt(3) - 1); + } + */ + + drawTexturedModalRect(x, y, icon + backgound * 9, iconY, 9, 9); + + /* + if (unused) + { + if (idx < levelLast) + drawTexturedModalRect(x, y, icon , iconY, 9, 9); + else if (idx == levelLast) + drawTexturedModalRect(x, y, icon + 9, iconY, 9, 9); + }*/ + + if (idx <= level) { + drawTexturedModalRect(x, y, icon + 9, iconY, 9, 9); + } else if (idx - level < 10 && idx2 != 0) { + drawTexturedModalRect(x, y, icon + 9 * (idx2 + 1), iconY, 9, 9); + } + } + + mc.mcProfiler.endSection(); + bind(Gui.icons); + + } + + protected void renderProgress(int width, int height) { + + mc.mcProfiler.startSection("SSProgress"); + + bind(progress); + + GL11.glPushMatrix(); + GL11.glEnable(GL11.GL_BLEND); + //OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glTranslatef(-50.0f, -50.0f, 0); + drawTexturedModalRect(width / 2, height / 2, 0, 0, 100, 100); + //OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + + mc.mcProfiler.endSection(); + bind(Gui.icons); + + } + + private void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } + + /** 謠丞吩ス阪〒縺ョX Y 繝繧ッ繧ケ繝√Ε縺ァ縺ョX Y 螟ァ縺阪& X Y */ + public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) + { + float zLevel = -90.0F; + + float f = 0.00390625F; + float f1 = 0.00390625F; + Tessellator tessellator = Tessellator.instance; + tessellator.startDrawingQuads(); + tessellator.addVertexWithUV((par1 + 0), (par2 + par6), zLevel, ((par3 + 0) * f), ((par4 + par6) * f1)); + tessellator.addVertexWithUV((par1 + par5), (par2 + par6), zLevel, ((par3 + par5) * f), ((par4 + par6) * f1)); + tessellator.addVertexWithUV((par1 + par5), (par2 + 0), zLevel, ((par3 + par5) * f), ((par4 + 0) * f1)); + tessellator.addVertexWithUV((par1 + 0), (par2 + 0), zLevel, ((par3 + 0) * f), ((par4 + 0) * f1)); + tessellator.draw(); + } } diff --git a/src/main/java/shift/sextiarysector/event/OreDictionaryEventHandler.java b/src/main/java/shift/sextiarysector/event/OreDictionaryEventHandler.java new file mode 100644 index 0000000..8529abf --- /dev/null +++ b/src/main/java/shift/sextiarysector/event/OreDictionaryEventHandler.java @@ -0,0 +1,33 @@ +package shift.sextiarysector.event; + +import java.util.Locale; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class OreDictionaryEventHandler { + + @SubscribeEvent + public void onOreRegisterEvent(OreRegisterEvent event) { + + String ore = event.Name; + ore = ore.toLowerCase(Locale.ENGLISH); + ItemStack item = event.Ore; + + if (ore.matches(".*salt.*") && !ore.matches(".*condiment.*")) { + + OreDictionary.registerOre("condimentSalt", item); + + } + + if (ore.matches(".water.*") && !ore.matches(".*fluid.*")) { + + OreDictionary.registerOre("fluidWater", item); + + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/event/PlayerStatusEventHandler.java b/src/main/java/shift/sextiarysector/event/PlayerStatusEventHandler.java index 553de95..7174752 100644 --- a/src/main/java/shift/sextiarysector/event/PlayerStatusEventHandler.java +++ b/src/main/java/shift/sextiarysector/event/PlayerStatusEventHandler.java @@ -1,21 +1,40 @@ package shift.sextiarysector.event; +import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.BiomeDictionary.Type; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.AttackEntityEvent; import net.minecraftforge.event.entity.player.PlayerUseItemEvent; +import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; import net.minecraftforge.event.world.BlockEvent.BreakEvent; +import shift.sextiarysector.SSPotions; import shift.sextiarysector.api.SextiarySectorAPI; import shift.sextiarysector.api.event.PlayerEatenEvent; +import shift.sextiarysector.module.ModuleHotSprings; import shift.sextiarysector.player.EntityPlayerManager; +import shift.sextiarysector.player.MoistureStats; +import shift.sextiarysector.player.StaminaStats; import cpw.mods.fml.common.eventhandler.SubscribeEvent; - +import cpw.mods.fml.common.gameevent.TickEvent; + +/*** + * + * 繝励Ξ繧、繝、繝シ髢「菫ゅョEvent + * + * @author Shift02 + * @SpecialThanks Furia + */ public class PlayerStatusEventHandler { /** 鬟溘∋迚ゥ繧帝」溘∋縺滓凾縺ョ蜍穂ス */ @@ -29,6 +48,26 @@ public void onPlayerUseItemEvent(PlayerUseItemEvent.Finish event) { } + /*** + * 遨コ閻ケ譎ゅョ繝繝。繝シ繧ク繧堤┌蜉ケ + */ + + @SubscribeEvent + public void onPlayerUseItemEvent(LivingAttackEvent event) { + + if (!(event.entityLiving instanceof EntityPlayer)) return; + + if (event.source == DamageSource.starve) { + event.setCanceled(true); + } + + } + + @SubscribeEvent + public void onPlayerUseItemEvent(LivingUpdateEvent event) { + + } + /** * 豌エ蛻髢「菫 */ @@ -60,20 +99,33 @@ public void onBlockBreakEvent(BreakEvent event) { @SubscribeEvent public void onLivingHurtEvent(LivingHurtEvent event) { - if (event.entityLiving.worldObj.isRemote - || !(event.entityLiving instanceof EntityPlayer)) { + if (event.entityLiving.worldObj.isRemote || !(event.entityLiving instanceof EntityPlayer)) { return; } EntityPlayer player = (EntityPlayer) event.entityLiving; - SextiarySectorAPI.addMoistureExhaustion(player, event.ammount * 1.4f); + SextiarySectorAPI.addMoistureExhaustion(player, event.ammount * 0.1f); } - // 繧ク繝」繝ウ繝 + //謾サ謦 @SubscribeEvent - public void onLivingJump(LivingJumpEvent event) { + public void onAttackEntityEvent(AttackEntityEvent event) { + + if (event.entityLiving.worldObj.isRemote || !(event.entityLiving instanceof EntityPlayer)) { + return; + } + + EntityPlayer player = (EntityPlayer) event.entityLiving; + + SextiarySectorAPI.addMoistureExhaustion(player, 0.1f); + + } + + //繧ク繝」繝ウ繝 + @SubscribeEvent + public void onLivingJump2(LivingJumpEvent event) { if (!(event.entityLiving instanceof EntityPlayer)) { return; @@ -92,9 +144,9 @@ public void onLivingJump(LivingJumpEvent event) { } if (player.isSprinting()) { - SextiarySectorAPI.addMoistureExhaustion(player, 0.8f * i); + SextiarySectorAPI.addMoistureExhaustion(player, 0.1f * i); } else { - SextiarySectorAPI.addMoistureExhaustion(player, 0.2f * i); + SextiarySectorAPI.addMoistureExhaustion(player, 0.05f * i); } } @@ -113,7 +165,7 @@ public void onBlockBreakEventS(BreakEvent event) { EntityPlayer player = event.getPlayer(); - float i = 0.075f; + float i = 0.75f; if (BiomeDictionary .isBiomeOfType( @@ -133,19 +185,248 @@ public void onBlockBreakEventS(BreakEvent event) { @SubscribeEvent public void onLivingHurtEvent2(LivingHurtEvent event) { - if (event.entityLiving.worldObj.isRemote - || !(event.entityLiving instanceof EntityPlayer)) { + if (event.entityLiving.worldObj.isRemote || !(event.entityLiving instanceof EntityPlayer)) { return; } EntityPlayer player = (EntityPlayer) event.entityLiving; - SextiarySectorAPI.addStaminaExhaustion(player, event.ammount * 1.4f); + SextiarySectorAPI.addStaminaExhaustion(player, event.ammount * 1.2f); } - // 繝吶ャ繝医〒蝗槫セゥ + // 繧ク繝」繝ウ繝 @SubscribeEvent + public void onLivingJump(LivingJumpEvent event) { + + if (!(event.entityLiving instanceof EntityPlayer)) { + return; + } + + if (event.entityLiving.worldObj.isRemote) { + return; + } + + EntityPlayer player = (EntityPlayer) event.entityLiving; + + float i = 1; + + if (BiomeDictionary.isBiomeOfType(player.worldObj.getBiomeGenForCoords((int) player.posX, (int) player.posY), Type.DESERT)) { + i = 2; + } + + if (player.isSprinting()) { + SextiarySectorAPI.addStaminaExhaustion(player, 2.2f * i); + } else { + SextiarySectorAPI.addStaminaExhaustion(player, 0.5f * i); + } + + } + + //謾サ謦 + @SubscribeEvent + public void onAttackEntityEvent2(AttackEntityEvent event) { + + if (event.entityLiving.worldObj.isRemote || !(event.entityLiving instanceof EntityPlayer)) { + return; + } + + EntityPlayer player = (EntityPlayer) event.entityLiving; + + SextiarySectorAPI.addStaminaExhaustion(player, 1.4f); + + } + + //繝吶ャ繝医〒蝗槫セゥ + @SubscribeEvent + public void LivingSleepingEvent(PlayerWakeUpEvent event) { + + if (event.entityPlayer.worldObj.isRemote) { + return; + } + + if (!(event.entityPlayer instanceof EntityPlayer)) { + return; + } + + if (event.updateWorld) return; + + if (!event.entityLiving.worldObj.isRemote) { + + EntityPlayer player = event.entityPlayer; + + if (EntityPlayerManager.getMoistureStats(player).getMoistureLevel() > 4 && player.getFoodStats().getFoodLevel() > 4) { + EntityPlayerManager.getStaminaStats(player).addStats(100, 20.0f); + } else { + EntityPlayerManager.getStaminaStats(player).addStats(40, 0.0f); + } + player.getFoodStats().addExhaustion(16.3f); + SextiarySectorAPI.addMoistureExhaustion(player, 17.3f); + + } + + } + + //Special Thanks ,Furia + @SubscribeEvent + public void playerUpdateEvent(TickEvent.PlayerTickEvent event) { + this.playerNoMoveEvent(event.player); + this.playerSittingEvent(event.player); + this.playerSpaEvent(event.player); + } + + private void playerNoMoveEvent(EntityPlayer player) { + + if (player.worldObj.getTotalWorldTime() % 120 != 0) return; + + if (player.worldObj.rand.nextBoolean()) return; + + if (player.isSneaking()) return; + + StaminaStats stats = EntityPlayerManager.getStaminaStats(player); + if (stats == null) return; + + if (!stats.needStamina()) return; + + MoistureStats moistStats = EntityPlayerManager.getMoistureStats(player); + if (moistStats == null) return; + + if (moistStats.getMoistureLevel() < 1) return; + + if ((int) player.lastTickPosX == (int) player.posX + && (int) player.lastTickPosY == (int) player.posY + && (int) player.lastTickPosZ == (int) player.posZ + && player.motionX == 0 + && player.motionY == 0 + && player.motionZ == 0) { + + if (!player.worldObj.isRemote) { + stats.addStats(1, 0.1f); + moistStats.addExhaustion(0.05f); + player.addExhaustion(0.1f); + } + generateRandomParticles(player, "happyVillager"); + + } + } + + private void playerSittingEvent(EntityPlayer player) { + + if (player.worldObj.getTotalWorldTime() % 70 != 0) + return; + + if (!player.isRiding()) return; + + StaminaStats stats = EntityPlayerManager.getStaminaStats(player); + if (stats == null) return; + + if (!stats.needStamina()) return; + + MoistureStats moistStats = EntityPlayerManager.getMoistureStats(player); + if (moistStats == null) return; + + if (moistStats.getMoistureLevel() < 10) + return; + + if (player.lastTickPosX == player.posX + && player.lastTickPosY == player.posY + && player.lastTickPosZ == player.posZ + && player.motionX == 0 + && player.motionY == 0 + && player.motionZ == 0) { + + stats.addStats(1, 0.0f); + moistStats.addExhaustion(1.4f); + player.addExhaustion(0.05f); + this.generateRandomParticles(player, "happyVillager"); + } + + } + + private void playerSpaEvent(EntityPlayer player) { + + if (player.worldObj.getTotalWorldTime() % 200 != 0) + return; + + StaminaStats stats = EntityPlayerManager.getStaminaStats(player); + if (stats == null) + return; + + if (!stats.needStamina()) + return; + + //spaEffect + if (!player.isInWater()) + return; + + int i = MathHelper.floor_double(player.posX); + int j = MathHelper.floor_double(player.boundingBox.minY); + int k = MathHelper.floor_double(player.posZ); + + for (int offset = 0; offset <= 1; offset++) { + Block spaBlock = player.worldObj.getBlock(i, j + offset, k); + int meta = player.worldObj.getBlockMetadata(i, j + offset, k); + if (spaBlock == null) continue; + + if (ModuleHotSprings.isHotSprings(spaBlock, meta)) { + player.addPotionEffect(new PotionEffect(SSPotions.hotSprings.getId(), 400, 2)); + generateRandomParticles(player, "happyVillager"); + break; + } + } + } + + private void generateRandomParticles(EntityPlayer player, String particleName) + { + for (int i = 0; i < 5; ++i) + { + double d0 = player.getRNG().nextGaussian() * 0.02D; + double d1 = player.getRNG().nextGaussian() * 0.02D; + double d2 = player.getRNG().nextGaussian() * 0.02D; + player.worldObj.spawnParticle(particleName, + player.posX + player.getRNG().nextFloat() * player.width * 2.0F - player.width, + player.posY + 0.2D + player.getRNG().nextFloat() * player.height, + player.posZ + player.getRNG().nextFloat() * player.width * 2.0F - player.width, + d0, d1, d2); + } + } + + /** 繧ケ繧ソ繝溘リ縺ョ繝懊シ繝翫せ */ + /* + @SubscribeEvent + public void livingDashEvent(LivingUpdateEvent event) { + + //if (event.entityLiving.worldObj.isRemote) { + // return; + //} + + if (!(event.entityLiving instanceof EntityPlayer)) { + return; + } + + EntityPlayer player = (EntityPlayer) event.entityLiving; + + if(EntityPlayerManager.getStaminaStats(player).getStaminaLevel()<20){ + + player.motionX *= 0.5; + //player.motionY *= 0.5; + player.motionZ *= 0.5; + + }else if(player.isSprinting() && !player.isAirBorne){ + + player.motionX *= 1.4; + //player.motionY *= 1.4; + player.motionZ *= 1.4; + + } + + + + + }*/ + + // 繝吶ャ繝医〒蝗槫セゥ + /*@SubscribeEvent public void LivingSleepingEvent(LivingUpdateEvent event) { if (event.entityLiving.worldObj.isRemote) { return; @@ -161,23 +442,19 @@ public void LivingSleepingEvent(LivingUpdateEvent event) { if (player.isPlayerFullyAsleep()) { - if (EntityPlayerManager.getMoistureStats(player) - .getMoistureLevel() > 4 - && player.getFoodStats().getFoodLevel() > 4) { - EntityPlayerManager.getStaminaStats(player).addStats(1000, - 500); + if (EntityPlayerManager.getMoistureStats(player).getMoistureLevel() > 4&& player.getFoodStats().getFoodLevel() > 4) { + EntityPlayerManager.getStaminaStats(player).addStats(100, 20.0f); } else { - EntityPlayerManager.getStaminaStats(player).addStats(300, - 100); + EntityPlayerManager.getStaminaStats(player).addStats(40, 0.0f); } - player.getFoodStats().addExhaustion(34f); - SextiarySectorAPI.addMoistureExhaustion(player, 34f); + player.getFoodStats().addExhaustion(21.0f); + SextiarySectorAPI.addMoistureExhaustion(player, 21.0f); // System.out.println("LivingSleepingEvent"); } } - } + }*/ } diff --git a/src/main/java/shift/sextiarysector/event/PlayerUnitEventHandler.java b/src/main/java/shift/sextiarysector/event/PlayerUnitEventHandler.java new file mode 100644 index 0000000..3bb7641 --- /dev/null +++ b/src/main/java/shift/sextiarysector/event/PlayerUnitEventHandler.java @@ -0,0 +1,388 @@ +package shift.sextiarysector.event; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.living.LivingHurtEvent; +import net.minecraftforge.event.entity.player.PlayerEvent; +import shift.mceconomy2.api.MCEconomyAPI; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.player.EntityPlayerManager; +import shift.sextiarysector.player.EquipmentStats; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class PlayerUnitEventHandler { + + @SubscribeEvent + public void livingDashEvent(LivingUpdateEvent event) { + + //if (event.entityLiving.worldObj.isRemote) { + // return; + //} + + /* + if (!(event.entityLiving instanceof EntityPlayer)) { + return; + } + + EntityPlayer player = (EntityPlayer) event.entityLiving; + + if (player.capabilities.isCreativeMode) return; + + if (!player.onGround) return; + + if (EntityPlayerManager.getStaminaStats(player).getStaminaLevel() < 5) { + + player.motionX *= 0.7; + //player.motionY *= 0.5; + player.motionZ *= 0.7; + //player.capabilities.setPlayerWalkSpeed(0.08f); + + } else if (EntityPlayerManager.getStaminaStats(player).getStaminaLevel() >= 30 && player.isSprinting() && Math.abs(player.motionX) <= getMaxMove() && Math.abs(player.motionZ) <= getMaxMove()) { + + player.motionX *= 1.1; + //player.motionY *= 1.4; + player.motionZ *= 1.1; + //player.capabilities.setPlayerWalkSpeed(0.16f); + + }*/ + + } + + public float getMaxMove() { + + return 3.4f; + + } + + //Unit髢「菫ゅョEvent + + @SubscribeEvent + public void playerAttackEvent(LivingHurtEvent event) { + + if (!(event.source.getEntity() instanceof EntityPlayer)) return; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats((EntityPlayer) event.source.getEntity()); + + for (int i = 0; i < EquipmentType.Unit.getSlots().length; i++) { + ItemStack item = e.inventory.getStackInSlot(EquipmentType.Unit.getSlots()[i]); + + if (item != null && item.getItem() != null && item.getItem() == SSItems.attackUnit) { + event.ammount++; + } + + } + + } + + @SubscribeEvent + public void playeDefenseEvent(LivingHurtEvent event) { + + if (!(event.entity instanceof EntityPlayer)) return; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats((EntityPlayer) event.entity); + + for (int i = 0; i < EquipmentType.Unit.getSlots().length; i++) { + ItemStack item = e.inventory.getStackInSlot(EquipmentType.Unit.getSlots()[i]); + + if (item != null && item.getItem() != null && item.getItem() == SSItems.defenseUnit) { + event.ammount--; + } + + } + + if (event.ammount < 0) { + event.ammount = 0; + } + + } + + @SubscribeEvent + public void playeHarvestCheckEvent(PlayerEvent.HarvestCheck event) { + + if (!(event.entity instanceof EntityPlayer)) return; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats((EntityPlayer) event.entity); + + Block block = event.block; + + for (int i = 0; i < EquipmentType.Unit.getSlots().length; i++) { + + ItemStack item = e.inventory.getStackInSlot(EquipmentType.Unit.getSlots()[i]); + + if (item == null) continue; + + if (item.getItem() == null) continue; + + if (item.getItem() == SSItems.pickaxeUnit) { + + for (int meta = 0; meta < 16; meta++) { + String tool = block.getHarvestTool(meta); + + if (tool == null) continue; + + if (tool.equals("pickaxe") && block.getHarvestLevel(meta) <= 1) { + event.success = true; + } + } + + } + + } + + } + + //jump繝ヲ繝九ャ繝 + @SubscribeEvent + public void onLivingJump(LivingJumpEvent event) { + + if (!(event.entityLiving instanceof EntityPlayer)) { + return; + } + + //if (event.entityLiving.worldObj.isRemote) { + // return; + //} + + EntityPlayer player = (EntityPlayer) event.entityLiving; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats((EntityPlayer) event.entity); + + double size = 0; + + for (int i = 0; i < EquipmentType.Unit.getSlots().length; i++) { + + ItemStack item = e.inventory.getStackInSlot(EquipmentType.Unit.getSlots()[i]); + + if (item == null) continue; + + if (item.getItem() == null) continue; + + if (item.getItem() == SSItems.jumpUnit) { + size += 0.1; + } + + } + + //System.out.println(size); + player.motionY += size; + + } + + //縺ゥ縺薙〒繧ら擅逵 + /* + @SubscribeEvent + public void onSleep(PlayerInteractEvent event) { + + if (event.action != Action.RIGHT_CLICK_BLOCK) return; + + System.out.println("aaa"); + if (!event.entityPlayer.isSneaking()) return; + + System.out.println("baaa"); + + if (event.entityPlayer.getCurrentEquippedItem() != null) return; + + System.out.println("caaa"); + + if (event.world.isRemote) return; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats(event.entityPlayer); + + for (int i = 0; i < EquipmentType.Unit.getSlots().length; i++) { + + ItemStack item = e.inventory.getStackInSlot(EquipmentType.Unit.getSlots()[i]); + + if (item == null) continue; + + if (item.getItem() == null) continue; + + if (item.getItem() == SSItems.bedMonsterUnit) { + System.out.println("daaa"); + event.entityPlayer.sleepInBedAt(event.x, event.y + 1, event.z); + return; + + } + + } + + //double y = event.world.getBlock(event.x, event.y, event.z).getBlockBoundsMaxY(); + + }*/ + + public boolean checkBed(World w, int x, int y, int z) { + + return false; + } + + //逹。逵繝ヲ繝九ャ繝 + /* + @SubscribeEvent + public void onSleep(PlayerSleepInBedEvent event) { + + EntityPlayer player = (EntityPlayer) event.entityLiving; + + NBTTagCompound nbt = player.getEntityData(); + NBTTagCompound ssnbt; + if (!nbt.hasKey("ss2")) { + + ssnbt = new NBTTagCompound(); + nbt.setTag("ss2", ssnbt); + + } else { + ssnbt = nbt.getCompoundTag("ss2"); + } + + if (ssnbt.hasKey("bed")) { + ssnbt.removeTag("bed"); + player.worldObj.isRemote = false; + return; + } + + EquipmentStats e = EntityPlayerManager.getEquipmentStats((EntityPlayer) event.entity); + + for (int i = 0; i < EquipmentType.Unit.getSlots().length; i++) { + + ItemStack item = e.inventory.getStackInSlot(EquipmentType.Unit.getSlots()[i]); + + if (item == null) continue; + + if (item.getItem() == null) continue; + + if (item.getItem() == SSItems.bedMonsterUnit) { + + if (!player.worldObj.isRemote) + { + if (player.isPlayerSleeping() || !player.isEntityAlive()) + { + return; + } + + if (!player.worldObj.provider.isSurfaceWorld()) + { + return; + } + + if (player.worldObj.isDaytime()) + { + return; + } + + if (Math.abs(player.posX - event.x) > 3.0D || Math.abs(player.posY - event.y) > 2.0D || Math.abs(player.posZ - event.z) > 3.0D) + { + return; + } + + event.result = EntityPlayer.EnumStatus.OK; + + if (player.isRiding()) + { + player.mountEntity((Entity) null); + } + + player.sleepInBedAt(event.x, event.y, event.z); + + player.worldObj.updateAllPlayersSleepingFlag(); + + return; + + } else { + return; + } + + } + + } + + }*/ + + protected void setSize(EntityPlayer p, float p_70105_1_, float p_70105_2_) + { + float f2; + + if (p_70105_1_ != p.width || p_70105_2_ != p.height) + { + f2 = p.width; + p.width = p_70105_1_; + p.height = p_70105_2_; + p.boundingBox.maxX = p.boundingBox.minX + p.width; + p.boundingBox.maxZ = p.boundingBox.minZ + p.width; + p.boundingBox.maxY = p.boundingBox.minY + p.height; + + if (p.width > f2 && !p.worldObj.isRemote) + { + p.moveEntity(f2 - p.width, 0.0D, f2 - p.width); + } + } + + f2 = p_70105_1_ % 2.0F; + + if (f2 < 0.375D) + { + p.myEntitySize = Entity.EnumEntitySize.SIZE_1; + } + else if (f2 < 0.75D) + { + p.myEntitySize = Entity.EnumEntitySize.SIZE_2; + } + else if (f2 < 1.0D) + { + p.myEntitySize = Entity.EnumEntitySize.SIZE_3; + } + else if (f2 < 1.375D) + { + p.myEntitySize = Entity.EnumEntitySize.SIZE_4; + } + else if (f2 < 1.75D) + { + p.myEntitySize = Entity.EnumEntitySize.SIZE_5; + } + else + { + p.myEntitySize = Entity.EnumEntitySize.SIZE_6; + } + } + + //繝ェ繝ウ繧ー + @SubscribeEvent(priority = EventPriority.HIGH) + public void onPlayerCloneEvent(net.minecraftforge.event.entity.player.PlayerEvent.Clone event) + { + + if (!event.wasDeath) return; + + if (!(event.original instanceof EntityPlayer)) return; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats(event.original); + + int mp = (int) (MCEconomyAPI.getPlayerMP(event.original) / 4.0f); + int xp = (int) (event.original.experienceLevel / 4.0f); + + for (int i = 0; i < EquipmentType.Other.getSlots().length; i++) { + + ItemStack item = e.inventory.getStackInSlot(EquipmentType.Other.getSlots()[i]); + + if (item != null && item.getItem() == SSItems.mpRing) { + + int reduce = MCEconomyAPI.reducePlayerMP(event.original, mp, false); + MCEconomyAPI.addPlayerMP(event.entityPlayer, reduce, false); + e.inventory.setInventorySlotContents(EquipmentType.Other.getSlots()[i], null); + + } else if (item != null && item.getItem() == SSItems.xpRing) { + + event.entityPlayer.experienceLevel += xp; + event.original.experienceLevel -= xp; + e.inventory.setInventorySlotContents(EquipmentType.Other.getSlots()[i], null); + + } + + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/event/SantaEventHandler.java b/src/main/java/shift/sextiarysector/event/SantaEventHandler.java new file mode 100644 index 0000000..b0a1af7 --- /dev/null +++ b/src/main/java/shift/sextiarysector/event/SantaEventHandler.java @@ -0,0 +1,150 @@ +package shift.sextiarysector.event; + +import java.util.Calendar; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityChest; +import net.minecraft.world.World; +import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +/** + * 繧ッ繝ェ繧ケ繝槭せ逕ィ縺ョEvent
+ * FMLPreInitializationEvent蜀縺ァMinecraftForge.EVENT_BUS縺ォ逋サ骭イ縺吶k縺ィ
+ * 繧オ繝ウ繧ソ縺輔s縺梧桾蜈縺ォ繝励Ξ繧シ繝ウ繝医r鄂ョ縺阪↓譚・縺セ縺 + * + * @version 1.0.0 + * @see FMLPreInitializationEvent + * @author Shift02 + */ +public class SantaEventHandler { + + /** 繧ッ繝ェ繧ケ繝槭せ縺ョ譛 */ + private static final int CHRISTMAS_MONTH = 12; + + /** 繧ッ繝ェ繧ケ繝槭せ縺ョ譌・ */ + private static final int CHRISTMAS_DATE = 25; + + /** + * 繝励Ξ繧、繝、繝シ縺悟ッ昴※縺繧九°縺ョ逶」隕胞vent + * @param event + */ + @SubscribeEvent + public void LivingSleepingEvent(LivingUpdateEvent event) { + + //Client縺ッ繧ュ繝」繝ウ繧サ繝ォ + if (event.entityLiving.worldObj.isRemote) { + return; + } + + //繧ッ繝ェ繧ケ繝槭せ莉・螟悶ッ繧ュ繝」繝ウ繧サ繝ォ + if (!this.isChristmas()) { + return; + } + + //繝励Ξ繧、繝、繝シ莉・螟悶ッ繧ュ繝」繝ウ繧サ繝ォ + //譚台ココ縺ォ縺ゅ£繧九励Ξ繧シ繝ウ繝医ッ縺ゅj縺セ縺帙s笏笏≫拍笏 + if (!(event.entityLiving instanceof EntityPlayer)) { + return; + } + + EntityPlayer player = (EntityPlayer) event.entityLiving; + + //縺吶〒縺ォ蜿励¢蜿悶▲縺ヲ縺繧句エ蜷医ッ繧ュ繝」繝ウ繧サ繝ォ + if (this.hasPresent(player)){ + return; + } + + if (!event.entityLiving.worldObj.isRemote) { + + if (player.isPlayerFullyAsleep()) { + + int x = (int) player.posX; + int y = (int) player.posY; + int z = (int) player.posZ; + World world = player.worldObj; + + int range = 2; + for (int i = -range; i < range; i++){ + for (int j = -range; j < range; j++) { + for(int k = -range; k < range; k++){ + if (world.isAirBlock(x + i, y + k, z + j)) { + if (generateChest(world, x + i, y + k, z + j)) { + this.receivePresent(player); + return; + } + } + } + } + } + + } + + } + + } + + /** + * 繝励Ξ繧シ繝ウ繝育畑繝√ぉ繧ケ繝医ョ逕滓 + * @param world 繝ッ繝シ繝ォ繝 + * @param x x蠎ァ讓 + * @param y y蠎ァ讓 + * @param z z蠎ァ讓 + * @return 逕滓舌〒縺阪◆繧液rue + */ + protected boolean generateChest(World world, int x, int y, int z) + { + boolean isGen = world.setBlock(x, y, z,Blocks.chest); + + if (isGen) + { + TileEntityChest tileEntityChest = (TileEntityChest)world.getTileEntity(x, y, z); + if (tileEntityChest != null) { + + for(int i=0; i<27; i++){ + tileEntityChest.setInventorySlotContents(i,new ItemStack(Blocks.gravel,64)); + } + + return true; + + } + } + + return false; + } + + /** + * 莉頑律縺後け繝ェ繧ケ繝槭せ縺九←縺縺玖ェソ縺ケ繧 + * @return 繧ッ繝ェ繧ケ繝槭せ縺ェ繧液rue + */ + private boolean isChristmas(){ + + Calendar calendar = Calendar.getInstance(); + + return calendar.get(Calendar.DATE) == CHRISTMAS_DATE && calendar.get(calendar.MONTH) == CHRISTMAS_MONTH - 1; + + } + + /** + * 繧オ繝ウ繧ソ縺輔s縺九i繝励Ξ繧シ繝ウ繝医r蜿励¢蜿悶▲縺溘°縺ゥ縺縺
+ * 荳莠コ荳蛟九〒縺吶hシ + * @param player 隱ソ縺ケ繧九励Ξ繧、繝、繝シ + * @return 蜿励¢縺ィ縺」縺ヲ縺繧句エ蜷医ッtrue + */ + private boolean hasPresent(EntityPlayer player){ + return player.getEntityData().hasKey("santa:"+Calendar.getInstance().get(Calendar.YEAR)); + } + + + /** + * 繝励Ξ繧シ繝ウ繝医r貂。縺呎凾縺ォ蜻シ縺カ繝。繧ス繝繝 + * @param player 貂。縺吶励Ξ繧、繝、繝シ + */ + private void receivePresent(EntityPlayer player){ + player.getEntityData().setBoolean("santa:"+Calendar.getInstance().get(Calendar.YEAR), true); + } + +} diff --git a/src/main/java/shift/sextiarysector/event/WorldEventHandler.java b/src/main/java/shift/sextiarysector/event/WorldEventHandler.java index 2efc802..036f8a7 100644 --- a/src/main/java/shift/sextiarysector/event/WorldEventHandler.java +++ b/src/main/java/shift/sextiarysector/event/WorldEventHandler.java @@ -2,10 +2,17 @@ import java.util.Random; +import net.minecraft.init.Blocks; import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.feature.WorldGenLakes; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.common.BiomeDictionary; +import net.minecraftforge.common.BiomeDictionary.Type; import net.minecraftforge.event.terraingen.OreGenEvent; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; +import shift.sextiarysector.Config; import shift.sextiarysector.SSBlocks; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -14,39 +21,145 @@ public class WorldEventHandler { private WorldGenMinable bluestoneGen; private WorldGenMinable yellowstoneGen; + private WorldGenMinable copperOreGen; + private WorldGenMinable zincOreGen; + private WorldGenMinable silverOreGen; + + private WorldGenMinable mithrilOreGen; + private WorldGenMinable orichalcumOreGen; + + private WorldGenMinable coaLargeGen; + private WorldGenMinable ironLarge; + private WorldGenMinable goldLarge; + + private WorldGenMinable silverLarge; + + private WorldGenLakes springWater; + private WorldGenLakes hotSprings; + + //繝舌ル繝ゥ + private WorldGenMinable lapisGen; + private int chunk_X; private int chunk_Z; private World currentWorld; + private BiomeGenBase biome; public Random randomGenerato; @SubscribeEvent - public void onOreGenEvent(OreGenEvent.Pre event) { + public void onOreGenEvent(OreGenEvent.Pre event) { this.randomGenerato = event.rand; this.chunk_X = event.worldX; this.chunk_Z = event.worldZ; this.currentWorld = event.world; + this.biome = event.world.getBiomeGenForCoords(chunk_X, chunk_Z); this.bluestoneGen = new WorldGenMinable(SSBlocks.blueStoneOre, 7); this.yellowstoneGen = new WorldGenMinable(SSBlocks.yellowStoneOre, 7); + copperOreGen = new WorldGenMinable(SSBlocks.copperOre, 10); + zincOreGen = new WorldGenMinable(SSBlocks.zincOre, 8); + silverOreGen = new WorldGenMinable(SSBlocks.silverOre, 8); + + mithrilOreGen = new WorldGenMinable(SSBlocks.mithrilOre, 8); + orichalcumOreGen = new WorldGenMinable(SSBlocks.orichalcumOre, 7); + + coaLargeGen = new WorldGenMinable(SSBlocks.coalLargeOre, 16); + ironLarge = new WorldGenMinable(SSBlocks.ironLargeOre, 8); + goldLarge = new WorldGenMinable(SSBlocks.goldLargeOre, 8); + + silverLarge = new WorldGenMinable(SSBlocks.silverLargeOre, 8); + + this.lapisGen = new WorldGenMinable(Blocks.lapis_ore, 6); this.genStandardOre1(8, this.bluestoneGen, 0, 16); this.genStandardOre1(8, this.yellowstoneGen, 0, 16); + + if (Config.generationCopperOre) this.genStandardOre1(20, this.copperOreGen, 0, 64); + if (Config.generationZincOre) this.genStandardOre1(12, this.zincOreGen, 0, 64); + if (Config.generationSilverOre) this.genStandardOre1(2, this.silverOreGen, 0, 32); + + if (BiomeDictionary.isBiomeOfType(biome, Type.COLD)) { + + this.genStandardOre1(4, mithrilOreGen, 0, 32); + + } else if (BiomeDictionary.isBiomeOfType(biome, Type.HOT)) { + + this.genStandardOre1(1, orichalcumOreGen, 0, 18); + + } + + this.genStandardOre1(10, this.coaLargeGen, 0, 128); + this.genStandardOre1(10, this.ironLarge, 0, 64); + this.genStandardOre1(1, this.goldLarge, 0, 32); + + this.genStandardOre1(1, this.silverLarge, 0, 32); //System.out.println("onOreGenEvent"); + this.genStandardOre1(1, this.lapisGen, 16, 24); + + } + + @SubscribeEvent + public void onPopulateChunkEvent(PopulateChunkEvent.Post event) { + + if (event.world.rand.nextInt(48) == 0) { + + this.randomGenerato = event.rand; + this.chunk_X = event.chunkX * 16; + this.chunk_Z = event.chunkZ * 16; + this.currentWorld = event.world; + this.biome = event.world.getBiomeGenForCoords(chunk_X + 16, chunk_Z + 16); + + this.springWater = new WorldGenLakes(SSBlocks.drinkingWater); + if (BiomeDictionary.isBiomeOfType(biome, Type.FOREST)) { + this.genStandard(1, springWater, 60, 126); + + } + + } + + if (event.world.rand.nextInt(16) == 0) { + + this.randomGenerato = event.rand; + this.chunk_X = event.chunkX * 16; + this.chunk_Z = event.chunkZ * 16; + this.currentWorld = event.world; + this.biome = event.world.getBiomeGenForCoords(chunk_X + 16, chunk_Z + 16); + + this.hotSprings = new WorldGenLakes(SSBlocks.hotSprings); + + this.genStandard(1, hotSprings, 20, 58); + + } + } protected void genStandardOre1(int par1, WorldGenerator par2WorldGenerator, int par3, int par4) - { - for (int l = 0; l < par1; ++l) - { - int i1 = this.chunk_X + this.randomGenerato.nextInt(16); - int j1 = this.randomGenerato.nextInt(par4 - par3) + par3; - int k1 = this.chunk_Z + this.randomGenerato.nextInt(16); - par2WorldGenerator.generate(this.currentWorld, this.randomGenerato, i1, j1, k1); - } - } + { + for (int l = 0; l < par1; ++l) + { + int i1 = this.chunk_X + this.randomGenerato.nextInt(16); + int j1 = this.randomGenerato.nextInt(par4 - par3) + par3; + int k1 = this.chunk_Z + this.randomGenerato.nextInt(16); + par2WorldGenerator.generate(this.currentWorld, this.randomGenerato, i1, j1, k1); + } + } + + protected void genStandard(int par1, WorldGenerator par2WorldGenerator, int par3, int par4) + { + for (int l = 0; l < par1; ++l) + { + int i1 = this.chunk_X + this.randomGenerato.nextInt(16); + int j1 = this.randomGenerato.nextInt(par4 - par3) + par3; + int k1 = this.chunk_Z + this.randomGenerato.nextInt(16); + //if(par2WorldGenerator == this.hotSprings)System.out.println("AAA"+"x " +i1 +" z"+k1); + if (par2WorldGenerator.generate(this.currentWorld, this.randomGenerato, i1, j1, k1)) { + } + + } + } } diff --git a/src/main/java/shift/sextiarysector/fluid/FluidColor.java b/src/main/java/shift/sextiarysector/fluid/FluidColor.java new file mode 100644 index 0000000..b0f1e80 --- /dev/null +++ b/src/main/java/shift/sextiarysector/fluid/FluidColor.java @@ -0,0 +1,23 @@ +package shift.sextiarysector.fluid; + +import net.minecraftforge.fluids.FluidRegistry; +import shift.sextiarysector.SSFluids.SSFluid; +import shift.sextiarysector.api.EnumColor; + +public class FluidColor extends SSFluid { + + public EnumColor color; + + public FluidColor(String fluidName, EnumColor color) { + super(fluidName, 0, 0, 0, 0); + this.color = color; + FluidRegistry.registerFluid(this); + } + + @Override + public int getColor() + { + return color.color; + } + +} diff --git a/src/main/java/shift/sextiarysector/fmp/IShaft.java b/src/main/java/shift/sextiarysector/fmp/IShaft.java new file mode 100644 index 0000000..06dcf70 --- /dev/null +++ b/src/main/java/shift/sextiarysector/fmp/IShaft.java @@ -0,0 +1,23 @@ +package shift.sextiarysector.fmp; + +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; + +public interface IShaft extends IGearForceHandler { + + public void setDirection(ForgeDirection d); + + public ForgeDirection getDirection(); + + public void setRotateStep(float r); + + public float getRotateStep(); + + public EnergyStorage getStorage(); + + public IShaft getInTileEntityShaft(); + + public IShaft getOutTileEntityShaft(); + +} diff --git a/src/main/java/shift/sextiarysector/fmp/ItemBlockShaftPart.java b/src/main/java/shift/sextiarysector/fmp/ItemBlockShaftPart.java new file mode 100644 index 0000000..708e9f7 --- /dev/null +++ b/src/main/java/shift/sextiarysector/fmp/ItemBlockShaftPart.java @@ -0,0 +1,94 @@ +package shift.sextiarysector.fmp; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import shift.sextiarysector.tileentity.TileEntityShaft; +import codechicken.lib.raytracer.RayTracer; +import codechicken.lib.vec.BlockCoord; +import codechicken.lib.vec.Vector3; + +public class ItemBlockShaftPart extends ItemBlock { + + public ItemBlockShaftPart(Block par1) { + super(par1); + } + + @Override + public boolean onItemUse(ItemStack itemStack, EntityPlayer par2EntityPlayer, World par3World, int x, int y, int z, + int side, float hitX, float hitY, float hitZ) + { + MovingObjectPosition hit = RayTracer.reTrace(par3World, par2EntityPlayer); + if (hit == null) { + return false; + } + BlockCoord pos = new BlockCoord(x, y, z); + Vector3 vhit = new Vector3(hitX, hitY, hitZ); + double d = getHitDepth(vhit, side); + if ((d < 1.0D) && (place(itemStack, par2EntityPlayer, par3World, pos, side, vhit))) { + return true; + } + pos.offset(side); + return place(itemStack, par2EntityPlayer, par3World, pos, side, vhit); + + } + + double getHitDepth(Vector3 vhit, int side) + { + return vhit.copy().scalarProject(codechicken.lib.vec.Rotation.axes[side]) + (side % 2 ^ 0x1); + } + + private boolean place(ItemStack item, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 vhit) + { + ShaftPart part = newPart(item, player, world, pos, side, vhit); + if ((part == null) || (!PartRegistry.canPlacePart(world, pos, part))) { + return false; + } + if (!world.isRemote) + { + PartRegistry.addPart(world, pos, part); + world.playSoundEffect(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5, + part.getBlock().stepSound.soundName, + (part.getBlock().stepSound.getVolume() + 1.0F) / 2.0F, + part.getBlock().stepSound.getPitch() * 0.8F); + if (!player.capabilities.isCreativeMode) + { + item.stackSize--; + if (item.stackSize == 0) + { + player.inventory.mainInventory[player.inventory.currentItem] = null; + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(player, item)); + } + } + } + return true; + } + + public ShaftPart newPart(ItemStack arg0, EntityPlayer arg1, World arg2, BlockCoord arg3, int arg4, Vector3 arg5) + { + return new ShaftPart(1, ForgeDirection.getOrientation(arg4), arg2, arg3.x, arg3.y, arg3.z); + } + + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + boolean result = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); + TileEntityShaft tile = (TileEntityShaft) world.getTileEntity(x, y, z); + tile.direction = ForgeDirection.getOrientation(side); + + return result; + } + + /* + @Override + public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer, ItemStack par7ItemStack) + { + return true; + }*/ +} diff --git a/src/main/java/shift/sextiarysector/fmp/PartRegistry.java b/src/main/java/shift/sextiarysector/fmp/PartRegistry.java new file mode 100644 index 0000000..ebb18b0 --- /dev/null +++ b/src/main/java/shift/sextiarysector/fmp/PartRegistry.java @@ -0,0 +1,86 @@ +package shift.sextiarysector.fmp; + +import java.util.Arrays; + +import net.minecraft.block.Block; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.tileentity.TileEntityShaft; +import codechicken.lib.packet.PacketCustom; +import codechicken.lib.vec.BlockCoord; +import codechicken.multipart.MultiPartRegistry; +import codechicken.multipart.MultiPartRegistry.IPartConverter; +import codechicken.multipart.MultiPartRegistry.IPartFactory; +import codechicken.multipart.MultipartGenerator; +import codechicken.multipart.TMultiPart; +import codechicken.multipart.TileMultipart; + +public class PartRegistry implements IPartFactory, IPartConverter { + + public static PartRegistry instance = new PartRegistry(); + + @Override + public Iterable blockTypes() { + return Arrays.asList( + SSBlocks.woodShaft, + SSBlocks.stoneShaft, + SSBlocks.steelShaft, + SSBlocks.ninjaShaft, + SSBlocks.orichalcumShaft + ); + } + + public static void init() + { + //PartRegistry p = new PartRegistry(); + MinecraftForge.EVENT_BUS.register(new ShaftEventHandler()); + PacketCustom.assignHandler(SextiarySector.instance, new SSMultipartSPH()); + MultiPartRegistry.registerConverter(instance); + + MultipartGenerator.registerPassThroughInterface("shift.sextiarysector.fmp.IShaft"); + MultiPartRegistry.registerParts(instance, new String[] { + "sextiarysector:wood_shaft", + "sextiarysector:stone_shaft", + "sextiarysector:steel_shaft", + "sextiarysector:ninja_shaft", + "sextiarysector:orichalcum_shaft" + }); + } + + @Override + public TMultiPart convert(World world, BlockCoord pos) { + Block b = world.getBlock(pos.x, pos.y, pos.z); + int meta = world.getBlockMetadata(pos.x, pos.y, pos.z); + TileEntity tile = world.getTileEntity(pos.x, pos.y, pos.z); + if (b == SSBlocks.woodShaft) return new ShaftPart((TileEntityShaft) tile); + if (b == SSBlocks.stoneShaft) return new ShaftPart((TileEntityShaft) tile); + if (b == SSBlocks.steelShaft) return new ShaftPart((TileEntityShaft) tile); + if (b == SSBlocks.ninjaShaft) return new ShaftPart((TileEntityShaft) tile); + if (b == SSBlocks.orichalcumShaft) return new ShaftPart((TileEntityShaft) tile); + return null; + } + + @Override + public TMultiPart createPart(String name, boolean client) { + + if (name.equals("sextiarysector:wood_shaft")) return new ShaftPart(1); + if (name.equals("sextiarysector:stone_shaft")) return new ShaftPart(2); + if (name.equals("sextiarysector:steel_shaft")) return new ShaftPart(3); + if (name.equals("sextiarysector:ninja_shaft")) return new ShaftPart(4); + if (name.equals("sextiarysector:orichalcum_shaft")) return new ShaftPart(5); + + return null; + } + + public static boolean canPlacePart(World world, BlockCoord pos, ShaftPart part) { + return TileMultipart.canPlacePart(world, pos, part); + } + + public static void addPart(World world, BlockCoord pos, ShaftPart part) { + TileMultipart.addPart(world, pos, part); + } + +} diff --git a/src/main/java/shift/sextiarysector/fmp/SSMultipartSPH.java b/src/main/java/shift/sextiarysector/fmp/SSMultipartSPH.java new file mode 100644 index 0000000..5ef51ee --- /dev/null +++ b/src/main/java/shift/sextiarysector/fmp/SSMultipartSPH.java @@ -0,0 +1,22 @@ +package shift.sextiarysector.fmp; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.play.INetHandlerPlayServer; +import shift.sextiarysector.SextiarySector; +import codechicken.lib.packet.PacketCustom; +import codechicken.lib.packet.PacketCustom.IServerPacketHandler; + +public class SSMultipartSPH implements IServerPacketHandler +{ + public static Object channel = SextiarySector.instance; + + @Override + public void handlePacket(PacketCustom packet, EntityPlayerMP sender, INetHandlerPlayServer netHandler) { + switch (packet.getType()) { + case 1: + ShaftEventHandler.place(sender, sender.worldObj); + break; + } + } + +} diff --git a/src/main/java/shift/sextiarysector/fmp/ShaftEventHandler.java b/src/main/java/shift/sextiarysector/fmp/ShaftEventHandler.java new file mode 100644 index 0000000..6cc301a --- /dev/null +++ b/src/main/java/shift/sextiarysector/fmp/ShaftEventHandler.java @@ -0,0 +1,136 @@ +package shift.sextiarysector.fmp; + +import java.util.NoSuchElementException; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockFence; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent; +import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SextiarySector; +import codechicken.lib.packet.PacketCustom; +import codechicken.lib.raytracer.RayTracer; +import codechicken.lib.vec.BlockCoord; +import codechicken.lib.vec.Vector3; +import codechicken.multipart.TileMultipart; +import codechicken.multipart.minecraft.McBlockPart; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class ShaftEventHandler { + + private final ThreadLocal placing = new ThreadLocal(); + + @SubscribeEvent(priority = EventPriority.LOW) + public void playerInteract(PlayerInteractEvent event) + { + + if (event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer.worldObj.isRemote) + { + if (placing.get() != null) return;//for mods that do dumb stuff and call this event like MFR + placing.set(event); + if (place(event.entityPlayer, event.entityPlayer.worldObj)) event.setCanceled(true); + placing.set(null); + } + } + + public static boolean place(EntityPlayer player, World world) + { + MovingObjectPosition hit = RayTracer.reTrace(world, player); + if (hit == null) + return false; + + BlockCoord pos = new BlockCoord(hit.blockX, hit.blockY, hit.blockZ).offset(hit.sideHit); + ItemStack held = player.getHeldItem(); + McBlockPart part = null; + if (held == null) + return false; + + Block heldBlock = Block.getBlockFromItem(held.getItem()); + if (heldBlock == Blocks.air) + return false; + + if (heldBlock == SSBlocks.woodShaft) part = ShaftPart.placement(1, world, pos, player, hit.sideHit); + if (heldBlock == SSBlocks.stoneShaft) part = ShaftPart.placement(2, world, pos, player, hit.sideHit); + if (heldBlock == SSBlocks.steelShaft) part = ShaftPart.placement(3, world, pos, player, hit.sideHit); + if (heldBlock == SSBlocks.ninjaShaft) part = ShaftPart.placement(4, world, pos, player, hit.sideHit); + if (heldBlock == SSBlocks.orichalcumShaft) part = ShaftPart.placement(5, world, pos, player, hit.sideHit); + + if (part == null) return false; + + if (world.isRemote && !player.isSneaking())//attempt to use block activated like normal and tell the server the right stuff + { + Vector3 f = new Vector3(hit.hitVec).add(-hit.blockX, -hit.blockY, -hit.blockZ); + Block block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ); + if (!ignoreActivate(block) && block.onBlockActivated(world, hit.blockX, hit.blockY, hit.blockZ, player, hit.sideHit, (float) f.x, (float) f.y, (float) f.z)) + { + player.swingItem(); + PacketCustom.sendToServer(new C08PacketPlayerBlockPlacement( + hit.blockX, hit.blockY, hit.blockZ, hit.sideHit, + player.inventory.getCurrentItem(), + (float) f.x, (float) f.y, (float) f.z)); + return true; + } + } + + TileMultipart tile = TileMultipart.getOrConvertTile(world, pos); + if (tile == null || !tile.canAddPart(part)) return false; + + if (!world.isRemote) + { + + try { + + TileMultipart.addPart(world, pos, part); + + world.playSoundEffect(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5, + part.getBlock().stepSound.func_150496_b(), + (part.getBlock().stepSound.getVolume() + 1.0F) / 2.0F, + part.getBlock().stepSound.getPitch() * 0.8F); + if (!player.capabilities.isCreativeMode) + { + held.stackSize--; + if (held.stackSize == 0) + { + player.inventory.mainInventory[player.inventory.currentItem] = null; + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(player, held)); + } + } + + } catch (NoSuchElementException e) { + + SextiarySector.Log.catching(e); + + } catch (Exception e) { + SextiarySector.Log.info("(笊ケ笳。笊ケ)縲後け繝ゥ繝繧キ繝・繧偵☆縺。繧繧翫"); + SextiarySector.Log.catching(e); + } + + } + else + { + player.swingItem(); + new PacketCustom(SSMultipartSPH.channel, 1).sendToServer(); + } + return true; + } + + /** + * Because vanilla is weird. + */ + private static boolean ignoreActivate(Block block) + { + if (block instanceof BlockFence) + return true; + return false; + } + +} diff --git a/src/main/java/shift/sextiarysector/fmp/ShaftPart.java b/src/main/java/shift/sextiarysector/fmp/ShaftPart.java new file mode 100644 index 0000000..b51f94b --- /dev/null +++ b/src/main/java/shift/sextiarysector/fmp/ShaftPart.java @@ -0,0 +1,490 @@ +package shift.sextiarysector.fmp; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.api.gearforce.item.IHammer; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.renderer.block.RendererShaft; +import shift.sextiarysector.renderer.model.ModelShaft; +import shift.sextiarysector.tileentity.TileEntityShaft; +import codechicken.lib.data.MCDataInput; +import codechicken.lib.data.MCDataOutput; +import codechicken.lib.vec.BlockCoord; +import codechicken.lib.vec.Cuboid6; +import codechicken.lib.vec.Vector3; +import codechicken.multipart.JIconHitEffects; +import codechicken.multipart.JNormalOcclusion; +import codechicken.multipart.TMultiPart; +import codechicken.multipart.minecraft.McBlockPart; + +public class ShaftPart extends McBlockPart implements JNormalOcclusion, JIconHitEffects, IShaft { + + //public TileEntityShaft shaft = new TileEntityShaft(); + + //public ForgeDirection direction = ForgeDirection.UNKNOWN; + public TileEntityShaft tShaft = null; + public int sType = 0; + + double minX = 0.25D; + double minY = 0.25D; + double minZ = 0.25D; + double maxX = 0.75D; + double maxY = 0.75D; + double maxZ = 0.75D; + private final Cuboid6 minmam = new Cuboid6(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.8125D, 0.8125D); + + public ShaftPart(int type, ForgeDirection d, World w, int x, int y, int z) { + //this.direction = d; + TileEntityShaft shaft = new TileEntityShaft(type); + shaft.setDirection(d); + shaft.setWorldObj(w); + shaft.xCoord = x; + shaft.yCoord = y; + shaft.zCoord = z; + + this.tShaft = shaft; + this.sType = type; + this.directionChange(); + + } + + public ShaftPart(TileEntityShaft t) { + this.tShaft = t; + this.sType = t.getStorage().getMaxPower(); + this.directionChange(); + } + + public ShaftPart(int type) { + sType = type; + } + + @Override + public Block getBlock() + { + switch (this.sType) { + case 1: + return SSBlocks.woodShaft; + case 2: + return SSBlocks.stoneShaft; + case 3: + return SSBlocks.steelShaft; + case 4: + return SSBlocks.ninjaShaft; + case 5: + return SSBlocks.orichalcumShaft; + } + return SSBlocks.woodShaft; + } + + public int rotateStep = 360; + + @Override + public void update() + { + + //if (rotateStep <= 0) { + // rotateStep += 360; + //} + + //rotateStep -= 2.2; + this.tShaft.setWorldObj(this.world()); + this.tShaft.xCoord = this.x(); + this.tShaft.yCoord = this.y(); + this.tShaft.zCoord = this.z(); + if (this.sType != 0 && this.tShaft.getStorage().getMaxPower() != this.sType) this.tShaft.getStorage().setPowerCapacity(this.sType); + + if (!this.tShaft.getWorldObj().isRemote & this.tShaft.getStorage().getSpeedStored() != this.tShaft.lastSpeed) { + this.tShaft.lastSpeed = (this.tShaft.getStorage().getSpeedStored()); + + sendDescUpdate(); + tile().notifyPartChange(this); + tile().markDirty(); + + } + + this.tShaft.updateEntity(); + + } + + @Override + public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item) + { + + if (item == null || !(item.getItem() instanceof IHammer)) return false; + + World world = world(); + if (world.isRemote) return true; + + //IShaft t = (IShaft) this.world().getTileEntity(this.x(), this.y(), this.z()); + + if (!player.isSneaking()) { + this.changeToHammer(player, part, item); + } else { + //System.out.println("AA"); + //this.breakToHammer(player, part, item); + } + + //this.world().markBlockForUpdate(this.x(), this.y(), this.z()); + + sendDescUpdate(); + tile().notifyPartChange(this); + tile().markDirty(); + + return true; + + } + + private void changeToHammer(EntityPlayer player, MovingObjectPosition part, ItemStack item) { + + if (!((IHammer) item.getItem()).canUse(item, player, 2)) return; + + IShaft t = (IShaft) this.world().getTileEntity(this.x(), this.y(), this.z()); + + ForgeDirection d = t.getDirection(); + + if (d.ordinal() > 4) { + t.setDirection(d.getOrientation(0)); + } else { + t.setDirection(d.getOrientation(d.ordinal() + 1)); + } + + ((IHammer) item.getItem()).use(item, player, 2); + + directionChange(); + this.world().playSoundEffect(this.x(), this.y(), this.z(), this.getBlock().stepSound.getStepResourcePath(), 1.0F, this.world().rand.nextFloat() * 0.1F + 0.6F); + + } + + private void breakToHammer(EntityPlayer player, MovingObjectPosition part, ItemStack item) { + + if (!((IHammer) item.getItem()).canUse(item, player, 10)) return; + + List l = this.tile().jPartList(); + + Iterator i = l.iterator(); + + while (i.hasNext()) { + + if (i == this) { + + EntityItem eItem = new EntityItem(player.worldObj, this.x() + 0.5d, this.y() + 0.5d, this.z() + 0.5d, new ItemStack(this.getBlock(), 1)); + + player.worldObj.spawnEntityInWorld(eItem); + + ((IHammer) item.getItem()).use(item, player, 10); + + //i.remove(); + this.tile().remPart(this); + + } + + } + + } + + public static McBlockPart placement(int type, World world, BlockCoord pos, EntityPlayer player, int side) + { + //pos = pos.copy().offset(side ^ 1); + //if (!world.isSideSolid(pos.x, pos.y, pos.z, ForgeDirection.getOrientation(side))) + // return null; + + //int meta = sideMetaMap[side ^ 1]; + //if (side < 2 && (MathHelper.floor_double(player.rotationYaw / 90 + 0.5) & 1) == 0) + // meta = metaSwapMap[side ^ 1]; + + return new ShaftPart(type, ForgeDirection.getOrientation(side), world, pos.x, pos.y, pos.z); + + } + + private static final ResourceLocation shaftTextures = new ResourceLocation("sextiarysector:textures/models/shaft.png"); + static public ModelShaft modelShaft = new ModelShaft(); + + @Override + public void renderDynamic(Vector3 pos, float frame, int pass) + { + + /*this.tShaft.setWorldObj(this.world()); + this.tShaft.xCoord = this.x(); + this.tShaft.yCoord = this.y(); + this.tShaft.zCoord = this.z();*/ + + getShaft(); + + this.directionChange(); + + RendererShaft.renderTileEntityAt2(this.world().getTileEntity(this.x(), this.y(), this.z()), pos.x, pos.y, pos.z, frame); + + } + + @Override + public Cuboid6 getBounds() { + + /*this.tShaft.setWorldObj(this.world()); + this.tShaft.xCoord = this.x(); + this.tShaft.yCoord = this.y(); + this.tShaft.zCoord = this.z();*/ + + getShaft(); + + directionChange(); + return new Cuboid6(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); + } + + @Override + public Iterable getOcclusionBoxes() { + + return Arrays.asList(new Cuboid6[] { this.getBounds() }); + + } + + @Override + public Iterable getCollisionBoxes() + { + return Arrays.asList(new Cuboid6[] { this.getBounds() }); + } + + @Override + public String getType() { + + switch (this.sType) { + case 1: + return "sextiarysector:wood_shaft"; + case 2: + return "sextiarysector:stone_shaft"; + case 3: + return "sextiarysector:steel_shaft"; + case 4: + return "sextiarysector:ninja_shaft"; + case 5: + return "sextiarysector:orichalcum_shaft"; + } + return "sextiarysector:wood_shaft"; + } + + private void directionChange() + { + if (tShaft.getDirection().ordinal() == 0 || tShaft.getDirection().ordinal() == 1) { + minY = 0; + maxY = 1; + minZ = 0.25D; + maxZ = 0.75D; + minX = 0.25D; + maxX = 0.75D; + } else if (tShaft.getDirection().ordinal() == 2 || tShaft.getDirection().ordinal() == 3) { + minZ = 0; + maxZ = 1; + minX = 0.25D; + maxX = 0.75D; + minY = 0.25D; + maxY = 0.75D; + } else if (tShaft.getDirection().ordinal() == 4 || tShaft.getDirection().ordinal() == 5) { + minX = 0; + maxX = 1; + minZ = 0.25D; + maxZ = 0.75D; + minY = 0.25D; + maxY = 0.75D; + } + } + + @Override + public Iterable getDrops() + { + return Arrays.asList(new ItemStack[] { new ItemStack(this.getBlock(), 1, 0) }); + } + + @Override + public ItemStack pickItem(MovingObjectPosition hit) + { + return new ItemStack(this.getBlock(), 1, 0); + } + + @Override + public IIcon getBreakingIcon(Object arg0, int arg1) { + return Blocks.stone.getIcon(0, 0); + } + + @Override + public IIcon getBrokenIcon(int arg0) { + return Blocks.stone.getIcon(0, 0); + } + + private TileEntityShaft getShaft() { + + if (tShaft == null) tShaft = new TileEntityShaft(); + + try { + + tShaft.setWorldObj(this.world()); + this.tShaft.xCoord = this.x(); + this.tShaft.yCoord = this.y(); + this.tShaft.zCoord = this.z(); + + } catch (NullPointerException e) { + } + + directionChange(); + + return tShaft; + } + + @Override + public void save(NBTTagCompound tag) + { + tag.setByte("stype", (byte) this.sType); + NBTTagCompound s = new NBTTagCompound(); + + tShaft.setWorldObj(this.world()); + this.tShaft.xCoord = this.x(); + this.tShaft.yCoord = this.y(); + this.tShaft.zCoord = this.z(); + + if (tShaft != null) tShaft.writeToNBT(s); + tag.setTag("shaft", s); + + } + + @Override + public void load(NBTTagCompound tag) + { + this.sType = tag.getByte("stype"); + + NBTTagCompound s = tag.getCompoundTag("shaft"); + if (tShaft == null) tShaft = new TileEntityShaft(); + tShaft.readFromNBT(s); + try { + this.world().markBlockForUpdate(this.x(), this.y(), this.z()); + } catch (NullPointerException e) { + } + + //tShaft.setWorldObj(this.world()); + //this.tShaft.xCoord = this.x(); + //this.tShaft.yCoord = this.y(); + //this.tShaft.zCoord = this.z(); + + } + + @Override + public void writeDesc(MCDataOutput packet) + { + packet.writeByte((byte) this.sType); + + NBTTagCompound s = new NBTTagCompound(); + + /*this.tShaft.setWorldObj(this.world()); + this.tShaft.xCoord = this.x(); + this.tShaft.yCoord = this.y(); + this.tShaft.zCoord = this.z();*/ + + //getShaft(); + + if (tShaft != null) tShaft.writeToNBT(s); + packet.writeNBTTagCompound(s); + + } + + @Override + public void readDesc(MCDataInput packet) + { + this.sType = packet.readByte(); + + NBTTagCompound s = packet.readNBTTagCompound(); + if (tShaft == null) tShaft = new TileEntityShaft(); + tShaft.readFromNBT(s); + try { + this.world().markBlockForUpdate(this.x(), this.y(), this.z()); + } catch (NullPointerException e) { + } + //tShaft.setWorldObj(this.world()); + //this.tShaft.xCoord = this.x(); + //this.tShaft.yCoord = this.y(); + //this.tShaft.zCoord = this.z(); + + } + + @Override + public void setDirection(ForgeDirection d) { + this.tShaft.setDirection(d); + } + + @Override + public ForgeDirection getDirection() { + return this.getShaft().getDirection(); + } + + @Override + public void setRotateStep(float r) { + this.getShaft().setRotateStep(r); + } + + @Override + public float getRotateStep() { + return this.getShaft().getRotateStep(); + } + + //GF + @Override + public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + return this.getShaft().addEnergy(from, power, speed, simulate); + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + return this.getShaft().drawEnergy(from, power, speed, simulate); + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.getShaft().canInterface(from); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return this.getShaft().getPowerStored(from); + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return this.getShaft().getSpeedStored(from); + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return this.getShaft().getMaxPowerStored(from); + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return this.getShaft().getMaxSpeedStored(from); + } + + @Override + public EnergyStorage getStorage() { + return this.getShaft().getStorage(); + } + + @Override + public IShaft getInTileEntityShaft() { + return this.getShaft().getInTileEntityShaft(); + } + + @Override + public IShaft getOutTileEntityShaft() { + return this.getShaft().getOutTileEntityShaft(); + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiAchievementsNext.java b/src/main/java/shift/sextiarysector/gui/GuiAchievementsNext.java new file mode 100644 index 0000000..8931637 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiAchievementsNext.java @@ -0,0 +1,667 @@ +package shift.sextiarysector.gui; + +import java.util.LinkedList; +import java.util.List; +import java.util.Random; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiLabel; +import net.minecraft.client.gui.GuiOptionButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.network.play.client.C16PacketClientStatus; +import net.minecraft.stats.Achievement; +import net.minecraft.stats.AchievementList; +import net.minecraft.stats.StatFileWriter; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.AchievementPage; + +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import shift.sextiarysector.achievement.IAchievementIcon; + +public class GuiAchievementsNext extends GuiAchievements{ + + private static final int field_146572_y = AchievementList.minDisplayColumn * 24 - 112; + private static final int field_146571_z = AchievementList.minDisplayRow * 24 - 112; + private static final int field_146559_A = AchievementList.maxDisplayColumn * 24 - 77; + private static final int field_146560_B = AchievementList.maxDisplayRow * 24 - 77; + private static final ResourceLocation field_146561_C = new ResourceLocation("textures/gui/achievement/achievement_background.png"); + protected GuiScreen field_146562_a; + protected int field_146555_f = 256; + protected int field_146557_g = 202; + protected int field_146563_h; + protected int field_146564_i; + protected float field_146570_r = 1.0F; + protected double field_146569_s; + protected double field_146568_t; + protected double field_146567_u; + protected double field_146566_v; + protected double field_146565_w; + protected double field_146573_x; + private int field_146554_D; + private StatFileWriter field_146556_E; + protected boolean progress = true; + + private int currentPage = -1; + private GuiButton button; + private LinkedList minecraftAchievements = new LinkedList(); + + public GuiAchievementsNext(GuiScreen p_i45026_1_, StatFileWriter p_i45026_2_) + { + super(p_i45026_1_, p_i45026_2_); + this.field_146562_a = p_i45026_1_; + this.field_146556_E = p_i45026_2_; + short short1 = 141; + short short2 = 141; + this.field_146569_s = this.field_146567_u = this.field_146565_w = (double)(AchievementList.openInventory.displayColumn * 24 - short1 / 2 - 12); + this.field_146568_t = this.field_146566_v = this.field_146573_x = (double)(AchievementList.openInventory.displayRow * 24 - short2 / 2); + minecraftAchievements.clear(); + for (Object achievement : AchievementList.achievementList) + { + if (!AchievementPage.isAchievementInPages((Achievement)achievement)) + { + minecraftAchievements.add((Achievement)achievement); + } + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS)); + this.buttonList.clear(); + this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0]))); + this.buttonList.add(button = new GuiButton(2, (width - field_146555_f) / 2 + 24, height / 2 + 74, 125, 20, AchievementPage.getTitle(currentPage))); + } + + @Override + protected void actionPerformed(GuiButton p_146284_1_) + { + if (!this.progress) + { + if (p_146284_1_.id == 1) + { + this.mc.displayGuiScreen(this.field_146562_a); + } + + if (p_146284_1_.id == 2) + { + currentPage++; + if (currentPage >= AchievementPage.getAchievementPages().size()) + { + currentPage = -1; + } + button.displayString = AchievementPage.getTitle(currentPage); + } + } + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + @Override + protected void keyTyped(char p_73869_1_, int p_73869_2_) + { + if (p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) + { + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + } + else + { + if (p_73869_2_ == 1) + { + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + } + + } + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) + { + if (this.progress) + { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingStats", new Object[0]), this.width / 2, this.height / 2, 16777215); + this.drawCenteredString(this.fontRendererObj, field_146510_b_[(int)(Minecraft.getSystemTime() / 150L % (long)field_146510_b_.length)], this.width / 2, this.height / 2 + this.fontRendererObj.FONT_HEIGHT * 2, 16777215); + } + else + { + int k; + + if (Mouse.isButtonDown(0)) + { + k = (this.width - this.field_146555_f) / 2; + int l = (this.height - this.field_146557_g) / 2; + int i1 = k + 8; + int j1 = l + 17; + + if ((this.field_146554_D == 0 || this.field_146554_D == 1) && p_73863_1_ >= i1 && p_73863_1_ < i1 + 224 && p_73863_2_ >= j1 && p_73863_2_ < j1 + 155) + { + if (this.field_146554_D == 0) + { + this.field_146554_D = 1; + } + else + { + this.field_146567_u -= (double)((float)(p_73863_1_ - this.field_146563_h) * this.field_146570_r); + this.field_146566_v -= (double)((float)(p_73863_2_ - this.field_146564_i) * this.field_146570_r); + this.field_146565_w = this.field_146569_s = this.field_146567_u; + this.field_146573_x = this.field_146568_t = this.field_146566_v; + } + + this.field_146563_h = p_73863_1_; + this.field_146564_i = p_73863_2_; + } + } + else + { + this.field_146554_D = 0; + } + + k = Mouse.getDWheel(); + float f4 = this.field_146570_r; + + if (k < 0) + { + this.field_146570_r += 0.25F; + } + else if (k > 0) + { + this.field_146570_r -= 0.25F; + } + + this.field_146570_r = MathHelper.clamp_float(this.field_146570_r, 1.0F, 2.0F); + + if (this.field_146570_r != f4) + { + float f6 = f4 - this.field_146570_r; + float f5 = f4 * (float)this.field_146555_f; + float f1 = f4 * (float)this.field_146557_g; + float f2 = this.field_146570_r * (float)this.field_146555_f; + float f3 = this.field_146570_r * (float)this.field_146557_g; + this.field_146567_u -= (double)((f2 - f5) * 0.5F); + this.field_146566_v -= (double)((f3 - f1) * 0.5F); + this.field_146565_w = this.field_146569_s = this.field_146567_u; + this.field_146573_x = this.field_146568_t = this.field_146566_v; + } + + if (this.field_146565_w < (double)field_146572_y) + { + this.field_146565_w = (double)field_146572_y; + } + + if (this.field_146573_x < (double)field_146571_z) + { + this.field_146573_x = (double)field_146571_z; + } + + if (this.field_146565_w >= (double)field_146559_A) + { + this.field_146565_w = (double)(field_146559_A - 1); + } + + if (this.field_146573_x >= (double)field_146560_B) + { + this.field_146573_x = (double)(field_146560_B - 1); + } + + this.drawDefaultBackground(); + this.func_146552_b(p_73863_1_, p_73863_2_, p_73863_3_); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + this.func_146553_h(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + } + + @Override + public void func_146509_g() + { + if (this.progress) + { + this.progress = false; + } + } + + /** + * Called from the main game loop to update the screen. + */ + @Override + public void updateScreen() + { + if (!this.progress) + { + this.field_146569_s = this.field_146567_u; + this.field_146568_t = this.field_146566_v; + double d0 = this.field_146565_w - this.field_146567_u; + double d1 = this.field_146573_x - this.field_146566_v; + + if (d0 * d0 + d1 * d1 < 4.0D) + { + this.field_146567_u += d0; + this.field_146566_v += d1; + } + else + { + this.field_146567_u += d0 * 0.85D; + this.field_146566_v += d1 * 0.85D; + } + } + } + + @Override + protected void func_146553_h() + { + int i = (this.width - this.field_146555_f) / 2; + int j = (this.height - this.field_146557_g) / 2; + this.fontRendererObj.drawString(I18n.format("gui.achievements", new Object[0]), i + 15, j + 5, 4210752); + } + + @Override + protected void func_146552_b(int p_146552_1_, int p_146552_2_, float p_146552_3_) + { + int k = MathHelper.floor_double(this.field_146569_s + (this.field_146567_u - this.field_146569_s) * (double)p_146552_3_); + int l = MathHelper.floor_double(this.field_146568_t + (this.field_146566_v - this.field_146568_t) * (double)p_146552_3_); + + if (k < field_146572_y) + { + k = field_146572_y; + } + + if (l < field_146571_z) + { + l = field_146571_z; + } + + if (k >= field_146559_A) + { + k = field_146559_A - 1; + } + + if (l >= field_146560_B) + { + l = field_146560_B - 1; + } + + int i1 = (this.width - this.field_146555_f) / 2; + int j1 = (this.height - this.field_146557_g) / 2; + int k1 = i1 + 16; + int l1 = j1 + 17; + this.zLevel = 0.0F; + GL11.glDepthFunc(GL11.GL_GEQUAL); + GL11.glPushMatrix(); + GL11.glTranslatef((float)k1, (float)l1, -200.0F); + GL11.glScalef(1.0F / this.field_146570_r, 1.0F / this.field_146570_r, 0.0F); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + int i2 = k + 288 >> 4; + int j2 = l + 288 >> 4; + int k2 = (k + 288) % 16; + int l2 = (l + 288) % 16; + boolean flag = true; + boolean flag1 = true; + boolean flag2 = true; + boolean flag3 = true; + boolean flag4 = true; + Random random = new Random(); + float f1 = 16.0F / this.field_146570_r; + float f2 = 16.0F / this.field_146570_r; + int i3; + int j3; + int k3; + + for (i3 = 0; (float)i3 * f1 - (float)l2 < 155.0F; ++i3) + { + + this.setBrightness(j2, i3); + + for (j3 = 0; (float)j3 * f2 - (float)k2 < 224.0F; ++j3) + { + random.setSeed((long)(this.mc.getSession().getPlayerID().hashCode() + i2 + j3 + (j2 + i3) * 16)); + int ir = 1 + j2 + i3; + if(ir < 0)ir*=-1; + if(ir == 0)ir=1; + k3 = random.nextInt(ir) + (j2 + i3) / 2; + IIcon iicon = this.getIcon(random, k3, j2, i3); + + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + this.drawTexturedModelRectFromIcon(j3 * 16 - k2, i3 * 16 - l2, iicon, 16, 16); + } + } + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthFunc(GL11.GL_LEQUAL); + this.mc.getTextureManager().bindTexture(field_146561_C); + int i4; + int j4; + int l4; + + List achievementList = (currentPage == -1 ? minecraftAchievements : AchievementPage.getAchievementPage(currentPage).getAchievements()); + for (i3 = 0; i3 < achievementList.size(); ++i3) + { + Achievement achievement1 = achievementList.get(i3); + + if (achievement1.parentAchievement != null && achievementList.contains(achievement1.parentAchievement)) + { + j3 = achievement1.displayColumn * 24 - k + 11; + k3 = achievement1.displayRow * 24 - l + 11; + l4 = achievement1.parentAchievement.displayColumn * 24 - k + 11; + int l3 = achievement1.parentAchievement.displayRow * 24 - l + 11; + boolean flag5 = this.field_146556_E.hasAchievementUnlocked(achievement1); + boolean flag6 = this.field_146556_E.canUnlockAchievement(achievement1); + i4 = this.field_146556_E.func_150874_c(achievement1); + + if (i4 <= 4) + { + j4 = -16777216; + + if (flag5) + { + j4 = -6250336; + } + else if (flag6) + { + j4 = -16711936; + } + + this.drawHorizontalLine(j3, l4, k3, j4); + this.drawVerticalLine(l4, k3, l3, j4); + + if (j3 > l4) + { + this.drawTexturedModalRect(j3 - 11 - 7, k3 - 5, 114, 234, 7, 11); + } + else if (j3 < l4) + { + this.drawTexturedModalRect(j3 + 11, k3 - 5, 107, 234, 7, 11); + } + else if (k3 > l3) + { + this.drawTexturedModalRect(j3 - 5, k3 - 11 - 7, 96, 234, 11, 7); + } + else if (k3 < l3) + { + this.drawTexturedModalRect(j3 - 5, k3 + 11, 96, 241, 11, 7); + } + } + } + } + + Achievement achievement = null; + RenderItem renderitem = new RenderItem(); + float f4 = (float)(p_146552_1_ - k1) * this.field_146570_r; + float f5 = (float)(p_146552_2_ - l1) * this.field_146570_r; + RenderHelper.enableGUIStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + int i5; + int j5; + + for (l4 = 0; l4 < achievementList.size(); ++l4) + { + Achievement achievement2 = (Achievement)achievementList.get(l4); + i5 = achievement2.displayColumn * 24 - k; + j5 = achievement2.displayRow * 24 - l; + + if (i5 >= -24 && j5 >= -24 && (float)i5 <= 224.0F * this.field_146570_r && (float)j5 <= 155.0F * this.field_146570_r) + { + i4 = this.field_146556_E.func_150874_c(achievement2); + float f6; + + if (this.field_146556_E.hasAchievementUnlocked(achievement2)) + { + f6 = 0.75F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + else if (this.field_146556_E.canUnlockAchievement(achievement2)) + { + f6 = 1.0F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + else if (i4 < 3) + { + f6 = 0.3F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + else if (i4 == 3) + { + f6 = 0.2F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + else + { + if (i4 != 4) + { + continue; + } + + f6 = 0.1F; + GL11.glColor4f(f6, f6, f6, 1.0F); + } + + this.mc.getTextureManager().bindTexture(field_146561_C); + + GL11.glEnable(GL11.GL_BLEND);// Forge: Specifically enable blend because it is needed here. And we fix Generic RenderItem's leakage of it. + if (achievement2.getSpecial()) + { + this.drawTexturedModalRect(i5 - 2, j5 - 2, 26, 202, 26, 26); + } + else + { + this.drawTexturedModalRect(i5 - 2, j5 - 2, 0, 202, 26, 26); + } + GL11.glDisable(GL11.GL_BLEND); //Forge: Cleanup states we set. + + if (!this.field_146556_E.canUnlockAchievement(achievement2)) + { + f6 = 0.1F; + GL11.glColor4f(f6, f6, f6, 1.0F); + renderitem.renderWithColor = false; + } + + GL11.glDisable(GL11.GL_LIGHTING); //Forge: Make sure Lighting is disabled. Fixes MC-33065 + GL11.glEnable(GL11.GL_CULL_FACE); + renderitem.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), achievement2.theItemStack, i5 + 3, j5 + 3); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_LIGHTING); + + if (!this.field_146556_E.canUnlockAchievement(achievement2)) + { + renderitem.renderWithColor = true; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + if (f4 >= (float)i5 && f4 <= (float)(i5 + 22) && f5 >= (float)j5 && f5 <= (float)(j5 + 22)) + { + achievement = achievement2; + } + } + } + + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_BLEND); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_146561_C); + this.drawTexturedModalRect(i1, j1, 0, 0, this.field_146555_f, this.field_146557_g); + this.zLevel = 0.0F; + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); + this.drawButton(p_146552_1_, p_146552_2_, p_146552_3_); + + if (achievement != null) + { + String s1 = achievement.func_150951_e().getUnformattedText(); + String s2 = achievement.getDescription(); + i5 = p_146552_1_ + 12; + j5 = p_146552_2_ - 4; + i4 = this.field_146556_E.func_150874_c(achievement); + + if (!this.field_146556_E.canUnlockAchievement(achievement)) + { + String s; + int k4; + + if (i4 == 3) + { + s1 = I18n.format("achievement.unknown", new Object[0]); + j4 = Math.max(this.fontRendererObj.getStringWidth(s1), 120); + s = (new ChatComponentTranslation("achievement.requires", new Object[] {achievement.parentAchievement.func_150951_e()})).getUnformattedText(); + k4 = this.fontRendererObj.splitStringWidth(s, j4); + this.drawGradientRect(i5 - 3, j5 - 3, i5 + j4 + 3, j5 + k4 + 12 + 3, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(s, i5, j5 + 12, j4, -9416624); + } + else if (i4 < 3) + { + j4 = Math.max(this.fontRendererObj.getStringWidth(s1), 120); + s = (new ChatComponentTranslation("achievement.requires", new Object[] {achievement.parentAchievement.func_150951_e()})).getUnformattedText(); + k4 = this.fontRendererObj.splitStringWidth(s, j4); + this.drawGradientRect(i5 - 3, j5 - 3, i5 + j4 + 3, j5 + k4 + 12 + 3, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(s, i5, j5 + 12, j4, -9416624); + } + else + { + s1 = null; + } + } + else + { + j4 = Math.max(this.fontRendererObj.getStringWidth(s1), 120); + int k5 = this.fontRendererObj.splitStringWidth(s2, j4); + + if (this.field_146556_E.hasAchievementUnlocked(achievement)) + { + k5 += 12; + } + + this.drawGradientRect(i5 - 3, j5 - 3, i5 + j4 + 3, j5 + k5 + 3 + 12, -1073741824, -1073741824); + this.fontRendererObj.drawSplitString(s2, i5, j5 + 12, j4, -6250336); + + if (this.field_146556_E.hasAchievementUnlocked(achievement)) + { + this.fontRendererObj.drawStringWithShadow(I18n.format("achievement.taken", new Object[0]), i5, j5 + k5 + 4, -7302913); + } + } + + if (s1 != null) + { + this.fontRendererObj.drawStringWithShadow(s1, i5, j5, this.field_146556_E.canUnlockAchievement(achievement) ? (achievement.getSpecial() ? -128 : -1) : (achievement.getSpecial() ? -8355776 : -8355712)); + } + } + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_LIGHTING); + RenderHelper.disableStandardItemLighting(); + } + + public void drawButton(int p_73863_1_, int p_73863_2_, float p_73863_3_) + { + int k; + + for (k = 0; k < this.buttonList.size(); ++k) + { + ((GuiButton)this.buttonList.get(k)).drawButton(this.mc, p_73863_1_, p_73863_2_); + } + + for (k = 0; k < this.labelList.size(); ++k) + { + ((GuiLabel)this.labelList.get(k)).func_146159_a(this.mc, p_73863_1_, p_73863_2_); + } + } + + private void setBrightness(int j2, int i3){ + + if(currentPage != -1 && AchievementPage.getAchievementPage(currentPage) instanceof IAchievementIcon){ + + float f3 = ((IAchievementIcon)AchievementPage.getAchievementPage(currentPage)).getBrightness(j2, i3); + GL11.glColor4f(f3, f3, f3, 1.0F); + return; + + } + + float f3 = 0.6F - (float)(j2 + i3) / 25.0F * 0.3F; + GL11.glColor4f(f3, f3, f3, 1.0F); + + } + + private IIcon getIcon(Random random , int k3, int j2, int i3){ + + IIcon iicon = Blocks.sand.getIcon(0, 0); + + if(currentPage != -1 && AchievementPage.getAchievementPage(currentPage) instanceof IAchievementIcon)return ((IAchievementIcon)AchievementPage.getAchievementPage(currentPage)).getIcon(random, k3, j2, i3); + + if (k3 <= 37 && j2 + i3 != 35) + { + if (k3 == 22) + { + if (random.nextInt(2) == 0) + { + iicon = Blocks.diamond_ore.getIcon(0, 0); + } + else + { + iicon = Blocks.redstone_ore.getIcon(0, 0); + } + } + else if (k3 == 10) + { + iicon = Blocks.iron_ore.getIcon(0, 0); + } + else if (k3 == 8) + { + iicon = Blocks.coal_ore.getIcon(0, 0); + } + else if (k3 > 4) + { + iicon = Blocks.stone.getIcon(0, 0); + } + else if (k3 > 0) + { + iicon = Blocks.dirt.getIcon(0, 0); + } + } + else + { + iicon = Blocks.bedrock.getIcon(0, 0); + } + + return iicon; + + } + + /** + * Returns true if this GUI should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() + { + return !this.progress; + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiCraftFurnace.java b/src/main/java/shift/sextiarysector/gui/GuiCraftFurnace.java new file mode 100644 index 0000000..8a3c7a9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiCraftFurnace.java @@ -0,0 +1,93 @@ +package shift.sextiarysector.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import shift.sextiarysector.container.ContainerCraftFurnace; +import shift.sextiarysector.recipe.FurnaceCraftingManager; +import shift.sextiarysector.tileentity.TileEntityCraftFurnace; + +public class GuiCraftFurnace extends GuiContainer{ + + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("sextiarysector:textures/guis/craft_furnace.png"); + private final TileEntityCraftFurnace furnaceInventory; + + public GuiCraftFurnace(InventoryPlayer par1InventoryPlayer, TileEntityCraftFurnace par2TileEntityFurnace) + { + super(new ContainerCraftFurnace(par1InventoryPlayer, par2TileEntityFurnace)); + this.furnaceInventory = par2TileEntityFurnace; + //this.ySize =222; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) + { + String s = this.furnaceInventory.hasCustomInventoryName() ? this.furnaceInventory.getInventoryName() : I18n.format(this.furnaceInventory.getInventoryName()); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + /** + * Draw the background layer for the GuiContainer (everything behind the items) + */ + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + int i1; + + if (this.furnaceInventory.isFuel()) + { + i1 = this.furnaceInventory.getEnergyProgressScaled(12); + this.drawTexturedModalRect(k + 15, l + 29 + 12 - i1, 176, 12 - i1, 14, i1 + 2); + } + + i1 = this.furnaceInventory.getWorkProgressScaled(24); + this.drawTexturedModalRect(k + 100 + 1, l + 41, 176, 14, i1 + 1, 16); + + ItemStack itemstack = FurnaceCraftingManager.getInstance().findMatchingRecipe(this.furnaceInventory.craftMatrix, this.furnaceInventory.getWorldObj()); + + if (itemstack != null ) + { + int k1 = (this.width - this.xSize) / 2; + int l1 = (this.height - this.ySize) / 2; + GL11.glPushMatrix(); + RenderHelper.enableGUIStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glEnable(GL11.GL_LIGHTING); + itemRender.zLevel = 100.0F; + + itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack, k1 + 105, l1 + 23); + itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), itemstack, k1 + 105, l1 + 23); + itemRender.zLevel = 0.0F; + GL11.glDisable(GL11.GL_LIGHTING); + + if(this.func_146978_c(105, 23, 16, 16, par2, par3)) + { + this.renderToolTip(itemstack, par2, par3); + } + + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + RenderHelper.enableStandardItemLighting(); + } + + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiExtractor.java b/src/main/java/shift/sextiarysector/gui/GuiExtractor.java new file mode 100644 index 0000000..3ebe268 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiExtractor.java @@ -0,0 +1,19 @@ +package shift.sextiarysector.gui; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.tileentity.TileEntityFluidFGFMachineBase; + +public class GuiExtractor extends GuiFluidFGFMachineBase { + + private static final ResourceLocation machineGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/extractor.png"); + + public GuiExtractor(InventoryPlayer par1InventoryPlayer, TileEntityFluidFGFMachineBase par2TileEntity) { + super(par1InventoryPlayer, par2TileEntity); + } + + @Override + protected ResourceLocation getBindTexture() { + return machineGuiTextures; + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiFluidFGFMachineBase.java b/src/main/java/shift/sextiarysector/gui/GuiFluidFGFMachineBase.java new file mode 100644 index 0000000..230bb83 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiFluidFGFMachineBase.java @@ -0,0 +1,210 @@ +package shift.sextiarysector.gui; + +import java.text.NumberFormat; +import java.util.ArrayList; + +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.container.ContainerFluidGFMachineBase; +import shift.sextiarysector.tileentity.TileEntityFluidFGFMachineBase; + +public abstract class GuiFluidFGFMachineBase extends GUIGearMachine +{ + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("sextiarysector:textures/guis/fluid_furnace.png"); + private final TileEntityFluidFGFMachineBase machineInventory; + float s = 0; + + public GuiFluidFGFMachineBase(InventoryPlayer p_i1091_1_, TileEntityFluidFGFMachineBase p_i1091_2_) + { + super(new ContainerFluidGFMachineBase(p_i1091_1_, p_i1091_2_)); + this.machineInventory = p_i1091_2_; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + @Override + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String s = this.machineInventory.hasCustomInventoryName() ? this.machineInventory.getInventoryName() : I18n.format(this.machineInventory.getInventoryName(), new Object[0]); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(getBindTexture()); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + int i1; + + if (this.machineInventory.isCharging() || this.machineInventory.isWorking() || (this.machineInventory.inPower != 0 || this.machineInventory.inSpeed != 0)) { + s = (this.mc.getSystemTime() / 20) % 360; + } + + this.drawGear(0, (int) -s, 46, 35); + + this.mc.getTextureManager().bindTexture(getBindTexture()); + + this.drawTexturedModalRect(k + 57, l + 36, 176, 0, 14, 14);//荳ュ螟ョ縺ョgear + + this.drawGear(0, (int) -s, 26, 30); + + this.drawGear(1, (int) s, 37, 29); + + this.drawGear(2, (int) s, 16, 26); + + this.mc.getTextureManager().bindTexture(getBindTexture()); + + i1 = this.machineInventory.getWorkProgressScaled(24); + this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16); + + this.drawTexturedModalRect(k + 7, l + 16, 201, 0, 18, 18); + + i1 = this.machineInventory.getEnergyProgressScaled(16); + //this.drawTexturedModalRect(k + 8, l + 17 + 16 - i1, 219, 14 + 16 - i1, 16, i1); + this.drawTexturedModalRect(k + 8, l + 17 + 16 - i1, 219, 16 - i1, 16, i1); + + //Fluid + if (this.machineInventory.isFluid()) + { + //FluidStack f = this.tileFurnace.getTank().getFluid(); + this.drawFluidTank(k + 107, l + 15, this.machineInventory.getTank(), 34, 36); + + } + this.mc.getTextureManager().bindTexture(getBindTexture()); + this.drawTexturedModalRect(k + 108, l + 17, 176, 31, 32, 36); + + } + + @Override + public void drawScreen(int par1, int par2, float par3) + { + super.drawScreen(par1, par2, par3); + + ArrayList arraylist = new ArrayList(); + + String f = "None"; + + if (this.machineInventory.isFluid()) + { + f = this.machineInventory.getTank().getFluid().getFluid().getLocalizedName(this.machineInventory.getTank().getFluid()); + } + + NumberFormat nfNum = NumberFormat.getNumberInstance(); + + arraylist.add(0, "" + EnumChatFormatting.RESET + "Fluid Tank" + EnumChatFormatting.RESET); + arraylist.add(1, "" + EnumChatFormatting.GRAY + "Fluid : " + f); + arraylist.add(2, "" + EnumChatFormatting.GRAY + "Amount : " + nfNum.format(this.machineInventory.getTank().getFluidAmount()) + " / " + nfNum.format(this.machineInventory.getTank().getCapacity()) + " mB"); + + GL11.glPushMatrix(); + if (this.func_146978_c(106, 14, 36, 38, par1, par2)) + { + drawHoveringText(arraylist, par1, par2, fontRendererObj); + } + GL11.glPopMatrix(); + + ArrayList arraylist2 = new ArrayList(); + + int p = machineInventory.inPower; + int s = machineInventory.inSpeed; + + arraylist2.add(0, "" + EnumChatFormatting.RESET + "Machine Status" + EnumChatFormatting.RESET); + arraylist2.add(1, "" + EnumChatFormatting.RED + "In Power" + EnumChatFormatting.RESET); + arraylist2.add(2, "" + EnumChatFormatting.GRAY + p); + arraylist2.add(3, "" + EnumChatFormatting.BLUE + "In Speed" + EnumChatFormatting.RESET); + arraylist2.add(4, EnumChatFormatting.GRAY + "" + s); + + GL11.glPushMatrix(); + if (this.func_146978_c(56, 35, 16, 16, par1, par2)) + { + drawHoveringText(arraylist2, par1, par2, fontRendererObj); + } + GL11.glPopMatrix(); + + ArrayList arraylist3 = new ArrayList(); + + //NumberFormat nfNum = NumberFormat.getNumberInstance(); + + int p2 = machineInventory.storage.getPowerStored(); + long s2 = machineInventory.storage.getSpeedStored(); + + int p2_1 = machineInventory.storage.getMaxPower(); + long s2_1 = machineInventory.storage.getMaxSpeed(); + + arraylist3.add(0, "" + EnumChatFormatting.RESET + "Machine Storage" + EnumChatFormatting.RESET); + arraylist3.add(1, "" + EnumChatFormatting.RED + "Power" + EnumChatFormatting.RESET); + arraylist3.add(2, "" + EnumChatFormatting.GRAY + p2 + " / " + p2_1); + arraylist3.add(3, "" + EnumChatFormatting.BLUE + "Speed" + EnumChatFormatting.RESET); + arraylist3.add(4, EnumChatFormatting.GRAY + "" + nfNum.format(s2) + " / " + nfNum.format(s2_1)); + + GL11.glPushMatrix(); + if (this.func_146978_c(6, 16, 18, 18, par1, par2)) + { + drawHoveringText(arraylist3, par1, par2, fontRendererObj); + } + GL11.glPopMatrix(); + + } + + public void drawFluidTank(int x, int y, FluidTank fluidTank, int width, int height) { + + GL11.glColor3f(1, 1, 1); + + FluidStack fluidStack = fluidTank.getFluid(); + + ResourceLocation r; + if (fluidStack.getFluid().getSpriteNumber() == 0) { + r = TextureMap.locationBlocksTexture; + } else { + r = TextureMap.locationItemsTexture; + } + + this.mc.getTextureManager().bindTexture(r); + this.setColor3ubFromInt(fluidStack.getFluid().getColor(fluidStack)); + + int widthR = width;//*(fluidTank.getFluidAmount()/fluidTank.getCapacity()); + int heightR = (int) (width * ((float) fluidTank.getFluidAmount() / (float) fluidTank.getCapacity())); + + int yR = y + (height - heightR); + + int widthL = 0; + int heightL = 0; + IIcon icon = (fluidStack.getFluid().getIcon(fluidStack)); + + for (int i = 0; i < widthR; i += 16) { + + for (int j = 0; j < heightR; j += 16) { + + widthL = Math.min(widthR - i, 16); + heightL = Math.min(heightR - j, 16); + this.drawTexturedModelRectFromIcon(x + i, yR + j, icon, widthL, heightL); + + } + } + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F); + + } + + public static void setColor3ubFromInt(int color) { + + GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + + } + + protected abstract ResourceLocation getBindTexture(); +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiFluidFurnace.java b/src/main/java/shift/sextiarysector/gui/GuiFluidFurnace.java new file mode 100644 index 0000000..d80bf25 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiFluidFurnace.java @@ -0,0 +1,20 @@ +package shift.sextiarysector.gui; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.tileentity.TileEntityFluidMachineBase; + +public class GuiFluidFurnace extends GuiFluidMachineBase{ + + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("sextiarysector:textures/guis/fluid_furnace.png"); + + public GuiFluidFurnace(InventoryPlayer p_i1091_1_,TileEntityFluidMachineBase p_i1091_2_) { + super(p_i1091_1_, p_i1091_2_); + } + + @Override + protected ResourceLocation getBindTexture() { + return furnaceGuiTextures; + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiFluidMachineBase.java b/src/main/java/shift/sextiarysector/gui/GuiFluidMachineBase.java new file mode 100644 index 0000000..aabcc23 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiFluidMachineBase.java @@ -0,0 +1,150 @@ +package shift.sextiarysector.gui; + +import java.text.NumberFormat; +import java.util.ArrayList; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.container.ContainerFluidMachineBase; +import shift.sextiarysector.tileentity.TileEntityFluidMachineBase; + +public abstract class GuiFluidMachineBase extends GuiContainer +{ + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("sextiarysector:textures/guis/fluid_furnace.png"); + private TileEntityFluidMachineBase tileFurnace; + + public GuiFluidMachineBase(InventoryPlayer p_i1091_1_, TileEntityFluidMachineBase p_i1091_2_) + { + super(new ContainerFluidMachineBase(p_i1091_1_, p_i1091_2_)); + this.tileFurnace = p_i1091_2_; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String s = this.tileFurnace.hasCustomInventoryName() ? this.tileFurnace.getInventoryName() : I18n.format(this.tileFurnace.getInventoryName(), new Object[0]); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(getBindTexture()); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + + if (this.tileFurnace.isFuel()) + { + int i1 = this.tileFurnace.getEnergyProgressScaled(13); + this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1); + i1 = this.tileFurnace.getWorkProgressScaled(24); + this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16); + } + + //Fluid + if (this.tileFurnace.isFluid()) + { + //FluidStack f = this.tileFurnace.getTank().getFluid(); + this.drawFluidTank(k + 107,l + 15,this.tileFurnace.getTank(),34,36); + + } + this.mc.getTextureManager().bindTexture(getBindTexture()); + this.drawTexturedModalRect(k + 108, l + 17, 176, 31, 32, 36); + + } + + @Override + public void drawScreen(int par1, int par2, float par3) + { + super.drawScreen(par1, par2, par3); + + ArrayList arraylist = new ArrayList(); + + String f = "None"; + + if (this.tileFurnace.isFluid()) + { + f = this.tileFurnace.getTank().getFluid().getFluid().getLocalizedName(this.tileFurnace.getTank().getFluid()); + } + + NumberFormat nfNum = NumberFormat.getNumberInstance(); + + arraylist.add(0,"" + EnumChatFormatting.RESET+ "Fluid Tank" + EnumChatFormatting.RESET ); + arraylist.add(1,"" + EnumChatFormatting.GRAY + "Fluid : "+f); + arraylist.add(2, ""+ EnumChatFormatting.GRAY + "Amount : " + nfNum.format(this.tileFurnace.getTank().getFluidAmount()) + " / " + nfNum.format(this.tileFurnace.getTank().getCapacity()) + " mB"); + + GL11.glPushMatrix(); + if (this.func_146978_c(106, 14, 36, 38, par1, par2)) + { + drawHoveringText(arraylist, par1, par2,fontRendererObj); + } + GL11.glPopMatrix(); + + + + } + + public void drawFluidTank(int x, int y, FluidTank fluidTank, int width, int height) { + + GL11.glColor3f(1,1,1); + + FluidStack fluidStack = fluidTank.getFluid(); + + ResourceLocation r; + if(fluidStack.getFluid().getSpriteNumber()==0){ + r = TextureMap.locationBlocksTexture; + }else{ + r = TextureMap.locationItemsTexture; + } + + this.mc.getTextureManager().bindTexture(r); + this.setColor3ubFromInt(fluidStack.getFluid().getColor(fluidStack)); + + int widthR = width;//*(fluidTank.getFluidAmount()/fluidTank.getCapacity()); + int heightR = (int) (width*((float)fluidTank.getFluidAmount()/(float)fluidTank.getCapacity())); + + int yR = y+(height-heightR); + + int widthL = 0; + int heightL = 0; + IIcon icon = (fluidStack.getFluid().getIcon(fluidStack)); + + for (int i = 0; i < widthR; i += 16) { + + for (int j = 0; j < heightR; j += 16) { + + widthL = Math.min(widthR - i, 16); + heightL = Math.min(heightR - j, 16); + this.drawTexturedModelRectFromIcon(x + i, yR + j, icon, widthL, heightL); + + } + } + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F); + + } + + public static void setColor3ubFromInt(int color) { + + GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + + } + + protected abstract ResourceLocation getBindTexture(); + +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiFoodSmokers.java b/src/main/java/shift/sextiarysector/gui/GuiFoodSmokers.java new file mode 100644 index 0000000..e681513 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiFoodSmokers.java @@ -0,0 +1,19 @@ +package shift.sextiarysector.gui; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.tileentity.TileEntityFluidMachineBase; + +public class GuiFoodSmokers extends GuiFluidMachineBase{ + + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("sextiarysector:textures/guis/fluid_furnace.png"); + + public GuiFoodSmokers(InventoryPlayer p_i1091_1_,TileEntityFluidMachineBase p_i1091_2_) { + super(p_i1091_1_, p_i1091_2_); + } + + @Override + protected ResourceLocation getBindTexture() { + return furnaceGuiTextures; + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiFreezer.java b/src/main/java/shift/sextiarysector/gui/GuiFreezer.java new file mode 100644 index 0000000..75b4e46 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiFreezer.java @@ -0,0 +1,51 @@ +package shift.sextiarysector.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.container.ContainerFreezer; +import shift.sextiarysector.tileentity.TileEntityFreezer; + +public class GuiFreezer extends GuiContainer +{ + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("sextiarysector:textures/guis/freezer.png"); + private TileEntityFreezer tileFurnace; + private static final String __OBFID = "CL_00000758"; + + public GuiFreezer(InventoryPlayer p_i1091_1_, TileEntityFreezer p_i1091_2_) + { + super(new ContainerFreezer(p_i1091_1_, p_i1091_2_)); + this.tileFurnace = p_i1091_2_; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String s = this.tileFurnace.hasCustomInventoryName() ? this.tileFurnace.getInventoryName() : I18n.format(this.tileFurnace.getInventoryName(), new Object[0]); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + if (this.tileFurnace.isFuel()) + { + int i1 = this.tileFurnace.getEnergyProgressScaled(13); + this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1); + i1 = this.tileFurnace.getWorkProgressScaled(24); + this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16); + } + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiFunnel.java b/src/main/java/shift/sextiarysector/gui/GuiFunnel.java new file mode 100644 index 0000000..e230ec5 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiFunnel.java @@ -0,0 +1,140 @@ +package shift.sextiarysector.gui; + +import java.text.NumberFormat; +import java.util.ArrayList; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.container.ContainerFunnel; +import shift.sextiarysector.tileentity.TileEntityFunnel; + +public class GuiFunnel extends GuiContainer +{ + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("sextiarysector:textures/guis/funnel.png"); + private final TileEntityFunnel tileFurnace; + + public GuiFunnel(InventoryPlayer p_i1091_1_, TileEntityFunnel p_i1091_2_) + { + super(new ContainerFunnel(p_i1091_1_, p_i1091_2_)); + this.tileFurnace = p_i1091_2_; + //this.allowUserInput = false; + this.ySize = 133; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + @Override + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String s = this.tileFurnace.hasCustomInventoryName() ? this.tileFurnace.getInventoryName() : I18n.format(this.tileFurnace.getInventoryName(), new Object[0]); + this.fontRendererObj.drawString(s, 8, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + //Fluid + if (this.tileFurnace.isFluid()) + { + //FluidStack f = this.tileFurnace.getTank().getFluid(); + this.drawFluidTank(k + 62, l + 20, this.tileFurnace.getTank(), 52, 16); + + } + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + this.drawTexturedModalRect(k + 61, l + 19, 176, 0, 53, 17); + + } + + @Override + public void drawScreen(int par1, int par2, float par3) + { + super.drawScreen(par1, par2, par3); + + ArrayList arraylist = new ArrayList(); + + String f = "None"; + + if (this.tileFurnace.isFluid()) + { + f = this.tileFurnace.getTank().getFluid().getFluid().getLocalizedName(this.tileFurnace.getTank().getFluid()); + } + + NumberFormat nfNum = NumberFormat.getNumberInstance(); + + arraylist.add(0, "" + EnumChatFormatting.RESET + "Fluid Tank" + EnumChatFormatting.RESET); + arraylist.add(1, "" + EnumChatFormatting.GRAY + "Fluid : " + f); + arraylist.add(2, "" + EnumChatFormatting.GRAY + "Amount : " + nfNum.format(this.tileFurnace.getTank().getFluidAmount()) + " / " + nfNum.format(this.tileFurnace.getTank().getCapacity()) + " mB"); + + GL11.glPushMatrix(); + if (this.func_146978_c(61, 19, 53, 17, par1, par2)) + { + drawHoveringText(arraylist, par1, par2, fontRendererObj); + } + GL11.glPopMatrix(); + + } + + public void drawFluidTank(int x, int y, FluidTank fluidTank, int width, int height) { + + GL11.glColor3f(1, 1, 1); + + FluidStack fluidStack = fluidTank.getFluid(); + + ResourceLocation r; + if (fluidStack.getFluid().getSpriteNumber() == 0) { + r = TextureMap.locationBlocksTexture; + } else { + r = TextureMap.locationItemsTexture; + } + + this.mc.getTextureManager().bindTexture(r); + this.setColor3ubFromInt(fluidStack.getFluid().getColor(fluidStack)); + + int widthR = width;//*(fluidTank.getFluidAmount()/fluidTank.getCapacity()); + int heightR = (int) (height * ((float) fluidTank.getFluidAmount() / (float) fluidTank.getCapacity())); + + int yR = y + (height - heightR); + + int widthL = 0; + int heightL = 0; + IIcon icon = (fluidStack.getFluid().getIcon(fluidStack)); + + for (int i = 0; i < widthR; i += 16) { + + for (int j = 0; j < heightR; j += 16) { + + widthL = Math.min(widthR - i, 16); + heightL = Math.min(heightR - j, 16); + this.drawTexturedModelRectFromIcon(x + i, yR + j, icon, widthL, heightL); + + } + } + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F); + + } + + public static void setColor3ubFromInt(int color) { + + GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiGFTank.java b/src/main/java/shift/sextiarysector/gui/GuiGFTank.java index d99bee9..b975d8a 100644 --- a/src/main/java/shift/sextiarysector/gui/GuiGFTank.java +++ b/src/main/java/shift/sextiarysector/gui/GuiGFTank.java @@ -17,6 +17,9 @@ public class GuiGFTank extends GUIGearMachine{ private static final ResourceLocation woodGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/wood_gf_tank.png"); private static final ResourceLocation stoneGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/stone_gf_tank.png"); + private static final ResourceLocation steelGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/steel_gf_tank.png"); + private static final ResourceLocation ninjaGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/ninja_gf_tank.png"); + private static final ResourceLocation orichalcumGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/orichalcum_gf_tank.png"); private int type; protected final TileEntityGFTank tankInventory; float s =0; @@ -135,8 +138,8 @@ public void drawScreen(int par1, int par2, float par3) int p3 = tankInventory.storage.getPowerStored(); long s3 = tankInventory.storage.getSpeedStored(); - int p2_1 = tankInventory.storage.getMaxPowerStored(); - long s2_1 = tankInventory.storage.getMaxSpeedStored(); + int p2_1 = tankInventory.storage.getMaxPower(); + long s2_1 = tankInventory.storage.getMaxSpeed(); arraylist3.add(0,"" + EnumChatFormatting.RESET+ "Machine Storage" + EnumChatFormatting.RESET ); arraylist3.add(1,"" + EnumChatFormatting.RED + "Power" + EnumChatFormatting.RESET ); @@ -158,6 +161,9 @@ protected ResourceLocation getBindTexture() { switch(this.type){ case 1:return this.woodGuiTextures; case 2:return this.stoneGuiTextures; + case 3:return this.steelGuiTextures; + case 4:return this.ninjaGuiTextures; + case 5:return this.orichalcumGuiTextures; } return this.woodGuiTextures; } diff --git a/src/main/java/shift/sextiarysector/gui/GuiInventoryNext.java b/src/main/java/shift/sextiarysector/gui/GuiInventoryNext.java new file mode 100644 index 0000000..01c6d0d --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiInventoryNext.java @@ -0,0 +1,156 @@ +package shift.sextiarysector.gui; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.achievement.GuiAchievements; +import net.minecraft.client.gui.achievement.GuiStats; +import net.minecraft.client.renderer.InventoryEffectRenderer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import shift.sextiarysector.SSPlayerTabs; +import shift.sextiarysector.container.ContainerPlayerNext; +import shift.sextiarysector.gui.tab.TabManager; + +public class GuiInventoryNext extends InventoryEffectRenderer +{ + + protected static final ResourceLocation field_147001_a = new ResourceLocation("sextiarysector:textures/guis/inventory_next.png"); + + /** x size of the inventory window in pixels. Defined as float, passed as int */ + private float xSizeFloat; + /** y size of the inventory window in pixels. Defined as float, passed as int. */ + private float ySizeFloat; + private static final String __OBFID = "CL_00000761"; + + public GuiInventoryNext(EntityPlayer p_i1094_1_) + { + super(new ContainerPlayerNext(p_i1094_1_.inventory, p_i1094_1_)); + this.allowUserInput = true; + } + + /** + * Called from the main game loop to update the screen. + */ + @Override + public void updateScreen() + { + if (this.mc.playerController.isInCreativeMode()) + { + //this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); + } + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + this.buttonList.clear(); + + super.initGui(); + + int cornerX = this.guiLeft; + + int cornerY = this.guiTop; + + if (TabManager.hasPotion())//!mc.thePlayer.getActivePotionEffects().isEmpty()) + { + cornerX = 160 + (this.width - this.xSize - 200) / 2; + } else { + cornerX = (this.width - this.xSize) / 2; + } + + TabManager.updateTabValues(cornerX, cornerY, this.buttonList, SSPlayerTabs.ss, false); + + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + @Override + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + //this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 86, 16, 4210752); + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) + { + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + this.xSizeFloat = p_73863_1_; + this.ySizeFloat = p_73863_2_; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(this.field_147001_a); + int k = this.guiLeft; + int l = this.guiTop; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + func_147046_a(k + 51, l + 75, 30, k + 51 - this.xSizeFloat, l + 75 - 50 - this.ySizeFloat, this.mc.thePlayer); + } + + public static void func_147046_a(int p_147046_0_, int p_147046_1_, int p_147046_2_, float p_147046_3_, float p_147046_4_, EntityLivingBase p_147046_5_) + { + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glPushMatrix(); + GL11.glTranslatef(p_147046_0_, p_147046_1_, 50.0F); + GL11.glScalef((-p_147046_2_), p_147046_2_, p_147046_2_); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + float f2 = p_147046_5_.renderYawOffset; + float f3 = p_147046_5_.rotationYaw; + float f4 = p_147046_5_.rotationPitch; + float f5 = p_147046_5_.prevRotationYawHead; + float f6 = p_147046_5_.rotationYawHead; + GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-((float) Math.atan(p_147046_4_ / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F); + p_147046_5_.renderYawOffset = (float) Math.atan(p_147046_3_ / 40.0F) * 20.0F; + p_147046_5_.rotationYaw = (float) Math.atan(p_147046_3_ / 40.0F) * 40.0F; + p_147046_5_.rotationPitch = -((float) Math.atan(p_147046_4_ / 40.0F)) * 20.0F; + p_147046_5_.rotationYawHead = p_147046_5_.rotationYaw; + p_147046_5_.prevRotationYawHead = p_147046_5_.rotationYaw; + GL11.glTranslatef(0.0F, p_147046_5_.yOffset, 0.0F); + RenderManager.instance.playerViewY = 180.0F; + RenderManager.instance.renderEntityWithPosYaw(p_147046_5_, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); + p_147046_5_.renderYawOffset = f2; + p_147046_5_.rotationYaw = f3; + p_147046_5_.rotationPitch = f4; + p_147046_5_.prevRotationYawHead = f5; + p_147046_5_.rotationYawHead = f6; + GL11.glPopMatrix(); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + + @Override + protected void actionPerformed(GuiButton p_146284_1_) + { + if (p_146284_1_.id == 0) + { + this.mc.displayGuiScreen(new GuiAchievements(this, this.mc.thePlayer.getStatFileWriter())); + } + + if (p_146284_1_.id == 1) + { + this.mc.displayGuiScreen(new GuiStats(this, this.mc.thePlayer.getStatFileWriter())); + } + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiMPRepair.java b/src/main/java/shift/sextiarysector/gui/GuiMPRepair.java new file mode 100644 index 0000000..1778657 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiMPRepair.java @@ -0,0 +1,223 @@ +package shift.sextiarysector.gui; + +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.network.play.client.C17PacketCustomPayload; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.apache.commons.io.Charsets; +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.container.ContainerMPRepair; + +public class GuiMPRepair extends GuiContainer implements ICrafting { + private static final ResourceLocation field_147093_u = new ResourceLocation("textures/gui/container/anvil.png"); + private final ContainerMPRepair field_147092_v; + private GuiTextField field_147091_w; + private final InventoryPlayer field_147094_x; + + public GuiMPRepair(InventoryPlayer p_i1073_1_, World p_i1073_2_, int p_i1073_3_, int p_i1073_4_, int p_i1073_5_) + { + super(new ContainerMPRepair(p_i1073_1_, p_i1073_2_, p_i1073_3_, p_i1073_4_, p_i1073_5_, Minecraft.getMinecraft().thePlayer)); + this.field_147094_x = p_i1073_1_; + this.field_147092_v = (ContainerMPRepair) this.inventorySlots; + } + + /** + * Adds the buttons (and other controls) to the screen in question. + */ + @Override + public void initGui() + { + super.initGui(); + Keyboard.enableRepeatEvents(true); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.field_147091_w = new GuiTextField(this.fontRendererObj, i + 62, j + 24, 103, 12); + this.field_147091_w.setTextColor(-1); + this.field_147091_w.setDisabledTextColour(-1); + this.field_147091_w.setEnableBackgroundDrawing(false); + this.field_147091_w.setMaxStringLength(40); + this.inventorySlots.removeCraftingFromCrafters(this); + this.inventorySlots.addCraftingToCrafters(this); + } + + /** + * Called when the screen is unloaded. Used to disable keyboard repeat events + */ + @Override + public void onGuiClosed() + { + super.onGuiClosed(); + Keyboard.enableRepeatEvents(false); + this.inventorySlots.removeCraftingFromCrafters(this); + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + @Override + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + this.fontRendererObj.drawString(I18n.format("container.ss.repair", new Object[0]), 60, 6, 4210752); + + if (this.field_147092_v.maximumCost > 0) + { + int k = 8453920; + boolean flag = true; + String s = I18n.format("container.ss.repair.cost", new Object[] { Integer.valueOf(this.field_147092_v.maximumCost) }); + + if (this.field_147092_v.maximumCost >= 10000 && !this.mc.thePlayer.capabilities.isCreativeMode) + { + s = I18n.format("container.repair.expensive", new Object[0]); + k = 16736352; + } + else if (!this.field_147092_v.getSlot(2).getHasStack()) + { + flag = false; + } + else if (!this.field_147092_v.getSlot(2).canTakeStack(this.field_147094_x.player)) + { + k = 16736352; + } + + if (flag) + { + int l = -16777216 | (k & 16579836) >> 2 | k & -16777216; + int i1 = this.xSize - 8 - this.fontRendererObj.getStringWidth(s); + byte b0 = 67; + + if (this.fontRendererObj.getUnicodeFlag()) + { + drawRect(i1 - 3, b0 - 2, this.xSize - 7, b0 + 10, -16777216); + drawRect(i1 - 2, b0 - 1, this.xSize - 8, b0 + 9, -12895429); + } + else + { + this.fontRendererObj.drawString(s, i1, b0 + 1, l); + this.fontRendererObj.drawString(s, i1 + 1, b0, l); + this.fontRendererObj.drawString(s, i1 + 1, b0 + 1, l); + } + + this.fontRendererObj.drawString(s, i1, b0, k); + } + } + + GL11.glEnable(GL11.GL_LIGHTING); + } + + /** + * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). + */ + @Override + protected void keyTyped(char p_73869_1_, int p_73869_2_) + { + if (this.field_147091_w.textboxKeyTyped(p_73869_1_, p_73869_2_)) + { + this.func_147090_g(); + } + else + { + super.keyTyped(p_73869_1_, p_73869_2_); + } + } + + private void func_147090_g() + { + String s = this.field_147091_w.getText(); + Slot slot = this.field_147092_v.getSlot(0); + + if (slot != null && slot.getHasStack() && !slot.getStack().hasDisplayName() && s.equals(slot.getStack().getDisplayName())) + { + s = ""; + } + + this.field_147092_v.updateItemName(s); + this.mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("MC|ItemName", s.getBytes(Charsets.UTF_8))); + } + + /** + * Called when the mouse is clicked. + */ + @Override + protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_) + { + super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); + this.field_147091_w.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_); + } + + /** + * Draws the screen and all the components in it. + */ + @Override + public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) + { + super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_BLEND); + this.field_147091_w.drawTextBox(); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_147093_u); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + this.drawTexturedModalRect(k + 59, l + 20, 0, this.ySize + (this.field_147092_v.getSlot(0).getHasStack() ? 0 : 16), 110, 16); + + if ((this.field_147092_v.getSlot(0).getHasStack() || this.field_147092_v.getSlot(1).getHasStack()) && !this.field_147092_v.getSlot(2).getHasStack()) + { + this.drawTexturedModalRect(k + 99, l + 45, this.xSize, 0, 28, 21); + } + } + + @Override + public void sendContainerAndContentsToPlayer(Container p_71110_1_, List p_71110_2_) + { + this.sendSlotContents(p_71110_1_, 0, p_71110_1_.getSlot(0).getStack()); + } + + /** + * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual + * contents of that slot. Args: Container, slot number, slot contents + */ + @Override + public void sendSlotContents(Container p_71111_1_, int p_71111_2_, ItemStack p_71111_3_) + { + if (p_71111_2_ == 0) + { + this.field_147091_w.setText(p_71111_3_ == null ? "" : p_71111_3_.getDisplayName()); + this.field_147091_w.setEnabled(p_71111_3_ != null); + + if (p_71111_3_ != null) + { + this.func_147090_g(); + } + } + } + + /** + * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, + * and enchanting level. Normally the first int identifies which variable to update, and the second contains the new + * value. Both are truncated to shorts in non-local SMP. + */ + @Override + public void sendProgressBarUpdate(Container p_71112_1_, int p_71112_2_, int p_71112_3_) { + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiMagicFurnace.java b/src/main/java/shift/sextiarysector/gui/GuiMagicFurnace.java new file mode 100644 index 0000000..107e3f0 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiMagicFurnace.java @@ -0,0 +1,51 @@ +package shift.sextiarysector.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.container.ContainerMagicFurnace; +import shift.sextiarysector.tileentity.TileEntityMagicFurnace; + +public class GuiMagicFurnace extends GuiContainer +{ + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("sextiarysector:textures/guis/magic_furnace.png"); + private TileEntityMagicFurnace tileFurnace; + private static final String __OBFID = "CL_00000758"; + + public GuiMagicFurnace(InventoryPlayer p_i1091_1_, TileEntityMagicFurnace p_i1091_2_) + { + super(new ContainerMagicFurnace(p_i1091_1_, p_i1091_2_)); + this.tileFurnace = p_i1091_2_; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String s = this.tileFurnace.hasCustomInventoryName() ? this.tileFurnace.getInventoryName() : I18n.format(this.tileFurnace.getInventoryName(), new Object[0]); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + if (this.tileFurnace.isFuel()) + { + int i1 = this.tileFurnace.getEnergyProgressScaled(13); + this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1); + i1 = this.tileFurnace.getWorkProgressScaled(24); + this.drawTexturedModalRect(k + 79, l + 34, 176, 14, i1 + 1, 16); + } + } +} \ No newline at end of file diff --git a/src/main/java/shift/sextiarysector/gui/GuiManaSqueezer.java b/src/main/java/shift/sextiarysector/gui/GuiManaSqueezer.java new file mode 100644 index 0000000..86e67a4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiManaSqueezer.java @@ -0,0 +1,20 @@ +package shift.sextiarysector.gui; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.tileentity.TileEntityFluidFGFMachineBase; + +public class GuiManaSqueezer extends GuiFluidFGFMachineBase { + + private static final ResourceLocation machineGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/mana_squeezer.png"); + + public GuiManaSqueezer(InventoryPlayer par1InventoryPlayer, TileEntityFluidFGFMachineBase par2TileEntity) { + super(par1InventoryPlayer, par2TileEntity); + } + + @Override + protected ResourceLocation getBindTexture() { + return machineGuiTextures; + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiPulverizer.java b/src/main/java/shift/sextiarysector/gui/GuiPulverizer.java new file mode 100644 index 0000000..f2fd127 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiPulverizer.java @@ -0,0 +1,19 @@ +package shift.sextiarysector.gui; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.tileentity.TileEntitySimpleMachine; + +public class GuiPulverizer extends GuiSimpleMachine{ + + private static final ResourceLocation machineGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/pulverizer.png"); + + public GuiPulverizer(InventoryPlayer par1InventoryPlayer, TileEntitySimpleMachine par2TileEntity) { + super(par1InventoryPlayer, par2TileEntity); + } + + @Override + protected ResourceLocation getBindTexture() { + return machineGuiTextures; + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiRollingMachine.java b/src/main/java/shift/sextiarysector/gui/GuiRollingMachine.java new file mode 100644 index 0000000..827cf28 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiRollingMachine.java @@ -0,0 +1,19 @@ +package shift.sextiarysector.gui; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.tileentity.TileEntitySimpleMachine; + +public class GuiRollingMachine extends GuiSimpleMachine{ + + private static final ResourceLocation machineGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/rolling_machine.png"); + + public GuiRollingMachine(InventoryPlayer par1InventoryPlayer, TileEntitySimpleMachine par2TileEntity) { + super(par1InventoryPlayer, par2TileEntity); + } + + @Override + protected ResourceLocation getBindTexture() { + return machineGuiTextures; + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiRucksack.java b/src/main/java/shift/sextiarysector/gui/GuiRucksack.java new file mode 100644 index 0000000..d6d16e3 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiRucksack.java @@ -0,0 +1,73 @@ +package shift.sextiarysector.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SSPlayerTabs; +import shift.sextiarysector.container.ContainerRucksack; +import shift.sextiarysector.container.InventoryPlayerNext; +import shift.sextiarysector.gui.tab.TabManager; + +public class GuiRucksack extends GuiContainer +{ + private static final ResourceLocation texture = new ResourceLocation("sextiarysector:textures/guis/rucksack.png"); + private boolean tab = false; + + public GuiRucksack(InventoryPlayer inventoryPlayer) + { + super(new ContainerRucksack(inventoryPlayer)); + //this.ySize = 222; + } + + public GuiRucksack(InventoryPlayer inventoryPlayer, InventoryPlayerNext inventoryPlayerN) + { + super(new ContainerRucksack(inventoryPlayer, inventoryPlayerN)); + tab = true; + //this.ySize = 222; + } + + public void initGui() + { + + this.buttonList.clear(); + + super.initGui(); + + if(!tab)return; + + int cornerX = this.guiLeft; + + int cornerY = this.guiTop; + + TabManager.updateTabValues(cornerX, cornerY,this.buttonList, SSPlayerTabs.rucksack,false); + + } + + /* + Chest縺ィ縺紀nventory縺ィ縺区枚蟄励r謠冗判縺吶k + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int p_146979_2_) + { + //謠冗判縺吶k譁蟄, X, Y, 濶イ + this.fontRendererObj.drawString(I18n.format("gui.ss.rucksack"), this.xSize / 2 - this.fontRendererObj.getStringWidth(I18n.format("gui.rucksack")) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + /* + 閭梧勹縺ョ謠冗判 + */ + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiSawmill.java b/src/main/java/shift/sextiarysector/gui/GuiSawmill.java new file mode 100644 index 0000000..92107da --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiSawmill.java @@ -0,0 +1,19 @@ +package shift.sextiarysector.gui; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.tileentity.TileEntitySimpleMachine; + +public class GuiSawmill extends GuiSimpleMachine{ + + private static final ResourceLocation machineGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/sawmill.png"); + + public GuiSawmill(InventoryPlayer par1InventoryPlayer, TileEntitySimpleMachine par2TileEntity) { + super(par1InventoryPlayer, par2TileEntity); + } + + @Override + protected ResourceLocation getBindTexture() { + return machineGuiTextures; + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiShippingBox.java b/src/main/java/shift/sextiarysector/gui/GuiShippingBox.java new file mode 100644 index 0000000..c979818 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiShippingBox.java @@ -0,0 +1,67 @@ +package shift.sextiarysector.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SSPlayerTabs; +import shift.sextiarysector.container.ContainerShippingBox; +import shift.sextiarysector.gui.tab.TabManager; + +public class GuiShippingBox extends GuiContainer { + + private static final ResourceLocation texture = new ResourceLocation("sextiarysector:textures/guis/shipping_box.png"); + private final boolean tab = false; + + public GuiShippingBox(EntityPlayer inventoryPlayer) + { + super(new ContainerShippingBox(inventoryPlayer.inventory, inventoryPlayer)); + //this.ySize = 222; + } + + @Override + public void initGui() + { + + this.buttonList.clear(); + + super.initGui(); + + if (!tab) return; + + int cornerX = this.guiLeft; + + int cornerY = this.guiTop; + + TabManager.updateTabValues(cornerX, cornerY, this.buttonList, SSPlayerTabs.rucksack, false); + + } + + /* + Chest縺ィ縺紀nventory縺ィ縺区枚蟄励r謠冗判縺吶k + */ + @Override + protected void drawGuiContainerForegroundLayer(int x, int p_146979_2_) + { + //謠冗判縺吶k譁蟄, X, Y, 濶イ + this.fontRendererObj.drawString(I18n.format("gui.ss.shipping_box"), this.xSize / 2 - this.fontRendererObj.getStringWidth(I18n.format("gui.ss.shipping_box")) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + /* + 閭梧勹縺ョ謠冗判 + */ + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(texture); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiSimpleMachine.java b/src/main/java/shift/sextiarysector/gui/GuiSimpleMachine.java index d4a1485..2fd8d8e 100644 --- a/src/main/java/shift/sextiarysector/gui/GuiSimpleMachine.java +++ b/src/main/java/shift/sextiarysector/gui/GuiSimpleMachine.java @@ -121,8 +121,8 @@ public void drawScreen(int par1, int par2, float par3) int p2 = machineInventory.storage.getPowerStored(); long s2 = machineInventory.storage.getSpeedStored(); - int p2_1 = machineInventory.storage.getMaxPowerStored(); - long s2_1 = machineInventory.storage.getMaxSpeedStored(); + int p2_1 = machineInventory.storage.getMaxPower(); + long s2_1 = machineInventory.storage.getMaxSpeed(); arraylist2.add(0,"" + EnumChatFormatting.RESET+ "Machine Storage" + EnumChatFormatting.RESET ); arraylist2.add(1,"" + EnumChatFormatting.RED + "Power" + EnumChatFormatting.RESET ); diff --git a/src/main/java/shift/sextiarysector/gui/GuiSpinningMachine.java b/src/main/java/shift/sextiarysector/gui/GuiSpinningMachine.java new file mode 100644 index 0000000..e4d24c2 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiSpinningMachine.java @@ -0,0 +1,19 @@ +package shift.sextiarysector.gui; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.tileentity.TileEntitySimpleMachine; + +public class GuiSpinningMachine extends GuiSimpleMachine { + + private static final ResourceLocation machineGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/spinning_machine.png"); + + public GuiSpinningMachine(InventoryPlayer par1InventoryPlayer, TileEntitySimpleMachine par2TileEntity) { + super(par1InventoryPlayer, par2TileEntity); + } + + @Override + protected ResourceLocation getBindTexture() { + return machineGuiTextures; + } +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiStatsNext.java b/src/main/java/shift/sextiarysector/gui/GuiStatsNext.java index 73bd2f2..0592fad 100644 --- a/src/main/java/shift/sextiarysector/gui/GuiStatsNext.java +++ b/src/main/java/shift/sextiarysector/gui/GuiStatsNext.java @@ -30,7 +30,7 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; -import shift.sextiarysector.module.ModuleAchievement; +import shift.sextiarysector.module.ModuleStatistics; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -514,7 +514,7 @@ else if (StatList.objectCraftStats[i] != null && GuiStatsNext.this.field_146546_ { flag = true; } - else if (ModuleAchievement.objectSellStats[i] != null && GuiStatsNext.this.field_146546_t.writeStat(ModuleAchievement.objectSellStats[i]) > 0) + else if (ModuleStatistics.objectSellStats[i] != null && GuiStatsNext.this.field_146546_t.writeStat(ModuleStatistics.objectSellStats[i]) > 0) { flag = true; } @@ -552,8 +552,8 @@ else if (StatsBlock.this.field_148217_o == 1) } else if (StatsBlock.this.field_148217_o == 3) { - statbase = ModuleAchievement.objectSellStats[j]; - statbase1 = ModuleAchievement.objectSellStats[k]; + statbase = ModuleStatistics.objectSellStats[j]; + statbase1 = ModuleStatistics.objectSellStats[k]; } if (statbase != null || statbase1 != null) @@ -641,7 +641,7 @@ protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p this.func_148209_a(StatList.objectCraftStats[k1], p_148126_2_ + GuiStatsNext.this.shift + 115, p_148126_3_, p_148126_1_ % 2 == 0); this.func_148209_a(StatList.objectUseStats[k1], p_148126_2_ + GuiStatsNext.this.shift + 165, p_148126_3_, p_148126_1_ % 2 == 0); this.func_148209_a(statcrafting, p_148126_2_ + GuiStatsNext.this.shift + 215, p_148126_3_, p_148126_1_ % 2 == 0); - this.func_148209_a((StatCrafting)ModuleAchievement.objectSellStats[k1], p_148126_2_ + GuiStatsNext.this.shift + 265, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a((StatCrafting)ModuleStatistics.objectSellStats[k1], p_148126_2_ + GuiStatsNext.this.shift + 265, p_148126_3_, p_148126_1_ % 2 == 0); } @@ -731,7 +731,7 @@ else if (StatList.objectCraftStats[i] != null && GuiStatsNext.this.field_146546_ { flag = true; } - else if (ModuleAchievement.objectSellStats[i] != null && GuiStatsNext.this.field_146546_t.writeStat(ModuleAchievement.objectSellStats[i]) > 0) + else if (ModuleStatistics.objectSellStats[i] != null && GuiStatsNext.this.field_146546_t.writeStat(ModuleStatistics.objectSellStats[i]) > 0) { flag = true; } @@ -770,8 +770,8 @@ else if (StatsItem.this.field_148217_o == 2) // else if (StatsItem.this.field_148217_o == 3) { - statbase = ModuleAchievement.objectSellStats[j]; - statbase1 = ModuleAchievement.objectSellStats[k]; + statbase = ModuleStatistics.objectSellStats[j]; + statbase1 = ModuleStatistics.objectSellStats[k]; } if (statbase != null || statbase1 != null) @@ -856,7 +856,7 @@ protected void drawSlot(int p_148126_1_, int p_148126_2_, int p_148126_3_, int p this.func_148209_a(StatList.objectBreakStats[k1], p_148126_2_ + GuiStatsNext.this.shift + 115, p_148126_3_, p_148126_1_ % 2 == 0); this.func_148209_a(StatList.objectCraftStats[k1], p_148126_2_ + GuiStatsNext.this.shift + 165, p_148126_3_, p_148126_1_ % 2 == 0); this.func_148209_a(statcrafting, p_148126_2_ + GuiStatsNext.this.shift + 215, p_148126_3_, p_148126_1_ % 2 == 0); - this.func_148209_a(ModuleAchievement.objectSellStats[k1], p_148126_2_ + GuiStatsNext.this.shift + 265, p_148126_3_, p_148126_1_ % 2 == 0); + this.func_148209_a(ModuleStatistics.objectSellStats[k1], p_148126_2_ + GuiStatsNext.this.shift + 265, p_148126_3_, p_148126_1_ % 2 == 0); } diff --git a/src/main/java/shift/sextiarysector/gui/GuiSteamMotor.java b/src/main/java/shift/sextiarysector/gui/GuiSteamMotor.java new file mode 100644 index 0000000..8aba2ff --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiSteamMotor.java @@ -0,0 +1,140 @@ +package shift.sextiarysector.gui; + +import java.text.NumberFormat; +import java.util.ArrayList; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.container.ContainerSteamMotor; +import shift.sextiarysector.tileentity.TileEntitySteamMotor; + +public class GuiSteamMotor extends GuiContainer +{ + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/steam_motor.png"); + private TileEntitySteamMotor tileFurnace; + + public GuiSteamMotor(InventoryPlayer p_i1091_1_, TileEntitySteamMotor p_i1091_2_) + { + super(new ContainerSteamMotor(p_i1091_1_, p_i1091_2_)); + this.tileFurnace = p_i1091_2_; + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + String s = this.tileFurnace.hasCustomInventoryName() ? this.tileFurnace.getInventoryName() : I18n.format(this.tileFurnace.getInventoryName(), new Object[0]); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + + + //Fluid + if (this.tileFurnace.isFluid()) + { + //FluidStack f = this.tileFurnace.getTank().getFluid(); + this.drawFluidTank(k + 74,l + 17,this.tileFurnace.getTank(),34,52); + + } + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + this.drawTexturedModalRect(k + 73, l + 16, 176, 0, 36, 54); + + } + + @Override + public void drawScreen(int par1, int par2, float par3) + { + super.drawScreen(par1, par2, par3); + + ArrayList arraylist = new ArrayList(); + + String f = "None"; + + if (this.tileFurnace.isFluid()) + { + f = this.tileFurnace.getTank().getFluid().getFluid().getLocalizedName(this.tileFurnace.getTank().getFluid()); + } + + NumberFormat nfNum = NumberFormat.getNumberInstance(); + + arraylist.add(0,"" + EnumChatFormatting.RESET+ "Fluid Tank" + EnumChatFormatting.RESET ); + arraylist.add(1,"" + EnumChatFormatting.GRAY + "Fluid : "+f); + arraylist.add(2, ""+ EnumChatFormatting.GRAY + "Amount : " + nfNum.format(this.tileFurnace.getTank().getFluidAmount()) + " / " + nfNum.format(this.tileFurnace.getTank().getCapacity()) + " mB"); + + GL11.glPushMatrix(); + if (this.func_146978_c(73, 16, 36, 54, par1, par2)) + { + drawHoveringText(arraylist, par1, par2,fontRendererObj); + } + GL11.glPopMatrix(); + + + + } + + public void drawFluidTank(int x, int y, FluidTank fluidTank, int width, int height) { + + GL11.glColor3f(1,1,1); + + FluidStack fluidStack = fluidTank.getFluid(); + + ResourceLocation r; + if(fluidStack.getFluid().getSpriteNumber()==0){ + r = TextureMap.locationBlocksTexture; + }else{ + r = TextureMap.locationItemsTexture; + } + + this.mc.getTextureManager().bindTexture(r); + this.setColor3ubFromInt(fluidStack.getFluid().getColor(fluidStack)); + + int widthR = width;//*(fluidTank.getFluidAmount()/fluidTank.getCapacity()); + int heightR = (int) (height*((float)fluidTank.getFluidAmount()/(float)fluidTank.getCapacity())); + + int yR = y+(height-heightR); + + int widthL = 0; + int heightL = 0; + IIcon icon = (fluidStack.getFluid().getIcon(fluidStack)); + + for (int i = 0; i < widthR; i += 16) { + + for (int j = 0; j < heightR; j += 16) { + + widthL = Math.min(widthR - i, 16); + heightL = Math.min(heightR - j, 16); + this.drawTexturedModelRectFromIcon(x + i, yR + j, icon, widthL, heightL); + + } + } + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F); + + } + + public static void setColor3ubFromInt(int color) { + + GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiTabCrafting.java b/src/main/java/shift/sextiarysector/gui/GuiTabCrafting.java new file mode 100644 index 0000000..dec9291 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiTabCrafting.java @@ -0,0 +1,57 @@ +package shift.sextiarysector.gui; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SSPlayerTabs; +import shift.sextiarysector.container.ContainerTabWorkbench; +import shift.sextiarysector.gui.tab.TabManager; + +public class GuiTabCrafting extends GuiContainer{ + + private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png"); + private static final String __OBFID = "CL_00000750"; + + public GuiTabCrafting(InventoryPlayer p_i1084_1_, World p_i1084_2_, int p_i1084_3_, int p_i1084_4_, int p_i1084_5_) + { + super(new ContainerTabWorkbench(p_i1084_1_, p_i1084_2_, p_i1084_3_, p_i1084_4_, p_i1084_5_)); + } + + /** + * Draw the foreground layer for the GuiContainer (everything in front of the items) + */ + protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) + { + this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); + } + + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(craftingTableGuiTextures); + int k = (this.width - this.xSize) / 2; + int l = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize); + } + + public void initGui() + { + this.buttonList.clear(); + + super.initGui(); + + int cornerX = this.guiLeft; + + int cornerY = this.guiTop; + + TabManager.updateTabValues(cornerX, cornerY,this.buttonList, SSPlayerTabs.craft,false); + + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/GuiTimeMachine.java b/src/main/java/shift/sextiarysector/gui/GuiTimeMachine.java new file mode 100644 index 0000000..3e5a695 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/GuiTimeMachine.java @@ -0,0 +1,19 @@ +package shift.sextiarysector.gui; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import shift.sextiarysector.tileentity.TileEntitySimpleMachine; + +public class GuiTimeMachine extends GuiSimpleMachine{ + + private static final ResourceLocation machineGuiTextures = new ResourceLocation("sextiarysector:textures/guis/machine/time_machine.png"); + + public GuiTimeMachine(InventoryPlayer par1InventoryPlayer, TileEntitySimpleMachine par2TileEntity) { + super(par1InventoryPlayer, par2TileEntity); + } + + @Override + protected ResourceLocation getBindTexture() { + return machineGuiTextures; + } +} diff --git a/src/main/java/shift/sextiarysector/gui/tab/AbstractTab.java b/src/main/java/shift/sextiarysector/gui/tab/AbstractTab.java new file mode 100644 index 0000000..ff8f0fb --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/tab/AbstractTab.java @@ -0,0 +1,20 @@ +package shift.sextiarysector.gui.tab; + +import net.minecraft.item.ItemStack; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public abstract class AbstractTab { + + @SideOnly(Side.CLIENT) + public abstract void onTabClicked (); + + public abstract ItemStack getItemStack(); + + @SideOnly(Side.CLIENT) + public abstract String getTabName(); + + @SideOnly(Side.CLIENT) + public abstract boolean shouldAddToList(); + +} diff --git a/src/main/java/shift/sextiarysector/gui/tab/GuiBackButton.java b/src/main/java/shift/sextiarysector/gui/tab/GuiBackButton.java new file mode 100644 index 0000000..7b3545e --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/tab/GuiBackButton.java @@ -0,0 +1,77 @@ +package shift.sextiarysector.gui.tab; + +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; + +import org.lwjgl.opengl.GL11; + +public class GuiBackButton extends GuiButton{ + + private int cornerX; + private int cornerY; + private List buttonList; + + public GuiBackButton(int p_i1021_1_, int p_i1021_2_, int p_i1021_3_,int p_i1021_4_, int p_i1021_5_, int x, int y, List buttonList) { + super(p_i1021_1_, p_i1021_2_, p_i1021_3_, p_i1021_4_, p_i1021_5_, "<"); + this.cornerX = x; + this.cornerY = y; + this.buttonList = buttonList; + } + + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow && (TabManager.getSelectPage()>1)) + { + TabManager.setSelectPage(TabManager.getSelectPage()-1); + TabManager.updateTabValues(cornerX, cornerY, buttonList, TabManager.getSelectedButton(),true); + } + + return inWindow; + } + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + FontRenderer fontrenderer = mc.fontRenderer; + mc.renderEngine.bindTexture(buttonTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int k = this.getHoverState(this.field_146123_n); + //GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_DEPTH_TEST); + //OpenGlHelper.glBlendFunc(770, 771, 1, 0); + //GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.zLevel = 0.0F; + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height); + this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height); + this.mouseDragged(mc, mouseX, mouseY); + int l = 14737632; + + if (packedFGColour != 0) + { + l = packedFGColour; + } + else if (!this.enabled) + { + l = 10526880; + } + else if (this.field_146123_n) + { + l = 16777120; + } + + this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l); + this.zLevel = 0.0F; + GL11.glDisable(GL11.GL_DEPTH_TEST); + } + } +} diff --git a/src/main/java/shift/sextiarysector/gui/tab/GuiNextButton.java b/src/main/java/shift/sextiarysector/gui/tab/GuiNextButton.java new file mode 100644 index 0000000..bb32772 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/tab/GuiNextButton.java @@ -0,0 +1,77 @@ +package shift.sextiarysector.gui.tab; + +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; + +import org.lwjgl.opengl.GL11; + +public class GuiNextButton extends GuiButton{ + + private int cornerX; + private int cornerY; + private List buttonList; + + public GuiNextButton(int p_i1021_1_, int p_i1021_2_, int p_i1021_3_,int p_i1021_4_, int p_i1021_5_, int x, int y, List buttonList) { + super(p_i1021_1_, p_i1021_2_, p_i1021_3_, p_i1021_4_, p_i1021_5_, ">"); + this.cornerX = x; + this.cornerY = y; + this.buttonList = buttonList; + } + + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow && (TabManager.getSelectPage()= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + int k = this.getHoverState(this.field_146123_n); + //GL11.glEnable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_DEPTH_TEST); + //OpenGlHelper.glBlendFunc(770, 771, 1, 0); + //GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.zLevel = 0.0F; + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + k * 20, this.width / 2, this.height); + this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + k * 20, this.width / 2, this.height); + this.mouseDragged(mc, mouseX, mouseY); + int l = 14737632; + + if (packedFGColour != 0) + { + l = packedFGColour; + } + else if (!this.enabled) + { + l = 10526880; + } + else if (this.field_146123_n) + { + l = 16777120; + } + + this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l); + this.zLevel = 0.0F; + GL11.glDisable(GL11.GL_DEPTH_TEST); + } + } +} diff --git a/src/main/java/shift/sextiarysector/gui/tab/InventoryTabEquipment.java b/src/main/java/shift/sextiarysector/gui/tab/InventoryTabEquipment.java new file mode 100644 index 0000000..ab75765 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/tab/InventoryTabEquipment.java @@ -0,0 +1,75 @@ +package shift.sextiarysector.gui.tab; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.item.ISSEquipment; +import shift.sextiarysector.player.EntityPlayerManager; +import cpw.mods.fml.client.FMLClientHandler; + +public class InventoryTabEquipment extends AbstractTab { + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + private EquipmentType type; + private ItemStack item; + + public InventoryTabEquipment(EquipmentType type,ItemStack item){ + this.type = type; + this.item = item; + } + + private ItemStack getSlotItem(){ + + for(int i:type.getSlots()){ + + ItemStack slot = EntityPlayerManager.getEquipmentStats(mc.thePlayer).inventory.getStackInSlot(i); + + if(slot!=null && slot.isItemEqual(item)){ + return slot; + } + + } + + + return null; + } + + @Override + public void onTabClicked() { + + if(getSlotItem()==null){ + return ; + } + + ((ISSEquipment)this.getItemStack().getItem()).onTabClicked(type, getSlotItem(), mc.thePlayer); + + } + + @Override + public ItemStack getItemStack() { + return item; + } + + @Override + public boolean shouldAddToList() { + + if(getSlotItem()==null){ + return false; + } + + return ((ISSEquipment)this.getItemStack().getItem()).shouldAddToList(type, getSlotItem(), mc.thePlayer); + } + + @Override + public String getTabName() { + + if(getSlotItem()==null){ + return "player.tab."+""; + } + + return "player.tab."+((ISSEquipment)this.getItemStack().getItem()).getTabName(type, getSlotItem(), mc.thePlayer); + } + + +} diff --git a/src/main/java/shift/sextiarysector/gui/tab/InventoryTabSS.java b/src/main/java/shift/sextiarysector/gui/tab/InventoryTabSS.java new file mode 100644 index 0000000..e9c5398 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/tab/InventoryTabSS.java @@ -0,0 +1,35 @@ +package shift.sextiarysector.gui.tab; + +import net.minecraft.client.Minecraft; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.packet.PacketGuiId; +import shift.sextiarysector.packet.SSPacketHandler; +import cpw.mods.fml.client.FMLClientHandler; + +public class InventoryTabSS extends AbstractTab { + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + @Override + public void onTabClicked() { + SSPacketHandler.INSTANCE.sendToServer(new PacketGuiId(200)); + //mc.thePlayer.openGui(SextiarySector.instance, 200, mc.thePlayer.worldObj, (int)mc.thePlayer.posX, (int)mc.thePlayer.posY, (int)mc.thePlayer.posZ); + } + + @Override + public ItemStack getItemStack() { + return new ItemStack(Items.chainmail_chestplate); + } + + @Override + public boolean shouldAddToList() { + return true; + } + + @Override + public String getTabName() { + return "player.tab.equipment"; + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/tab/InventoryTabVanilla.java b/src/main/java/shift/sextiarysector/gui/tab/InventoryTabVanilla.java new file mode 100644 index 0000000..cb1fa1a --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/tab/InventoryTabVanilla.java @@ -0,0 +1,28 @@ +package shift.sextiarysector.gui.tab; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + +public class InventoryTabVanilla extends AbstractTab { + + @Override + public ItemStack getItemStack() { + return new ItemStack(Blocks.crafting_table); + } + + @Override + public boolean shouldAddToList() { + return true; + } + + @Override + public void onTabClicked() { + TabManager.openInventoryGui(); + } + + @Override + public String getTabName() { + return "player.tab.vanilla"; + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/tab/TabButton.java b/src/main/java/shift/sextiarysector/gui/tab/TabButton.java new file mode 100644 index 0000000..3085db6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/tab/TabButton.java @@ -0,0 +1,182 @@ +package shift.sextiarysector.gui.tab; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +public class TabButton extends GuiButton{ + + ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + private AbstractTab tab; + RenderItem itemRenderer = new RenderItem(); + + public TabButton(AbstractTab tab) + { + super(0,0,0, 28, 32, ""); + this.tab = tab; + } + + + @Override + public void drawButton (Minecraft mc, int mouseX, int mouseY) + { + if (this.visible) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + + int yTexPos = this.enabled ? 3 : 32; + int ySize = this.enabled ? 25 : 32; + int xOffset = this.id == 2 ? 0 : (this.id == 7 ? 5 : 1 ); + int yPos = this.yPosition + (this.enabled ? 3 : 0); + + + GL11.glEnable(GL11.GL_DEPTH_TEST); + + float z = this.zLevel; + this.zLevel = 100.0F; + this.itemRenderer.zLevel = 100.0F; + mc.renderEngine.bindTexture(this.texture); + this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + + RenderHelper.enableGUIStandardItemLighting(); + this.zLevel = 200.0F; + this.itemRenderer.zLevel = 200.0F; + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, tab.getItemStack(), xPosition + 6, yPosition + 8); + this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, tab.getItemStack(), xPosition + 6, yPosition + 8); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + this.itemRenderer.zLevel = 0.0F; + this.zLevel = 0.0F; + RenderHelper.disableStandardItemLighting(); + + this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + //int k = this.getHoverState(this.field_146123_n); + + if(this.field_146123_n){ + //this.drawCenteredString(mc.fontRenderer, I18n.format(this.tab.getTabName()), mouseX, mouseY, 0xffffff); + List name = new ArrayList(); + name.add(I18n.format(this.tab.getTabName())); + this.drawHoveringText(name, mouseX, mouseY, mc.fontRenderer, mc.currentScreen); + //((GuiContainer)mc.currentScreen).drawHoveringText(name, mouseX + 20, mouseY + 5, mc.fontRenderer); + } + + GL11.glDisable(GL11.GL_DEPTH_TEST); + + } + } + + protected void drawHoveringText(List p_146283_1_, int p_146283_2_, int p_146283_3_, FontRenderer font , GuiScreen gui) + { + if (!p_146283_1_.isEmpty()) + { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + //RenderHelper.disableStandardItemLighting(); + //GL11.glDisable(GL11.GL_LIGHTING); + //GL11.glDisable(GL11.GL_DEPTH_TEST); + int k = 0; + Iterator iterator = p_146283_1_.iterator(); + + while (iterator.hasNext()) + { + String s = (String)iterator.next(); + int l = font.getStringWidth(s); + + if (l > k) + { + k = l; + } + } + + int j2 = p_146283_2_ + 12; + int k2 = p_146283_3_ - 12; + int i1 = 8; + + if (p_146283_1_.size() > 1) + { + i1 += 2 + (p_146283_1_.size() - 1) * 10; + } + + if (j2 + k > gui.width) + { + j2 -= 28 + k; + } + + if (k2 + i1 + 6 > this.height + 25) + { + k2 = this.height + 25 - i1 - 6; + } + + this.zLevel = 300.0F; + itemRenderer.zLevel = 300.0F; + int j1 = -267386864; + this.drawGradientRect(j2 - 3, k2 - 4, j2 + k + 3, k2 - 3, j1, j1); + this.drawGradientRect(j2 - 3, k2 + i1 + 3, j2 + k + 3, k2 + i1 + 4, j1, j1); + this.drawGradientRect(j2 - 3, k2 - 3, j2 + k + 3, k2 + i1 + 3, j1, j1); + this.drawGradientRect(j2 - 4, k2 - 3, j2 - 3, k2 + i1 + 3, j1, j1); + this.drawGradientRect(j2 + k + 3, k2 - 3, j2 + k + 4, k2 + i1 + 3, j1, j1); + int k1 = 1347420415; + int l1 = (k1 & 16711422) >> 1 | k1 & -16777216; + this.drawGradientRect(j2 - 3, k2 - 3 + 1, j2 - 3 + 1, k2 + i1 + 3 - 1, k1, l1); + this.drawGradientRect(j2 + k + 2, k2 - 3 + 1, j2 + k + 3, k2 + i1 + 3 - 1, k1, l1); + this.drawGradientRect(j2 - 3, k2 - 3, j2 + k + 3, k2 - 3 + 1, k1, k1); + this.drawGradientRect(j2 - 3, k2 + i1 + 2, j2 + k + 3, k2 + i1 + 3, l1, l1); + + GL11.glDisable(GL11.GL_DEPTH_TEST); + for (int i2 = 0; i2 < p_146283_1_.size(); ++i2) + { + String s1 = (String)p_146283_1_.get(i2); + font.drawStringWithShadow(s1, j2, k2, -1); + + if (i2 == 0) + { + k2 += 2; + } + + k2 += 10; + } + GL11.glEnable(GL11.GL_DEPTH_TEST); + + this.zLevel = 0.0F; + itemRenderer.zLevel = 0.0F; + //GL11.glEnable(GL11.GL_LIGHTING); + //GL11.glEnable(GL11.GL_DEPTH_TEST); + //RenderHelper.enableStandardItemLighting(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + } + } + + @Override + public boolean mousePressed (Minecraft mc, int mouseX, int mouseY) + { + boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; + + if (inWindow) + { + //mc.thePlayer.openContainer = null; + this.tab.onTabClicked(); + } + + return inWindow; + } + + public boolean shouldAddToList () { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/gui/tab/TabManager.java b/src/main/java/shift/sextiarysector/gui/tab/TabManager.java new file mode 100644 index 0000000..dbc7626 --- /dev/null +++ b/src/main/java/shift/sextiarysector/gui/tab/TabManager.java @@ -0,0 +1,298 @@ +package shift.sextiarysector.gui.tab; + +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.network.play.client.C0DPacketCloseWindow; +import net.minecraftforge.client.event.GuiScreenEvent; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class TabManager { + + private static HashMap tabMap = new HashMap(); + private static int tabSize = 0; + + private static Minecraft mc = FMLClientHandler.instance().getClient(); + + private static EntityPlayer getPlayer() { + return FMLClientHandler.instance().getClient().thePlayer; + } + + private static final String Select_Page = "selectpage"; + private static final String Selected_Button = "selectedbutton"; + + private static boolean init; + private static AbstractTab vanilla; + + public static WeakReference buttons; + + public static void initTabManager() { + + if (!init) { + init = true; + vanilla = new InventoryTabVanilla(); + registerTab(vanilla); + } + + } + + public static void registerTab(AbstractTab tab) + { + if (!init) initTabManager(); + tabMap.put(tabSize, tab); + tabSize++; + } + + public static int getTabNumber(AbstractTab tab) { + + for (int i = 0; i < tabMap.size(); i++) { + if (tabMap.get(i).equals(tab)) { + return i; + } + } + return 0; + + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void guiPreInit(GuiScreenEvent.InitGuiEvent.Pre event) + { + + buttons = null;//event.buttonList; + + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + + if ((event.gui instanceof GuiInventory)) + { + + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + + if (this.hasPotion()) + { + guiLeft = 160 + (event.gui.width - xSize - 200) / 2; + } + + updateTabValues(guiLeft, guiTop, event.buttonList, vanilla, false); + + } + } + + public static boolean hasPotion() + { + if (mc.thePlayer.getActivePotionEffects().isEmpty()) return false; + + return isNotNEI(); + + //if (!Loader.isModLoaded("NotEnoughItems")) return true; + + //try + //{ + // Class c = Class.forName("codechicken.nei.NEIClientConfig"); + // Object hidden = c.getMethod("isHidden").invoke(null); + // Object enabled = c.getMethod("isEnabled").invoke(null); + // + // if (hidden != null && hidden instanceof Boolean && enabled != null && enabled instanceof Boolean) + // { + // if ((Boolean) hidden || !((Boolean) enabled)) + // { + // return true; + // } + // } + + ////} catch (Exception e) + //} + + //return false; + + } + + private static boolean isNotNEI() { + + if (!Loader.isModLoaded("NotEnoughItems")) return true; + + try + { + Class c = Class.forName("codechicken.nei.NEIClientConfig"); + Object hidden = c.getMethod("isHidden").invoke(null); + Object enabled = c.getMethod("isEnabled").invoke(null); + + if (hidden != null && hidden instanceof Boolean && enabled != null && enabled instanceof Boolean) + { + if ((Boolean) hidden || !((Boolean) enabled)) + { + return true; + } + } + + } catch (Exception e) + { + } + + return false; + + } + + public static void updateTabValues(int cornerX, int cornerY, List buttonList, AbstractTab selectedButton, boolean reset) + { + + if (reset) { + + GuiButton[] r = (GuiButton[]) buttonList.toArray(new GuiButton[0]); + + buttonList.clear(); + + for (int i = 0; i < r.length; i++) { + if (!(r[i] instanceof TabButton) && !(r[i] instanceof GuiBackButton) && !(r[i] instanceof GuiNextButton)) { + buttonList.add(r[i]); + } + } + } + + if (!reset) { + buttons = new WeakReference(buttonList); + } + + int count = 3; + int pCount = getSelectPage(); + ArrayList tabs = getTabListFromPage(pCount); + + TabButton buttonV = new TabButton(tabMap.get(0)); + buttonV.id = 2; + buttonV.xPosition = cornerX; + buttonV.yPosition = cornerY - 28; + buttonV.enabled = !tabMap.get(0).equals(selectedButton); + buttonList.add(buttonV); + + for (int i = 0; i < tabs.size(); i++) + { + AbstractTab t = tabs.get(i); + + if (t.shouldAddToList()) + { + TabButton button = new TabButton(t); + button.id = count; + button.xPosition = cornerX + 32 + (count - 3) * 29; + button.yPosition = cornerY - 28; + button.enabled = !t.equals(selectedButton); + buttonList.add(button); + count++; + } + } + + int xSize = 176; + int ySize = 166; + int tabCount = getUpdateTab().size(); + if (tabCount > 5) + { + buttonList.add(new GuiBackButton(8, cornerX - 24, cornerY - 22, 20, 20, cornerX, cornerY, buttonList)); + buttonList.add(new GuiNextButton(9, cornerX + xSize - 20 + 24, cornerY - 22, 20, 20, cornerX, cornerY, buttonList)); + } + + setSelectedButton(selectedButton); + + } + + @SideOnly(Side.CLIENT) + private static void setSelectedButton(AbstractTab selectedButton) { + + for (int i = 0; i < tabMap.size(); i++) + { + if (tabMap.get(i).equals(selectedButton)) { + getPlayer().getEntityData().setInteger(Selected_Button, i); + return; + } + } + + } + + @SideOnly(Side.CLIENT) + public static AbstractTab getSelectedButton() { + return tabMap.get(getPlayer().getEntityData().getInteger(Selected_Button)); + } + + @SideOnly(Side.CLIENT) + private static ArrayList getTabListFromPage(int i) { + + ArrayList tabs = new ArrayList(); + ArrayList now = getUpdateTab(); + int j = i - 1; + + if (i > getPageSize()) { + setSelectPage(1); + j = 0; + } + + for (int k = j * 5; k < now.size() && k < (j * 5 + 5); k++) { + tabs.add(now.get(k)); + } + + return tabs; + + } + + @SideOnly(Side.CLIENT) + private static ArrayList getUpdateTab() + { + ArrayList tabs = new ArrayList(); + + for (int i = 1; i < tabMap.size(); i++) + { + AbstractTab t = tabMap.get(i); + if (t.shouldAddToList()) + { + tabs.add(t); + } + } + + return tabs; + + } + + public static int getPageSize() { + ArrayList naw = getUpdateTab(); + + return naw.size() % 5 == 0 ? naw.size() / 5 : (naw.size() / 5) + 1; + } + + public static int getSelectPage() + { + int i = getPlayer().getEntityData().getInteger(Select_Page); + if (i == 0) { + setSelectPage(1); + return 1; + } + + return i; + } + + public static void setSelectPage(int i) { + getPlayer().getEntityData().setInteger(Select_Page, i); + } + + public static void openInventoryGui() + { + mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId)); + GuiInventory inventory = new GuiInventory(mc.thePlayer); + mc.displayGuiScreen(inventory); + } + +} diff --git a/src/main/java/shift/sextiarysector/item/GearForceItemManager.java b/src/main/java/shift/sextiarysector/item/GearForceItemManager.java index 90f416b..3fafccd 100644 --- a/src/main/java/shift/sextiarysector/item/GearForceItemManager.java +++ b/src/main/java/shift/sextiarysector/item/GearForceItemManager.java @@ -6,9 +6,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import shift.sextiarysector.SextiarySector; -import shift.sextiarysector.api.machine.item.IGearForceItem; -import shift.sextiarysector.api.machine.item.IGearForceItemManager; +import shift.sextiarysector.api.gearforce.item.IGearForceItem; +import shift.sextiarysector.api.gearforce.item.IGearForceItemManager; public class GearForceItemManager implements IGearForceItemManager { @@ -19,93 +18,98 @@ public class GearForceItemManager implements IGearForceItemManager { @Override public int reduceEnergy(ItemStack itemStack, int power, int speed, boolean simulate) { - if(!(itemStack.getItem() instanceof IGearForceItem)){ + if (!(itemStack.getItem() instanceof IGearForceItem)) { return 0; } - IGearForceItem item = (IGearForceItem)itemStack.getItem(); + IGearForceItem item = (IGearForceItem) itemStack.getItem(); - if(this.getSpeed(itemStack)<=0){ + if (this.getSpeed(itemStack) <= 0) { return 0; } + if (power != item.getMaxPower(itemStack)) return 0; + int sp = speed; - if(item.getMaxPowerStored(itemStack)power){ - sp = (int) (speed*Math.pow(0.25, item.getMaxPowerStored(itemStack)-power)); - } + if(item.getMaxPower(itemStack)>power){ + sp = (int) (speed*Math.pow(0.25, item.getMaxPower(itemStack)-power)); + }*/ int speedReceived = 0; int speedReceived2 = 0; - if(this.getSpeed(itemStack)>=sp){ + if (this.getSpeed(itemStack) >= sp) { speedReceived = this.getSpeed(itemStack) - sp; speedReceived2 = sp; - }else{ + } else { speedReceived = 0; speedReceived2 = this.getSpeed(itemStack); } - if (!simulate) - { - this.setEnergy(itemStack, item.getMaxPowerStored(itemStack), speedReceived); - } + if (!simulate) + { + this.setEnergy(itemStack, item.getMaxPower(itemStack), speedReceived); + } - return speedReceived2; + return speedReceived2; } //蠅励d縺 @Override public int addEnergy(ItemStack itemStack, int power, int speed, boolean simulate) { - - if(!(itemStack.getItem() instanceof IGearForceItem)){ + if (!(itemStack.getItem() instanceof IGearForceItem)) { return 0; } - IGearForceItem item = (IGearForceItem)itemStack.getItem(); + IGearForceItem item = (IGearForceItem) itemStack.getItem(); - if(item.getMaxPowerStored(itemStack)>power){ + if (item.getMaxPower(itemStack) > power) { return 0; } + if (power != item.getMaxPower(itemStack)) return 0; + int sp = speed; - if(item.getMaxPowerStored(itemStack)this.getSpeed(itemStack)+sp){ - speedReceived = this.getSpeed(itemStack)+sp; + if (item.getMaxSpeed(itemStack) > this.getSpeed(itemStack) + sp) { + speedReceived = this.getSpeed(itemStack) + sp; speedReceived2 = sp; - }else{ - speedReceived = item.getMaxSpeedStored(itemStack); - speedReceived2 = item.getMaxSpeedStored(itemStack)-this.getSpeed(itemStack); + } else { + speedReceived = item.getMaxSpeed(itemStack); + speedReceived2 = item.getMaxSpeed(itemStack) - this.getSpeed(itemStack); } - if (!simulate) - { - this.setEnergy(itemStack, item.getMaxPowerStored(itemStack) , speedReceived); - } + if (!simulate) + { + this.setEnergy(itemStack, item.getMaxPower(itemStack), speedReceived); + } - return speedReceived2; + return speedReceived2; } @Override public int getPower(ItemStack theItem) { if (theItem.getTagCompound() == null) - { + { theItem.setTagCompound(new NBTTagCompound()); return 0; - } + } return theItem.getTagCompound().getInteger("gfpower"); @@ -115,106 +119,108 @@ public int getPower(ItemStack theItem) { public int getSpeed(ItemStack theItem) { if (theItem.getTagCompound() == null) - { + { theItem.setTagCompound(new NBTTagCompound()); return 0; - } + } return theItem.getTagCompound().getInteger("gfspeed"); } @Override - public boolean setEnergy(ItemStack itemStack, int power, int speed) - { + public boolean setEnergy(ItemStack itemStack, int power, int speed) + { - if(!(itemStack.getItem() instanceof IGearForceItem)){ - return false ; + if (!(itemStack.getItem() instanceof IGearForceItem)) { + return false; } - IGearForceItem item = (IGearForceItem)itemStack.getItem(); + IGearForceItem item = (IGearForceItem) itemStack.getItem(); if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } + { + itemStack.setTagCompound(new NBTTagCompound()); + } int d = 100; - int powerStored = Math.max(Math.min(power, item.getMaxPowerStored(itemStack)), 0); - int speedStored = Math.max(Math.min(speed, item.getMaxSpeedStored(itemStack)), 0); - itemStack.getTagCompound().setInteger("gfpower", powerStored); - if(speedStored==0)itemStack.getTagCompound().setInteger("gfpower", 0); - itemStack.getTagCompound().setInteger("gfspeed", speedStored); - int damage = (int) (d - (speedStored / (double) item.getMaxSpeedStored(itemStack)) * d); - if(speedStored==0){ - damage = 0; - } - if(speedStored==item.getMaxSpeedStored(itemStack)){ - damage = 1; - } - if(damage==0&&speedStored!=0){ - damage = 1; - } - - if(!r.contains(itemStack.getItem())&&((IGearForceItem)itemStack.getItem()).isCustomDamage(itemStack)){ - SextiarySector.proxy.registerItemRenderer(itemStack.getItem()); - r.add(itemStack.getItem()); - } - - //itemStack.setItemDamage(damage); + int powerStored = Math.max(Math.min(power, item.getMaxPower(itemStack)), 0); + int speedStored = Math.max(Math.min(speed, item.getMaxSpeed(itemStack)), 0); + itemStack.getTagCompound().setInteger("gfpower", powerStored); + if (speedStored == 0) itemStack.getTagCompound().setInteger("gfpower", 0); + itemStack.getTagCompound().setInteger("gfspeed", speedStored); + int damage = (int) (d - (speedStored / (double) item.getMaxSpeed(itemStack)) * d); + if (speedStored == 0) { + damage = 0; + } + if (speedStored == item.getMaxSpeed(itemStack)) { + damage = 1; + } + if (damage == 0 && speedStored != 0) { + damage = 1; + } + + /* + if (!r.contains(itemStack.getItem()) && ((IGearForceItem) itemStack.getItem()).isCustomDamage(itemStack)) { + SextiarySector.proxy.registerItemRenderer(itemStack.getItem()); + r.add(itemStack.getItem()); + }*/ + + //itemStack.setItemDamage(damage); return true; - } + } @Override public boolean canUse(ItemStack itemStack, int speed) { - if(speed<0||!(itemStack.getItem() instanceof IGearForceItem)){ + if (speed < 0 || !(itemStack.getItem() instanceof IGearForceItem)) { return false; } - IGearForceItem item = (IGearForceItem)itemStack.getItem(); + IGearForceItem item = (IGearForceItem) itemStack.getItem(); if (itemStack.getTagCompound() == null) - { - itemStack.setTagCompound(new NBTTagCompound()); - } + { + itemStack.setTagCompound(new NBTTagCompound()); + } long speedStored = itemStack.getTagCompound().getInteger("gfspeed"); - if(item.getMaxSpeedStored(itemStack)= 100 && this.canDrink(par3EntityPlayer, false)) { + par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); + } + + } + + return par1ItemStack; + + } + + private ItemStack onEmptyItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); + + if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; + + if (!par3EntityPlayer.canPlayerEdit(x, y, z, movingobjectposition.sideHit, par1ItemStack)) + { + return par1ItemStack; + } + + Block block = par2World.getBlock(x, y, z); + + Fluid f = FluidRegistry.lookupFluidForBlock(block); + + if (f != null) { + this.fill(par1ItemStack, new FluidStack(f, 1000), true); + par2World.setBlockToAir(x, y, z); + } + + } + + return par1ItemStack; + } + + @Override + public ItemStack onEaten(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer) { + + if (par2World.isRemote) { + return stack; + } + + MinecraftForge.EVENT_BUS.post(new BlockBottleEvent(par3EntityPlayer, this.getFluid(stack))); + this.drain(stack, 100, true); + + return stack; + //--stack.stackSize; + + } + + @Override + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + return EnumAction.drink; + } + + public boolean canDrink(EntityPlayer par3EntityPlayer, boolean par1) + { + return (par1 || EntityPlayerManager.getMoistureStats(par3EntityPlayer).needMoisture()) && !par3EntityPlayer.capabilities.disableDamage; + } + + @Override + public int getMaxItemUseDuration(ItemStack p_77626_1_) + { + return 32; + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0)); + + for (int i = 1; i <= FluidRegistry.getRegisteredFluids().size(); i++) { + ItemStack item = new ItemStack(p_150895_1_, 1, i); + this.fill(item, new FluidStack(FluidRegistry.getFluid(i), capacity), true); + p_150895_3_.add(item); + } + + } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer par1EntityPlayer, List list, boolean flag) + { + + String name = "None"; + int amount = 0; + + if (this.getFluid(itemstack) != null) { + name = this.getFluid(itemstack).getFluid().getLocalizedName(this.getFluid(itemstack)); + amount = this.getFluid(itemstack).amount; + } + + NumberFormat nfNum = NumberFormat.getNumberInstance(); + + list.add("Name" + " : " + name); + list.add("Amount" + " : " + nfNum.format(amount) + " / " + nfNum.format(this.capacity) + " mB"); + + } + + /* IFluidContainerItem */ + @Override + public FluidStack getFluid(ItemStack container) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return null; + } + return FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + } + + @Override + public int getCapacity(ItemStack container) + { + return capacity; + } + + @Override + public int fill(ItemStack container, FluidStack resource, boolean doFill) + { + if (resource == null) + { + return 0; + } + + if (!doFill) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return Math.min(capacity, resource.amount); + } + + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + + if (stack == null) + { + return Math.min(capacity, resource.amount); + } + + if (!stack.isFluidEqual(resource)) + { + return 0; + } + + return Math.min(capacity - stack.amount, resource.amount); + } + + if (container.stackTagCompound == null) + { + container.stackTagCompound = new NBTTagCompound(); + } + + if (!container.stackTagCompound.hasKey("Fluid")) + { + NBTTagCompound fluidTag = resource.writeToNBT(new NBTTagCompound()); + + container.setItemDamage(resource.getFluid().getID()); + + if (capacity < resource.amount) + { + fluidTag.setInteger("Amount", capacity); + container.stackTagCompound.setTag("Fluid", fluidTag); + return capacity; + } + + container.stackTagCompound.setTag("Fluid", fluidTag); + return resource.amount; + } + + NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + FluidStack stack = FluidStack.loadFluidStackFromNBT(fluidTag); + + if (!stack.isFluidEqual(resource)) + { + return 0; + } + + int filled = capacity - stack.amount; + if (resource.amount < filled) + { + stack.amount += resource.amount; + filled = resource.amount; + } + else + { + stack.amount = capacity; + } + + container.stackTagCompound.setTag("Fluid", stack.writeToNBT(fluidTag)); + return filled; + } + + @Override + public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return null; + } + + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + if (stack == null) + { + return null; + } + + stack.amount = Math.min(stack.amount, maxDrain); + if (doDrain) + { + if (maxDrain >= capacity) + { + container.stackTagCompound.removeTag("Fluid"); + + if (container.stackTagCompound.hasNoTags()) + { + container.stackTagCompound = null; + } + + container.setItemDamage(0); + + return stack; + } + + NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + fluidTag.setInteger("Amount", fluidTag.getInteger("Amount") - maxDrain); + container.stackTagCompound.setTag("Fluid", fluidTag); + } + return stack; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemBlockBuoyBase.java b/src/main/java/shift/sextiarysector/item/ItemBlockBuoyBase.java new file mode 100644 index 0000000..ebb7b49 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemBlockBuoyBase.java @@ -0,0 +1,152 @@ +package shift.sextiarysector.item; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.MovingObjectPosition.MovingObjectType; +import net.minecraft.world.World; + +public class ItemBlockBuoyBase extends ItemBlock { + + public ItemBlockBuoyBase(Block par1) { + super(par1); + + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); + + if (movingobjectposition == null) + { + return par1ItemStack; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) + { + return par1ItemStack; + } + + if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack)) + { + return par1ItemStack; + } + + if (par2World.getBlock(i, j, k).getMaterial() == Material.water && par2World.getBlockMetadata(i, j, k) == 0 && par2World.isAirBlock(i, j + 1, k)) + { + + int l = MathHelper.floor_double(par3EntityPlayer.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + int d = 0; + if (l == 0) { + d = 4; + } else if (l == 1) { + d = 6; + } else if (l == 2) { + d = 0; + } else if (l == 3) { + d = 2; + } + + par2World.setBlock(i, j + 1, k, this.field_150939_a); + par2World.setBlockMetadataWithNotify(i, j + 1, k, d, 2); + + if (!par3EntityPlayer.capabilities.isCreativeMode) + { + --par1ItemStack.stackSize; + } + } + } + + return par1ItemStack; + } + } + + /* + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) + { + int i1 = par3World.getBlock(par4, par5, par6); + + if (i1 == Block.snow.blockID && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1) + { + par7 = 1; + } + else if (i1 != Block.vine.blockID && i1 != Block.tallGrass.blockID && i1 != Block.deadBush.blockID + && (Block.blocksList[i1] == null || !Block.blocksList[i1].isBlockReplaceable(par3World, par4, par5, par6))) + { + if (par7 == 0) + { + --par5; + } + + if (par7 == 1) + { + ++par5; + } + + if (par7 == 2) + { + --par6; + } + + if (par7 == 3) + { + ++par6; + } + + if (par7 == 4) + { + --par4; + } + + if (par7 == 5) + { + ++par4; + } + } + + if (par1ItemStack.stackSize == 0) + { + return false; + } + else if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) + { + return false; + } + else if (par5 == 255 && Block.blocksList[this.blockID].blockMaterial.isSolid()) + { + return false; + } + else if (par3World.canPlaceEntityOnSide(this.blockID, par4, par5, par6, false, par7, par2EntityPlayer, par1ItemStack)) + { + Block block = Block.blocksList[this.blockID]; + int j1 = this.getMetadata(par1ItemStack.getItemDamage()); + int k1 = Block.blocksList[this.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, j1); + + if (placeBlockAt(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10, k1)) + { + par3World.playSoundEffect(par4 + 0.5F, par5 + 0.5F, par6 + 0.5F, block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); + --par1ItemStack.stackSize; + } + + return true; + } + else + { + return false; + } + }*/ + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemBlockShaft.java b/src/main/java/shift/sextiarysector/item/ItemBlockDirection.java similarity index 82% rename from src/main/java/shift/sextiarysector/item/ItemBlockShaft.java rename to src/main/java/shift/sextiarysector/item/ItemBlockDirection.java index a0de9db..0c52cdd 100644 --- a/src/main/java/shift/sextiarysector/item/ItemBlockShaft.java +++ b/src/main/java/shift/sextiarysector/item/ItemBlockDirection.java @@ -8,9 +8,9 @@ import net.minecraftforge.common.util.ForgeDirection; import shift.sextiarysector.tileentity.TileEntityDirection; -public class ItemBlockShaft extends ItemBlock{ +public class ItemBlockDirection extends ItemBlock{ - public ItemBlockShaft(Block par1) { + public ItemBlockDirection(Block par1) { super(par1); } @@ -20,7 +20,7 @@ public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, i { boolean result = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ,metadata); - if(result){ + if(result && world.getTileEntity(x, y, z) instanceof TileEntityDirection){ TileEntityDirection tile = (TileEntityDirection)world.getTileEntity(x, y, z); tile.direction = ForgeDirection.getOrientation(side); } diff --git a/src/main/java/shift/sextiarysector/item/ItemBlockFigure.java b/src/main/java/shift/sextiarysector/item/ItemBlockFigure.java new file mode 100644 index 0000000..96af16e --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemBlockFigure.java @@ -0,0 +1,70 @@ +package shift.sextiarysector.item; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.block.BlockFigure; +import shift.sextiarysector.tileentity.TileEntityFigure; + +public class ItemBlockFigure extends ItemBlock { + + private static ItemStack fItem = new ItemStack(Blocks.dirt); + + public ItemBlockFigure(Block p_i45328_1_) { + super(p_i45328_1_); + this.hasSubtypes = true; + } + + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + boolean result = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); + + if (result && world.getTileEntity(x, y, z) instanceof TileEntityFigure) { + TileEntityFigure tile = (TileEntityFigure) world.getTileEntity(x, y, z); + + tile.setFigure(BlockFigure.getFigureItem(stack)); + tile.setEdition(BlockFigure.getEdition(stack)); + } + + return result; + } + + @Override + public void addInformation(ItemStack itemstack, EntityPlayer par1EntityPlayer, List list, boolean flag) + { + + try { + + NBTTagCompound nbt = itemstack.stackTagCompound; + + if (nbt == null) + { + return; + } + + if (nbt.hasKey("figure")) { + + fItem.readFromNBT(nbt.getCompoundTag("figure")); + list.add(StatCollector.translateToLocal("tooltip.name") + " : " + fItem.getDisplayName()); + list.add(StatCollector.translateToLocal("tooltip.edition") + " : " + StatCollector.translateToLocal("edition." + BlockFigure.getEdition(itemstack))); + + } + + } catch (Exception e) { + + SextiarySector.Log.catching(e); + + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemBlockFluidCrafter.java b/src/main/java/shift/sextiarysector/item/ItemBlockFluidCrafter.java new file mode 100644 index 0000000..50c7819 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemBlockFluidCrafter.java @@ -0,0 +1,162 @@ +package shift.sextiarysector.item; + +import java.text.NumberFormat; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.tileentity.TileEntityFluidCrafter; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemBlockFluidCrafter extends ItemBlock{ + + public ItemBlockFluidCrafter(Block par1) { + super(par1); + this.setHasSubtypes(true); + } + + public int getMetadata(int p_77647_1_) + { + return p_77647_1_; + } + + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + boolean result = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ,metadata); + + if(result){ + + if(stack.getItemDamage()!=0){ + TileEntityFluidCrafter tileEntity = (TileEntityFluidCrafter)world.getTileEntity(x, y, z); + tileEntity.f = new FluidStack(FluidRegistry.getFluid(stack.getItemDamage()),1000); + } + + } + + return result; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0)); + + for(int i=1;i<=FluidRegistry.getRegisteredFluids().size();i++){ + ItemStack item = new ItemStack(p_150895_1_, 1, i); + p_150895_3_.add(item); + } + + } + + /* + //繧「繧、繝繝 + @Override + public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4,int par5, int par6, int par7, float par8, float par9, float par10) + { + + if (par2EntityPlayer.isSneaking()) { + return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9,par10); + } else { + return false; + } + + } + + @Override + public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + + if (par3EntityPlayer.isSneaking()) { + return par1ItemStack; + } else { + + if(par1ItemStack.getItemDamage()==0){ + return this.onEmptyItemRightClick(par1ItemStack, par2World, par3EntityPlayer); + } + + } + + + return par1ItemStack; + + } + + private ItemStack onEmptyItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) + { + + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); + + + if (movingobjectposition != null && movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int x = movingobjectposition.blockX; + int y = movingobjectposition.blockY; + int z = movingobjectposition.blockZ; + + if (!par3EntityPlayer.canPlayerEdit(x, y, z, movingobjectposition.sideHit, par1ItemStack)) + { + return par1ItemStack; + } + + Block block = par2World.getBlock(x, y, z); + + Fluid f = FluidRegistry.lookupFluidForBlock(block); + + if(f!=null){ + + if (par3EntityPlayer.capabilities.isCreativeMode) + { + return par1ItemStack; + } + + ItemStack item = par1ItemStack.copy(); + item.stackSize = 1; + item.setItemDamage(f.getID()); + + if (--par1ItemStack.stackSize <= 0) + { + return item; + } + + if (!par3EntityPlayer.inventory.addItemStackToInventory(item)) + { + par3EntityPlayer.dropPlayerItemWithRandomChoice(item, false); + } + + par2World.setBlockToAir(x, y, z); + } + + } + + + return par1ItemStack; + }*/ + + @Override + public void addInformation(ItemStack itemstack,EntityPlayer par1EntityPlayer, List list , boolean flag) + { + + String name = "None"; + int amount = 0; + + if(itemstack.getItemDamage()!=0){ + name = FluidRegistry.getFluid(itemstack.getItemDamage()).getLocalizedName(); + amount = 1000; + } + + NumberFormat nfNum = NumberFormat.getNumberInstance(); + + list.add("Name" +" : " + name); + list.add("Amount" +" : " + nfNum.format(amount) + " / " + nfNum.format(1000) + " mB"); + + } +} diff --git a/src/main/java/shift/sextiarysector/item/ItemBlockFood.java b/src/main/java/shift/sextiarysector/item/ItemBlockFood.java new file mode 100644 index 0000000..c44ff92 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemBlockFood.java @@ -0,0 +1,66 @@ +package shift.sextiarysector.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; + +/** block繧帝」溘∋繧後k繧医≧縺ォ縺吶kClass ver2(Potion蜉ケ譫應サ倥″) + * + * GameRegistry.registerBlock(sampleBlock, ItemBlockFood.class, "SampleBlock"); + * + * 縺ョ繧医≧縺ォ菴ソ縺 + * */ +public class ItemBlockFood extends ItemBlock{ + + private final int healAmount = 4; //蝗槫セゥ驥 + private final float saturationModifier = 2.5f; // 蝗槫セゥ縺吶k髫縺礼ゥコ閻ケ蠎ヲ + + private final Potion potion = Potion.heal;//Potion縺ョ遞ョ鬘 + private final int level = 0;//Potion縺ョ蠑キ縺 + private final int time = 600;//Potion縺ョ譎る俣 + + public ItemBlockFood(Block p_i45328_1_) { + super(p_i45328_1_); + } + + public ItemStack onEaten(ItemStack p_77654_1_, World p_77654_2_, EntityPlayer p_77654_3_) + { + --p_77654_1_.stackSize; + p_77654_3_.getFoodStats().addStats(healAmount, saturationModifier); + p_77654_2_.playSoundAtEntity(p_77654_3_, "random.burp", 0.5F, p_77654_2_.rand.nextFloat() * 0.1F + 0.9F); + + //Potion蜉ケ譫懊rplayer縺ォ莉伜刈 + p_77654_3_.addPotionEffect(new PotionEffect(potion.id, time, level)); + + return p_77654_1_; + } + + //譎る俣 + public int getMaxItemUseDuration(ItemStack p_77626_1_) + { + return 32; + } + + //鬟溘∋迚ゥ + public EnumAction getItemUseAction(ItemStack p_77661_1_) + { + return EnumAction.eat; + } + + // + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) + { + if (p_77659_3_.canEat(false)) + { + p_77659_3_.setItemInUse(p_77659_1_, this.getMaxItemUseDuration(p_77659_1_)); + } + + return p_77659_1_; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemBlockGearShaft.java b/src/main/java/shift/sextiarysector/item/ItemBlockGearShaft.java new file mode 100644 index 0000000..5126eca --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemBlockGearShaft.java @@ -0,0 +1,49 @@ +package shift.sextiarysector.item; + +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.tileentity.TileEntityDirection; + +public class ItemBlockGearShaft extends ItemBlock{ + + public ItemBlockGearShaft(Block par1) { + super(par1); + this.hasSubtypes = true; + } + + public int getMetadata(int p_77647_1_) + { + return p_77647_1_; + } + + @Override + public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) + { + boolean result = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ,metadata); + + if(result){ + TileEntityDirection tile = (TileEntityDirection)world.getTileEntity(x, y, z); + tile.direction = ForgeDirection.getOrientation(side); + } + + return result; + } + + @Override + public void addInformation(ItemStack itemstack,EntityPlayer par1EntityPlayer, List list , boolean flag) + { + + if(itemstack.getItemDamage()==0){ + list.add("[Mode] Up"); + }else{ + list.add("[Mode] Down"); + } + + } +} diff --git a/src/main/java/shift/sextiarysector/item/ItemBlockSSFluid.java b/src/main/java/shift/sextiarysector/item/ItemBlockSSFluid.java new file mode 100644 index 0000000..514b38a --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemBlockSSFluid.java @@ -0,0 +1,25 @@ +package shift.sextiarysector.item; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.block.BlockSSFluid; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemBlockSSFluid extends ItemBlock { + + public ItemBlockSSFluid(Block p_i45328_1_) { + super(p_i45328_1_); + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack itemstack, int p_82790_2_) + { + + return ((BlockSSFluid) this.field_150939_a).getFluid().getColor(); + + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemBottle.java b/src/main/java/shift/sextiarysector/item/ItemBottle.java new file mode 100644 index 0000000..cd70b6a --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemBottle.java @@ -0,0 +1,116 @@ +package shift.sextiarysector.item; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.api.event.FillBottleEvent; +import cpw.mods.fml.common.eventhandler.Event; + +public class ItemBottle extends Item{ + + public ItemBottle(){ + this.setCreativeTab(SextiarySectorAPI.TabSSCore); + } + + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) + { + + MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, true); + + if (movingobjectposition == null) return p_77659_1_; + + FillBottleEvent event = new FillBottleEvent(p_77659_3_, p_77659_1_, p_77659_2_, movingobjectposition); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return p_77659_1_; + } + + if (event.getResult() == Event.Result.ALLOW) + { + if (p_77659_3_.capabilities.isCreativeMode) + { + return p_77659_1_; + } + + if (--p_77659_1_.stackSize <= 0) + { + return event.result; + } + + if (!p_77659_3_.inventory.addItemStackToInventory(event.result)) + { + p_77659_3_.dropPlayerItemWithRandomChoice(event.result, false); + } + + return p_77659_1_; + + } + + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + int i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (!p_77659_2_.canMineBlock(p_77659_3_, i, j, k)) + { + return p_77659_1_; + } + + if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_)) + { + return p_77659_1_; + } + + Block block = p_77659_2_.getBlock(i, j, k); + int l = p_77659_2_.getBlockMetadata(i, j, k); + + if (block == Blocks.water && l == 0) + { + //p_77659_2_.setBlockToAir(i, j, k); + return this.func_150910_a(p_77659_1_, p_77659_3_, SSItems.waterBottle); + } + + if (block == Blocks.lava && l == 0) + { + p_77659_2_.setBlockToAir(i, j, k); + return this.func_150910_a(p_77659_1_, p_77659_3_, SSItems.lavaBottle); + } + + if (block == SSBlocks.drinkingWater && l == 0) + { + //p_77659_2_.setBlockToAir(i, j, k); + return this.func_150910_a(p_77659_1_, p_77659_3_, SSItems.drinkingWaterBottle); + } + + } + + return p_77659_1_; + + } + + + private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_) + { + if (p_150910_2_.capabilities.isCreativeMode) return p_150910_1_; + + if (--p_150910_1_.stackSize <= 0) return new ItemStack(p_150910_3_); + + if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) + { + p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false); + } + + return p_150910_1_; + + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemContactLenses.java b/src/main/java/shift/sextiarysector/item/ItemContactLenses.java new file mode 100644 index 0000000..a254ca6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemContactLenses.java @@ -0,0 +1,40 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; + +public class ItemContactLenses extends Item implements IEquipment { + + public ItemContactLenses() { + this.setCreativeTab(SextiarySectorAPI.TabSSPlayer); + this.setMaxStackSize(1); + } + + @Override + public boolean canTakeStack(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return equipment.ordinal() == EquipmentType.Face.ordinal(); + } + + @Override + public boolean isItemValid(EquipmentType equipment, ItemStack stack) { + return equipment.ordinal() == EquipmentType.Face.ordinal(); + } + + @Override + public void onUpdate(EquipmentType equipment, ItemStack stack, World world, Entity player, int slot) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemCrop.java b/src/main/java/shift/sextiarysector/item/ItemCrop.java index 992ab1f..aa51fbb 100644 --- a/src/main/java/shift/sextiarysector/item/ItemCrop.java +++ b/src/main/java/shift/sextiarysector/item/ItemCrop.java @@ -1,6 +1,5 @@ package shift.sextiarysector.item; -import java.util.ArrayList; import java.util.List; import net.minecraft.creativetab.CreativeTabs; @@ -12,17 +11,12 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemCrop extends ItemFoodDrink{ +public class ItemCrop extends Item{ - public static ArrayList crops = new ArrayList(); - - public int cost; - - public ItemCrop(int food, float foodM, int drink, float drinkM,int stamina, float staminaM, boolean p_i45339_3_) { - super(food, foodM, drink, drinkM, stamina, staminaM, p_i45339_3_); + public ItemCrop(List list) { this.hasSubtypes = true; - crops.add(this); + list.add(this); this.setCreativeTab(SextiarySectorAPI.TabSSAgriculture); diff --git a/src/main/java/shift/sextiarysector/item/ItemDrink.java b/src/main/java/shift/sextiarysector/item/ItemDrink.java new file mode 100644 index 0000000..c4e34e9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemDrink.java @@ -0,0 +1,14 @@ +package shift.sextiarysector.item; + +import net.minecraft.init.Items; + +public class ItemDrink extends ItemFoodDrink { + + public ItemDrink(int food, float foodM, int drink, float drinkM, int stamina, float staminaM, boolean p_i45339_3_) { + super(food, foodM, drink, drinkM, stamina, staminaM, p_i45339_3_); + this.setDrink(); + this.setMaxStackSize(1); + this.setContainerItem(Items.glass_bottle); + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemFigureBox.java b/src/main/java/shift/sextiarysector/item/ItemFigureBox.java new file mode 100644 index 0000000..2cda4f2 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemFigureBox.java @@ -0,0 +1,79 @@ +package shift.sextiarysector.item; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +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.StatCollector; +import net.minecraft.world.World; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.block.BlockFigure; +import shift.sextiarysector.module.ModuleFigure; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemFigureBox extends Item{ + + public ItemFigureBox() { + this.hasSubtypes = true; + } + + @Override + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) + { + + NBTTagCompound nbt = p_77659_1_.getTagCompound(); + + ItemStack item = ModuleFigure.getFigure(p_77659_2_, nbt.getString("edition")); + + if(item!=null){ + + if(p_77659_2_.isRemote)return p_77659_1_; + ItemStack f = new ItemStack(SSBlocks.figure); + BlockFigure.setFigureItem(f, item, nbt.getString("edition")); + p_77659_3_.entityDropItem(f , 0.5f); + p_77659_1_.stackSize--; + + } + + return p_77659_1_; + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + + for(String edition : ModuleFigure.getInstance().figures.keySet()){ + + p_150895_3_.add(getEditionFigureBox(edition)); + + } + + } + + public ItemStack getEditionFigureBox(String edition){ + + ItemStack item = new ItemStack(this, 1, 0); + NBTTagCompound nbt = new NBTTagCompound(); + item.setTagCompound(nbt); + nbt.setString("edition", edition); + return item; + + } + + @Override + public void addInformation(ItemStack itemstack,EntityPlayer par1EntityPlayer, List list , boolean flag) + { + + + NBTTagCompound nbt = itemstack.getTagCompound(); + + list.add(StatCollector.translateToLocal("tooltip.edition") + " : " + StatCollector.translateToLocal("edition."+nbt.getString("edition"))); + + + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemFoodCrop.java b/src/main/java/shift/sextiarysector/item/ItemFoodCrop.java new file mode 100644 index 0000000..3cfef07 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemFoodCrop.java @@ -0,0 +1,47 @@ +package shift.sextiarysector.item; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import shift.sextiarysector.api.SextiarySectorAPI; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemFoodCrop extends ItemFoodDrink{ + + //public static ArrayList crops = new ArrayList(); + + + public ItemFoodCrop(List list, int food, float foodM, int drink, float drinkM,int stamina, float staminaM, boolean p_i45339_3_) { + super(food, foodM, drink, drinkM, stamina, staminaM, p_i45339_3_); + this.hasSubtypes = true; + + list.add(this); + + this.setCreativeTab(SextiarySectorAPI.TabSSAgriculture); + + } + + public String getItemStackDisplayName(ItemStack p_77653_1_) + { + + String s = ""; + if(p_77653_1_.getItemDamage()==1){ + s ="" + EnumChatFormatting.AQUA + StatCollector.translateToLocal("item.ss.crop.big"); + } + + return ("" + s + " " + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(p_77653_1_) + ".name")).trim(); + } + + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 0)); + p_150895_3_.add(new ItemStack(p_150895_1_, 1, 1)); + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemFoodDrink.java b/src/main/java/shift/sextiarysector/item/ItemFoodDrink.java index 6ae3198..5154934 100644 --- a/src/main/java/shift/sextiarysector/item/ItemFoodDrink.java +++ b/src/main/java/shift/sextiarysector/item/ItemFoodDrink.java @@ -32,9 +32,9 @@ public ItemFoodDrink(int food, float foodM, int drink, float drinkM, int stamina this.moistureSaturationModifier = drinkM; this.healStaminaAmount = stamina; - this.saturationModifier = staminaM; + this.staminaSaturationModifier = staminaM; - this.setCreativeTab(SextiarySectorAPI.TabSSCore); + this.setCreativeTab(SextiarySectorAPI.TabSSCooking); } diff --git a/src/main/java/shift/sextiarysector/item/ItemFullBottle.java b/src/main/java/shift/sextiarysector/item/ItemFullBottle.java new file mode 100644 index 0000000..d1a2064 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemFullBottle.java @@ -0,0 +1,15 @@ +package shift.sextiarysector.item; + +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class ItemFullBottle extends Item { + + public ItemFullBottle() { + this.setCreativeTab(SextiarySectorAPI.TabSSCore); + this.setContainerItem(Items.glass_bottle); + this.setMaxStackSize(1); + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemGFContactLenses.java b/src/main/java/shift/sextiarysector/item/ItemGFContactLenses.java new file mode 100644 index 0000000..595d1bb --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemGFContactLenses.java @@ -0,0 +1,39 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.gearforce.item.IGearForceGridItem; + +public class ItemGFContactLenses extends ItemContactLenses implements IGearForceGridItem { + + public ItemGFContactLenses() { + this.setCreativeTab(SextiarySectorAPI.TabSSPlayer); + this.setMaxStackSize(1); + } + + @Override + public boolean canTakeStack(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return equipment.ordinal() == EquipmentType.Face.ordinal(); + } + + @Override + public boolean isItemValid(EquipmentType equipment, ItemStack stack) { + return equipment.ordinal() == EquipmentType.Face.ordinal(); + } + + @Override + public void onUpdate(EquipmentType equipment, ItemStack stack, World world, Entity player, int slot) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemGFHammer.java b/src/main/java/shift/sextiarysector/item/ItemGFHammer.java new file mode 100644 index 0000000..c918843 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemGFHammer.java @@ -0,0 +1,25 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.api.gearforce.item.IHammer; +import shift.sextiarysector.api.gearforce.item.ItemGearForce; + +public class ItemGFHammer extends ItemGearForce implements IHammer { + + public ItemGFHammer(int power, int maxSpeed, int slot) { + super(power, maxSpeed, slot); + this.setMaxStackSize(1); + } + + @Override + public boolean canUse(ItemStack item, EntityPlayer player, int damage) { + return false; + } + + @Override + public boolean use(ItemStack item, EntityPlayer player, int damage) { + return false; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemGearStorage.java b/src/main/java/shift/sextiarysector/item/ItemGearStorage.java index e22429d..173d85d 100644 --- a/src/main/java/shift/sextiarysector/item/ItemGearStorage.java +++ b/src/main/java/shift/sextiarysector/item/ItemGearStorage.java @@ -3,8 +3,8 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; -import shift.sextiarysector.api.machine.item.GearForceItem; -import shift.sextiarysector.api.machine.item.ItemGearForce; +import shift.sextiarysector.api.gearforce.item.GearForceItemAPI; +import shift.sextiarysector.api.gearforce.item.ItemGearForce; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -20,7 +20,7 @@ public ItemGearStorage(int power, int maxSpeed, int slot) { public IIcon getIconIndex(ItemStack p_77650_1_) { - if(GearForceItem.manager.getSpeed(p_77650_1_)>0){ + if(GearForceItemAPI.manager.getSpeed(p_77650_1_)>0){ return this.full; } @@ -29,7 +29,7 @@ public IIcon getIconIndex(ItemStack p_77650_1_) public IIcon getIcon(ItemStack stack, int pass) { - if(GearForceItem.manager.getSpeed(stack)>0){ + if(GearForceItemAPI.manager.getSpeed(stack)>0){ return this.full; } diff --git a/src/main/java/shift/sextiarysector/item/ItemGuiUnit.java b/src/main/java/shift/sextiarysector/item/ItemGuiUnit.java new file mode 100644 index 0000000..39403fc --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemGuiUnit.java @@ -0,0 +1,58 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; +import shift.sextiarysector.packet.PacketGuiId; +import shift.sextiarysector.packet.SSPacketHandler; + +public class ItemGuiUnit extends Item implements IEquipment, ISSEquipment { + + public int guiID; + + public ItemGuiUnit(int gui) { + this.guiID = gui; + this.setMaxStackSize(1); + } + + @Override + public boolean canTakeStack(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return equipment.equals(EquipmentType.Unit); + } + + @Override + public boolean isItemValid(EquipmentType equipment, ItemStack stack) { + return equipment.equals(EquipmentType.Unit); + } + + @Override + public boolean shouldAddToList(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + + @Override + public void onTabClicked(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + SSPacketHandler.INSTANCE.sendToServer(new PacketGuiId(guiID)); + + } + + @Override + public String getTabName(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return this.getUnlocalizedName(); + } + + @Override + public void onUpdate(EquipmentType equipment, ItemStack stack, World world, Entity player, int slot) { + + } + + @Override + public boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemHammer.java b/src/main/java/shift/sextiarysector/item/ItemHammer.java index 8f01b59..0000b19 100644 --- a/src/main/java/shift/sextiarysector/item/ItemHammer.java +++ b/src/main/java/shift/sextiarysector/item/ItemHammer.java @@ -1,19 +1,63 @@ package shift.sextiarysector.item; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import shift.sextiarysector.api.machine.item.IHammer; +import net.minecraftforge.common.ForgeHooks; +import shift.sextiarysector.api.gearforce.item.IHammer; -public class ItemHammer extends Item implements IHammer{ +public class ItemHammer extends Item implements IHammer { + + public ItemHammer() { + + this.setHarvestLevel("hammer", 1); + this.maxStackSize = 1; + this.setMaxDamage(140); + + } @Override - public boolean canUse(ItemStack item) { + public float getDigSpeed(ItemStack stack, Block block, int meta) + { + if (ForgeHooks.isToolEffective(stack, block, meta)) + { + return 6.0f; + } + return super.getDigSpeed(stack, block, meta); + } + + /* + @Override + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (block == Blocks.anvil) { + + if (p_77648_3_.isRemote) return true; + + p_77648_2_.openGui(SextiarySector.instance, 10, p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_); + return true; + + } + + return false; + }*/ + + @Override + public boolean canUse(ItemStack item, EntityPlayer player, int damage) { return true; } @Override - public boolean use(ItemStack item) { + public boolean use(ItemStack item, EntityPlayer player, int damage) { + + //item.setItemDamage(damage); + item.damageItem(damage, player); + return true; + } } diff --git a/src/main/java/shift/sextiarysector/item/ItemHoverBoots.java b/src/main/java/shift/sextiarysector/item/ItemHoverBoots.java new file mode 100644 index 0000000..d755aa4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemHoverBoots.java @@ -0,0 +1,37 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.api.SextiarySectorAPI; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemHoverBoots extends ItemArmor { + + @SideOnly(Side.CLIENT) + private static net.minecraft.client.model.ModelBiped boots; + + public ItemHoverBoots() { + super(ArmorMaterial.DIAMOND, 0, 3); + this.setCreativeTab(SextiarySectorAPI.TabSSPlayer); + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { + return "sextiarysector:textures/models/shift_hat.png"; + } + + @Override + @SideOnly(Side.CLIENT) + public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + { + if (boots == null) { + boots = new net.minecraft.client.model.ModelBiped(); + } + + return boots; + } +} diff --git a/src/main/java/shift/sextiarysector/item/ItemKnife.java b/src/main/java/shift/sextiarysector/item/ItemKnife.java new file mode 100644 index 0000000..182bb0b --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemKnife.java @@ -0,0 +1,110 @@ +package shift.sextiarysector.item; + +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemTool; +import shift.sextiarysector.api.SextiarySectorAPI; + +import com.google.common.collect.Sets; + +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemKnife extends ItemTool +{ + + private static final Set field_150916_c = Sets.newHashSet(new Block[] { Blocks.crafting_table }); + + private boolean repair = false; + private boolean furnace = false; + + public ItemKnife(ToolMaterial p_i45343_1_) + { + super(1.0F, p_i45343_1_, field_150916_c); + int i = p_i45343_1_.getHarvestLevel(); + float d = p_i45343_1_.getMaxUses(); + this.setHarvestLevel("knife", i); + if (i == 0) { + this.setHarvestLevel("axe", 0); + } else { + this.setHarvestLevel("axe", i - 1); + } + this.setMaxDamage((int) (d / 2.0f)); + this.setCreativeTab(SextiarySectorAPI.TabSSCooking); + FMLCommonHandler.instance().bus().register(this); + } + + //繧「繧、繝繝縺後け繝ゥ繝輔ヨ蠕後↓謌サ繧峨↑縺繧医≧縺ォ縺吶k + @Override + public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) + { + return false; + } + + //菫ョ逅莉・螟悶↑繧峨け繝ゥ繝輔ヨ蠕後↓getContainerItemStack繧貞他縺ウ蜃コ縺 + @Override + public boolean hasContainerItem() + { + return !repair && !furnace; + } + + //菫ョ逅縺九←縺縺九r蛻、螳壹☆繧 + @SubscribeEvent + public void onCrafting(ItemCraftedEvent event) + { + //ID縺檎┌縺上↑縺」縺溘ョ縺ァ縲√い繧、繝繝繧、繝ウ繧ケ繧ソ繝ウ繧ケ縺ァ豈碑シ縲 + repair = this == event.crafting.getItem(); + furnace = false; + } + + //繧ッ繝ゥ繝輔ヨ蠕後ョ繧「繧、繝繝繧偵√ム繝。繝シ繧ク繧剃ク弱∴縺ヲ霑斐☆ + @Override + public ItemStack getContainerItem(ItemStack itemStack) + { + + if (!hasContainerItem(itemStack)) + { + return null; + } + + if (itemStack != null && itemStack.getItem() == this) + { + itemStack.setItemDamage(itemStack.getItemDamage() + 1); + } + return itemStack; + } + + //繧ォ繝槭ラ逕ィ + @Override + public String getToolMaterialName() + { + + if (this.toolMaterial.toString().equals("WOOD")) { + furnace = true; + } + + return this.toolMaterial.toString(); + } + + @Override + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return true; + } + + @Override + public Item setTextureName(String p_111206_1_) + { + this.iconString = "sextiarysector:tool/" + p_111206_1_; + return this; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemLavaBottle.java b/src/main/java/shift/sextiarysector/item/ItemLavaBottle.java new file mode 100644 index 0000000..930f185 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemLavaBottle.java @@ -0,0 +1,37 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.SSPotions; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class ItemLavaBottle extends ItemFoodDrink { + + public ItemLavaBottle() { + super(0, 0, 0, 0, 1, 0, false); + this.setContainerItem(Items.glass_bottle); + this.setDrink(); + this.setMaxStackSize(1); + this.setAlwaysEdible(); + + this.setCreativeTab(SextiarySectorAPI.TabSSFluid); + } + + @Override + protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer player) + { + + player.addExhaustion(7.8f); + player.addPotionEffect(new PotionEffect(SSPotions.burn.getId(), 360, 2)); + + if (!player.inventory.addItemStackToInventory(new ItemStack(SSItems.obsidianNugget))) + { + player.dropPlayerItemWithRandomChoice(new ItemStack(SSItems.obsidianNugget, 1, 0), false); + } + + } +} diff --git a/src/main/java/shift/sextiarysector/item/ItemLeafBed.java b/src/main/java/shift/sextiarysector/item/ItemLeafBed.java new file mode 100644 index 0000000..5f5cf46 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemLeafBed.java @@ -0,0 +1,79 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.block.BlockLeafBed; + +public class ItemLeafBed extends Item { + + @Override + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (p_77648_3_.isRemote) + { + return true; + } + else if (p_77648_7_ != 1) + { + return false; + } + else + { + ++p_77648_5_; + BlockLeafBed blockbed = (BlockLeafBed) SSBlocks.leafBed; + int i1 = MathHelper.floor_double(p_77648_2_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + byte b0 = 0; + byte b1 = 0; + + if (i1 == 0) + { + b1 = 1; + } + + if (i1 == 1) + { + b0 = -1; + } + + if (i1 == 2) + { + b1 = -1; + } + + if (i1 == 3) + { + b0 = 1; + } + + if (p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_) && p_77648_2_.canPlayerEdit(p_77648_4_ + b0, p_77648_5_, p_77648_6_ + b1, p_77648_7_, p_77648_1_)) + { + if (p_77648_3_.isAirBlock(p_77648_4_, p_77648_5_, p_77648_6_) && p_77648_3_.isAirBlock(p_77648_4_ + b0, p_77648_5_, p_77648_6_ + b1) && World.doesBlockHaveSolidTopSurface(p_77648_3_, p_77648_4_, p_77648_5_ - 1, p_77648_6_) + && World.doesBlockHaveSolidTopSurface(p_77648_3_, p_77648_4_ + b0, p_77648_5_ - 1, p_77648_6_ + b1)) + { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, blockbed, i1, 3); + + if (p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_) == blockbed) + { + p_77648_3_.setBlock(p_77648_4_ + b0, p_77648_5_, p_77648_6_ + b1, blockbed, i1 + 8, 3); + } + + --p_77648_1_.stackSize; + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemMagicContactLenses.java b/src/main/java/shift/sextiarysector/item/ItemMagicContactLenses.java new file mode 100644 index 0000000..fcd0502 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemMagicContactLenses.java @@ -0,0 +1,14 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.item.ItemStack; +import thaumcraft.api.IGoggles; + +public class ItemMagicContactLenses extends ItemContactLenses implements IGoggles { + + @Override + public boolean showIngamePopups(ItemStack itemstack, EntityLivingBase player) { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemMineboat.java b/src/main/java/shift/sextiarysector/item/ItemMineboat.java new file mode 100644 index 0000000..69e90a4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemMineboat.java @@ -0,0 +1,121 @@ +package shift.sextiarysector.item; + +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.entity.EntityMineboat; +import shift.sextiarysector.entity.EntityMineboatChest; + +public class ItemMineboat extends Item { + + public ItemMineboat() { + super(); + this.maxStackSize = 1; + this.setCreativeTab(SextiarySectorAPI.TabSSTransport); + } + + @Override + public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) + { + float f = 1.0F; + float f1 = p_77659_3_.prevRotationPitch + (p_77659_3_.rotationPitch - p_77659_3_.prevRotationPitch) * f; + float f2 = p_77659_3_.prevRotationYaw + (p_77659_3_.rotationYaw - p_77659_3_.prevRotationYaw) * f; + double d0 = p_77659_3_.prevPosX + (p_77659_3_.posX - p_77659_3_.prevPosX) * f; + double d1 = p_77659_3_.prevPosY + (p_77659_3_.posY - p_77659_3_.prevPosY) * f + 1.62D - p_77659_3_.yOffset; + double d2 = p_77659_3_.prevPosZ + (p_77659_3_.posZ - p_77659_3_.prevPosZ) * f; + Vec3 vec3 = Vec3.createVectorHelper(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); + float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = 5.0D; + Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3); + MovingObjectPosition movingobjectposition = p_77659_2_.rayTraceBlocks(vec3, vec31, true); + + if (movingobjectposition == null) + { + return p_77659_1_; + } + else + { + Vec3 vec32 = p_77659_3_.getLook(f); + boolean flag = false; + float f9 = 1.0F; + List list = p_77659_2_.getEntitiesWithinAABBExcludingEntity(p_77659_3_, p_77659_3_.boundingBox.addCoord(vec32.xCoord * d3, vec32.yCoord * d3, vec32.zCoord * d3).expand(f9, f9, f9)); + int i; + + for (i = 0; i < list.size(); ++i) + { + Entity entity = (Entity) list.get(i); + + if (entity.canBeCollidedWith()) + { + float f10 = entity.getCollisionBorderSize(); + AxisAlignedBB axisalignedbb = entity.boundingBox.expand(f10, f10, f10); + + if (axisalignedbb.isVecInside(vec3)) + { + flag = true; + } + } + } + + if (flag) + { + return p_77659_1_; + } + else + { + if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) + { + i = movingobjectposition.blockX; + int j = movingobjectposition.blockY; + int k = movingobjectposition.blockZ; + + if (p_77659_2_.getBlock(i, j, k) == Blocks.snow_layer) + { + --j; + } + + EntityMineboat entityboat = this.createMineboat(p_77659_2_, i, j, k);//new EntityMineboatChest(p_77659_2_, i + 0.5F, j + 1.0F, k + 0.5F); + entityboat.rotationYaw = ((MathHelper.floor_double(p_77659_3_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3) - 1) * 90; + + if (!p_77659_2_.getCollidingBoundingBoxes(entityboat, entityboat.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty()) + { + return p_77659_1_; + } + + if (!p_77659_2_.isRemote) + { + p_77659_2_.spawnEntityInWorld(entityboat); + } + + if (!p_77659_3_.capabilities.isCreativeMode) + { + --p_77659_1_.stackSize; + } + } + + return p_77659_1_; + } + } + } + + public EntityMineboat createMineboat(World par1World, double par2, double par4, double par6) { + return new EntityMineboatChest(par1World, par2 + 0.5F, par4 + 1.0F, par6 + 0.5F); + + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemMineboatTank.java b/src/main/java/shift/sextiarysector/item/ItemMineboatTank.java new file mode 100644 index 0000000..a4fcd18 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemMineboatTank.java @@ -0,0 +1,15 @@ +package shift.sextiarysector.item; + +import net.minecraft.world.World; +import shift.sextiarysector.entity.EntityMineboat; +import shift.sextiarysector.entity.EntityMineboatTank; + +public class ItemMineboatTank extends ItemMineboat { + + @Override + public EntityMineboat createMineboat(World par1World, double par2, double par4, double par6) { + return new EntityMineboatTank(par1World, par2 + 0.5F, par4 + 1.0F, par6 + 0.5F); + + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemOxygenTank.java b/src/main/java/shift/sextiarysector/item/ItemOxygenTank.java new file mode 100644 index 0000000..8d5dbea --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemOxygenTank.java @@ -0,0 +1,235 @@ +package shift.sextiarysector.item; + +import java.text.NumberFormat; +import java.util.List; + +import net.minecraft.block.material.Material; +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.world.World; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; +import shift.sextiarysector.SSFluids; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemOxygenTank extends Item implements IEquipment, IFluidContainerItem { + + protected int capacity; + + public ItemOxygenTank() + { + super(); + this.capacity = FluidContainerRegistry.BUCKET_VOLUME * 32;//capacity; + this.setMaxStackSize(1); + } + + @Override + public boolean canTakeStack(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return equipment.ordinal() == EquipmentType.Bag.ordinal(); + } + + @Override + public boolean isItemValid(EquipmentType equipment, ItemStack stack) { + return equipment.ordinal() == EquipmentType.Bag.ordinal(); + } + + @Override + public void onUpdate(EquipmentType equipment, ItemStack stack, World world, Entity player, int slot) { + + if (this.getFluid(stack) == null) return; + if (this.getFluid(stack).amount < 50) return; + if (!player.isInsideOfMaterial(Material.water)) return; + + if (player.worldObj.getWorldTime() % 50 == 0) { + player.setAir(300); + this.drain(stack, 50, true); + } + + } + + @Override + public boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack itemStack, EntityPlayer par3EntityPlayer, List list, boolean par4) + { + + String f = "None"; + int amount = 0; + + if (this.getFluid(itemStack) != null) + { + f = this.getFluid(itemStack).getFluid().getLocalizedName(this.getFluid(itemStack)); + amount = this.getFluid(itemStack).amount; + } + + NumberFormat nf = NumberFormat.getNumberInstance(); + + list.add("Fluid : " + f); + list.add("Amount : " + nf.format(amount) + " / " + nf.format(this.capacity) + " mB"); + + } + + @Override + public boolean showDurabilityBar(ItemStack stack) + { + + //if (this.getFluidAmount(stack) == 0) return false; + + return true;//stack.isItemDamaged(); + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + return 1.0D - (double) this.getFluidAmount(stack) / (double) this.capacity; + } + + /* IFluidContainerItem */ + @Override + public FluidStack getFluid(ItemStack container) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return null; + } + return FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + } + + @Override + public int getCapacity(ItemStack container) + { + return capacity; + } + + @Override + public int fill(ItemStack container, FluidStack resource, boolean doFill) + { + if (resource == null) + { + return 0; + } + + if (resource.getFluid().getID() != SSFluids.oxygen.getID()) return 0; + + if (!doFill) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return Math.min(capacity, resource.amount); + } + + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + + if (stack == null) + { + return Math.min(capacity, resource.amount); + } + + if (!stack.isFluidEqual(resource)) + { + return 0; + } + + return Math.min(capacity - stack.amount, resource.amount); + } + + if (container.stackTagCompound == null) + { + container.stackTagCompound = new NBTTagCompound(); + } + + if (!container.stackTagCompound.hasKey("Fluid")) + { + NBTTagCompound fluidTag = resource.writeToNBT(new NBTTagCompound()); + + if (capacity < resource.amount) + { + fluidTag.setInteger("Amount", capacity); + container.stackTagCompound.setTag("Fluid", fluidTag); + return capacity; + } + + container.stackTagCompound.setTag("Fluid", fluidTag); + return resource.amount; + } + + NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + FluidStack stack = FluidStack.loadFluidStackFromNBT(fluidTag); + + if (!stack.isFluidEqual(resource)) + { + return 0; + } + + int filled = capacity - stack.amount; + if (resource.amount < filled) + { + stack.amount += resource.amount; + filled = resource.amount; + } + else + { + stack.amount = capacity; + } + + container.stackTagCompound.setTag("Fluid", stack.writeToNBT(fluidTag)); + return filled; + } + + @Override + public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return null; + } + + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + if (stack == null) + { + return null; + } + + int currentAmount = stack.amount; + stack.amount = Math.min(stack.amount, maxDrain); + if (doDrain) + { + if (currentAmount == stack.amount) + { + container.stackTagCompound.removeTag("Fluid"); + + if (container.stackTagCompound.hasNoTags()) + { + container.stackTagCompound = null; + } + return stack; + } + + NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + fluidTag.setInteger("Amount", currentAmount - stack.amount); + container.stackTagCompound.setTag("Fluid", fluidTag); + } + return stack; + } + + public int getFluidAmount(ItemStack container) { + + if (this.getFluid(container) == null) { + return 0; + } + return this.getFluid(container).amount; + + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemProtectionRing.java b/src/main/java/shift/sextiarysector/item/ItemProtectionRing.java new file mode 100644 index 0000000..83e543e --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemProtectionRing.java @@ -0,0 +1,14 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.api.equipment.EquipmentType; + +public class ItemProtectionRing extends ItemRing { + + @Override + public boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return false; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemRing.java b/src/main/java/shift/sextiarysector/item/ItemRing.java new file mode 100644 index 0000000..b1499bd --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemRing.java @@ -0,0 +1,37 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; + +public class ItemRing extends Item implements IEquipment { + + public ItemRing() { + this.setMaxStackSize(1); + } + + @Override + public boolean canTakeStack(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return equipment.ordinal() == EquipmentType.Other.ordinal(); + } + + @Override + public boolean isItemValid(EquipmentType equipment, ItemStack stack) { + return equipment.ordinal() == EquipmentType.Other.ordinal(); + } + + @Override + public void onUpdate(EquipmentType equipment, ItemStack stack, World world, Entity player, int slot) { + + } + + @Override + public boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemRucksack.java b/src/main/java/shift/sextiarysector/item/ItemRucksack.java new file mode 100644 index 0000000..e0e1c45 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemRucksack.java @@ -0,0 +1,67 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; +import shift.sextiarysector.packet.PacketGuiId; +import shift.sextiarysector.packet.SSPacketHandler; + +public class ItemRucksack extends Item implements IEquipment, ISSEquipment { + + public ItemRucksack() + { + super(); + this.setMaxStackSize(1); + this.setCreativeTab(SextiarySectorAPI.TabSSPlayer); + } + + @Override + public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) + { + player.openGui(SextiarySector.instance, 205, world, (int) player.posX, (int) player.posY, (int) player.posZ); + return itemStack; + } + + @Override + public boolean canTakeStack(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return equipment.ordinal() == EquipmentType.Bag.ordinal(); + } + + @Override + public boolean isItemValid(EquipmentType equipment, ItemStack stack) { + return equipment.ordinal() == EquipmentType.Bag.ordinal(); + } + + @Override + public boolean shouldAddToList(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + + @Override + public void onTabClicked(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + SSPacketHandler.INSTANCE.sendToServer(new PacketGuiId(206)); + + } + + @Override + public String getTabName(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return this.getUnlocalizedName(); + } + + @Override + public void onUpdate(EquipmentType equipment, ItemStack stack, World world, Entity player, int slot) { + + } + + @Override + public boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemSSArmor.java b/src/main/java/shift/sextiarysector/item/ItemSSArmor.java new file mode 100644 index 0000000..4c6e2f3 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemSSArmor.java @@ -0,0 +1,26 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class ItemSSArmor extends ItemArmor { + + private static String modelRoot = "sextiarysector:textures/models/armor/"; + + public ItemSSArmor(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) { + super(p_i45325_1_, p_i45325_2_, p_i45325_3_); + this.setCreativeTab(SextiarySectorAPI.TabSSPlayer); + + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) + { + + String s1 = String.format(modelRoot + "%s_layer_%d%s.png", this.getArmorMaterial().name(), (slot == 2 ? 2 : 1), type == null ? "" : String.format("_%s", type)); + + return s1; + } +} diff --git a/src/main/java/shift/sextiarysector/item/ItemSSAxe.java b/src/main/java/shift/sextiarysector/item/ItemSSAxe.java new file mode 100644 index 0000000..6e6a921 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemSSAxe.java @@ -0,0 +1,12 @@ +package shift.sextiarysector.item; + +import net.minecraft.item.ItemAxe; + +public class ItemSSAxe extends ItemAxe { + + public ItemSSAxe(ToolMaterial p_i45327_1_) { + super(p_i45327_1_); + //this.setCreativeTab(SextiarySectorAPI.TabSSCore); + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemSSPickaxe.java b/src/main/java/shift/sextiarysector/item/ItemSSPickaxe.java new file mode 100644 index 0000000..5cf0bcc --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemSSPickaxe.java @@ -0,0 +1,11 @@ +package shift.sextiarysector.item; + +import net.minecraft.item.ItemPickaxe; + +public class ItemSSPickaxe extends ItemPickaxe { + + public ItemSSPickaxe(ToolMaterial p_i45347_1_) { + super(p_i45347_1_); + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemSSShears.java b/src/main/java/shift/sextiarysector/item/ItemSSShears.java new file mode 100644 index 0000000..6788f1f --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemSSShears.java @@ -0,0 +1,15 @@ +package shift.sextiarysector.item; + +import net.minecraft.item.ItemShears; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class ItemSSShears extends ItemShears { + + public ItemSSShears(ToolMaterial m) + { + this.setMaxStackSize(1); + this.setMaxDamage(m.getMaxUses() - 12); + this.setCreativeTab(SextiarySectorAPI.TabSSCore); + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemScoop.java b/src/main/java/shift/sextiarysector/item/ItemScoop.java index 24948d5..eb34bd9 100644 --- a/src/main/java/shift/sextiarysector/item/ItemScoop.java +++ b/src/main/java/shift/sextiarysector/item/ItemScoop.java @@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.ItemTool; import net.minecraft.world.World; +import shift.sextiarysector.SSAchievement; import shift.sextiarysector.SSBlocks; import shift.sextiarysector.api.SextiarySectorAPI; @@ -17,83 +18,90 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ItemScoop extends ItemTool{ +public class ItemScoop extends ItemTool { //protected Item.ToolMaterial theToolMaterial; - private static final Set field_150916_c = Sets.newHashSet(new Block[] {Blocks.sand, Blocks.gravel, Blocks.snow}); - - public ItemScoop(ToolMaterial p_i45343_1_) - { - super(1.0F, p_i45343_1_, field_150916_c); - int i = p_i45343_1_.getHarvestLevel(); - if(i==0){ - this.setHarvestLevel("scoop", 0); - }else{ - this.setHarvestLevel("scoop", i-1); - } - this.setCreativeTab(SextiarySectorAPI.TabSSAgriculture); - } - - - public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) - { - if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) - { - return false; - } - else - { - - Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); - - if (p_77648_7_ != 0 && p_77648_3_.getBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_).isAir(p_77648_3_, p_77648_4_, p_77648_5_ + 1, p_77648_6_) && (block == Blocks.grass || block == Blocks.dirt)) - { - Block block1 = SSBlocks.hole; - p_77648_3_.playSoundEffect((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); - - if (p_77648_3_.isRemote) - { - return true; - } - else - { - p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, block1); - p_77648_1_.damageItem(1, p_77648_2_); - return true; - } - } - else if(p_77648_7_ != 0 && p_77648_3_.getBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_).isAir(p_77648_3_, p_77648_4_, p_77648_5_ + 1, p_77648_6_) && (block == Blocks.farmland )){ - - Block block1 = SSBlocks.farmland; - p_77648_3_.playSoundEffect((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); - - if (p_77648_3_.isRemote) - { - return true; - } - else - { - p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, block1); - p_77648_1_.damageItem(1, p_77648_2_); - return true; - } - - }else{ - return false; - } - } - } - - @SideOnly(Side.CLIENT) - public boolean isFull3D() - { - return true; - } - - public Item setTextureName(String p_111206_1_) - { - this.iconString = "sextiarysector:tool/"+p_111206_1_; - return this; - } + private static final Set field_150916_c = Sets.newHashSet(new Block[] { Blocks.sand, Blocks.gravel, Blocks.snow }); + + public ItemScoop(ToolMaterial p_i45343_1_) + { + super(1.0F, p_i45343_1_, field_150916_c); + int i = p_i45343_1_.getHarvestLevel(); + float d = p_i45343_1_.getMaxUses(); + this.setHarvestLevel("scoop", i); + if (i == 0) { + this.setHarvestLevel("shovel", 0); + } else { + this.setHarvestLevel("shovel", i - 1); + } + this.setMaxDamage((int) (d / 2.0f)); + this.setCreativeTab(SextiarySectorAPI.TabSSAgriculture); + } + + @Override + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) + { + if (!p_77648_2_.canPlayerEdit(p_77648_4_, p_77648_5_, p_77648_6_, p_77648_7_, p_77648_1_)) + { + return false; + } + else + { + + Block block = p_77648_3_.getBlock(p_77648_4_, p_77648_5_, p_77648_6_); + + if (p_77648_7_ != 0 && p_77648_3_.getBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_).isAir(p_77648_3_, p_77648_4_, p_77648_5_ + 1, p_77648_6_) && (block == Blocks.grass || block == Blocks.dirt)) + { + Block block1 = SSBlocks.hole; + p_77648_3_.playSoundEffect(p_77648_4_ + 0.5F, p_77648_5_ + 0.5F, p_77648_6_ + 0.5F, block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); + + if (!p_77648_3_.isRemote) p_77648_2_.addStat(SSAchievement.hole, 1); + if (p_77648_3_.isRemote) + { + return true; + } + else + { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, block1); + p_77648_1_.damageItem(1, p_77648_2_); + return true; + } + } + else if (p_77648_7_ != 0 && p_77648_3_.getBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_).isAir(p_77648_3_, p_77648_4_, p_77648_5_ + 1, p_77648_6_) && (block == Blocks.farmland)) { + + Block block1 = SSBlocks.farmland; + p_77648_3_.playSoundEffect(p_77648_4_ + 0.5F, p_77648_5_ + 0.5F, p_77648_6_ + 0.5F, block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F); + + if (!p_77648_3_.isRemote) p_77648_2_.addStat(SSAchievement.farmland, 1); + if (p_77648_3_.isRemote) + { + return true; + } + else + { + p_77648_3_.setBlock(p_77648_4_, p_77648_5_, p_77648_6_, block1); + p_77648_1_.damageItem(1, p_77648_2_); + return true; + } + + } else { + return false; + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean isFull3D() + { + return true; + } + + @Override + public Item setTextureName(String p_111206_1_) + { + this.iconString = "sextiarysector:tool/" + p_111206_1_; + return this; + } } diff --git a/src/main/java/shift/sextiarysector/item/ItemShiftHat.java b/src/main/java/shift/sextiarysector/item/ItemShiftHat.java index 4c5e205..f1fc067 100644 --- a/src/main/java/shift/sextiarysector/item/ItemShiftHat.java +++ b/src/main/java/shift/sextiarysector/item/ItemShiftHat.java @@ -1,12 +1,11 @@ package shift.sextiarysector.item; -import net.minecraft.client.model.ModelBiped; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; +import shift.sextiarysector.SextiarySector; import shift.sextiarysector.api.SextiarySectorAPI; -import shift.sextiarysector.renderer.model.ModelShiftHat; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -14,7 +13,7 @@ public class ItemShiftHat extends ItemArmor{ public ItemShiftHat() { super(ArmorMaterial.DIAMOND, 0, 0); - this.setCreativeTab(SextiarySectorAPI.TabSSCore); + this.setCreativeTab(SextiarySectorAPI.TabSSPlayer); } public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) @@ -22,12 +21,12 @@ public String getArmorTexture(ItemStack stack, Entity entity, int slot, String t return "sextiarysector:textures/models/shift_hat.png"; } - public static ModelShiftHat model = new ModelShiftHat(); + @SideOnly(Side.CLIENT) - public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) + public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { - return model; + return (net.minecraft.client.model.ModelBiped) SextiarySector.proxy.getShiftHat(); } } diff --git a/src/main/java/shift/sextiarysector/item/ItemShopRing.java b/src/main/java/shift/sextiarysector/item/ItemShopRing.java new file mode 100644 index 0000000..ce94ed6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemShopRing.java @@ -0,0 +1,126 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import shift.mceconomy2.api.MCEconomyAPI; +import shift.sextiarysector.SSShops.SSProductList; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; +import shift.sextiarysector.api.season.SeasonAPI; +import shift.sextiarysector.gui.tab.AbstractTab; +import shift.sextiarysector.gui.tab.TabManager; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemShopRing extends Item implements IEquipment, ISSEquipment { + + private SSProductList list; + private SSProductList[] sList; + public AbstractTab tab; + + @SideOnly(Side.CLIENT) + public boolean isRing; + + public ItemShopRing() { + this.setMaxStackSize(1); + this.setCreativeTab(SextiarySectorAPI.TabSSEconomy); + MinecraftForge.EVENT_BUS.register(this); + } + + public SSProductList getList(World world) { + + if (world == null || sList == null) return this.getList(); + + return sList[SeasonAPI.getSeason(world).ordinal()]; + } + + public SSProductList getList() { + return list; + } + + public void setList(SSProductList list) { + this.list = list; + } + + public void setList(SSProductList[] list) { + this.sList = list; + this.list = list[0]; + } + + public void setTab(AbstractTab tab) { + this.tab = tab; + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void onOpenShopGuiEvent(shift.mceconomy2.api.shop.OpenShopGuiEvent event) { + + //if(!isShop(event.shopID))return; + if (!this.isRing) return; + + this.isRing = false; + + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + + TabManager.updateTabValues(guiLeft, guiTop, event.buttonList, tab, false); + + } + + private boolean isShop(int id) { + + if (sList != null) { + for (SSProductList l : sList) { + if (l.id == id) return true; + } + } + + return list.id == id; + + } + + @Override + public String getTabName(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return this.getUnlocalizedName(); + } + + @Override + public boolean shouldAddToList(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + + @Override + public void onTabClicked(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + this.isRing = true; + MCEconomyAPI.openShopGui(this.getList(player.worldObj).id, player, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); + } + + @Override + public boolean canTakeStack(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return equipment.equals(EquipmentType.Other); + } + + @Override + public boolean isItemValid(EquipmentType equipment, ItemStack stack) { + return equipment.equals(EquipmentType.Other); + } + + @Override + public void onUpdate(EquipmentType equipment, ItemStack stack, World world, Entity player, int slot) { + + } + + @Override + public boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemSimpleBucket.java b/src/main/java/shift/sextiarysector/item/ItemSimpleBucket.java new file mode 100644 index 0000000..940b4a4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemSimpleBucket.java @@ -0,0 +1,15 @@ +package shift.sextiarysector.item; + +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class ItemSimpleBucket extends Item { + + public ItemSimpleBucket() { + this.maxStackSize = 1; + this.setCreativeTab(SextiarySectorAPI.TabSSFluid); + this.setContainerItem(Items.bucket); + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemSoup.java b/src/main/java/shift/sextiarysector/item/ItemSoup.java new file mode 100644 index 0000000..b1ba4c2 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemSoup.java @@ -0,0 +1,14 @@ +package shift.sextiarysector.item; + +import net.minecraft.init.Items; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class ItemSoup extends ItemFoodDrink{ + + public ItemSoup(int food, float foodM, int drink, float drinkM, int stamina, float staminaM, boolean p_i45339_3_) { + super(food, foodM, drink, drinkM, stamina, staminaM, p_i45339_3_); + this.setCreativeTab(SextiarySectorAPI.TabSSCooking); + this.setContainerItem(Items.bowl); + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemSpray.java b/src/main/java/shift/sextiarysector/item/ItemSpray.java new file mode 100644 index 0000000..932656e --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemSpray.java @@ -0,0 +1,283 @@ +package shift.sextiarysector.item; + +import java.text.NumberFormat; +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +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.IIcon; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidContainerItem; +import shift.sextiarysector.SSFluids; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.api.EnumColor; +import shift.sextiarysector.api.IColorItem; +import shift.sextiarysector.fluid.FluidColor; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class ItemSpray extends Item implements IColorItem, IFluidContainerItem { + + protected int capacity; + + public ItemSpray() { + this.setHasSubtypes(true); + this.capacity = FluidContainerRegistry.BUCKET_VOLUME * 1;//capacity; + this.setMaxStackSize(1); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) + { + + //p_150895_3_.add(new ItemStack(this, 1, 0)); + + for (int i = 0; i < SSFluids.color.length; i++) { + + ItemStack item = new ItemStack(this, 1, i); + this.fill(item, new FluidStack(SSFluids.color[i], capacity), true); + + p_150895_3_.add(item); + + } + + } + + @Override + public int getDamage(ItemStack stack) + { + if (this.getFluid(stack) == null) return 16; + + return ((FluidColor) this.getFluid(stack).getFluid()).color.ordinal(); + } + + @SideOnly(Side.CLIENT) + @Override + public void addInformation(ItemStack itemStack, EntityPlayer par3EntityPlayer, List list, boolean par4) + { + + String f = "None"; + int amount = 0; + + if (this.getFluid(itemStack) != null) + { + f = this.getFluid(itemStack).getFluid().getLocalizedName(this.getFluid(itemStack)); + amount = this.getFluid(itemStack).amount; + } + + NumberFormat nf = NumberFormat.getNumberInstance(); + + list.add("Dye : " + f); + list.add("Amount : " + nf.format(amount) + " / " + nf.format(this.capacity) + " mB"); + + } + + @Override + public boolean showDurabilityBar(ItemStack stack) + { + + //if (this.getFluidAmount(stack) == 0) return false; + + return true;//stack.isItemDamaged(); + } + + @Override + public double getDurabilityForDisplay(ItemStack stack) + { + return 1.0D - (double) this.getFluidAmount(stack) / (double) this.capacity; + } + + /* + @Override + public void addInformation(ItemStack itemstack, EntityPlayer par1EntityPlayer, List list, boolean flag) + { + list.add(EnumColor.getColor(itemstack.getItemDamage()).name()); + }*/ + + @Override + public EnumColor getColor(ItemStack itemstack) { + + if (this.getFluid(itemstack) == null) return EnumColor.Unknown; + return ((FluidColor) this.getFluid(itemstack).getFluid()).color; + + } + + @Override + public void useItem(ItemStack item) { + this.drain(item, 10, true); + } + + @Override + public boolean canUse(ItemStack item) { + return this.getFluidAmount(item) >= 10; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() + { + return true; + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_) + { + return p_77618_2_ == 0 ? SSItems.emptyBottle.getIconFromDamage(0) : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_); + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack itemstack, int p_82790_2_) + { + + if (p_82790_2_ == 0) return super.getColorFromItemStack(itemstack, p_82790_2_); + if (this.getFluid(itemstack) == null) return super.getColorFromItemStack(itemstack, p_82790_2_); + + return ((FluidColor) this.getFluid(itemstack).getFluid()).color.color; + + } + + /* IFluidContainerItem */ + @Override + public FluidStack getFluid(ItemStack container) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return null; + } + return FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + } + + @Override + public int getCapacity(ItemStack container) + { + return capacity; + } + + @Override + public int fill(ItemStack container, FluidStack resource, boolean doFill) + { + if (resource == null) + { + return 0; + } + + if (!(resource.getFluid() instanceof FluidColor)) return 0; + + if (!doFill) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return Math.min(capacity, resource.amount); + } + + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + + if (stack == null) + { + return Math.min(capacity, resource.amount); + } + + if (!stack.isFluidEqual(resource)) + { + return 0; + } + + return Math.min(capacity - stack.amount, resource.amount); + } + + if (container.stackTagCompound == null) + { + container.stackTagCompound = new NBTTagCompound(); + } + + if (!container.stackTagCompound.hasKey("Fluid")) + { + NBTTagCompound fluidTag = resource.writeToNBT(new NBTTagCompound()); + + if (capacity < resource.amount) + { + fluidTag.setInteger("Amount", capacity); + container.stackTagCompound.setTag("Fluid", fluidTag); + return capacity; + } + + container.stackTagCompound.setTag("Fluid", fluidTag); + return resource.amount; + } + + NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + FluidStack stack = FluidStack.loadFluidStackFromNBT(fluidTag); + + if (!stack.isFluidEqual(resource)) + { + return 0; + } + + int filled = capacity - stack.amount; + if (resource.amount < filled) + { + stack.amount += resource.amount; + filled = resource.amount; + } + else + { + stack.amount = capacity; + } + + container.stackTagCompound.setTag("Fluid", stack.writeToNBT(fluidTag)); + return filled; + } + + @Override + public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain) + { + if (container.stackTagCompound == null || !container.stackTagCompound.hasKey("Fluid")) + { + return null; + } + + FluidStack stack = FluidStack.loadFluidStackFromNBT(container.stackTagCompound.getCompoundTag("Fluid")); + if (stack == null) + { + return null; + } + + int currentAmount = stack.amount; + stack.amount = Math.min(stack.amount, maxDrain); + if (doDrain) + { + if (currentAmount == stack.amount) + { + container.stackTagCompound.removeTag("Fluid"); + + if (container.stackTagCompound.hasNoTags()) + { + container.stackTagCompound = null; + } + return stack; + } + + NBTTagCompound fluidTag = container.stackTagCompound.getCompoundTag("Fluid"); + fluidTag.setInteger("Amount", currentAmount - stack.amount); + container.stackTagCompound.setTag("Fluid", fluidTag); + } + return stack; + } + + public int getFluidAmount(ItemStack container) { + + if (this.getFluid(container) == null) { + return 0; + } + return this.getFluid(container).amount; + + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemUnit.java b/src/main/java/shift/sextiarysector/item/ItemUnit.java new file mode 100644 index 0000000..c76bee7 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemUnit.java @@ -0,0 +1,37 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; + +public class ItemUnit extends Item implements IEquipment { + + public ItemUnit() { + this.maxStackSize = 1; + } + + @Override + public boolean canTakeStack(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return equipment.equals(EquipmentType.Unit); + } + + @Override + public boolean isItemValid(EquipmentType equipment, ItemStack stack) { + return equipment.equals(EquipmentType.Unit); + } + + @Override + public void onUpdate(EquipmentType equipment, ItemStack stack, World world, Entity player, int slot) { + + } + + @Override + public boolean canDrop(EquipmentType equipment, ItemStack stack, EntityPlayer player) { + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemWaterBottle.java b/src/main/java/shift/sextiarysector/item/ItemWaterBottle.java new file mode 100644 index 0000000..dcc20d6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/item/ItemWaterBottle.java @@ -0,0 +1,29 @@ +package shift.sextiarysector.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.api.SextiarySectorAPI; + +public class ItemWaterBottle extends ItemFoodDrink { + + public ItemWaterBottle() { + super(0, 0, 3, 0, 0, 0, false); + this.setContainerItem(SSItems.emptyBottle); + this.setDrink(); + this.setMaxStackSize(4); + this.setCreativeTab(SextiarySectorAPI.TabSSFluid); + } + + @Override + protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer player) + { + player.addExhaustion(4.5f); + player.addPotionEffect(new PotionEffect(Potion.hunger.getId(), 30, 0)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/item/ItemWateringCan.java b/src/main/java/shift/sextiarysector/item/ItemWateringCan.java index 93aaa41..27fb843 100644 --- a/src/main/java/shift/sextiarysector/item/ItemWateringCan.java +++ b/src/main/java/shift/sextiarysector/item/ItemWateringCan.java @@ -16,6 +16,7 @@ import shift.sextiarysector.api.SextiarySectorAPI; import shift.sextiarysector.block.BlockSSCrop; import shift.sextiarysector.block.BlockSSFarmland; +import shift.sextiarysector.block.BlockWood; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -59,7 +60,7 @@ public boolean addWater(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, int z = par6; - if(par3World.getBlock(x, y, z) != SSBlocks.farmland && !(par3World.getBlock(x, y, z) instanceof BlockSSCrop)){ + if(par3World.getBlock(x, y, z) != SSBlocks.farmland && par3World.getBlock(x, y, z) != SSBlocks.wood && !(par3World.getBlock(x, y, z) instanceof BlockSSCrop)){ return false; } @@ -84,6 +85,23 @@ public boolean addWater(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, } + }else if(b instanceof BlockWood){ + + boolean f = ((BlockWood) b).addWater(par3World, x, y, z); + + if(f){ + + if(par3World.isRemote){ + this.spawnParticle(par3World, x, y+1, z); + }else{ + par3World.playSoundAtEntity(par2EntityPlayer, "liquid.water", 1.0F, 1.0F); + par1ItemStack.damageItem(1, par2EntityPlayer); + } + + return true; + + } + } diff --git a/src/main/java/shift/sextiarysector/module/FertilizerManager.java b/src/main/java/shift/sextiarysector/module/FertilizerManager.java index a4b966e..d8987c7 100644 --- a/src/main/java/shift/sextiarysector/module/FertilizerManager.java +++ b/src/main/java/shift/sextiarysector/module/FertilizerManager.java @@ -4,21 +4,48 @@ import java.util.Random; import net.minecraft.item.ItemStack; +import shift.sextiarysector.api.agriculture.FarmlandType; import shift.sextiarysector.api.agriculture.IFertilizer; import shift.sextiarysector.api.agriculture.IFertilizerManager; public class FertilizerManager implements IFertilizerManager { //public static HashMap fertilizers = new HashMap(); + public static ArrayList fertilizerIcons = new ArrayList(); + public static ArrayList fertilizers = new ArrayList(); + + public static ArrayList normal = new ArrayList(); + public static ArrayList paddy = new ArrayList(); //public static HashMap fertilizersS = new HashMap(); private static Random r = new Random(); @Override - public void registerFertilizer(IFertilizer fertilizer) { + public void registerFertilizer(FarmlandType type , IFertilizer fertilizer) { //fertilizersS.put(fertilizer.getName(), fertilizer); fertilizers.add(fertilizer); + + this.addIcon(fertilizer); + + switch(type){ + + case Normal:normal.add(fertilizer);break; + case Paddy : paddy.add(fertilizer);break; + + } + } + + private void addIcon(IFertilizer fertilizer){ + + for(IFertilizer f :fertilizerIcons){ + + if(this.checkItem(fertilizer.getFertilizer(), f.getFertilizer()))return; + + } + + fertilizerIcons.add(fertilizer); + } public static IFertilizer getFertilizer(ItemStack item) @@ -38,6 +65,24 @@ public static IFertilizer getFertilizer(ItemStack item) return null; + } + + public static IFertilizer getFertilizerIcon(ItemStack item) + { + if (item == null) + { + return null; + } + + for(IFertilizer f:fertilizerIcons){ + + if(checkItem(item,f.getFertilizer())){ + return f; + } + + } + + return null; } private static boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) diff --git a/src/main/java/shift/sextiarysector/module/ModuleAchievement.java b/src/main/java/shift/sextiarysector/module/ModuleAchievement.java deleted file mode 100644 index 5374ecd..0000000 --- a/src/main/java/shift/sextiarysector/module/ModuleAchievement.java +++ /dev/null @@ -1,165 +0,0 @@ -package shift.sextiarysector.module; - -import java.util.ArrayList; -import java.util.Iterator; - -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; -import net.minecraft.stats.StatBase; -import net.minecraft.stats.StatCrafting; -import net.minecraft.stats.StatList; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.util.StatCollector; -import net.minecraftforge.common.AchievementPage; -import shift.sextiarysector.SSBlocks; -import shift.sextiarysector.SextiarySector; -import cpw.mods.fml.common.event.FMLInitializationEvent; -import cpw.mods.fml.common.event.FMLPostInitializationEvent; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - -public class ModuleAchievement implements IModule { - - - private static ModuleAchievement instance; - - public static StatBase[] objectSellStats = new StatBase[32000]; - - private ModuleAchievement() { - } - - public static ModuleAchievement getInstance() { - if(instance==null){ - instance = new ModuleAchievement(); - } - return instance; - } - - @Override - public void preInit(FMLPreInitializationEvent event) { - - initEconomy(); - - } - - private ArrayList economy = new ArrayList(); - - public static Achievement creeperFirework; - - public static Achievement creeperChest; - - public static Achievement shipping; - - private void initEconomy() { - - creeperFirework = new SSAchievement("creeper_firework", 0, 0, new ItemStack(Items.fireworks), (Achievement)null,economy).initIndependentStat().registerStat(); - creeperChest = new SSAchievement("creeper_chest", 1, -2, new ItemStack(SSBlocks.creeperChest), creeperFirework,economy).registerStat(); - shipping = new SSAchievement("shipping", 3, -2, new ItemStack(SSBlocks.shippingBox), creeperChest,economy).registerStat(); - - AchievementPage.registerAchievementPage(new AchievementPage("achievement.ss.economy", economy.toArray(new Achievement[0])){ - public String getName() - { - return StatCollector.translateToLocal(super.getName()); - } - }); - - } - - private static class SSAchievement extends Achievement{ - - public SSAchievement(String p_i45302_1_,int p_i45302_3_, int p_i45302_4_, ItemStack p_i45302_5_,Achievement p_i45302_6_,ArrayLista) { - super("achievement.ss"+p_i45302_1_, p_i45302_1_, p_i45302_3_, p_i45302_4_, p_i45302_5_,p_i45302_6_); - a.add(this); - } - - } - - @Override - public void load(FMLInitializationEvent event) { - - } - @Override - public void postInit(FMLPostInitializationEvent event) { - - initStats(); - - } - - private static void initStats() - { - Iterator iterator = Item.itemRegistry.iterator(); - - while (iterator.hasNext()) - { - - try{ - - Item item = (Item)iterator.next(); - - if (item != null) - { - int i = Item.getIdFromItem(item); - - objectSellStats[i] = (new StatCrafting("stat.sellItem." + i, new ChatComponentTranslation("stat.sellItem", new Object[] {(new ItemStack(item)).func_151000_E()}), item)).registerStat(); - - if (!(item instanceof ItemBlock)) - { - StatList.itemStats.add((StatCrafting)objectSellStats[i]); - } - - } - - - }catch (NullPointerException e){ - SextiarySector.Log.catching(e); - }catch (ArrayIndexOutOfBoundsException e){ - SextiarySector.Log.catching(e); - } - - } - - replaceAllSimilarBlocks(objectSellStats); - } - - private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_) - { - func_151180_a(p_75924_0_, Blocks.water, Blocks.flowing_water); - func_151180_a(p_75924_0_, Blocks.lava, Blocks.flowing_lava); - func_151180_a(p_75924_0_, Blocks.lit_pumpkin, Blocks.pumpkin); - func_151180_a(p_75924_0_, Blocks.lit_furnace, Blocks.furnace); - func_151180_a(p_75924_0_, Blocks.lit_redstone_ore, Blocks.redstone_ore); - func_151180_a(p_75924_0_, Blocks.powered_repeater, Blocks.unpowered_repeater); - func_151180_a(p_75924_0_, Blocks.powered_comparator, Blocks.unpowered_comparator); - func_151180_a(p_75924_0_, Blocks.redstone_torch, Blocks.unlit_redstone_torch); - func_151180_a(p_75924_0_, Blocks.lit_redstone_lamp, Blocks.redstone_lamp); - func_151180_a(p_75924_0_, Blocks.red_mushroom, Blocks.brown_mushroom); - func_151180_a(p_75924_0_, Blocks.double_stone_slab, Blocks.stone_slab); - func_151180_a(p_75924_0_, Blocks.double_wooden_slab, Blocks.wooden_slab); - func_151180_a(p_75924_0_, Blocks.grass, Blocks.dirt); - func_151180_a(p_75924_0_, Blocks.farmland, Blocks.dirt); - } - - private static void func_151180_a(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_) - { - int i = Block.getIdFromBlock(p_151180_1_); - int j = Block.getIdFromBlock(p_151180_2_); - - if (p_151180_0_[i] != null && p_151180_0_[j] == null) - { - p_151180_0_[j] = p_151180_0_[i]; - } - else - { - StatList.allStats.remove(p_151180_0_[i]); - StatList.objectMineStats.remove(p_151180_0_[i]); - StatList.generalStats.remove(p_151180_0_[i]); - p_151180_0_[i] = p_151180_0_[j]; - } - } - - -} diff --git a/src/main/java/shift/sextiarysector/module/ModuleAgriculture.java b/src/main/java/shift/sextiarysector/module/ModuleAgriculture.java index 92c62b3..7be7bd1 100644 --- a/src/main/java/shift/sextiarysector/module/ModuleAgriculture.java +++ b/src/main/java/shift/sextiarysector/module/ModuleAgriculture.java @@ -1,11 +1,12 @@ package shift.sextiarysector.module; import net.minecraft.init.Items; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import shift.sextiarysector.SSItems; import shift.sextiarysector.api.agriculture.AgricultureAPI; +import shift.sextiarysector.api.agriculture.FarmlandType; import shift.sextiarysector.api.agriculture.SimpleFertilizer; -import shift.sextiarysector.item.ItemCrop; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; @@ -36,12 +37,18 @@ public void load(FMLInitializationEvent event) { String t = "sextiarysector:fertilizer/"; - for(ItemCrop item :ItemCrop.crops){ - AgricultureAPI.fertilizerManager.registerFertilizer(new SimpleFertilizer("bone",t+"bone",new ItemStack(Items.dye, 1, 15), new ItemStack(item), new ItemStack(item,1,1))); + for(Item item :SSItems.farmlandCrops){ + AgricultureAPI.fertilizerManager.registerFertilizer(FarmlandType.Normal, new SimpleFertilizer("bone",t+"bone",new ItemStack(Items.dye, 1, 15), new ItemStack(item), new ItemStack(item,1,1))); } - AgricultureAPI.fertilizerManager.registerFertilizer(new SimpleFertilizer("stone",t+"stone",new ItemStack(SSItems.stoneDust), new ItemStack(SSItems.corn), new ItemStack(SSItems.goldenCorn))); - AgricultureAPI.fertilizerManager.registerFertilizer(new SimpleFertilizer("stone",t+"stone",new ItemStack(SSItems.stoneDust), new ItemStack(SSItems.turnip), new ItemStack(SSItems.ironTurnip))); + for(Item item :SSItems.paddyCrops){ + AgricultureAPI.fertilizerManager.registerFertilizer(FarmlandType.Paddy, new SimpleFertilizer("bone",t+"bone",new ItemStack(Items.dye, 1, 15), new ItemStack(item), new ItemStack(item,1,1))); + } + + AgricultureAPI.fertilizerManager.registerFertilizer(FarmlandType.Normal, new SimpleFertilizer("stone",t+"stone",new ItemStack(SSItems.stoneDust), new ItemStack(SSItems.corn), new ItemStack(SSItems.goldenCorn))); + AgricultureAPI.fertilizerManager.registerFertilizer(FarmlandType.Normal, new SimpleFertilizer("stone",t+"stone",new ItemStack(SSItems.stoneDust), new ItemStack(SSItems.turnip), new ItemStack(SSItems.ironTurnip))); + + AgricultureAPI.fertilizerManager.registerFertilizer(FarmlandType.Normal, new SimpleFertilizer("water_lily",t+"water_lily",new ItemStack(SSItems.dustWaterLily), new ItemStack(SSItems.sweetPotato), new ItemStack(SSItems.bluePotato))); //AgricultureAPI.fertilizerManager.registerFertilizer(new SimpleFertilizer("bone",t+"bone",new ItemStack(Items.dye, 4, 15), new ItemStack(SSItems.cucumber), new ItemStack(SSItems.tomato))); diff --git a/src/main/java/shift/sextiarysector/module/ModuleChest.java b/src/main/java/shift/sextiarysector/module/ModuleChest.java new file mode 100644 index 0000000..05cb99a --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleChest.java @@ -0,0 +1,46 @@ +package shift.sextiarysector.module; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraftforge.common.ChestGenHooks; +import shift.sextiarysector.SSItems; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ModuleChest implements IModule { + + private static ModuleChest instance; + + private ModuleChest() { + } + + public static ModuleChest getInstance() { + if (instance == null) { + instance = new ModuleChest(); + } + return instance; + } + + @Override + public void preInit(FMLPreInitializationEvent event) { + + } + + @Override + public void load(FMLInitializationEvent event) { + + ChestGenHooks pyramidDesertyChest = ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST); + pyramidDesertyChest.addItem(new WeightedRandomChestContent(new ItemStack(SSItems.attackRustUnit), 1, 1, 2)); + + ChestGenHooks pyramidJungleChest = ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_JUNGLE_CHEST); + pyramidJungleChest.addItem(new WeightedRandomChestContent(new ItemStack(SSItems.defenseRustUnit), 1, 1, 2)); + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + + } + +} diff --git a/src/main/java/shift/sextiarysector/module/ModuleColor.java b/src/main/java/shift/sextiarysector/module/ModuleColor.java new file mode 100644 index 0000000..cd9d76a --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleColor.java @@ -0,0 +1,28 @@ +package shift.sextiarysector.module; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ModuleColor implements IModule { + + @Override + public void preInit(FMLPreInitializationEvent event) { + + } + + @Override + public void load(FMLInitializationEvent event) { + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + + } + + //public static float[] getGLColor3f(EnumColor color) { + // return EntitySheep.fleeceColorTable[15 - color.ordinal()]; + //} + +} diff --git a/src/main/java/shift/sextiarysector/module/ModuleFigure.java b/src/main/java/shift/sextiarysector/module/ModuleFigure.java new file mode 100644 index 0000000..fe79c09 --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleFigure.java @@ -0,0 +1,166 @@ +package shift.sextiarysector.module; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Random; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.World; +import shift.sextiarysector.SSBlocks; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ModuleFigure implements IModule { + + private static ModuleFigure instance; + + private ModuleFigure() { + } + + public static ModuleFigure getInstance() { + if (instance == null) { + instance = new ModuleFigure(); + } + return instance; + } + + @Override + public void preInit(FMLPreInitializationEvent event) { + + } + + @Override + public void load(FMLInitializationEvent event) { + + //繝輔ぅ繧ョ繝・繧「蛻晏ソ閠 + addFigure("figure_beginner", new ItemStack(Blocks.dirt), 50); + addFigure("figure_beginner", new ItemStack(Blocks.clay), 40); + addFigure("figure_beginner", new ItemStack(Blocks.fence), 22); + addFigure("figure_beginner", new ItemStack(Blocks.log), 30); + addFigure("figure_beginner", new ItemStack(Blocks.iron_ore), 16); + + addFigure("figure_beginner", new ItemStack(Items.stick), 50); + addFigure("figure_beginner", new ItemStack(Items.flint), 40); + addFigure("figure_beginner", new ItemStack(Items.fish), 26); + addFigure("figure_beginner", new ItemStack(Items.book), 34); + addFigure("figure_beginner", new ItemStack(Items.bone), 18); + addFigure("figure_beginner", new ItemStack(Items.cake), 2); + + //驩ア遏ウ繧キ繝ェ繝シ繧コ + addFigure("ore_festival", new ItemStack(Blocks.stone), 50); + addFigure("ore_festival", new ItemStack(Blocks.cobblestone), 40); + addFigure("ore_festival", new ItemStack(Blocks.coal_ore), 30); + addFigure("ore_festival", new ItemStack(Blocks.iron_ore), 20); + addFigure("ore_festival", new ItemStack(Blocks.gold_ore), 16); + addFigure("ore_festival", new ItemStack(Blocks.lapis_ore), 10); + addFigure("ore_festival", new ItemStack(Blocks.redstone_ore), 8); + addFigure("ore_festival", new ItemStack(Blocks.diamond_ore), 2); + + //MOD + //addFigure("ore_festival", new ItemStack(SSBlocks.zincOre), 10); + addFigure("ore_festival", new ItemStack(SSBlocks.copperOre), 20); + addFigure("ore_festival", new ItemStack(SSBlocks.silverOre), 14); + addFigure("ore_festival", new ItemStack(SSBlocks.blueStoneOre), 8); + addFigure("ore_festival", new ItemStack(SSBlocks.yellowStoneOre), 8); + addFigure("ore_festival", new ItemStack(SSBlocks.mithrilOre), 5); + addFigure("ore_festival", new ItemStack(SSBlocks.orichalcumOre), 1); + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + + } + + public static void addFigure(String edition, ItemStack seed, int weight) + { + addFigure(edition, new FigureEntry(seed, weight)); + } + + public static void addFigure(String edition, FigureEntry shellEntry) { + if (!figures.containsKey(edition)) { + figures.put(edition, new ArrayList()); + } + figures.get(edition).add(shellEntry); + } + + public static class FigureEntry extends WeightedRandom.Item + { + public final ItemStack figure; + private float damage; + private boolean enchant; + + public FigureEntry(ItemStack seed, int weight) + { + super(weight); + this.figure = seed; + } + + public ItemStack addCustom(Random p_150708_1_) + { + ItemStack itemstack = this.figure.copy(); + + if (this.damage > 0.0F) + { + int i = (int) (this.damage * this.figure.getMaxDamage()); + int j = itemstack.getMaxDamage() - p_150708_1_.nextInt(p_150708_1_.nextInt(i) + 1); + + if (j > i) + { + j = i; + } + + if (j < 1) + { + j = 1; + } + + itemstack.setItemDamage(j); + } + + if (this.enchant) + { + EnchantmentHelper.addRandomEnchantment(p_150708_1_, itemstack, 30); + } + + return itemstack; + } + + public FigureEntry setDamage(float p_150709_1_) + { + this.damage = p_150709_1_; + return this; + } + + public FigureEntry setEnchant() + { + this.enchant = true; + return this; + } + + } + + public static final HashMap> figures = new HashMap>(); + + public static ItemStack getFigure(World world, String edition) + { + + if (!figures.containsKey(edition)) return null; + + FigureEntry entry = (FigureEntry) WeightedRandom.getRandomItem(world.rand, figures.get(edition)); + if (entry == null || entry.figure == null) + { + return null; + } + + return entry.addCustom(world.rand); + + } + +} diff --git a/src/main/java/shift/sextiarysector/module/ModuleFishing.java b/src/main/java/shift/sextiarysector/module/ModuleFishing.java new file mode 100644 index 0000000..b0aac50 --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleFishing.java @@ -0,0 +1,44 @@ +package shift.sextiarysector.module; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandomFishable; +import net.minecraftforge.common.FishingHooks; +import shift.sextiarysector.SSItems; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ModuleFishing implements IModule { + + private static ModuleFishing instance; + + private ModuleFishing() { + } + + public static ModuleFishing getInstance() { + if (instance == null) { + instance = new ModuleFishing(); + } + return instance; + } + + @Override + public void preInit(FMLPreInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public void load(FMLInitializationEvent event) { + + FishingHooks.addTreasure(new WeightedRandomFishable(new ItemStack(SSItems.jumpUnit), 1)); + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + +} diff --git a/src/main/java/shift/sextiarysector/module/ModuleHotSprings.java b/src/main/java/shift/sextiarysector/module/ModuleHotSprings.java new file mode 100644 index 0000000..040cb2b --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleHotSprings.java @@ -0,0 +1,77 @@ +package shift.sextiarysector.module; + +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import shift.sextiarysector.SSBlocks; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ModuleHotSprings implements IModule { + + private static ModuleHotSprings instance; + + private ModuleHotSprings() { + } + + public static ModuleHotSprings getInstance() { + if (instance == null) { + instance = new ModuleHotSprings(); + } + return instance; + } + + public static List hotSpringsBlocks = new ArrayList(); + + @Override + public void preInit(FMLPreInitializationEvent event) { + + } + + @Override + public void load(FMLInitializationEvent event) { + + registerBlock(SSBlocks.hotSprings); + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + + } + + public static void registerBlock(Block block) { + + if (block == null) return; + registerBlock(new ItemStack(block, 1, OreDictionary.WILDCARD_VALUE)); + + } + + public static void registerBlock(ItemStack stack) { + + if (stack == null) return; + hotSpringsBlocks.add(stack); + + } + + public static boolean isHotSprings(Block block, int meta) { + + if (block == null) return false; + + for (ItemStack stack : hotSpringsBlocks) { + if (checkItem(block, meta, stack)) return true; + } + return false; + + } + + private static boolean checkItem(Block block, int meta, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == Item.getItemFromBlock(block) && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == meta); + } +} diff --git a/src/main/java/shift/sextiarysector/module/ModuleSandpit.java b/src/main/java/shift/sextiarysector/module/ModuleSandpit.java new file mode 100644 index 0000000..0c4fb77 --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleSandpit.java @@ -0,0 +1,56 @@ +package shift.sextiarysector.module; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.block.BlockSandpit; +import shift.sextiarysector.block.BlockSandpit.ShellEntry; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ModuleSandpit implements IModule { + + private static ModuleSandpit instance; + + private ModuleSandpit() { + } + + public static ModuleSandpit getInstance() { + if (instance == null) { + instance = new ModuleSandpit(); + } + return instance; + } + + @Override + public void preInit(FMLPreInitializationEvent event) { + + } + + @Override + public void load(FMLInitializationEvent event) { + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + + BlockSandpit.addShell(new ItemStack(Items.stick), 45); + + BlockSandpit.addShell(new ItemStack(Items.glass_bottle), 14); + + BlockSandpit.addShell(new ShellEntry(new ItemStack(Items.book), 10).setEnchant()); + + BlockSandpit.addShell(new ItemStack(SSItems.laver), 26); + + BlockSandpit.addShell(new ItemStack(Items.redstone), 8); + BlockSandpit.addShell(new ItemStack(SSItems.blueStoneDust), 8); + BlockSandpit.addShell(new ItemStack(SSItems.yellowStoneDust), 8); + + BlockSandpit.addShell(new ItemStack(SSItems.mithrilDust), 3); + BlockSandpit.addShell(new ItemStack(SSItems.orichalcumGem), 1); + + } + +} diff --git a/src/main/java/shift/sextiarysector/module/ModuleStatistics.java b/src/main/java/shift/sextiarysector/module/ModuleStatistics.java new file mode 100644 index 0000000..8aa4b8a --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleStatistics.java @@ -0,0 +1,129 @@ +package shift.sextiarysector.module; + +import java.util.Iterator; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatBase; +import net.minecraft.stats.StatCrafting; +import net.minecraft.stats.StatList; +import net.minecraft.util.ChatComponentTranslation; +import shift.sextiarysector.SextiarySector; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ModuleStatistics implements IModule { + + private static ModuleStatistics instance; + + public static StatBase[] objectSellStats = new StatBase[32000]; + + private ModuleStatistics() { + } + + public static ModuleStatistics getInstance() { + if (instance == null) { + instance = new ModuleStatistics(); + } + return instance; + } + + @Override + public void preInit(FMLPreInitializationEvent event) { + } + + @Override + public void load(FMLInitializationEvent event) { + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + + initStats(); + + } + + private static void initStats() + { + Iterator iterator = Item.itemRegistry.iterator(); + + while (iterator.hasNext()) + { + + try { + + Item item = (Item) iterator.next(); + + if (item != null) + { + int i = Item.getIdFromItem(item); + + objectSellStats[i] = (new StatCrafting("stat.sellItem." + i, new ChatComponentTranslation("stat.sellItem", new Object[] { (new ItemStack(item)).func_151000_E() }), item)).registerStat(); + + if (!(item instanceof ItemBlock)) + { + StatList.itemStats.add(objectSellStats[i]); + } + + } + + } catch (NullPointerException e) { + SextiarySector.Log.catching(e); + } catch (ArrayIndexOutOfBoundsException e) { + SextiarySector.Log.catching(e); + } catch (NoClassDefFoundError e) { + SextiarySector.Log.catching(e); + } catch (IndexOutOfBoundsException e) { + SextiarySector.Log.catching(e); + } catch (Exception e) { + SextiarySector.Log.info("(笊ケ笳。笊ケ)縲後け繝ゥ繝繧キ繝・繧偵☆縺。繧繧翫"); + SextiarySector.Log.catching(e); + } + + } + + replaceAllSimilarBlocks(objectSellStats); + } + + private static void replaceAllSimilarBlocks(StatBase[] p_75924_0_) + { + func_151180_a(p_75924_0_, Blocks.water, Blocks.flowing_water); + func_151180_a(p_75924_0_, Blocks.lava, Blocks.flowing_lava); + func_151180_a(p_75924_0_, Blocks.lit_pumpkin, Blocks.pumpkin); + func_151180_a(p_75924_0_, Blocks.lit_furnace, Blocks.furnace); + func_151180_a(p_75924_0_, Blocks.lit_redstone_ore, Blocks.redstone_ore); + func_151180_a(p_75924_0_, Blocks.powered_repeater, Blocks.unpowered_repeater); + func_151180_a(p_75924_0_, Blocks.powered_comparator, Blocks.unpowered_comparator); + func_151180_a(p_75924_0_, Blocks.redstone_torch, Blocks.unlit_redstone_torch); + func_151180_a(p_75924_0_, Blocks.lit_redstone_lamp, Blocks.redstone_lamp); + func_151180_a(p_75924_0_, Blocks.red_mushroom, Blocks.brown_mushroom); + func_151180_a(p_75924_0_, Blocks.double_stone_slab, Blocks.stone_slab); + func_151180_a(p_75924_0_, Blocks.double_wooden_slab, Blocks.wooden_slab); + func_151180_a(p_75924_0_, Blocks.grass, Blocks.dirt); + func_151180_a(p_75924_0_, Blocks.farmland, Blocks.dirt); + } + + private static void func_151180_a(StatBase[] p_151180_0_, Block p_151180_1_, Block p_151180_2_) + { + int i = Block.getIdFromBlock(p_151180_1_); + int j = Block.getIdFromBlock(p_151180_2_); + + if (p_151180_0_[i] != null && p_151180_0_[j] == null) + { + p_151180_0_[j] = p_151180_0_[i]; + } + else + { + StatList.allStats.remove(p_151180_0_[i]); + StatList.objectMineStats.remove(p_151180_0_[i]); + StatList.generalStats.remove(p_151180_0_[i]); + p_151180_0_[i] = p_151180_0_[j]; + } + } + +} diff --git a/src/main/java/shift/sextiarysector/module/ModuleToolMaterial.java b/src/main/java/shift/sextiarysector/module/ModuleToolMaterial.java new file mode 100644 index 0000000..12c2b32 --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleToolMaterial.java @@ -0,0 +1,57 @@ +package shift.sextiarysector.module; + +import net.minecraft.item.Item.ToolMaterial; +import net.minecraft.item.ItemArmor.ArmorMaterial; +import net.minecraftforge.common.util.EnumHelper; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ModuleToolMaterial implements IModule { + + private static ModuleToolMaterial instance; + + private ModuleToolMaterial() { + } + + public static ModuleToolMaterial getInstance() { + if (instance == null) { + instance = new ModuleToolMaterial(); + } + return instance; + } + + public static ToolMaterial copperTool; + public static ToolMaterial brassTool; + public static ToolMaterial ninjaTool; + + public static ArmorMaterial copperArmor; + public static ArmorMaterial ninjaArmor; + + @Override + public void preInit(FMLPreInitializationEvent event) { + + //繝ャ繝吶Ν 閠蝉ケ 繧ケ繝斐シ繝 Power Enchant + copperTool = EnumHelper.addToolMaterial("copper", 2, 200, 4.0F, 1.0F, 10); + brassTool = EnumHelper.addToolMaterial("brass", 2, 660, 7.0F, 3.0F, 8); + ninjaTool = EnumHelper.addToolMaterial("ninja", 4, 1172, 12.5F, 5.0F, 19); + + //閠蝉ケ 縺昴l縺槭l縺ョ髦イ蠕。蜉 Enchant + copperArmor = EnumHelper.addArmorMaterial("copper", 13, new int[] { 2, 6, 4, 2 }, 7); + ninjaArmor = EnumHelper.addArmorMaterial("ninja", 29, new int[] { 4, 9, 6, 4 }, 22); + + } + + @Override + public void load(FMLInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + +} diff --git a/src/main/java/shift/sextiarysector/module/ModuleTrap.java b/src/main/java/shift/sextiarysector/module/ModuleTrap.java new file mode 100644 index 0000000..28361ed --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleTrap.java @@ -0,0 +1,200 @@ +package shift.sextiarysector.module; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandom; +import net.minecraft.world.World; +import shift.sextiarysector.SextiarySector; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class ModuleTrap implements IModule { + + private static ModuleTrap instance; + + private ModuleTrap() { + } + + public static ModuleTrap getInstance() { + if (instance == null) { + instance = new ModuleTrap(); + } + return instance; + } + + static final List smallTrapList = new ArrayList(); + + @Override + public void preInit(FMLPreInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public void load(FMLInitializationEvent event) { + + addTrap(new ItemStack(Items.feather), 50); + addTrap(new ItemStack(Items.egg), 20); + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + public static void addTrap(ItemStack seed, int weight) + { + addTrap(new TrapEntry(seed, weight)); + } + + public static void addTrap(TrapEntry shellEntry) { + smallTrapList.add(shellEntry); + } + + //public static void addTrap(Class entity, int weight) { + // smallTrapList.add(new TrapEntry(entity, weight)); + //} + + public static class TrapEntry extends WeightedRandom.Item + { + public final ItemStack item; + //public final Class entity; + private float damage; + private boolean enchant; + + public TrapEntry(ItemStack seed, int weight) + { + super(weight); + this.item = seed; + //this.entity = null; + } + + public TrapEntry(Class entity, int weight) + { + super(weight); + this.item = null; + //this.entity = entity; + } + + public ItemStack addCustom(Random p_150708_1_) + { + ItemStack itemstack = this.item.copy(); + + if (this.damage > 0.0F) + { + int i = (int) (this.damage * this.item.getMaxDamage()); + int j = itemstack.getMaxDamage() - p_150708_1_.nextInt(p_150708_1_.nextInt(i) + 1); + + if (j > i) + { + j = i; + } + + if (j < 1) + { + j = 1; + } + + itemstack.setItemDamage(j); + } + + if (this.enchant) + { + EnchantmentHelper.addRandomEnchantment(p_150708_1_, itemstack, 30); + } + + return itemstack; + } + + public TrapEntry setDamage(float p_150709_1_) + { + this.damage = p_150709_1_; + return this; + } + + public TrapEntry setEnchant() + { + this.enchant = true; + return this; + } + + } + + public static ItemStack getTrapItem(World world) { + + TrapEntry entry = (TrapEntry) WeightedRandom.getRandomItem(world.rand, smallTrapList); + + if (entry == null) return null; + + if (entry.item != null) + { + return entry.addCustom(world.rand); + } + + return null; + + } + + public static void spawnTrap(World world, int x, int y, int z) + { + + Entity entity = null; + + TrapEntry entry = (TrapEntry) WeightedRandom.getRandomItem(world.rand, smallTrapList); + + if (entry == null) return; + + if (entry.item != null) + { + entity = new EntityItem(world, x + 0.5d, y + 0.5d, z + 0.5d, entry.addCustom(world.rand)); + } + + /*if (entry.entity != null) + { + entity = createEntityByClass(entry.entity, world); + if (entity != null && entity instanceof EntityLivingBase) + { + EntityLiving entityliving = (EntityLiving) entity; + entity.setLocationAndAngles(x + 0.5d, y + 0.5d, z + 0.5d, MathHelper.wrapAngleTo180_float(world.rand.nextFloat() * 360.0F), 0.0F); + entityliving.rotationYawHead = entityliving.rotationYaw; + entityliving.renderYawOffset = entityliving.rotationYaw; + //entityliving.onSpawnWithEgg((IEntityLivingData) null); + entityliving.playLivingSound(); + } + }*/ + + if (entity != null) world.spawnEntityInWorld(entity); + + } + + public static Entity createEntityByClass(Class entityClass, World p_75616_1_) + { + Entity entity = null; + + try + { + Class oclass = entityClass; + + if (oclass != null) + { + entity = (Entity) oclass.getConstructor(new Class[] { World.class }).newInstance(new Object[] { p_75616_1_ }); + } + } catch (Exception exception) + { + SextiarySector.Log.catching(exception); + } + + return entity; + } + +} diff --git a/src/main/java/shift/sextiarysector/module/ModuleVanillaRecipe.java b/src/main/java/shift/sextiarysector/module/ModuleVanillaRecipe.java new file mode 100644 index 0000000..08e3abf --- /dev/null +++ b/src/main/java/shift/sextiarysector/module/ModuleVanillaRecipe.java @@ -0,0 +1,556 @@ +package shift.sextiarysector.module; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.item.crafting.ShapedRecipes; +import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import shift.sextiarysector.SextiarySector; +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.registry.GameRegistry; + +/** + * This code was referenced to OreDictionary.class. + * This code was referenced to CustomizeVanillaRecipe.class. by FluidityFoodstuffs + * */ +public class ModuleVanillaRecipe implements IModule { + + private static ModuleVanillaRecipe instance; + + private ModuleVanillaRecipe() { + } + + public static ModuleVanillaRecipe getInstance() { + if (instance == null) { + instance = new ModuleVanillaRecipe(); + } + return instance; + } + + private static Map replaceTable = new HashMap(); + + private static ArrayList exclusions = new ArrayList(); + + @Override + public void preInit(FMLPreInitializationEvent event) { + + replaceTable.put(new ItemStack(Blocks.wool), "blockWool"); + + for (int i = 0; i < 16; i++) { + exclusions.add(new ItemStack(Blocks.wool, 1, i)); + } + + } + + @Override + public void load(FMLInitializationEvent event) { + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + + List targetRecipes = CraftingManager.getInstance().getRecipeList(); + List addRecipes = new ArrayList(); + List addOreRecipes = new ArrayList(); + List addShapelessRecipes = new ArrayList(); + List addShapelessOreRecipes = new ArrayList(); + + ItemStack[] replaces = replaceTable.keySet().toArray(new ItemStack[replaceTable.keySet().size()]); + + int count = 0; + + for (Object obj : targetRecipes) + { + if (obj instanceof ShapedRecipes) + { + ShapedRecipes recipe = (ShapedRecipes) obj; + ItemStack output = recipe.getRecipeOutput(); + if (output != null && containsMatch(false, exclusions.toArray(new ItemStack[exclusions.size()]), output)) + { + continue; + } + + if (containsMatch(true, recipe.recipeItems, replaces)) + { + addRecipes.add(recipe); + } + } + else if (obj instanceof ShapelessRecipes) + { + ShapelessRecipes recipe = (ShapelessRecipes) obj; + ItemStack output = recipe.getRecipeOutput(); + if (output != null && containsMatch(false, exclusions.toArray(new ItemStack[exclusions.size()]), output)) + { + continue; + } + + if (containsMatch(true, (ItemStack[]) recipe.recipeItems.toArray(new ItemStack[recipe.recipeItems.size()]), replaces)) + { + addShapelessRecipes.add(recipe); + } + } + if (obj instanceof ShapedOreRecipe) + { + ShapedOreRecipe recipe = (ShapedOreRecipe) obj; + ItemStack output = recipe.getRecipeOutput(); + if (output != null && containsMatch(false, exclusions.toArray(new ItemStack[exclusions.size()]), output)) + { + continue; + } + + ArrayList check = new ArrayList(); + for (Object object : recipe.getInput()) + { + ItemStack item = null; + + if (object instanceof ItemStack) + { + item = (ItemStack) object; + } + else if (object instanceof Item) + { + item = new ItemStack((Item) object); + } + else if (object instanceof Block) + { + item = new ItemStack((Block) object, 1, OreDictionary.WILDCARD_VALUE); + } + + if (item != null) + { + check.add(item); + } + } + + if (!check.isEmpty() && containsMatch(true, check.toArray((new ItemStack[check.size()])), replaces)) + { + addOreRecipes.add(recipe); + } + } + else if (obj instanceof ShapelessOreRecipe) + { + ShapelessOreRecipe recipe = (ShapelessOreRecipe) obj; + ItemStack output = recipe.getRecipeOutput(); + if (output != null && containsMatch(false, exclusions.toArray(new ItemStack[exclusions.size()]), output)) + { + continue; + } + + ArrayList check = new ArrayList(); + for (Object object : recipe.getInput()) + { + ItemStack item = null; + + if (object instanceof ItemStack) + { + item = (ItemStack) object; + } + else if (object instanceof Item) + { + item = new ItemStack((Item) object); + } + else if (object instanceof Block) + { + item = new ItemStack((Block) object, 1, OreDictionary.WILDCARD_VALUE); + } + + if (item != null) + { + check.add(item); + } + } + + if (!check.isEmpty() && containsMatch(true, check.toArray((new ItemStack[check.size()])), replaces)) + { + addShapelessOreRecipes.add(recipe); + } + } + } + + for (Object obj : addRecipes) + { + if (obj instanceof ShapedRecipes) + { + registerCustomShapedRecipe((ShapedRecipes) obj); + count++; + } + } + + for (Object obj : addShapelessRecipes) + { + if (obj instanceof ShapelessRecipes) + { + registerCustomShapelessRecipe((ShapelessRecipes) obj); + count++; + } + } + + for (Object obj : addOreRecipes) + { + if (obj instanceof ShapedOreRecipe) + { + registerCustomShapedOreRecipe((ShapedOreRecipe) obj); + count++; + } + } + + for (Object obj : addShapelessOreRecipes) + { + if (obj instanceof ShapelessOreRecipe) + { + registerCustomShapelessOreRecipe((ShapelessOreRecipe) obj); + count++; + } + } + + SextiarySector.Log.info("Replaced " + count + " recipes."); + + } + + //Shaped + private static void registerCustomShapedRecipe(ShapedRecipes recipe) + { + ItemStack output = recipe.getRecipeOutput(); + int x = recipe.recipeWidth; + int y = recipe.recipeHeight; + ItemStack[] items = recipe.recipeItems; + + if (x * y > 9) return; + + ArrayList inputArray = new ArrayList(); + + //3x3繧医j螟ァ縺阪↑繝ャ繧キ繝斐↓縺ッ蜈ィ縺丞ッセ蠢懊@縺ヲ縺縺ェ縺 + String[] s = { "A", "B", "C", "D", "E", "F", "G", "H", "I" }; + Character[] c = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I' }; + + String[] returnArray = new String[y]; + + //繧ッ繝ゥ繝輔ヨ谺謖螳夂畑縺ョString[]縺ョ逕滓 + for (int i = 1; i < y + 1; i++) + { + String f = ""; + for (int k = 1; k < x + 1; k++) + { + f += items[k + ((i - 1) * x) - 1] == null ? " " : s[k + ((i - 1) * x) - 1]; + } + returnArray[i - 1] = f; + } + + for (int i = 0; i < returnArray.length; i++) + { + inputArray.add(returnArray[i]); + } + + //ItemStack驟榊鈴Κ蛻縺ョ霑ス蜉 + //Character縲!temStack/String 縺ョ鬆縺ォ霑ス蜉縺励※縺縺代ー濶ッ縺縲らゥコ谺縺ッnull縺ョ縺セ縺セ縲 + for (int i = 0; i < x * y; i++) + { + if (items[i] != null) + { + String sign = s[i]; + ItemStack item = items[i]; + boolean b = false; + + for (Entry entry : replaceTable.entrySet()) + { + if (itemMatches(entry.getKey(), item, true)) + { + String oreName = entry.getValue(); + + inputArray.add(c[i]); + inputArray.add(entry.getValue()); + b = true; + } + } + + if (!b) + { + inputArray.add(c[i]); + inputArray.add(item); + } + } + } + + Object[] newInputs = inputArray.toArray(); + GameRegistry.addRecipe(new ShapedOreRecipe(output, newInputs)); + SextiarySector.Log.info("Customized ShapdRecipe : " + inputArray.toString()); + } + + //Shapeless + private static void registerCustomShapelessRecipe(ShapelessRecipes recipe) + { + ItemStack output = recipe.getRecipeOutput(); + List items = recipe.recipeItems; + ArrayList inputs = new ArrayList(); + + for (ItemStack item : items) + { + boolean b = false; + if (item != null) + { + for (Entry entry : replaceTable.entrySet()) + { + if (itemMatches(entry.getKey(), item, true)) + { + String oreName = entry.getValue(); + inputs.add(oreName); + b = true; + } + } + + if (!b) + { + inputs.add(item); + } + } + } + + Object[] newInputs = inputs.toArray(); + GameRegistry.addRecipe(new ShapelessOreRecipe(output, newInputs)); + SextiarySector.Log.info("Customized ShapelessRecipe : " + inputs.toString()); + + } + + //Shaped-Ore + private static void registerCustomShapedOreRecipe(ShapedOreRecipe recipe) + { + ItemStack output = recipe.getRecipeOutput(); + Object[] objects = recipe.getInput(); + ArrayList inputs = new ArrayList(); + + int x = 0; + int y = 0; + + try + { + Field fieldW = recipe.getClass().getDeclaredField("width"); + fieldW.setAccessible(true); + x = fieldW.getInt(recipe); + + Field fieldH = recipe.getClass().getDeclaredField("height"); + fieldH.setAccessible(true); + y = fieldH.getInt(recipe); + } catch (Exception e) + { + return; + } + + if (x * y == 0 || x * y > 9) return; + + //3x3繧医j螟ァ縺阪↑繝ャ繧キ繝斐↓縺ッ蜈ィ縺丞ッセ蠢懊@縺ヲ縺縺ェ縺 + String[] s = { "A", "B", "C", "D", "E", "F", "G", "H", "I" }; + Character[] c = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I' }; + + String[] returnArray = new String[y]; + + //繧ッ繝ゥ繝輔ヨ谺謖螳夂畑縺ョString[]縺ョ逕滓 + for (int i = 1; i < y + 1; i++) + { + String f = ""; + for (int k = 1; k < x + 1; k++) + { + f += objects[k + ((i - 1) * x) - 1] == null ? " " : s[k + ((i - 1) * x) - 1]; + } + returnArray[i - 1] = f; + } + + for (int i = 0; i < returnArray.length; i++) + { + inputs.add(returnArray[i]); + } + + //item + for (int i = 0; i < x * y; i++) + { + boolean b = false; + ItemStack item = null; + Object obj = objects[i]; + if (obj == null) continue; + + if (obj instanceof ItemStack) + { + item = (ItemStack) obj; + } + else if (obj instanceof Item) + { + item = new ItemStack((Item) obj); + } + else if (obj instanceof Block) + { + item = new ItemStack((Block) obj, 1, OreDictionary.WILDCARD_VALUE); + } + else if (obj instanceof ArrayList) + { + if ((ArrayList) obj != null && !((ArrayList) obj).isEmpty()) + { + ArrayList list = (ArrayList) obj; + for (ItemStack oreItem : list) { + if (oreItem == null || OreDictionary.getOreIDs(oreItem).length == 0) continue; + int[] id = OreDictionary.getOreIDs(oreItem); + for (int j = 0; j < id.length; j++) + { + String str = OreDictionary.getOreName(OreDictionary.getOreIDs(oreItem)[j]); + if (str != null) { + inputs.add(c[i]); + inputs.add(str); + b = true; + break; + } + } + if (b) break; + } + } + + if (!b) + { + inputs.add(c[i]); + inputs.add("Unknown"); + b = true; + } + } + + if (item != null) + { + for (Entry entry : replaceTable.entrySet()) + { + if (itemMatches(entry.getKey(), item, true)) + { + String oreName = entry.getValue(); + inputs.add(c[i]); + inputs.add(oreName); + b = true; + } + } + + if (!b) + { + inputs.add(c[i]); + inputs.add(obj); + } + } + } + + Object[] newInputs = inputs.toArray(); + GameRegistry.addRecipe(new ShapedOreRecipe(output, newInputs)); + SextiarySector.Log.info("Customized ShapedOreRecipe : " + inputs.toString()); + + } + + //Shapeless-Ore + private static void registerCustomShapelessOreRecipe(ShapelessOreRecipe recipe) + { + ItemStack output = recipe.getRecipeOutput(); + ArrayList objects = recipe.getInput(); + ArrayList inputs = new ArrayList(); + + for (Object obj : objects) + { + boolean b = false; + ItemStack item = null; + + if (obj instanceof ItemStack) + { + item = (ItemStack) obj; + } + else if (obj instanceof Item) + { + item = new ItemStack((Item) obj); + } + else if (obj instanceof Block) + { + item = new ItemStack((Block) obj, 1, OreDictionary.WILDCARD_VALUE); + } + else if (obj instanceof ArrayList) + { + if ((ArrayList) obj != null && !((ArrayList) obj).isEmpty()) + { + ArrayList list = (ArrayList) obj; + for (ItemStack oreItem : list) { + if (oreItem == null || OreDictionary.getOreIDs(oreItem).length == 0) continue; + int[] id = OreDictionary.getOreIDs(oreItem); + for (int j = 0; j < id.length; j++) + { + String str = OreDictionary.getOreName(OreDictionary.getOreIDs(oreItem)[j]); + if (str != null) { + inputs.add(str); + b = true; + break; + } + } + if (b) break; + } + } + + if (!b) + { + inputs.add("Unknown"); + b = true; + } + } + + if (item != null) + { + for (Entry entry : replaceTable.entrySet()) + { + if (itemMatches(entry.getKey(), item, true)) + { + String oreName = entry.getValue(); + inputs.add(oreName); + b = true; + } + } + } + + if (!b) + { + inputs.add(obj); + } + } + + Object[] newInputs = inputs.toArray(); + GameRegistry.addRecipe(new ShapelessOreRecipe(output, newInputs)); + SextiarySector.Log.info("Customized ShapelessOreRecipe : " + inputs.toString()); + + } + + private static boolean containsMatch(boolean strict, ItemStack[] inputs, ItemStack... targets) + { + for (ItemStack input : inputs) + { + for (ItemStack target : targets) + { + if (itemMatches(target, input, strict)) + { + return true; + } + } + } + return false; + } + + public static boolean itemMatches(ItemStack target, ItemStack input, boolean strict) + { + if (input == null && target != null || input != null && target == null) + { + return false; + } + return (target.getItem() == input.getItem() && ((target.getItemDamage() == OreDictionary.WILDCARD_VALUE && !strict) || target.getItemDamage() == input.getItemDamage())); + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/AbstractFuel2RecipeHandler.java b/src/main/java/shift/sextiarysector/nei/AbstractFuel2RecipeHandler.java new file mode 100644 index 0000000..7e6fafb --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/AbstractFuel2RecipeHandler.java @@ -0,0 +1,129 @@ +package shift.sextiarysector.nei; + +import static codechicken.nei.NEIClientUtils.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map.Entry; + +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.GuiRecipe; + +public abstract class AbstractFuel2RecipeHandler extends AbstractSimple2RecipeHandler{ + + public class CachedFuelRecipe extends CachedRecipe + { + public FuelPair fuel; + + public CachedFuelRecipe(FuelPair fuel) { + this.fuel = fuel; + } + + @Override + public PositionedStack getIngredient() { + return mfurnace.get(cycleticks / 48 % mfurnace.size()).ingred; + } + + @Override + public PositionedStack getResult() { + return mfurnace.get(cycleticks / 48 % mfurnace.size()).result; + } + + @Override + public PositionedStack getOtherStack() { + return fuel.stack; + } + } + + private ArrayList mfurnace = new ArrayList(); + + public AbstractFuel2RecipeHandler() { + super(); + loadAllSmelting(); + } + + public String getRecipeName() { + return I18n.format("nei."+getGuiRecipeName()); + } + + private void loadAllSmelting() { + + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + + for(Entry recipe : recipes.entrySet()) + { + ItemStack item = recipe.getValue(); + if(OreDictionary.getOres(recipe.getKey()).size()>=1){ + mfurnace.add(new SimpleMachinePair(OreDictionary.getOres(recipe.getKey()), item)); + } + + } + + if(metarecipes == null)return; + for(Entry recipe : metarecipes.entrySet()) + { + ItemStack item = recipe.getValue(); + mfurnace.add(new SimpleMachinePair(recipe.getKey(), item)); + } + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals(getFuelHandlerName()) && getClass() == getFuelHandlerClass()) + for (FuelPair fuel : afuels) + arecipes.add(new CachedFuelRecipe(fuel)); + } + + public void loadUsageRecipes(ItemStack ingredient) { + for (FuelPair fuel : afuels) + if (fuel.stack.contains(ingredient)) + arecipes.add(new CachedFuelRecipe(fuel)); + } + + public String getOverlayIdentifier() { + return getFuelHandlerName(); + } + + @Override + public List handleItemTooltip(GuiRecipe gui, ItemStack stack, List currenttip, int recipe) { + CachedFuelRecipe crecipe = (CachedFuelRecipe) arecipes.get(recipe); + FuelPair fuel = crecipe.fuel; + float burnTime = fuel.burnTime / 200F; + + if (gui.isMouseOver(fuel.stack, recipe) && burnTime < 1) { + burnTime = 1F / burnTime; + String s_time = Float.toString(burnTime); + if (burnTime == Math.round(burnTime)) + s_time = Integer.toString((int) burnTime); + + currenttip.add(translate("recipe.fuel.required", s_time)); + } else if ((gui.isMouseOver(crecipe.getResult(), recipe) || gui.isMouseOver(crecipe.getIngredient(), recipe)) && burnTime > 1) { + String s_time = Float.toString(burnTime); + if (burnTime == Math.round(burnTime)) + s_time = Integer.toString((int) burnTime); + + currenttip.add(translate("recipe.fuel." + (gui.isMouseOver(crecipe.getResult(), recipe) ? "produced" : "processed"), s_time)); + } + + return currenttip; + } + + abstract Class getFuelHandlerClass(); + + @Override + Class getHandlerClass() { + return null; + } + + @Override + String getHandlerName() { + return ""; + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/AbstractFuelRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/AbstractFuelRecipeHandler.java new file mode 100644 index 0000000..3e27df6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/AbstractFuelRecipeHandler.java @@ -0,0 +1,129 @@ +package shift.sextiarysector.nei; + +import static codechicken.nei.NEIClientUtils.*; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map.Entry; + +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.GuiRecipe; + +public abstract class AbstractFuelRecipeHandler extends AbstractSimpleRecipeHandler { + + public class CachedFuelRecipe extends CachedRecipe + { + public FuelPair fuel; + + public CachedFuelRecipe(FuelPair fuel) { + this.fuel = fuel; + } + + @Override + public PositionedStack getIngredient() { + return mfurnace.get(cycleticks / 48 % mfurnace.size()).ingred; + } + + @Override + public PositionedStack getResult() { + return mfurnace.get(cycleticks / 48 % mfurnace.size()).result; + } + + @Override + public PositionedStack getOtherStack() { + return fuel.stack; + } + } + + private ArrayList mfurnace = new ArrayList(); + + public AbstractFuelRecipeHandler() { + super(); + loadAllSmelting(); + } + + public String getRecipeName() { + return I18n.format("nei."+getGuiRecipeName()); + } + + private void loadAllSmelting() { + + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + + for(Entry recipe : recipes.entrySet()) + { + ItemStack item = recipe.getValue(); + if(OreDictionary.getOres(recipe.getKey()).size()>=1){ + mfurnace.add(new SimpleMachinePair(OreDictionary.getOres(recipe.getKey()), item)); + } + + } + + if(metarecipes == null)return; + for(Entry recipe : metarecipes.entrySet()) + { + ItemStack item = recipe.getValue(); + mfurnace.add(new SimpleMachinePair(recipe.getKey(), item)); + } + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) { + if (outputId.equals(getFuelHandlerName()) && getClass() == getFuelHandlerClass()) + for (FuelPair fuel : afuels) + arecipes.add(new CachedFuelRecipe(fuel)); + } + + public void loadUsageRecipes(ItemStack ingredient) { + for (FuelPair fuel : afuels) + if (fuel.stack.contains(ingredient)) + arecipes.add(new CachedFuelRecipe(fuel)); + } + + public String getOverlayIdentifier() { + return getFuelHandlerName(); + } + + @Override + public List handleItemTooltip(GuiRecipe gui, ItemStack stack, List currenttip, int recipe) { + CachedFuelRecipe crecipe = (CachedFuelRecipe) arecipes.get(recipe); + FuelPair fuel = crecipe.fuel; + float burnTime = fuel.burnTime / 200F; + + if (gui.isMouseOver(fuel.stack, recipe) && burnTime < 1) { + burnTime = 1F / burnTime; + String s_time = Float.toString(burnTime); + if (burnTime == Math.round(burnTime)) + s_time = Integer.toString((int) burnTime); + + currenttip.add(translate("recipe.fuel.required", s_time)); + } else if ((gui.isMouseOver(crecipe.getResult(), recipe) || gui.isMouseOver(crecipe.getIngredient(), recipe)) && burnTime > 1) { + String s_time = Float.toString(burnTime); + if (burnTime == Math.round(burnTime)) + s_time = Integer.toString((int) burnTime); + + currenttip.add(translate("recipe.fuel." + (gui.isMouseOver(crecipe.getResult(), recipe) ? "produced" : "processed"), s_time)); + } + + return currenttip; + } + + abstract Class getFuelHandlerClass(); + + @Override + Class getHandlerClass() { + return null; + } + + @Override + String getHandlerName() { + return ""; + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/AbstractSimple2RecipeHandler.java b/src/main/java/shift/sextiarysector/nei/AbstractSimple2RecipeHandler.java new file mode 100644 index 0000000..3d5d6a5 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/AbstractSimple2RecipeHandler.java @@ -0,0 +1,250 @@ +package shift.sextiarysector.nei; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Set; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import shift.sextiarysector.recipe.RecipeSimpleMachine; +import codechicken.nei.ItemList; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.TemplateRecipeHandler; + +public abstract class AbstractSimple2RecipeHandler extends TemplateSSRecipeHandler{ + + public class SimpleMachinePair extends CachedRecipe + { + public SimpleMachinePair(ItemStack ingred, ItemStack result) + { + ingred.stackSize = 1; + this.ingred = new PositionedStack(ingred, 51, 42); + this.result = new PositionedStack(result, 111, 24); + } + + public SimpleMachinePair(List ingred, ItemStack result) + { + for(int i = 0;i afuels; + + public PositionedStack getResult() { + return null; + } + + @Override + public String getOverlayIdentifier() { + return getHandlerName(); + } + + @Override + public void loadTransferRects() { + transferRects.add(new RecipeTransferRect(new Rectangle(50, 23, 18, 18), getFuelHandlerName())); + transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(74, 23, 24, 18), getHandlerName())); + } + + @Override + public TemplateRecipeHandler newInstance() { + if (afuels == null) + findFuels(); + return super.newInstance(); + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) + { + if(outputId.equals(getHandlerName()) && getClass() == getHandlerClass())//don't want subclasses getting a hold of this + { + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + + for(Entry recipe : recipes.entrySet()) + { + ItemStack item = recipe.getValue(); + if(OreDictionary.getOres(recipe.getKey()).size()>=1){ + arecipes.add(new SimpleMachinePair(OreDictionary.getOres(recipe.getKey()), item)); + } + + } + + if(metarecipes == null)return; + for(Entry recipe : metarecipes.entrySet()) + { + ItemStack item = recipe.getValue(); + arecipes.add(new SimpleMachinePair(recipe.getKey(), item)); + } + } + else + { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) + { + + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + for(Entry recipe : recipes.entrySet()) + { + ItemStack item = recipe.getValue(); + if(NEIServerUtils.areStacksSameType(item, result)) + { + if(OreDictionary.getOres(recipe.getKey()).size()>=1){ + arecipes.add(new SimpleMachinePair(OreDictionary.getOres(recipe.getKey()), item)); + } + + } + } + + if(metarecipes == null)return; + for(Entry recipe : metarecipes.entrySet()) + { + ItemStack item = recipe.getValue(); + if(NEIServerUtils.areStacksSameType(item, result)) + { + arecipes.add(new SimpleMachinePair(recipe.getKey(), item)); + } + } + } + + @Override + public void loadUsageRecipes(String inputId, Object... ingredients) { + if (inputId.equals(getFuelHandlerName()) && getClass() == getHandlerClass())//don't want subclasses getting a hold of this + loadCraftingRecipes(getHandlerName()); + else + super.loadUsageRecipes(inputId, ingredients); + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) + { + + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + for(Entry recipe : recipes.entrySet()) + { + ItemStack item = recipe.getValue(); + ArrayList items = OreDictionary.getOres(recipe.getKey()); + for(int i = 0; i< items.size() ; i++){ + if(this.checkItem(items.get(i),ingredient)){ + arecipes.add(new SimpleMachinePair(items, item)); + break; + } + } + } + + if(metarecipes == null)return; + for(Entry recipe : metarecipes.entrySet()) + { + ItemStack item = recipe.getValue(); + //if(ingredient.itemID == recipe.getKey().get(0) && ingredient.getItemDamage() == recipe.getKey().get(1)) + if(this.checkItem(ingredient, recipe.getKey())) + { + arecipes.add(new SimpleMachinePair(ingredient, item)); + } + } + } + + private boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } + + @Override + public void drawExtras(int recipe) + { + drawProgressBar(51, 25, 176, 0, 14, 14, 48, 7); + drawProgressBar(74, 23, 176, 14, 24, 16, 48, 0); + } + + private static Set excludedFuels() { + Set efuels = new HashSet(); + efuels.add(Item.getItemFromBlock(Blocks.brown_mushroom)); + efuels.add(Item.getItemFromBlock(Blocks.red_mushroom)); + efuels.add(Item.getItemFromBlock(Blocks.standing_sign)); + efuels.add(Item.getItemFromBlock(Blocks.wall_sign)); + efuels.add(Item.getItemFromBlock(Blocks.wooden_door)); + efuels.add(Item.getItemFromBlock(Blocks.trapped_chest)); + return efuels; + } + + private void findFuels() { + afuels = new ArrayList(); + Set efuels = excludedFuels(); + for (ItemStack item : ItemList.items) + if (!efuels.contains(item.getItem())) { + int burnTime = getFuelTime(item); + if (burnTime > 0) + afuels.add(new FuelPair(item.copy(), burnTime)); + } + } + + abstract Class getHandlerClass(); + abstract String getHandlerName(); + abstract RecipeSimpleMachine getRecipe(); + abstract String getGuiRecipeName(); + public abstract Class getGuiClass(); + abstract String getFuelHandlerName(); + abstract int getFuelTime(ItemStack item); + + @Override + public String getRecipeName() { + return I18n.format("nei."+getGuiRecipeName()); + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/AbstractSimpleRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/AbstractSimpleRecipeHandler.java new file mode 100644 index 0000000..d7be6bc --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/AbstractSimpleRecipeHandler.java @@ -0,0 +1,249 @@ +package shift.sextiarysector.nei; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map.Entry; +import java.util.Set; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import shift.sextiarysector.recipe.RecipeSimpleMachine; +import codechicken.nei.ItemList; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.TemplateRecipeHandler; + +public abstract class AbstractSimpleRecipeHandler extends TemplateSSRecipeHandler{ + + public class SimpleMachinePair extends CachedRecipe + { + public SimpleMachinePair(ItemStack ingred, ItemStack result) + { + ingred.stackSize = 1; + this.ingred = new PositionedStack(ingred, 51, 6); + this.result = new PositionedStack(result, 111, 24); + } + + public SimpleMachinePair(List ingred, ItemStack result) + { + for(int i = 0;i afuels; + + public PositionedStack getResult() { + return null; + } + + @Override + public String getOverlayIdentifier() { + return getHandlerName(); + } + + @Override + public void loadTransferRects() { + transferRects.add(new RecipeTransferRect(new Rectangle(50, 23, 18, 18), getFuelHandlerName())); + transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(74, 23, 24, 18), getHandlerName())); + } + + @Override + public TemplateRecipeHandler newInstance() { + if (afuels == null) + findFuels(); + return super.newInstance(); + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) + { + if(outputId.equals(getHandlerName()) && getClass() == getHandlerClass())//don't want subclasses getting a hold of this + { + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + + for(Entry recipe : recipes.entrySet()) + { + ItemStack item = recipe.getValue(); + if(OreDictionary.getOres(recipe.getKey()).size()>=1){ + arecipes.add(new SimpleMachinePair(OreDictionary.getOres(recipe.getKey()), item)); + } + + } + + if(metarecipes == null)return; + for(Entry recipe : metarecipes.entrySet()) + { + ItemStack item = recipe.getValue(); + arecipes.add(new SimpleMachinePair(recipe.getKey(), item)); + } + } + else + { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) + { + + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + for(Entry recipe : recipes.entrySet()) + { + ItemStack item = recipe.getValue(); + if(NEIServerUtils.areStacksSameType(item, result)) + { + if(OreDictionary.getOres(recipe.getKey()).size()>=1){ + arecipes.add(new SimpleMachinePair(OreDictionary.getOres(recipe.getKey()), item)); + } + + } + } + + if(metarecipes == null)return; + for(Entry recipe : metarecipes.entrySet()) + { + ItemStack item = recipe.getValue(); + if(NEIServerUtils.areStacksSameType(item, result)) + { + arecipes.add(new SimpleMachinePair(recipe.getKey(), item)); + } + } + } + + @Override + public void loadUsageRecipes(String inputId, Object... ingredients) { + if (inputId.equals(getFuelHandlerName()) && getClass() == getHandlerClass())//don't want subclasses getting a hold of this + loadCraftingRecipes(getHandlerName()); + else + super.loadUsageRecipes(inputId, ingredients); + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) + { + + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + for(Entry recipe : recipes.entrySet()) + { + ItemStack item = recipe.getValue(); + ArrayList items = OreDictionary.getOres(recipe.getKey()); + for(int i = 0; i< items.size() ; i++){ + if(this.checkItem(items.get(i),ingredient)){ + arecipes.add(new SimpleMachinePair(items, item)); + break; + } + } + } + + if(metarecipes == null)return; + for(Entry recipe : metarecipes.entrySet()) + { + ItemStack item = recipe.getValue(); + //if(ingredient.itemID == recipe.getKey().get(0) && ingredient.getItemDamage() == recipe.getKey().get(1)) + if(this.checkItem(ingredient, recipe.getKey())) + { + arecipes.add(new SimpleMachinePair(ingredient, item)); + } + } + } + + private boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } + + @Override + public void drawExtras(int recipe) + { + drawProgressBar(51, 25, 176, 0, 14, 14, 48, 7); + drawProgressBar(74, 23, 176, 14, 24, 16, 48, 0); + } + + private static Set excludedFuels() { + Set efuels = new HashSet(); + efuels.add(Item.getItemFromBlock(Blocks.brown_mushroom)); + efuels.add(Item.getItemFromBlock(Blocks.red_mushroom)); + efuels.add(Item.getItemFromBlock(Blocks.standing_sign)); + efuels.add(Item.getItemFromBlock(Blocks.wall_sign)); + efuels.add(Item.getItemFromBlock(Blocks.wooden_door)); + efuels.add(Item.getItemFromBlock(Blocks.trapped_chest)); + return efuels; + } + + private void findFuels() { + afuels = new ArrayList(); + Set efuels = excludedFuels(); + for (ItemStack item : ItemList.items) + if (!efuels.contains(item.getItem())) { + int burnTime = getFuelTime(item); + if (burnTime > 0) + afuels.add(new FuelPair(item.copy(), burnTime)); + } + } + + abstract Class getHandlerClass(); + abstract String getHandlerName(); + abstract RecipeSimpleMachine getRecipe(); + abstract String getGuiRecipeName(); + public abstract Class getGuiClass(); + abstract String getFuelHandlerName(); + abstract int getFuelTime(ItemStack item); + + @Override + public String getRecipeName() { + return I18n.format("nei."+getGuiRecipeName()); + } +} diff --git a/src/main/java/shift/sextiarysector/nei/ExtractorRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/ExtractorRecipeHandler.java new file mode 100644 index 0000000..2fffd91 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/ExtractorRecipeHandler.java @@ -0,0 +1,61 @@ +package shift.sextiarysector.nei; + +import static codechicken.lib.gui.GuiDraw.*; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraftforge.fluids.FluidContainerRegistry; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiExtractor; +import shift.sextiarysector.recipe.RecipeSimpleFluid; + +public class ExtractorRecipeHandler extends SimpleFluidRecipeHandler { + + @Override + Class getHandlerClass() { + return ExtractorRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_Extractor"; + } + + @Override + RecipeSimpleFluid getRecipe() { + return SSRecipes.extractor; + } + + @Override + String getGuiRecipeName() { + return "ss.extractor"; + } + + @Override + public Class getGuiClass() { + return GuiExtractor.class; + } + + @Override + int getMaxFluid() { + return FluidContainerRegistry.BUCKET_VOLUME * 10; + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/machine/extractor_nei.png"; + } + + @Override + public void drawExtras(int recipe) + { + //drawProgressBar(52, 25, 176, 0, 14, 14, 48, 7); + drawProgressBar(74, 23, 176, 14, 24, 16, 48, 0); + + if (((SimpleFluidPair) this.arecipes.get(recipe)).fluidStack != null) { + this.drawFluidTank(102, 4, ((SimpleFluidPair) this.arecipes.get(recipe)).fluidStack, 34, 36); + } + + changeTexture(getGuiTexture()); + drawTexturedModalRect(103, 6, 176, 31, 32, 36); + + } +} diff --git a/src/main/java/shift/sextiarysector/nei/FertilizerFarmlandRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/FertilizerFarmlandRecipeHandler.java new file mode 100644 index 0000000..e17df2d --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/FertilizerFarmlandRecipeHandler.java @@ -0,0 +1,39 @@ +package shift.sextiarysector.nei; + +import java.util.ArrayList; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import shift.sextiarysector.api.agriculture.IFertilizer; +import shift.sextiarysector.module.FertilizerManager; + +public class FertilizerFarmlandRecipeHandler extends FertilizerRecipeHandler{ + + public Class getHandlerClass(){ + return FertilizerFarmlandRecipeHandler.class; + } + public String getHandlerName(){ + return "SS_Fertilizer_Farmland"; + } + public ArrayList getRecipe(){ + return FertilizerManager.normal; + } + public String getGuiRecipeName(){ + return "ss.fertilizer_farmland"; + } + + public Class getGuiClass(){ + return null; + } + + @Override + public String getRecipeName() { + return I18n.format("nei."+getGuiRecipeName()); + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/fertilizer_farmland_nei.png"; + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/FertilizerPaddyRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/FertilizerPaddyRecipeHandler.java new file mode 100644 index 0000000..b8b2cb5 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/FertilizerPaddyRecipeHandler.java @@ -0,0 +1,38 @@ +package shift.sextiarysector.nei; + +import java.util.ArrayList; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.resources.I18n; +import shift.sextiarysector.api.agriculture.IFertilizer; +import shift.sextiarysector.module.FertilizerManager; + +public class FertilizerPaddyRecipeHandler extends FertilizerRecipeHandler{ + + public Class getHandlerClass(){ + return FertilizerPaddyRecipeHandler.class; + } + public String getHandlerName(){ + return "SS_Fertilizer_Paddy"; + } + public ArrayList getRecipe(){ + return FertilizerManager.paddy; + } + public String getGuiRecipeName(){ + return "ss.fertilizer_paddy"; + } + + public Class getGuiClass(){ + return null; + } + + @Override + public String getRecipeName() { + return I18n.format("nei."+getGuiRecipeName()); + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/fertilizer_paddy_nei.png"; + } +} diff --git a/src/main/java/shift/sextiarysector/nei/FertilizerRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/FertilizerRecipeHandler.java index f6b19da..7ff6bca 100644 --- a/src/main/java/shift/sextiarysector/nei/FertilizerRecipeHandler.java +++ b/src/main/java/shift/sextiarysector/nei/FertilizerRecipeHandler.java @@ -7,12 +7,11 @@ import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import shift.sextiarysector.api.agriculture.IFertilizer; -import shift.sextiarysector.module.FertilizerManager; import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.TemplateRecipeHandler; -public class FertilizerRecipeHandler extends TemplateSSRecipeHandler{ +public abstract class FertilizerRecipeHandler extends TemplateSSRecipeHandler{ public class FertilizerPair extends CachedRecipe { @@ -153,31 +152,18 @@ public void drawExtras(int recipe) drawProgressBar(74, 23, 176, 14, 24, 16, 48, 0); } - private Class getHandlerClass(){ - return FertilizerRecipeHandler.class; - } - private String getHandlerName(){ - return "SS_Fertilizer"; - } - private ArrayList getRecipe(){ - return FertilizerManager.fertilizers; - } - String getGuiRecipeName(){ - return "ss.fertilizer"; - } + public abstract Class getHandlerClass(); + public abstract String getHandlerName(); + public abstract ArrayList getRecipe(); + public abstract String getGuiRecipeName(); - public Class getGuiClass(){ - return null; - } + public abstract Class getGuiClass(); @Override public String getRecipeName() { return I18n.format("nei."+getGuiRecipeName()); } - @Override - public String getGuiTexture() { - return "sextiarysector:textures/guis/fertilizer_nei.png"; - } + public abstract String getGuiTexture(); } diff --git a/src/main/java/shift/sextiarysector/nei/FluidFurnaceRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/FluidFurnaceRecipeHandler.java new file mode 100644 index 0000000..866fd7e --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/FluidFurnaceRecipeHandler.java @@ -0,0 +1,46 @@ +package shift.sextiarysector.nei; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraftforge.fluids.FluidContainerRegistry; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiFluidFurnace; +import shift.sextiarysector.recipe.RecipeSimpleFluid; + +public class FluidFurnaceRecipeHandler extends SimpleFluidRecipeHandler{ + + @Override + Class getHandlerClass() { + return FluidFurnaceRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_FluidFurnace"; + } + + @Override + RecipeSimpleFluid getRecipe() { + return SSRecipes.fluidFurnace; + } + + @Override + String getGuiRecipeName() { + return "ss.fluid_furnace"; + } + + @Override + public Class getGuiClass() { + return GuiFluidFurnace.class; + } + + @Override + int getMaxFluid() { + return FluidContainerRegistry.BUCKET_VOLUME * 10; + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/fluid_furnace_nei.png"; + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/FoodSmokersRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/FoodSmokersRecipeHandler.java new file mode 100644 index 0000000..c728b2b --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/FoodSmokersRecipeHandler.java @@ -0,0 +1,45 @@ +package shift.sextiarysector.nei; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraftforge.fluids.FluidContainerRegistry; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiFoodSmokers; +import shift.sextiarysector.recipe.RecipeSimpleFluid; + +public class FoodSmokersRecipeHandler extends SimpleFluidRecipeHandler{ + + @Override + Class getHandlerClass() { + return FoodSmokersRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_FoodSmokers"; + } + + @Override + RecipeSimpleFluid getRecipe() { + return SSRecipes.foodSmokers; + } + + @Override + String getGuiRecipeName() { + return "ss.food_smokers"; + } + + @Override + public Class getGuiClass() { + return GuiFoodSmokers.class; + } + + @Override + int getMaxFluid() { + return FluidContainerRegistry.BUCKET_VOLUME * 10; + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/fluid_furnace_nei.png"; + } +} diff --git a/src/main/java/shift/sextiarysector/nei/FreezerRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/FreezerRecipeHandler.java new file mode 100644 index 0000000..f49a0d1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/FreezerRecipeHandler.java @@ -0,0 +1,52 @@ +package shift.sextiarysector.nei; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiFreezer; +import shift.sextiarysector.recipe.RecipeSimpleMachine; + +public class FreezerRecipeHandler extends AbstractSimple2RecipeHandler{ + + @Override + Class getHandlerClass() { + return FreezerRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_Freezer"; + } + + + @Override + RecipeSimpleMachine getRecipe() { + return SSRecipes.freezer; + } + + @Override + String getGuiRecipeName() { + return "ss.freezer"; + } + + @Override + public Class getGuiClass() { + return GuiFreezer.class; + } + + @Override + String getFuelHandlerName() { + return "SS_IceFuel"; + } + + @Override + int getFuelTime(ItemStack item) { + return SSRecipes.iceFuel.getResult(item); + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/freezer.png"; + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/IceFuelRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/IceFuelRecipeHandler.java new file mode 100644 index 0000000..442982a --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/IceFuelRecipeHandler.java @@ -0,0 +1,50 @@ +package shift.sextiarysector.nei; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiFreezer; +import shift.sextiarysector.recipe.RecipeSimpleMachine; + +public class IceFuelRecipeHandler extends AbstractFuel2RecipeHandler{ + + @Override + Class getFuelHandlerClass() { + return IceFuelRecipeHandler.class; + } + + @Override + RecipeSimpleMachine getRecipe() { + return SSRecipes.freezer; + } + + @Override + String getGuiRecipeName() { + return "ss.ice_fuel"; + } + + @Override + public Class getGuiClass() { + return GuiFreezer.class; + } + + @Override + String getFuelHandlerName() { + return "SS_IceFuel"; + } + + @Override + String getHandlerName() { + return "SS_Freezer"; + } + + @Override + int getFuelTime(ItemStack item) { + return SSRecipes.iceFuel.getResult(item); + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/freezer.png"; + } +} diff --git a/src/main/java/shift/sextiarysector/nei/MagicFuelRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/MagicFuelRecipeHandler.java new file mode 100644 index 0000000..6ca1581 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/MagicFuelRecipeHandler.java @@ -0,0 +1,50 @@ +package shift.sextiarysector.nei; + +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiMagicFurnace; +import shift.sextiarysector.recipe.RecipeSimpleMachine; + +public class MagicFuelRecipeHandler extends AbstractFuelRecipeHandler{ + + @Override + Class getFuelHandlerClass() { + return MagicFuelRecipeHandler.class; + } + + @Override + RecipeSimpleMachine getRecipe() { + return SSRecipes.magicFurnace; + } + + @Override + String getGuiRecipeName() { + return "ss.magic_fuel"; + } + + @Override + public Class getGuiClass() { + return GuiMagicFurnace.class; + } + + @Override + String getFuelHandlerName() { + return "SS_MagicFuel"; + } + + @Override + String getHandlerName() { + return "SS_MagicFurnace"; + } + + @Override + int getFuelTime(ItemStack item) { + return SSRecipes.magicFuel.getResult(item); + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/magic_furnace.png"; + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/MagicFurnaceRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/MagicFurnaceRecipeHandler.java new file mode 100644 index 0000000..d9f6fac --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/MagicFurnaceRecipeHandler.java @@ -0,0 +1,52 @@ +package shift.sextiarysector.nei; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiMagicFurnace; +import shift.sextiarysector.recipe.RecipeSimpleMachine; + +public class MagicFurnaceRecipeHandler extends AbstractSimpleRecipeHandler{ + + @Override + Class getHandlerClass() { + return MagicFurnaceRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_MagicFurnace"; + } + + + @Override + RecipeSimpleMachine getRecipe() { + return SSRecipes.magicFurnace; + } + + @Override + String getGuiRecipeName() { + return "ss.magic_furnace"; + } + + @Override + public Class getGuiClass() { + return GuiMagicFurnace.class; + } + + @Override + String getFuelHandlerName() { + return "SS_MagicFuel"; + } + + @Override + int getFuelTime(ItemStack item) { + return SSRecipes.magicFuel.getResult(item); + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/magic_furnace.png"; + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/ManaSqueezerRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/ManaSqueezerRecipeHandler.java new file mode 100644 index 0000000..d230c39 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/ManaSqueezerRecipeHandler.java @@ -0,0 +1,62 @@ +package shift.sextiarysector.nei; + +import static codechicken.lib.gui.GuiDraw.*; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraftforge.fluids.FluidContainerRegistry; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiManaSqueezer; +import shift.sextiarysector.recipe.RecipeSimpleFluid; + +public class ManaSqueezerRecipeHandler extends SimpleFluidRecipeHandler { + + @Override + Class getHandlerClass() { + return ManaSqueezerRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_ManaSqueezer"; + } + + @Override + RecipeSimpleFluid getRecipe() { + return SSRecipes.manaSqueezer; + } + + @Override + String getGuiRecipeName() { + return "ss.mana_squeezer"; + } + + @Override + public Class getGuiClass() { + return GuiManaSqueezer.class; + } + + @Override + int getMaxFluid() { + return FluidContainerRegistry.BUCKET_VOLUME * 10; + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/machine/mana_squeezer_nei.png"; + } + + @Override + public void drawExtras(int recipe) + { + //drawProgressBar(52, 25, 176, 0, 14, 14, 48, 7); + drawProgressBar(74, 23, 176, 14, 24, 16, 48, 0); + + if (((SimpleFluidPair) this.arecipes.get(recipe)).fluidStack != null) { + this.drawFluidTank(102, 4, ((SimpleFluidPair) this.arecipes.get(recipe)).fluidStack, 34, 36); + } + + changeTexture(getGuiTexture()); + drawTexturedModalRect(103, 6, 176, 31, 32, 36); + + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/NEIGuiTabsHandler.java b/src/main/java/shift/sextiarysector/nei/NEIGuiTabsHandler.java new file mode 100644 index 0000000..fd2a135 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/NEIGuiTabsHandler.java @@ -0,0 +1,73 @@ +package shift.sextiarysector.nei; + +import java.util.List; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.gui.tab.GuiNextButton; +import shift.sextiarysector.gui.tab.TabManager; +import codechicken.nei.VisiblityData; +import codechicken.nei.api.INEIGuiHandler; +import codechicken.nei.api.TaggedInventoryArea; + +public class NEIGuiTabsHandler implements INEIGuiHandler { + + @Override + public VisiblityData modifyVisiblity(GuiContainer gui, VisiblityData currentVisibility) + { + return currentVisibility; + } + + @Override + public Iterable getItemSpawnSlots(GuiContainer gui, ItemStack item) { + return null; + } + + @Override + public List getInventoryAreas(GuiContainer gui) + { + return null; + } + + @Override + public boolean handleDragNDrop(GuiContainer gui, int mousex, int mousey, ItemStack draggedStack, int button) + { + return false; + } + + @Override + public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int w, int h) + { + + if (TabManager.buttons == null) return false; + + List list = TabManager.buttons.get(); + + if (list == null) return false; + + GuiButton next = null; + + for (GuiButton button : list) { + if (button instanceof GuiNextButton) next = button; + } + + if (next == null) return false; + + int xw = x + w; + int yh = y + h; + + if (this.mousePressed(next, x, y)) return true; + if (this.mousePressed(next, xw, y)) return true; + if (this.mousePressed(next, x, yh)) return true; + if (this.mousePressed(next, xw, yh)) return true; + + return false; + } + + public boolean mousePressed(GuiButton p_146116_1_, int p_146116_2_, int p_146116_3_) + { + return p_146116_1_.enabled && p_146116_1_.visible && p_146116_2_ >= p_146116_1_.xPosition && p_146116_3_ >= p_146116_1_.yPosition && p_146116_2_ < p_146116_1_.xPosition + p_146116_1_.width && p_146116_3_ < p_146116_1_.yPosition + p_146116_1_.height; + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/NEISextiarySectorConfig.java b/src/main/java/shift/sextiarysector/nei/NEISextiarySectorConfig.java index 337f9d5..8c85b42 100644 --- a/src/main/java/shift/sextiarysector/nei/NEISextiarySectorConfig.java +++ b/src/main/java/shift/sextiarysector/nei/NEISextiarySectorConfig.java @@ -1,8 +1,19 @@ package shift.sextiarysector.nei; +import shift.sextiarysector.gui.GuiExtractor; +import shift.sextiarysector.gui.GuiFluidFurnace; +import shift.sextiarysector.gui.GuiFoodSmokers; +import shift.sextiarysector.gui.GuiFreezer; import shift.sextiarysector.gui.GuiLargeFurnace; import shift.sextiarysector.gui.GuiLoom; +import shift.sextiarysector.gui.GuiMagicFurnace; +import shift.sextiarysector.gui.GuiManaSqueezer; import shift.sextiarysector.gui.GuiMillstone; +import shift.sextiarysector.gui.GuiPulverizer; +import shift.sextiarysector.gui.GuiRollingMachine; +import shift.sextiarysector.gui.GuiSawmill; +import shift.sextiarysector.gui.GuiSpinningMachine; +import shift.sextiarysector.gui.GuiTimeMachine; import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; @@ -11,13 +22,33 @@ public class NEISextiarySectorConfig implements IConfigureNEI { @Override public void loadConfig() { - API.registerRecipeHandler(new MillstoneRecipeHandler()); API.registerUsageHandler(new MillstoneRecipeHandler()); API.registerRecipeHandler(new LoomRecipeHandler()); API.registerUsageHandler(new LoomRecipeHandler()); + API.registerRecipeHandler(new SawmillRecipeHandler()); + API.registerUsageHandler(new SawmillRecipeHandler()); + + API.registerRecipeHandler(new SpinningMachineRecipeHandler()); + API.registerUsageHandler(new SpinningMachineRecipeHandler()); + + API.registerRecipeHandler(new ExtractorRecipeHandler()); + API.registerUsageHandler(new ExtractorRecipeHandler()); + + API.registerRecipeHandler(new PulverizerRecipeHandler()); + API.registerUsageHandler(new PulverizerRecipeHandler()); + + API.registerRecipeHandler(new RollingMachineRecipeHandler()); + API.registerUsageHandler(new RollingMachineRecipeHandler()); + + API.registerRecipeHandler(new ManaSqueezerRecipeHandler()); + API.registerUsageHandler(new ManaSqueezerRecipeHandler()); + + API.registerRecipeHandler(new TimeMachineRecipeHandler()); + API.registerUsageHandler(new TimeMachineRecipeHandler()); + /* API.registerRecipeHandler(new LoomRecipeHandler()); API.registerUsageHandler(new LoomRecipeHandler()); @@ -31,9 +62,26 @@ public void loadConfig() { API.registerRecipeHandler(new FurnaceShapelessRecipeHandler()); API.registerUsageHandler(new FurnaceShapelessRecipeHandler()); + API.registerRecipeHandler(new FluidFurnaceRecipeHandler()); + API.registerUsageHandler(new FluidFurnaceRecipeHandler()); + API.registerRecipeHandler(new FoodSmokersRecipeHandler()); + API.registerUsageHandler(new FoodSmokersRecipeHandler()); + + API.registerRecipeHandler(new MagicFurnaceRecipeHandler()); + API.registerUsageHandler(new MagicFurnaceRecipeHandler()); + API.registerRecipeHandler(new MagicFuelRecipeHandler()); + API.registerUsageHandler(new MagicFuelRecipeHandler()); + + API.registerRecipeHandler(new FreezerRecipeHandler()); + API.registerUsageHandler(new FreezerRecipeHandler()); + API.registerRecipeHandler(new IceFuelRecipeHandler()); + API.registerUsageHandler(new IceFuelRecipeHandler()); - API.registerRecipeHandler(new FertilizerRecipeHandler()); - API.registerUsageHandler(new FertilizerRecipeHandler()); + API.registerRecipeHandler(new FertilizerFarmlandRecipeHandler()); + API.registerUsageHandler(new FertilizerFarmlandRecipeHandler()); + + API.registerRecipeHandler(new FertilizerPaddyRecipeHandler()); + API.registerUsageHandler(new FertilizerPaddyRecipeHandler()); /* API.registerRecipeHandler(new BrewingRecipeHandler()); @@ -49,10 +97,24 @@ public void loadConfig() { //API.registerGuiOverlay(GuiLoom.class, "SextiarySectorLoom"); API.registerGuiOverlay(GuiLargeFurnace.class, "furnaceCrafting"); + API.registerGuiOverlay(GuiFluidFurnace.class, "SS_FluidFurnace"); + API.registerGuiOverlay(GuiFoodSmokers.class, "SS_FoodSmokers"); + API.registerGuiOverlay(GuiMagicFurnace.class, "SS_MagicFurnace"); + API.registerGuiOverlay(GuiFreezer.class, "SS_Freezer"); + API.registerGuiOverlay(GuiMillstone.class, "SS_Millstone"); API.registerGuiOverlay(GuiLoom.class, "SS_Loom"); + API.registerGuiOverlay(GuiSawmill.class, "SS_Sawmill"); + API.registerGuiOverlay(GuiSpinningMachine.class, "SS_SpinningMachine"); + API.registerGuiOverlay(GuiExtractor.class, "SS_Extractor"); + API.registerGuiOverlay(GuiPulverizer.class, "SS_Pulverizer"); + API.registerGuiOverlay(GuiRollingMachine.class, "SS_RollingMachine"); + API.registerGuiOverlay(GuiManaSqueezer.class, "SS_ManaSqueezer"); + API.registerGuiOverlay(GuiTimeMachine.class, "SS_TimeMachine"); //API.registerGuiOverlay(GuiBrewingStand.class, "SextiarySectorBrewing"); + API.registerNEIGuiHandler(new NEIGuiTabsHandler()); + } @Override @@ -62,7 +124,7 @@ public String getName() { @Override public String getVersion() { - return "0.0.3"; + return "0.0.4"; } } diff --git a/src/main/java/shift/sextiarysector/nei/PulverizerRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/PulverizerRecipeHandler.java new file mode 100644 index 0000000..49016d0 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/PulverizerRecipeHandler.java @@ -0,0 +1,40 @@ +package shift.sextiarysector.nei; + +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiPulverizer; +import shift.sextiarysector.gui.GuiSimpleMachine; +import shift.sextiarysector.recipe.RecipeSimpleMachine; + +public class PulverizerRecipeHandler extends SimpleMachineRecipeHandler{ + + @Override + public Class getGuiClass() + { + return GuiPulverizer.class; + } + + @Override + Class getHandlerClass() { + return PulverizerRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_Pulverizer"; + } + + @Override + RecipeSimpleMachine getRecipe() { + return SSRecipes.pulverizer; + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/machine/pulverizer_nei.png"; + } + + @Override + String getGuiRecipeName() { + return "ss.pulverizer"; + } +} diff --git a/src/main/java/shift/sextiarysector/nei/RollingMachineRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/RollingMachineRecipeHandler.java new file mode 100644 index 0000000..129ac96 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/RollingMachineRecipeHandler.java @@ -0,0 +1,40 @@ +package shift.sextiarysector.nei; + +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiRollingMachine; +import shift.sextiarysector.gui.GuiSimpleMachine; +import shift.sextiarysector.recipe.RecipeSimpleMachine; + +public class RollingMachineRecipeHandler extends SimpleMachineRecipeHandler{ + + @Override + public Class getGuiClass() + { + return GuiRollingMachine.class; + } + + @Override + Class getHandlerClass() { + return RollingMachineRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_RollingMachine"; + } + + @Override + RecipeSimpleMachine getRecipe() { + return SSRecipes.rollingMachine; + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/machine/rolling_machine_nei.png"; + } + + @Override + String getGuiRecipeName() { + return "ss.rolling_machine"; + } +} diff --git a/src/main/java/shift/sextiarysector/nei/SawmillRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/SawmillRecipeHandler.java new file mode 100644 index 0000000..659bd09 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/SawmillRecipeHandler.java @@ -0,0 +1,41 @@ +package shift.sextiarysector.nei; + +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiSawmill; +import shift.sextiarysector.gui.GuiSimpleMachine; +import shift.sextiarysector.recipe.RecipeSimpleMachine; + +public class SawmillRecipeHandler extends SimpleMachineRecipeHandler{ + + @Override + public Class getGuiClass() + { + return GuiSawmill.class; + } + + @Override + Class getHandlerClass() { + return SawmillRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_Sawmill"; + } + + @Override + RecipeSimpleMachine getRecipe() { + return SSRecipes.sawmill; + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/machine/sawmill_nei.png"; + } + + @Override + String getGuiRecipeName() { + return "ss.sawmill"; + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/SimpleFluidRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/SimpleFluidRecipeHandler.java new file mode 100644 index 0000000..aa6244c --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/SimpleFluidRecipeHandler.java @@ -0,0 +1,323 @@ +package shift.sextiarysector.nei; + +import static codechicken.lib.gui.GuiDraw.*; + +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map.Entry; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.resources.I18n; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.recipe.RecipeSimpleFluid; +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.TemplateRecipeHandler; + +public abstract class SimpleFluidRecipeHandler extends TemplateSSRecipeHandler { + + public class SimpleFluidPair extends CachedRecipe + { + public SimpleFluidPair(ItemStack ingred, ItemStack result, FluidStack fluidStack) + { + ingred.stackSize = 1; + this.ingred = new PositionedStack(ingred, 51, 6); + if (result != null) this.result = new PositionedStack(result, 111 - 9, 24 + 18); + if (ingred.getItem().getContainerItem(ingred.copy()) != null) { + this.result2 = new PositionedStack(ingred.getItem().getContainerItem(ingred.copy()), 111 - 9 + 18, 24 + 18); + } + + this.fluidStack = fluidStack; + } + + public SimpleFluidPair(List ingred, ItemStack result, FluidStack fluidStack) + { + for (int i = 0; i < ingred.size(); i++) { + ingred.get(i).stackSize = 1; + } + //ingred.stackSize = 1; + this.ingred = new PositionedStack(ingred, 51, 6); + if (result != null) this.result = new PositionedStack(result, 111 - 9, 24 + 18); + for (ItemStack item : ingred) { + if (item.getItem().getContainerItem(item.copy()) != null) { + this.result2 = new PositionedStack(item.getItem().getContainerItem(item.copy()), 111 - 9 + 18, 24 + 18); + break; + } + } + this.fluidStack = fluidStack; + } + + @Override + public PositionedStack getIngredient() + { + int cycle = cycleticks / 48; + /* + if(ingred.item.getItemDamage() == -1) + { + PositionedStack stack = ingred.copy(); + int maxDamage = 0; + do + { + maxDamage++; + stack.item.setItemDamage(maxDamage); + } + while(NEIClientUtils.isValidItem(stack.item)); + + stack.item.setItemDamage(cycle % maxDamage); + return stack; + }*/ + + this.randomRenderPermutation(ingred, cycleticks / 20); + + return ingred; + } + + @Override + public PositionedStack getResult() + { + return result; + } + + @Override + public PositionedStack getOtherStack() { + return result2; + } + + /* + @Override + public PositionedStack getOtherStack() + { + return afuels.get((cycleticks/48) % afuels.size()).stack; + }*/ + + PositionedStack ingred; + PositionedStack result; + PositionedStack result2; + FluidStack fluidStack; + } + + public PositionedStack getResult() { + return null; + } + + @Override + public String getOverlayIdentifier() { + return getHandlerName(); + } + + @Override + public void loadTransferRects() { + transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(74, 23, 24, 18), getHandlerName())); + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) + { + if (outputId.equals(getHandlerName()) && getClass() == getHandlerClass())//don't want subclasses getting a hold of this + { + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + for (Entry recipe : recipes.entrySet()) + { + ItemStack item = (ItemStack) recipe.getValue()[0]; + if (OreDictionary.getOres(recipe.getKey()).size() >= 1) { + arecipes.add(new SimpleFluidPair(OreDictionary.getOres(recipe.getKey()), item, (FluidStack) recipe.getValue()[1])); + } + + } + + if (metarecipes == null) return; + for (Entry recipe : metarecipes.entrySet()) + { + ItemStack item = (ItemStack) recipe.getValue()[0]; + arecipes.add(new SimpleFluidPair(recipe.getKey(), item, (FluidStack) recipe.getValue()[1])); + } + } + else + { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) + { + + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + for (Entry recipe : recipes.entrySet()) + { + ItemStack item = (ItemStack) recipe.getValue()[0]; + if (NEIServerUtils.areStacksSameType(item, result)) + { + if (OreDictionary.getOres(recipe.getKey()).size() >= 1) { + arecipes.add(new SimpleFluidPair(OreDictionary.getOres(recipe.getKey()), item, (FluidStack) recipe.getValue()[1])); + } + + } + } + + if (metarecipes == null) return; + for (Entry recipe : metarecipes.entrySet()) + { + ItemStack item = (ItemStack) recipe.getValue()[0]; + if (NEIServerUtils.areStacksSameType(item, result)) + { + arecipes.add(new SimpleFluidPair(recipe.getKey(), item, (FluidStack) recipe.getValue()[1])); + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) + { + + HashMap recipes = (HashMap) getRecipe().getOreList(); + HashMap metarecipes = (HashMap) getRecipe().getMetaList(); + + /* + for (Entry recipe : recipes.entrySet()) + { + ItemStack item = (ItemStack) recipe.getValue()[0]; + ArrayList items = OreDictionary.getOres(recipe.getKey()); + for (int i = 0; i < items.size(); i++) { + if (this.checkItem(items.get(i), ingredient)) { + arecipes.add(new SimpleFluidPair(items, item, (FluidStack) recipe.getValue()[1])); + break; + } + } + }*/ + + for (String key : recipes.keySet()) { + ArrayList items = OreDictionary.getOres(key); + for (int i = 0; i < items.size(); i++) { + if (this.checkItem(ingredient, items.get(i))) { + arecipes.add(new SimpleFluidPair(items, (ItemStack) recipes.get(key)[0], (FluidStack) recipes.get(key)[1])); + break; + } + } + } + + if (metarecipes == null) return; + for (Entry recipe : metarecipes.entrySet()) + { + ItemStack item = (ItemStack) recipe.getValue()[0]; + //if(ingredient.itemID == recipe.getKey().get(0) && ingredient.getItemDamage() == recipe.getKey().get(1)) + if (this.checkItem(ingredient, recipe.getKey())) + { + arecipes.add(new SimpleFluidPair(ingredient, item, (FluidStack) recipe.getValue()[1])); + } + } + } + + private boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == OreDictionary.WILDCARD_VALUE || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } + + @Override + public void drawExtras(int recipe) + { + drawProgressBar(52, 25, 176, 0, 14, 14, 48, 7); + drawProgressBar(74, 23, 176, 14, 24, 16, 48, 0); + + if (((SimpleFluidPair) this.arecipes.get(recipe)).fluidStack != null) { + this.drawFluidTank(102, 4, ((SimpleFluidPair) this.arecipes.get(recipe)).fluidStack, 34, 36); + } + + changeTexture(getGuiTexture()); + drawTexturedModalRect(103, 6, 176, 31, 32, 36); + + } + + public void drawFluidTank(int x, int y, FluidStack fluidStack, int width, int height) { + + ResourceLocation r; + if (fluidStack.getFluid().getSpriteNumber() == 0) { + r = TextureMap.locationBlocksTexture; + } else { + r = TextureMap.locationItemsTexture; + } + + renderEngine.bindTexture(r); + this.setColor3ubFromInt(fluidStack.getFluid().getColor(fluidStack)); + + int widthR = width;//*(fluidTank.getFluidAmount()/fluidTank.getCapacity()); + int heightR = (int) (width * ((float) fluidStack.amount / (float) this.getMaxFluid())); + + int yR = y + (height - heightR); + + int widthL = 0; + int heightL = 0; + IIcon icon = (fluidStack.getFluid().getIcon(fluidStack)); + + for (int i = 0; i < widthR; i += 16) { + + for (int j = 0; j < heightR; j += 16) { + + widthL = Math.min(widthR - i, 16); + heightL = Math.min(heightR - j, 16); + gui.drawTexturedModelRectFromIcon(x + i, yR + j, icon, widthL, heightL); + + } + } + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F); + + } + + public static void setColor3ubFromInt(int color) { + + GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + + } + + @Override + public List drawTooltip(int recipe, int offsetx, int offsety, List currenttip) { + + if (((SimpleFluidPair) this.arecipes.get(recipe)).fluidStack == null) return currenttip; + + if (42 < offsety && offsety < 77 && 226 < offsetx && offsetx < 261) { + + FluidStack f = ((SimpleFluidPair) this.arecipes.get(recipe)).fluidStack; + + currenttip.add(f.getLocalizedName()); + currenttip.add(String.format("%1$,3d", f.amount) + " mB"); + + } + + return currenttip; + + } + + abstract Class getHandlerClass(); + + abstract String getHandlerName(); + + abstract RecipeSimpleFluid getRecipe(); + + abstract String getGuiRecipeName(); + + @Override + public abstract Class getGuiClass(); + + abstract int getMaxFluid(); + + @Override + public String getRecipeName() { + return I18n.format("nei." + getGuiRecipeName()); + } + +} diff --git a/src/main/java/shift/sextiarysector/nei/SpinningMachineRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/SpinningMachineRecipeHandler.java new file mode 100644 index 0000000..9177c67 --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/SpinningMachineRecipeHandler.java @@ -0,0 +1,40 @@ +package shift.sextiarysector.nei; + +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiSimpleMachine; +import shift.sextiarysector.gui.GuiSpinningMachine; +import shift.sextiarysector.recipe.RecipeSimpleMachine; + +public class SpinningMachineRecipeHandler extends SimpleMachineRecipeHandler { + + @Override + public Class getGuiClass() + { + return GuiSpinningMachine.class; + } + + @Override + Class getHandlerClass() { + return SpinningMachineRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_SpinningMachine"; + } + + @Override + RecipeSimpleMachine getRecipe() { + return SSRecipes.spinning_machine; + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/machine/spinning_machine_nei.png"; + } + + @Override + String getGuiRecipeName() { + return "ss.spinning_machine"; + } +} diff --git a/src/main/java/shift/sextiarysector/nei/TemplateSSRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/TemplateSSRecipeHandler.java index a08aa6a..a9614f7 100644 --- a/src/main/java/shift/sextiarysector/nei/TemplateSSRecipeHandler.java +++ b/src/main/java/shift/sextiarysector/nei/TemplateSSRecipeHandler.java @@ -1,9 +1,11 @@ package shift.sextiarysector.nei; +import java.awt.Point; import java.util.List; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.resources.I18n; +import codechicken.lib.gui.GuiDraw; import codechicken.nei.guihook.GuiContainerManager; import codechicken.nei.guihook.IContainerInputHandler; import codechicken.nei.guihook.IContainerTooltipHandler; @@ -43,6 +45,12 @@ public List handleTooltip(GuiRecipe gui, List currenttip, int re List s =super.handleTooltip(gui, currenttip, recipe); + formatRecipe(s); + + Point mousepos = GuiDraw.getMousePosition(); + Point offset = gui.getRecipePosition(recipe); + this.drawTooltip(recipe, mousepos.x - offset.x, mousepos.y - offset.y, s); + return formatRecipe(s); } @@ -64,4 +72,9 @@ private static List formatRecipe(List currenttip){ } + //繝繝シ繝ォ繝√ャ繝礼畑縺ョ繝。繧ス繝繝 + public List drawTooltip(int recipe, int offsetx, int offsety, List currenttip){ + return currenttip; + } + } diff --git a/src/main/java/shift/sextiarysector/nei/TimeMachineRecipeHandler.java b/src/main/java/shift/sextiarysector/nei/TimeMachineRecipeHandler.java new file mode 100644 index 0000000..55e7e2a --- /dev/null +++ b/src/main/java/shift/sextiarysector/nei/TimeMachineRecipeHandler.java @@ -0,0 +1,40 @@ +package shift.sextiarysector.nei; + +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.gui.GuiSimpleMachine; +import shift.sextiarysector.gui.GuiTimeMachine; +import shift.sextiarysector.recipe.RecipeSimpleMachine; + +public class TimeMachineRecipeHandler extends SimpleMachineRecipeHandler{ + + @Override + public Class getGuiClass() + { + return GuiTimeMachine.class; + } + + @Override + Class getHandlerClass() { + return TimeMachineRecipeHandler.class; + } + + @Override + String getHandlerName() { + return "SS_TimeMachine"; + } + + @Override + RecipeSimpleMachine getRecipe() { + return SSRecipes.timeMachine; + } + + @Override + public String getGuiTexture() { + return "sextiarysector:textures/guis/machine/time_machine_nei.png"; + } + + @Override + String getGuiRecipeName() { + return "ss.time_machine"; + } +} diff --git a/src/main/java/shift/sextiarysector/packet/MessageGuiId.java b/src/main/java/shift/sextiarysector/packet/MessageGuiId.java new file mode 100644 index 0000000..018e0c8 --- /dev/null +++ b/src/main/java/shift/sextiarysector/packet/MessageGuiId.java @@ -0,0 +1,29 @@ +package shift.sextiarysector.packet; + +import net.minecraft.entity.player.EntityPlayerMP; +import shift.sextiarysector.SextiarySector; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; + +public class MessageGuiId implements IMessageHandler{ + + @Override + public IMessage onMessage(PacketGuiId message, MessageContext ctx) { + + EntityPlayerMP p = ctx.getServerHandler().playerEntity; + + //CustomPlayerData data = EntityPlayerManager.getCustomPlayerData(p); + + //data.loadNBTData(message.getData()); + + //System.out.println("AAAAA" + message.getData().getInteger("gui")); + + int i = message.getData().getInteger("gui"); + + p.openGui(SextiarySector.instance, i, p.worldObj, (int)p.posX, (int)p.posY, (int)p.posZ); + + return null; + + } +} diff --git a/src/main/java/shift/sextiarysector/packet/PacketGuiId.java b/src/main/java/shift/sextiarysector/packet/PacketGuiId.java new file mode 100644 index 0000000..02753cf --- /dev/null +++ b/src/main/java/shift/sextiarysector/packet/PacketGuiId.java @@ -0,0 +1,42 @@ +package shift.sextiarysector.packet; + +import io.netty.buffer.ByteBuf; +import net.minecraft.nbt.NBTTagCompound; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; + +public class PacketGuiId implements IMessage{ + + private NBTTagCompound data; + + public PacketGuiId(){ + + } + + public PacketGuiId(int id) { + + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("gui", id); + this.setData(nbt); + + } + + @Override + public void fromBytes(ByteBuf buf) { + setData(ByteBufUtils.readTag(buf)); + } + + @Override + public void toBytes(ByteBuf buf) { + ByteBufUtils.writeTag(buf, getData()); + } + + public NBTTagCompound getData() { + return data; + } + + public void setData(NBTTagCompound data) { + this.data = data; + } + +} diff --git a/src/main/java/shift/sextiarysector/packet/PacketHandler.java b/src/main/java/shift/sextiarysector/packet/SSPacketHandler.java similarity index 87% rename from src/main/java/shift/sextiarysector/packet/PacketHandler.java rename to src/main/java/shift/sextiarysector/packet/SSPacketHandler.java index eee9d45..bfb887d 100644 --- a/src/main/java/shift/sextiarysector/packet/PacketHandler.java +++ b/src/main/java/shift/sextiarysector/packet/SSPacketHandler.java @@ -5,7 +5,7 @@ import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; -public class PacketHandler { +public class SSPacketHandler { public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE.newSimpleChannel("sextiarysector"); @@ -16,6 +16,7 @@ public static void init(FMLPreInitializationEvent event) { */ INSTANCE.registerMessage(MessagePlayer.class,PacketPlayerData.class, 0, Side.CLIENT); + INSTANCE.registerMessage(MessageGuiId.class,PacketGuiId.class, 1, Side.SERVER); } diff --git a/src/main/java/shift/sextiarysector/player/CustomPlayerData.java b/src/main/java/shift/sextiarysector/player/CustomPlayerData.java index 0dc42bd..63d356a 100644 --- a/src/main/java/shift/sextiarysector/player/CustomPlayerData.java +++ b/src/main/java/shift/sextiarysector/player/CustomPlayerData.java @@ -6,32 +6,40 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.IExtendedEntityProperties; -import shift.sextiarysector.packet.PacketHandler; import shift.sextiarysector.packet.PacketPlayerData; +import shift.sextiarysector.packet.SSPacketHandler; -public class CustomPlayerData implements IExtendedEntityProperties{ +public class CustomPlayerData implements IExtendedEntityProperties { /** 豌エ蛻 */ - private MoistureStats moisture ; + private MoistureStats moisture; /** 繧ケ繧ソ繝溘リ */ private StaminaStats stamina; + /**陬蛯**/ + private EquipmentStats equipment; + + /**蜃コ闕キ邂ア */ + private ShippingBoxStats shippingBox; + + //@SideOnly(Side.CLIENT) + //private TabStats tab; public void onUpdateEntity(EntityPlayer entityPlayer) - { + { - if(moisture.isPacket()||stamina.isPacket()){ - PacketHandler.INSTANCE.sendTo(new PacketPlayerData(this), (EntityPlayerMP) entityPlayer); + if (moisture.isPacket() || stamina.isPacket()) { + SSPacketHandler.INSTANCE.sendTo(new PacketPlayerData(this), (EntityPlayerMP) entityPlayer); //.out.println("onUpdateEntity"); } - //System.out.println("AAA"+this.moisture.getMoistureLevel()+" : "+this.stamina.getStaminaLevel()); - this.moisture.onUpdate(entityPlayer); this.stamina.onUpdate(entityPlayer); + this.equipment.onUpdate(entityPlayer); + this.shippingBox.onUpdate(entityPlayer); - } + } @Override public void saveNBTData(NBTTagCompound compound) { @@ -40,6 +48,10 @@ public void saveNBTData(NBTTagCompound compound) { this.stamina.writeNBT(compound); + this.equipment.writeNBT(compound); + + this.shippingBox.writeNBT(compound); + } @Override @@ -47,16 +59,26 @@ public void loadNBTData(NBTTagCompound compound) { this.moisture.readNBT(compound); - this.moisture.readNBT(compound); + this.stamina.readNBT(compound); + + this.equipment.readNBT(compound); + + this.shippingBox.readNBT(compound); } @Override public void init(Entity entity, World world) { - this.moisture = new MoistureStats(); + if (this.moisture == null) this.moisture = new MoistureStats(); + + if (this.stamina == null) this.stamina = new StaminaStats(); + + if (this.equipment == null) this.equipment = new EquipmentStats(); - this.stamina = new StaminaStats(); + if (this.shippingBox == null) this.shippingBox = new ShippingBoxStats(); + + //this.tab = new TabStats(); } @@ -76,6 +98,38 @@ private void setStamina(StaminaStats stamina) { this.stamina = stamina; } + public EquipmentStats getEquipmentStats() { + return equipment; + } + + public void setEquipmentStats(EquipmentStats e) { + this.equipment = e; + } + + public ShippingBoxStats getShippingBoxStats() { + return shippingBox; + } + + public void setShippingBoxStats(ShippingBoxStats s) { + this.shippingBox = s; + } + + //@SideOnly(Side.CLIENT) + //public void setTabList(ArrayList tabList){ + // tab.setTabList(tabList); + //} + + //@SideOnly(Side.CLIENT) + //public ArrayList getTabList(){ + // return tab.getTabList(); + //} + + //public void setSelectPage(int i){ + // tab.selectPage = i; + //} + ///public int getSelectPage(){ + // return tab.selectPage; + //} } diff --git a/src/main/java/shift/sextiarysector/player/EntityPlayerManager.java b/src/main/java/shift/sextiarysector/player/EntityPlayerManager.java index fc52029..0301e3e 100644 --- a/src/main/java/shift/sextiarysector/player/EntityPlayerManager.java +++ b/src/main/java/shift/sextiarysector/player/EntityPlayerManager.java @@ -2,17 +2,19 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.event.entity.EntityEvent; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; +import net.minecraftforge.event.entity.player.PlayerDropsEvent; +import shift.sextiarysector.SSAchievement; import shift.sextiarysector.api.IPlayerManager; -import shift.sextiarysector.packet.PacketHandler; import shift.sextiarysector.packet.PacketPlayerData; +import shift.sextiarysector.packet.SSPacketHandler; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; - -public class EntityPlayerManager implements IPlayerManager{//implements {//IPlayerTracker{ +public class EntityPlayerManager implements IPlayerManager {//implements {//IPlayerTracker{ //@SideOnly(Side.CLIENT) //public static Minecraft mc = FMLClientHandler.instance().getClient(); @@ -22,7 +24,7 @@ public class EntityPlayerManager implements IPlayerManager{//implements {//IPla private final static int MAX_MOISTURE_LEVEL = 20; private final static int MAX_PREVMOISTURE_LEVEL = 20; - private final static int MAX_STAMINA_LEVEL = 1000; + private final static int MAX_STAMINA_LEVEL = 100; private final static int MAX_PREV_STAMINA_LEVEL = 20; /* @@ -39,43 +41,55 @@ public class EntityPlayerManager implements IPlayerManager{//implements {//IPla public static EntityPlayerManager instance = new EntityPlayerManager(); - private EntityPlayerManager(){ + private EntityPlayerManager() { } @Override public void addMoistureStats(EntityPlayer entityPlayer, int par1, float par2) { if (!entityPlayer.worldObj.isRemote) - { + { getMoistureStats(entityPlayer).addStats(par1, par2); - } + //Achievement + entityPlayer.addStat(SSAchievement.moisture, 1); + } } @Override public void addStaminaStats(EntityPlayer entityPlayer, int par1, float par2) { if (!entityPlayer.worldObj.isRemote) - { + { getStaminaStats(entityPlayer).addStats(par1, par2); - } + } } @Override - public void addMoistureExhaustion(EntityPlayer entityPlayer,float par1) - { + public void addMoistureExhaustion(EntityPlayer entityPlayer, float par1) + { if (!entityPlayer.worldObj.isRemote) - { + { getMoistureStats(entityPlayer).addExhaustion(par1); - } - } + } + } @Override - public void addStaminaExhaustion(EntityPlayer entityPlayer,float par1) - { + public void addStaminaExhaustion(EntityPlayer entityPlayer, float par1) + { if (!entityPlayer.worldObj.isRemote) - { + { getStaminaStats(entityPlayer).addExhaustion(par1); - } - } + } + } + + @Override + public int getMoistureLevel(EntityPlayer entityPlayer) { + return getMoistureStats(entityPlayer).getMoistureLevel(); + } + + @Override + public int getStaminaLevel(EntityPlayer entityPlayer) { + return getStaminaStats(entityPlayer).getStaminaLevel(); + } //隗ヲ繧峨↑縺 @@ -83,7 +97,7 @@ public void addStaminaExhaustion(EntityPlayer entityPlayer,float par1) @SubscribeEvent public void LivingUpdateEvent(LivingUpdateEvent event) { - if(!event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer){ + if (!event.entityLiving.worldObj.isRemote && event.entityLiving instanceof EntityPlayer) { onUpdateEntity((EntityPlayer) event.entityLiving); @@ -92,8 +106,7 @@ public void LivingUpdateEvent(LivingUpdateEvent event) } public static void onUpdateEntity(EntityPlayer entityPlayer) - { - + { getCustomPlayerData(entityPlayer).onUpdateEntity(entityPlayer); @@ -140,7 +153,7 @@ public static void onUpdateEntity(EntityPlayer entityPlayer) if (lM != m.getMoistureLevel() || m.getSaturationLevel() == 0.0F != wM || lS != s.getStaminaLevel() || s.getSaturationLevel() == 0.0F != wS) - { + { entityPlayer.playerNetServerHandler.sendPacketToPlayer(getPacketUpdate(m.getMoistureLevel(),m.getSaturationLevel(),s.getStaminaLevel(),s.getSaturationLevel())); lastMoistureLevel.put(name, m.getMoistureLevel()); lastStaminaLevel.put(name, s.getStaminaLevel()); @@ -151,34 +164,78 @@ public static void onUpdateEntity(EntityPlayer entityPlayer) m.writeNBT(nbt); s.writeNBT(nbt); - }*/ + }*/ + + } + + @SubscribeEvent + public void onPlayerDropsEvent(PlayerDropsEvent event) + { + if (!event.entityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + this.getCustomPlayerData(event.entityPlayer).getEquipmentStats().inventory.dropAllItems(event.entityPlayer); + } + + } + + @SubscribeEvent + public void onPlayerCloneEvent(net.minecraftforge.event.entity.player.PlayerEvent.Clone event) + { + + if (!event.wasDeath) { + + EntityPlayer old = event.original; + + EquipmentStats e = this.getEquipmentStats(old); + NBTTagCompound nbt = new NBTTagCompound(); + e.writeNBT(nbt); + + EquipmentStats eNew = this.getEquipmentStats(event.entityPlayer); + eNew.readNBT(nbt); - } + //this.getCustomPlayerData(event.entityPlayer).setEquipmentStats(e); + + ShippingBoxStats s = this.getShippingBoxStats(old); + NBTTagCompound nbtS = new NBTTagCompound(); + s.writeNBT(nbtS); + + ShippingBoxStats sNew = this.getShippingBoxStats(event.entityPlayer); + sNew.readNBT(nbtS); + + return; + } - private void oneton(){ + if (event.entityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + this.getCustomPlayerData(event.entityPlayer).setEquipmentStats(this.getEquipmentStats(event.original)); + + } + + this.getCustomPlayerData(event.entityPlayer).setShippingBoxStats(this.getShippingBoxStats(event.original)); } + private void oneton() { + + } /** Player縺ョ繝繝シ繧ソ縺ョ逋サ骭イ*/ @SubscribeEvent - public void onEntityConstructing(EntityEvent.EntityConstructing event) { - if (event.entity instanceof EntityPlayer) { - EntityPlayerManager.register((EntityPlayer)event.entity); - } - } + public void onEntityConstructing(EntityEvent.EntityConstructing event) { + if (event.entity instanceof EntityPlayer) { + EntityPlayerManager.register((EntityPlayer) event.entity); + } + } - public static void register(EntityPlayer entityPlayer){ + public static void register(EntityPlayer entityPlayer) { entityPlayer.registerExtendedProperties(kye, new CustomPlayerData()); } - public static CustomPlayerData getCustomPlayerData(EntityPlayer entityPlayer){ + public static CustomPlayerData getCustomPlayerData(EntityPlayer entityPlayer) { return (CustomPlayerData) entityPlayer.getExtendedProperties(kye); } public static MoistureStats getMoistureStats(EntityPlayer entityPlayer) - { + { return getCustomPlayerData(entityPlayer).getMoisture(); /* @@ -192,10 +249,10 @@ public static MoistureStats getMoistureStats(EntityPlayer entityPlayer) return moistureMap.get(name); }*/ - } + } public static StaminaStats getStaminaStats(EntityPlayer entityPlayer) - { + { return getCustomPlayerData(entityPlayer).getStamina(); @@ -210,7 +267,15 @@ public static StaminaStats getStaminaStats(EntityPlayer entityPlayer) return staminaMap.get(name); }*/ - } + } + + public static EquipmentStats getEquipmentStats(EntityPlayer entityPlayer) { + return getCustomPlayerData(entityPlayer).getEquipmentStats(); + } + + public static ShippingBoxStats getShippingBoxStats(EntityPlayer entityPlayer) { + return getCustomPlayerData(entityPlayer).getShippingBoxStats(); + } //繝代こ繝繝育畑 /* @@ -278,21 +343,21 @@ public static Packet getPacketUpdate(int m,float f,int s,float g) }*/ //GUI逕ィ - public static int getPrevMoistureLevel(EntityPlayer entityPlayer) - { + public static int getPrevMoistureLevel(EntityPlayer entityPlayer) + { - return getMoistureStats(entityPlayer).getMoistureLevel()/(MAX_MOISTURE_LEVEL/MAX_PREVMOISTURE_LEVEL); + return getMoistureStats(entityPlayer).getMoistureLevel() / (MAX_MOISTURE_LEVEL / MAX_PREVMOISTURE_LEVEL); - } + } - public static int getPrevStaminaLevel(EntityPlayer entityPlayer) - { + public static int getPrevStaminaLevel(EntityPlayer entityPlayer) + { - return getStaminaStats(entityPlayer).getStaminaLevel()/(MAX_STAMINA_LEVEL/MAX_PREV_STAMINA_LEVEL); + return getStaminaStats(entityPlayer).getStaminaLevel() / (MAX_STAMINA_LEVEL / MAX_PREV_STAMINA_LEVEL); - } + } - /* + /* @Override public void onPlayerLogin(EntityPlayer player){ //繝励Ξ繧、繝、繝シ縺後Ο繧ー繧、繝ウ縺励◆譎ゅョ蜃ヲ逅 @@ -341,32 +406,32 @@ public void onPlayerLogout(EntityPlayer player) { } -*/ + */ - @SubscribeEvent + @SubscribeEvent /* 繝ッ繝シ繝ォ繝峨↓蜈・縺」縺滓凾縺ォ蜻シ縺ー繧後k繧、繝吶Φ繝医 */ public void onEntityJoinWorld(EntityJoinWorldEvent event) { if (!event.entity.worldObj.isRemote && event.entity instanceof EntityPlayer) { - PacketHandler.INSTANCE.sendTo(new PacketPlayerData(this.getCustomPlayerData((EntityPlayer) event.entity)), (EntityPlayerMP) event.entity); + SSPacketHandler.INSTANCE.sendTo(new PacketPlayerData(this.getCustomPlayerData((EntityPlayer) event.entity)), (EntityPlayerMP) event.entity); } } - @SubscribeEvent + @SubscribeEvent public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event) { //繝励Ξ繧、繝、繝シ縺後ョ繧」繝。繝ウ繧キ繝ァ繝ウ髢薙r遘サ蜍輔@縺溘→縺阪ョ蜃ヲ逅 - if(!event.player.worldObj.isRemote)PacketHandler.INSTANCE.sendTo(new PacketPlayerData(this.getCustomPlayerData(event.player)), (EntityPlayerMP) event.player); + if (!event.player.worldObj.isRemote) SSPacketHandler.INSTANCE.sendTo(new PacketPlayerData(this.getCustomPlayerData(event.player)), (EntityPlayerMP) event.player); } - @SubscribeEvent + @SubscribeEvent public void onPlayerRespawn(PlayerEvent.PlayerRespawnEvent event) { //繝励Ξ繧、繝、繝シ縺後Μ繧ケ繝昴シ繝ウ縺励◆譎ゅョ蜃ヲ逅 - //System.out.println("onPlayerRespawn"); - if(!event.player.worldObj.isRemote)PacketHandler.INSTANCE.sendTo(new PacketPlayerData(this.getCustomPlayerData(event.player)), (EntityPlayerMP) event.player); + //System.out.println("onPlayerRespawn"); + if (!event.player.worldObj.isRemote) SSPacketHandler.INSTANCE.sendTo(new PacketPlayerData(this.getCustomPlayerData(event.player)), (EntityPlayerMP) event.player); } diff --git a/src/main/java/shift/sextiarysector/player/EquipmentStats.java b/src/main/java/shift/sextiarysector/player/EquipmentStats.java new file mode 100644 index 0000000..beaba43 --- /dev/null +++ b/src/main/java/shift/sextiarysector/player/EquipmentStats.java @@ -0,0 +1,54 @@ +package shift.sextiarysector.player; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.api.equipment.IEquipment; +import shift.sextiarysector.container.InventoryPlayerNext; + +public class EquipmentStats { + + public final String NBT_ID = "ssequipment"; + + public InventoryPlayerNext inventory; + + public EquipmentStats() { + + inventory = new InventoryPlayerNext(); + + } + + public void onUpdate(EntityPlayer entityPlayer) { + + for (int i = 0; i < inventory.getSizeInventory(); i++) { + + if (inventory.getStackInSlot(i) == null) continue; + if (!(inventory.getStackInSlot(i).getItem() instanceof IEquipment)) continue; + + IEquipment e = (IEquipment) inventory.getStackInSlot(i).getItem(); + + e.onUpdate(EquipmentType.getEquipmentTypeFromSlot(i), inventory.getStackInSlot(i), entityPlayer.worldObj, entityPlayer, i); + + } + + } + + public void writeNBT(NBTTagCompound compound) { + + NBTTagCompound nbt = new NBTTagCompound(); + + inventory.writeToNBT(nbt); + + compound.setTag(NBT_ID, nbt); + + } + + public void readNBT(NBTTagCompound compound) { + + if (compound.hasKey(NBT_ID)) { + inventory.readFromNBT(compound.getCompoundTag(NBT_ID)); + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/player/MoistureStats.java b/src/main/java/shift/sextiarysector/player/MoistureStats.java index eea85ff..eb00b0a 100644 --- a/src/main/java/shift/sextiarysector/player/MoistureStats.java +++ b/src/main/java/shift/sextiarysector/player/MoistureStats.java @@ -2,8 +2,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; import net.minecraft.world.EnumDifficulty; +import shift.sextiarysector.Config; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -11,198 +11,197 @@ public class MoistureStats { //豌エ蛻 /** 豌エ蛻 */ - private int moistureLevel = 20; - private final static int MAX_STAMINA_LEVEL = 20; + private int moistureLevel = 20; + private final static int MAX_STAMINA_LEVEL = 20; private final static int MAX_PREV_STAMINA_LEVEL = 20; - /** 髫縺玲ーエ蛻繧イ繝シ繧ク */ - private float moistureSaturationLevel = 5.0F; - - //Packet逕ィ - private int lastMoistureLevel = 20 ; - private float lastSaturationLevel = 0; - - /** 蝟峨ョ貂縺阪Ξ繝吶Ν 縺薙l縺悟「励∴繧九→豌エ蛻繧イ繝シ繧ク縺梧ク帙k */ - private float moistureExhaustionLevel; - - /** The player's food timer value. */ - private int moistureTimer; - private int prevMoistureLevel = 20; - - /** - * Args: int foodLevel, float foodSaturationModifier - */ - public void addStats(int par1, float par2) - { - this.moistureLevel = Math.min(par1 + this.moistureLevel, 20); - this.moistureSaturationLevel = Math.min(Math.min(this.moistureSaturationLevel + par2, this.moistureLevel),MAX_PREV_STAMINA_LEVEL); - } - - /** - * Handles the food game logic. - */ - public void onUpdate(EntityPlayer par1EntityPlayer) - { - EnumDifficulty i = par1EntityPlayer.worldObj.difficultySetting; - this.prevMoistureLevel = this.moistureLevel; - - if (this.moistureExhaustionLevel > 4.0F) - { - this.moistureExhaustionLevel -= 4.0F; - - if (this.moistureSaturationLevel > 0.0F) - { - this.moistureSaturationLevel = Math.max(this.moistureSaturationLevel - 1.0F, 0.0F); - } - else if (i.getDifficultyId() > 0) - { - this.moistureLevel = Math.max(this.moistureLevel - 1, 0); - } - } - - if (par1EntityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.moistureLevel >= 18 && par1EntityPlayer.shouldHeal()) - { - ++this.moistureTimer; - - if (this.moistureTimer >= 80) - { - par1EntityPlayer.heal(1.0F); - this.addExhaustion(3.0F); - this.moistureTimer = 0; - } - } - else if (this.moistureLevel <= 0) - { - ++this.moistureTimer; - - if (this.moistureTimer >= 80) - { - if (par1EntityPlayer.getHealth() > 10.0F || i.getDifficultyId() >= 3 || par1EntityPlayer.getHealth() > 1.0F && i.getDifficultyId() >= 2) - { - par1EntityPlayer.attackEntityFrom(DamageSource.starve, 1.0F); - } - - this.moistureTimer = 0; - } - } - else - { - this.moistureTimer = 0; - } - } - - /** - * Reads food stats from an NBT object. - */ - public void readNBT(NBTTagCompound par1NBTTagCompound) - { - if (par1NBTTagCompound.hasKey("moisturelevel")) - { - this.moistureLevel = par1NBTTagCompound.getInteger("moisturelevel"); - this.moistureTimer = par1NBTTagCompound.getInteger("moistureticktimer"); - this.moistureSaturationLevel = par1NBTTagCompound.getFloat("moisturesaturationlevel"); - this.moistureExhaustionLevel = par1NBTTagCompound.getFloat("moistureexhaustionlevel"); - } - } - - /** - * Writes food stats to an NBT object. - */ - public void writeNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setInteger("moisturelevel", this.moistureLevel); - par1NBTTagCompound.setInteger("moistureticktimer", this.moistureTimer); - par1NBTTagCompound.setFloat("moisturesaturationlevel", this.moistureSaturationLevel); - par1NBTTagCompound.setFloat("moistureexhaustionlevel", this.moistureExhaustionLevel); - } - - public boolean isPacket(){ - - boolean flag = false; - - if(this.moistureLevel!=this.lastMoistureLevel){ - flag= true; - this.lastMoistureLevel=this.moistureLevel; - } - - if(this.moistureSaturationLevel!=this.lastSaturationLevel){ - - flag=true; - this.lastSaturationLevel=this.moistureSaturationLevel; - - } + /** 髫縺玲ーエ蛻繧イ繝シ繧ク */ + private float moistureSaturationLevel = 5.0F; + + //Packet逕ィ + private int lastMoistureLevel = 20; + private float lastSaturationLevel = 0; + + /** 蝟峨ョ貂縺阪Ξ繝吶Ν 縺薙l縺悟「励∴繧九→豌エ蛻繧イ繝シ繧ク縺梧ク帙k */ + private float moistureExhaustionLevel; + + /** The player's food timer value. */ + private int moistureTimer; + private int prevMoistureLevel = 20; + + /** + * Args: int foodLevel, float foodSaturationModifier + */ + public void addStats(int par1, float par2) + { + this.moistureLevel = Math.min(par1 + this.moistureLevel, 20); + this.moistureSaturationLevel = Math.min(Math.min(this.moistureSaturationLevel + par2, this.moistureLevel), MAX_PREV_STAMINA_LEVEL); + } + + /** + * Handles the food game logic. + */ + public void onUpdate(EntityPlayer par1EntityPlayer) + { + EnumDifficulty i = par1EntityPlayer.worldObj.difficultySetting; + this.prevMoistureLevel = this.moistureLevel; + + if (this.moistureExhaustionLevel > 4.0F) + { + this.moistureExhaustionLevel -= 4.0F; + + if (this.moistureSaturationLevel > 0.0F) + { + this.moistureSaturationLevel = Math.max(this.moistureSaturationLevel - 1.0F, 0.0F); + } + else if (i.getDifficultyId() > 0 || Config.peacefulMoisture) + { + this.moistureLevel = Math.max(this.moistureLevel - 1, 0); + } + } + + if (par1EntityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.moistureLevel >= 18 && par1EntityPlayer.shouldHeal()) + { + ++this.moistureTimer; + + if (this.moistureTimer >= 160) + { + par1EntityPlayer.heal(1.0F); + this.addExhaustion(3.0F); + this.moistureTimer = 0; + } + } + else if (this.moistureLevel <= 0) + { + ++this.moistureTimer; + + if (this.moistureTimer >= 80) + { + if (par1EntityPlayer.getHealth() > 10.0F || i.getDifficultyId() >= 3 || par1EntityPlayer.getHealth() > 1.0F && i.getDifficultyId() >= 2) + { + //par1EntityPlayer.attackEntityFrom(DamageSource.starve, 1.0F); + } + + this.moistureTimer = 0; + } + } + else + { + this.moistureTimer = 0; + } + } + + /** + * Reads food stats from an NBT object. + */ + public void readNBT(NBTTagCompound par1NBTTagCompound) + { + if (par1NBTTagCompound.hasKey("moisturelevel")) + { + this.moistureLevel = par1NBTTagCompound.getInteger("moisturelevel"); + this.moistureTimer = par1NBTTagCompound.getInteger("moistureticktimer"); + this.moistureSaturationLevel = par1NBTTagCompound.getFloat("moisturesaturationlevel"); + this.moistureExhaustionLevel = par1NBTTagCompound.getFloat("moistureexhaustionlevel"); + } + } + + /** + * Writes food stats to an NBT object. + */ + public void writeNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setInteger("moisturelevel", this.moistureLevel); + par1NBTTagCompound.setInteger("moistureticktimer", this.moistureTimer); + par1NBTTagCompound.setFloat("moisturesaturationlevel", this.moistureSaturationLevel); + par1NBTTagCompound.setFloat("moistureexhaustionlevel", this.moistureExhaustionLevel); + } + + public boolean isPacket() { + + boolean flag = false; + + if (this.moistureLevel != this.lastMoistureLevel) { + flag = true; + this.lastMoistureLevel = this.moistureLevel; + } + + if (this.moistureSaturationLevel != this.lastSaturationLevel) { + + flag = true; + this.lastSaturationLevel = this.moistureSaturationLevel; + + } return flag; - } - - - /** - * Get the player's food level. - */ - public int getMoistureLevel() - { - return this.moistureLevel; - } - - @SideOnly(Side.CLIENT) - public int getPrevMoistureLevel() - { - return this.prevMoistureLevel; - } - - /** - * If foodLevel is not max. - */ - public boolean needMoisture() - { - return this.moistureLevel < MAX_STAMINA_LEVEL; - } - - /** - * adds input to foodExhaustionLevel to a max of 40 - */ - public void addExhaustion(float par1) - { - this.moistureExhaustionLevel = Math.min(this.moistureExhaustionLevel + par1, 40.0F); - } - - /** - * Get the player's food saturation level. - */ - public float getSaturationLevel() - { - return this.moistureSaturationLevel; - } - - @SideOnly(Side.CLIENT) - public void setMoistureLevel(int par1) - { - this.moistureLevel = par1; - } - - @SideOnly(Side.CLIENT) - public void setMoistureSaturationLevel(float par1) - { - this.moistureSaturationLevel = par1; - } - - @SideOnly(Side.SERVER) + } + + /** + * Get the player's moisture level. + */ + public int getMoistureLevel() + { + return this.moistureLevel; + } + + @SideOnly(Side.CLIENT) + public int getPrevMoistureLevel() + { + return this.prevMoistureLevel; + } + + /** + * If foodLevel is not max. + */ + public boolean needMoisture() + { + return this.moistureLevel < MAX_STAMINA_LEVEL; + } + + /** + * adds input to foodExhaustionLevel to a max of 40 + */ + public void addExhaustion(float par1) + { + this.moistureExhaustionLevel = Math.min(this.moistureExhaustionLevel + par1, 40.0F); + } + + /** + * Get the player's food saturation level. + */ + public float getSaturationLevel() + { + return this.moistureSaturationLevel; + } + + @SideOnly(Side.CLIENT) + public void setMoistureLevel(int par1) + { + this.moistureLevel = par1; + } + + @SideOnly(Side.CLIENT) + public void setMoistureSaturationLevel(float par1) + { + this.moistureSaturationLevel = par1; + } + + @SideOnly(Side.SERVER) public int getLastMoistureLevel() { return lastMoistureLevel; } - @SideOnly(Side.SERVER) + @SideOnly(Side.SERVER) public void setLastMoistureLevel(int lastMoistureLevel) { this.lastMoistureLevel = lastMoistureLevel; } - @SideOnly(Side.SERVER) + @SideOnly(Side.SERVER) public float getLastExhaustionLevel() { return lastSaturationLevel; } - @SideOnly(Side.SERVER) + @SideOnly(Side.SERVER) public void setLastExhaustionLevel(float lastExhaustionLevel) { this.lastSaturationLevel = lastExhaustionLevel; } diff --git a/src/main/java/shift/sextiarysector/player/ShippingBoxStats.java b/src/main/java/shift/sextiarysector/player/ShippingBoxStats.java new file mode 100644 index 0000000..4590e55 --- /dev/null +++ b/src/main/java/shift/sextiarysector/player/ShippingBoxStats.java @@ -0,0 +1,70 @@ +package shift.sextiarysector.player; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import shift.mceconomy2.api.MCEconomyAPI; +import shift.sextiarysector.api.season.SeasonAPI; +import shift.sextiarysector.container.InventoryShippingBox; +import shift.sextiarysector.module.ModuleStatistics; + +public class ShippingBoxStats { + + public final String NBT_ID = "ssshippingbox"; + + public InventoryShippingBox inventory; + + public ShippingBoxStats() { + + inventory = new InventoryShippingBox(); + + } + + public void onUpdate(EntityPlayer entityPlayer) { + + if (SeasonAPI.getHour(entityPlayer.worldObj, 1) != 7 || SeasonAPI.getMinute(entityPlayer.worldObj) != 0) return; + + for (int i = 0; i < inventory.getSizeInventory(); i++) { + + ItemStack item = inventory.getStackInSlot(i); + + if (item == null) continue; + + if (MCEconomyAPI.getPurchase(item) < 0) continue; + + int mp = MCEconomyAPI.getPurchase(item) * item.stackSize; + + int addmp = MCEconomyAPI.addPlayerMP(entityPlayer, mp, true); + + if (addmp != mp) continue; + + MCEconomyAPI.addPlayerMP(entityPlayer, addmp, false); + entityPlayer.addStat(ModuleStatistics.objectSellStats[Item.getIdFromItem(item.getItem())], item.stackSize); + + inventory.setInventorySlotContents(i, null); + inventory.markDirty(); + + } + + } + + public void writeNBT(NBTTagCompound compound) { + + NBTTagCompound nbt = new NBTTagCompound(); + + inventory.writeToNBT(nbt); + + compound.setTag(NBT_ID, nbt); + + } + + public void readNBT(NBTTagCompound compound) { + + if (compound.hasKey(NBT_ID)) { + inventory.readFromNBT(compound.getCompoundTag(NBT_ID)); + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/player/StaminaStats.java b/src/main/java/shift/sextiarysector/player/StaminaStats.java index 199e814..8fcc1d3 100644 --- a/src/main/java/shift/sextiarysector/player/StaminaStats.java +++ b/src/main/java/shift/sextiarysector/player/StaminaStats.java @@ -2,193 +2,198 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.DamageSource; import net.minecraft.world.EnumDifficulty; +import shift.sextiarysector.Config; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class StaminaStats { /** The player's stamina level. */ - private int staminaLevel = 1000; - private final static int MAX_STAMINA_LEVEL = 1000; + private int staminaLevel = 100; + private final static int MAX_STAMINA_LEVEL = 100; private final static int MAX_PREV_STAMINA_LEVEL = 20; - /** The player's food saturation. */ - private float staminaSaturationLevel = 5.0F; - - //Packet逕ィ - private int lastStaminaLevel = 1000 ; - private float lastSaturationLevel = 0; - - /** The player's food exhaustion. */ - private float staminaExhaustionLevel; - - /** The player's food timer value. */ - private int staminaTimer; - private int prevStaminaLevel = 20; - - /** - * Args: int staminaLevel, float staminaSaturationModifier - */ - public void addStats(int par1, float par2) - { - this.staminaLevel = Math.min(par1 + this.staminaLevel, MAX_STAMINA_LEVEL); - this.staminaSaturationLevel = Math.min(this.staminaSaturationLevel + par1 * par2 * 2.0F, this.staminaLevel); - } - - /* - public void addStats(IStaminaFood par1ItemStaminaFood) - { - this.addStats(par1ItemStaminaFood.getHealAmount(), par1ItemStaminaFood.getSaturationModifier()); - }*/ - - /** - * Handles the food game logic. - */ - public void onUpdate(EntityPlayer par1EntityPlayer) - { - EnumDifficulty i = par1EntityPlayer.worldObj.difficultySetting; - this.prevStaminaLevel = this.staminaLevel; - - if (this.staminaExhaustionLevel > 4.0F) - { - this.staminaExhaustionLevel -= 4.0F; - - if (this.staminaSaturationLevel > 0.0F) - { - this.staminaSaturationLevel = Math.max(this.staminaSaturationLevel - 1.0F, 0.0F); - } - else if (i.getDifficultyId() > 0) - { - this.staminaLevel = Math.max(this.staminaLevel - 1, 0); - } - } - - if (par1EntityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.staminaLevel >= 18 && par1EntityPlayer.shouldHeal()) - { - ++this.staminaTimer; - - if (this.staminaTimer >= 80) - { - par1EntityPlayer.heal(1.0F); - this.addExhaustion(3.0F); - this.staminaTimer = 0; - } - } - else if (this.staminaLevel <= 0) - { - ++this.staminaTimer; - - if (this.staminaTimer >= 80) - { - if (par1EntityPlayer.getHealth() > 10.0F || i.getDifficultyId() >= 3 || par1EntityPlayer.getHealth() > 1.0F && i.getDifficultyId() >= 2) - { - //par1EntityPlayer.attackEntityFrom(DamageSource.starve, 1.0F); - } - - this.staminaTimer = 0; - } - } - else - { - this.staminaTimer = 0; - } - } - - /** - * Reads food stats from an NBT object. - */ - public void readNBT(NBTTagCompound par1NBTTagCompound) - { - if (par1NBTTagCompound.hasKey("staminalevel")) - { - this.staminaLevel = par1NBTTagCompound.getInteger("staminalevel"); - this.staminaTimer = par1NBTTagCompound.getInteger("staminaticktimer"); - this.staminaSaturationLevel = par1NBTTagCompound.getFloat("staminasaturationlevel"); - this.staminaExhaustionLevel = par1NBTTagCompound.getFloat("staminaexhaustionlevel"); - } - } - - /** - * Writes food stats to an NBT object. - */ - public void writeNBT(NBTTagCompound par1NBTTagCompound) - { - par1NBTTagCompound.setInteger("staminalevel", this.staminaLevel); - par1NBTTagCompound.setInteger("staminaticktimer", this.staminaTimer); - par1NBTTagCompound.setFloat("staminasaturationlevel", this.staminaSaturationLevel); - par1NBTTagCompound.setFloat("staminaexhaustionlevel", this.staminaExhaustionLevel); - } - - /**Packet繧帝」帙ー縺吝ソ隕√′縺ゅk縺九←縺縺*/ - public boolean isPacket(){ - - boolean flag = false; - - if(this.staminaLevel!=this.lastStaminaLevel){ - flag= true; - this.lastStaminaLevel=this.staminaLevel; - } - - if(this.staminaSaturationLevel!=this.lastSaturationLevel){ - - flag=true; - this.lastSaturationLevel=this.staminaSaturationLevel; - - } + /** The player's food saturation. */ + private float staminaSaturationLevel = 5.0F; + + //Packet逕ィ + private int lastStaminaLevel = 100; + private float lastSaturationLevel = 0; + + /** The player's food exhaustion. */ + private float staminaExhaustionLevel; + + /** The player's food timer value. */ + private int staminaTimer; + private int prevStaminaLevel = 20; + + /** + * Args: int staminaLevel, float staminaSaturationModifier + */ + public void addStats(int par1, float par2) + { + this.staminaLevel = Math.min(par1 + this.staminaLevel, MAX_STAMINA_LEVEL); + this.staminaSaturationLevel = Math.min(Math.min(this.staminaSaturationLevel + par1 * par2 * 2.0F, this.staminaLevel), MAX_STAMINA_LEVEL / 2); + } + + /* + public void addStats(IStaminaFood par1ItemStaminaFood) + { + this.addStats(par1ItemStaminaFood.getHealAmount(), par1ItemStaminaFood.getSaturationModifier()); + }*/ + + /** + * Handles the food game logic. + */ + public void onUpdate(EntityPlayer par1EntityPlayer) + { + EnumDifficulty i = par1EntityPlayer.worldObj.difficultySetting; + this.prevStaminaLevel = this.staminaLevel; + + if (this.staminaExhaustionLevel > 4.0F) + { + this.staminaExhaustionLevel -= 4.0F; + + if (this.staminaSaturationLevel > 0.0F) + { + this.staminaSaturationLevel = Math.max(this.staminaSaturationLevel - 1.0F, 0.0F); + } + else if (i.getDifficultyId() > 0 || Config.peacefulStamina) + { + this.staminaLevel = Math.max(this.staminaLevel - 1, 0); + } + } + + if (par1EntityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.staminaLevel >= 18 && par1EntityPlayer.shouldHeal()) + { + ++this.staminaTimer; + + if (this.staminaTimer >= 160) + { + par1EntityPlayer.heal(1.0F); + this.addExhaustion(3.0F); + this.staminaTimer = 0; + } + } + else if (this.staminaLevel <= 0) + { + ++this.staminaTimer; + + if (this.staminaTimer >= 80) + { + if (par1EntityPlayer.getHealth() > 10.0F || i.getDifficultyId() >= 3 || par1EntityPlayer.getHealth() > 1.0F && i.getDifficultyId() >= 2) + { + if (!par1EntityPlayer.isPlayerSleeping()) { + par1EntityPlayer.attackEntityFrom(DamageSource.starve, 1.0F); + } + //par1EntityPlayer.attackEntityFrom(DamageSource.starve, 1.0F); + } + + this.staminaTimer = 0; + } + } + else + { + this.staminaTimer = 0; + } + } + + /** + * Reads food stats from an NBT object. + */ + public void readNBT(NBTTagCompound par1NBTTagCompound) + { + if (par1NBTTagCompound.hasKey("staminalevel")) + { + this.staminaLevel = par1NBTTagCompound.getInteger("staminalevel"); + this.staminaTimer = par1NBTTagCompound.getInteger("staminaticktimer"); + this.staminaSaturationLevel = par1NBTTagCompound.getFloat("staminasaturationlevel"); + this.staminaExhaustionLevel = par1NBTTagCompound.getFloat("staminaexhaustionlevel"); + } + } + + /** + * Writes food stats to an NBT object. + */ + public void writeNBT(NBTTagCompound par1NBTTagCompound) + { + par1NBTTagCompound.setInteger("staminalevel", this.staminaLevel); + par1NBTTagCompound.setInteger("staminaticktimer", this.staminaTimer); + par1NBTTagCompound.setFloat("staminasaturationlevel", this.staminaSaturationLevel); + par1NBTTagCompound.setFloat("staminaexhaustionlevel", this.staminaExhaustionLevel); + } + + /**Packet繧帝」帙ー縺吝ソ隕√′縺ゅk縺九←縺縺*/ + public boolean isPacket() { + + boolean flag = false; + + if (this.staminaLevel != this.lastStaminaLevel) { + flag = true; + this.lastStaminaLevel = this.staminaLevel; + } + + if (this.staminaSaturationLevel != this.lastSaturationLevel) { + + flag = true; + this.lastSaturationLevel = this.staminaSaturationLevel; + + } return flag; - } - - /** - * Get the player's food level. - */ - public int getStaminaLevel() - { - return this.staminaLevel; - } - - @SideOnly(Side.CLIENT) - public int getPrevStaminaLevel() - { - return this.prevStaminaLevel; - } - - /** - * If foodLevel is not max. - */ - public boolean needStamina() - { - return this.staminaLevel < MAX_STAMINA_LEVEL; - } - - /** - * adds input to foodExhaustionLevel to a max of 400 - */ - public void addExhaustion(float par1) - { - this.staminaExhaustionLevel = Math.min(this.staminaExhaustionLevel + par1, 400.0F); - } - - /** - * Get the player's food saturation level. - */ - public float getSaturationLevel() - { - return this.staminaSaturationLevel; - } - - @SideOnly(Side.CLIENT) - public void setStaminaLevel(int par1) - { - this.staminaLevel = par1; - } - - @SideOnly(Side.CLIENT) - public void setStaminaSaturationLevel(float par1) - { - this.staminaSaturationLevel = par1; - } + } + + /** + * Get the player's food level. + */ + public int getStaminaLevel() + { + return this.staminaLevel; + } + + @SideOnly(Side.CLIENT) + public int getPrevStaminaLevel() + { + return this.prevStaminaLevel; + } + + /** + * If foodLevel is not max. + */ + public boolean needStamina() + { + return this.staminaLevel < MAX_STAMINA_LEVEL; + } + + /** + * adds input to foodExhaustionLevel to a max of 400 + */ + public void addExhaustion(float par1) + { + this.staminaExhaustionLevel = Math.min(this.staminaExhaustionLevel + par1, 400.0F); + } + + /** + * Get the player's food saturation level. + */ + public float getSaturationLevel() + { + return this.staminaSaturationLevel; + } + + @SideOnly(Side.CLIENT) + public void setStaminaLevel(int par1) + { + this.staminaLevel = par1; + } + + @SideOnly(Side.CLIENT) + public void setStaminaSaturationLevel(float par1) + { + this.staminaSaturationLevel = par1; + } } diff --git a/src/main/java/shift/sextiarysector/plugin/IPlugin.java b/src/main/java/shift/sextiarysector/plugin/IPlugin.java index eb33e3b..b110191 100644 --- a/src/main/java/shift/sextiarysector/plugin/IPlugin.java +++ b/src/main/java/shift/sextiarysector/plugin/IPlugin.java @@ -1,11 +1,22 @@ package shift.sextiarysector.plugin; +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.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public interface IPlugin { - public void prePlugin(); + public String getModName(); + + public void prePlugin(FMLPreInitializationEvent event); + + @SideOnly(Side.CLIENT) + public void preClientPlugin(FMLPreInitializationEvent event); - public void initPlugin(); + public void initPlugin(FMLInitializationEvent event); - public void postPlugin(); + public void postPlugin(FMLPostInitializationEvent event); } diff --git a/src/main/java/shift/sextiarysector/plugin/PluginAppleMilk.java b/src/main/java/shift/sextiarysector/plugin/PluginAppleMilk.java index 45f6ba2..a038bfb 100644 --- a/src/main/java/shift/sextiarysector/plugin/PluginAppleMilk.java +++ b/src/main/java/shift/sextiarysector/plugin/PluginAppleMilk.java @@ -1,12 +1,60 @@ package shift.sextiarysector.plugin; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.block.BlockSandpit; +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.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class PluginAppleMilk { +public class PluginAppleMilk implements IPlugin { - public static void registeDCsAppleMilk(FMLPostInitializationEvent event) { + public static Item chalcedonyKnife; + public static Item clam; + public static Item princessClam; + @Override + public void prePlugin(FMLPreInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + + this.chalcedonyKnife = GameRegistry.findItem("DCsAppleMilk", "defeatedcrow.chalcedonyKnife"); + this.clam = GameRegistry.findItem("DCsAppleMilk", "defeatedcrow.clam"); + this.princessClam = GameRegistry.findItem("DCsAppleMilk", "defeatedcrow.princessClam"); + + OreDictionary.registerOre("craftingToolWireCutter", new ItemStack(chalcedonyKnife, 1, OreDictionary.WILDCARD_VALUE)); + OreDictionary.registerOre("craftingToolKnife", new ItemStack(chalcedonyKnife, 1, OreDictionary.WILDCARD_VALUE)); + + OreDictionary.registerOre("craftingMagic", new ItemStack(princessClam, 1, 0)); + + SSRecipes.magicFuel.add(new ItemStack(princessClam, 1, 0), 3200); + + } + + @Override + public void postPlugin(FMLPostInitializationEvent event) { + + BlockSandpit.addShell(new ItemStack(clam, 1, 0), 14); + + } + + @Override + public String getModName() { + return "AppleMilk"; + } + + @Override + @SideOnly(Side.CLIENT) + public void preClientPlugin(FMLPreInitializationEvent event) { } diff --git a/src/main/java/shift/sextiarysector/plugin/PluginCleaver.java b/src/main/java/shift/sextiarysector/plugin/PluginCleaver.java new file mode 100644 index 0000000..c7b5fc4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/plugin/PluginCleaver.java @@ -0,0 +1,74 @@ +package shift.sextiarysector.plugin; + +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import shift.mceconomy2.api.shop.ProductItem; +import shift.sextiarysector.SSFluids; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.SSShops; +import shift.sextiarysector.item.ItemFigureBox; +import shift.sextiarysector.module.ModuleFigure; +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.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PluginCleaver implements IPlugin { + + public static Item itemCleaverNormal; + public static Item itemCleaverBlaze; + public static Item itemCleaverSoul; + public static Item itemCleaverOgre; + + @Override + public void prePlugin(FMLPreInitializationEvent event) { + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + + this.itemCleaverNormal = GameRegistry.findItem("schr0.cleaver", "itemCleaverNormal"); + this.itemCleaverBlaze = GameRegistry.findItem("schr0.cleaver", "itemCleaverBlaze"); + this.itemCleaverSoul = GameRegistry.findItem("schr0.cleaver", "itemCleaverSoul"); + this.itemCleaverOgre = GameRegistry.findItem("schr0.cleaver", "itemCleaverOgre"); + + OreDictionary.registerOre("craftingToolWireCutter", new ItemStack(itemCleaverNormal, 1, 0)); + OreDictionary.registerOre("craftingToolKnife", new ItemStack(itemCleaverNormal, 1, 0)); + + SSRecipes.fluidFurnace.add(new ItemStack(this.itemCleaverNormal, 1), new ItemStack(Items.stick, 1), new FluidStack(SSFluids.iron, 3500)); + SSRecipes.magicFuel.add(new ItemStack(this.itemCleaverSoul, 1), 3200); + + } + + @Override + public void postPlugin(FMLPostInitializationEvent event) { + + ModuleFigure.addFigure("schr0_cleaver", new ItemStack(itemCleaverNormal, 1), 20); + ModuleFigure.addFigure("schr0_cleaver", new ItemStack(itemCleaverBlaze, 1), 20); + ModuleFigure.addFigure("schr0_cleaver", new ItemStack(itemCleaverSoul, 1), 20); + ModuleFigure.addFigure("schr0_cleaver", new ItemStack(itemCleaverOgre, 1), 20); + + for (int i = 0; i < 4; i++) { + SSShops.creepers[i].addItemProduct(new ProductItem(((ItemFigureBox) SSItems.figureBox).getEditionFigureBox("schr0_cleaver"), 500)); + } + + } + + @Override + public String getModName() { + return "schr0.cleaver"; + } + + @Override + @SideOnly(Side.CLIENT) + public void preClientPlugin(FMLPreInitializationEvent event) { + + } +} diff --git a/src/main/java/shift/sextiarysector/plugin/PluginComputerCraft.java b/src/main/java/shift/sextiarysector/plugin/PluginComputerCraft.java index 8072919..08d4531 100644 --- a/src/main/java/shift/sextiarysector/plugin/PluginComputerCraft.java +++ b/src/main/java/shift/sextiarysector/plugin/PluginComputerCraft.java @@ -8,7 +8,12 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import shift.sextiarysector.SSItems; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +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.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import dan200.computercraft.api.ComputerCraftAPI; import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.api.turtle.ITurtleAccess; @@ -18,14 +23,27 @@ import dan200.computercraft.api.turtle.TurtleUpgradeType; import dan200.computercraft.api.turtle.TurtleVerb; -public class PluginComputerCraft{ +public class PluginComputerCraft implements IPlugin{ - public static void initPlugin(){ + @Override + public void prePlugin(FMLPreInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { ComputerCraftAPI.registerTurtleUpgrade(new TurtleGearTool(420,new ItemStack(SSItems.woodGear,1))); } + @Override + public void postPlugin(FMLPostInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + public static class TurtleGearTool implements ITurtleUpgrade{ public int id; @@ -88,12 +106,12 @@ public TurtleCommandResult useTool(ITurtleAccess turtle,TurtleSide side, TurtleV } TileEntity t = world.getTileEntity(newX, newY, newZ); - if(t instanceof IEnergyHandler){ + if(t instanceof IGearForceHandler){ if(verb==TurtleVerb.Attack){ - return this.addEnergy(turtle, (IEnergyHandler) t,ForgeDirection.getOrientation(direction) ); + return this.addEnergy(turtle, (IGearForceHandler) t,ForgeDirection.getOrientation(direction) ); }else{ - return this.getEnergy(turtle, (IEnergyHandler) t, ForgeDirection.getOrientation(direction) ); + return this.getEnergy(turtle, (IGearForceHandler) t, ForgeDirection.getOrientation(direction) ); } } @@ -101,7 +119,7 @@ public TurtleCommandResult useTool(ITurtleAccess turtle,TurtleSide side, TurtleV return TurtleCommandResult.failure(); } - private TurtleCommandResult addEnergy(ITurtleAccess turtle,IEnergyHandler h,ForgeDirection direction){ + private TurtleCommandResult addEnergy(ITurtleAccess turtle,IGearForceHandler h,ForgeDirection direction){ if(turtle.getFuelLevel()>0){ @@ -118,7 +136,7 @@ private TurtleCommandResult addEnergy(ITurtleAccess turtle,IEnergyHandler h,Forg } - private TurtleCommandResult getEnergy(ITurtleAccess turtle,IEnergyHandler h,ForgeDirection direction){ + private TurtleCommandResult getEnergy(ITurtleAccess turtle,IGearForceHandler h,ForgeDirection direction){ int i = h.drawEnergy(direction.getOpposite(), 1, 100, true)/10; if(i>0){ @@ -145,4 +163,17 @@ public void update(ITurtleAccess turtle, TurtleSide side) { } + @Override + public String getModName() { + return "ComputerCraft"; + } + + @Override + @SideOnly(Side.CLIENT) + public void preClientPlugin(FMLPreInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + } diff --git a/src/main/java/shift/sextiarysector/plugin/PluginFMP.java b/src/main/java/shift/sextiarysector/plugin/PluginFMP.java new file mode 100644 index 0000000..0440c2f --- /dev/null +++ b/src/main/java/shift/sextiarysector/plugin/PluginFMP.java @@ -0,0 +1,37 @@ +package shift.sextiarysector.plugin; + +import shift.sextiarysector.fmp.PartRegistry; +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class PluginFMP implements IPlugin { + + @Override + public String getModName() { + return "ForgeMultipart"; + } + + @Override + public void prePlugin(FMLPreInitializationEvent event) { + + } + + @Override + public void preClientPlugin(FMLPreInitializationEvent event) { + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + + PartRegistry.init(); + + } + + @Override + public void postPlugin(FMLPostInitializationEvent event) { + + } + +} diff --git a/src/main/java/shift/sextiarysector/plugin/PluginIC2.java b/src/main/java/shift/sextiarysector/plugin/PluginIC2.java new file mode 100644 index 0000000..8d0381d --- /dev/null +++ b/src/main/java/shift/sextiarysector/plugin/PluginIC2.java @@ -0,0 +1,83 @@ +package shift.sextiarysector.plugin; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraftforge.oredict.ShapedOreRecipe; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.block.BlockElectricMotor; +import shift.sextiarysector.item.ItemBlockDirection; +import shift.sextiarysector.renderer.block.RendererElectricMotor; +import shift.sextiarysector.tileentity.TileEntityElectricMotor; +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.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PluginIC2 implements IPlugin { + + //1EU -> 3Power 2Speed + + @Override + public String getModName() { + return "IC2"; + } + + public static int electricMotorType; + public static Block electricMotor; + + public static Item ic2Dust;//3 Copper , 7 Tin + public static Item cable; + + @Override + public void prePlugin(FMLPreInitializationEvent event) { + + electricMotor = new BlockElectricMotor().setBlockName("ss.electric_motor").setBlockTextureName("glass").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(electricMotor, ItemBlockDirection.class, "ElectricMotor"); + GameRegistry.registerTileEntity(TileEntityElectricMotor.class, "ElectricMotor"); + + } + + @Override + @SideOnly(Side.CLIENT) + public void preClientPlugin(FMLPreInitializationEvent event) { + + electricMotorType = cpw.mods.fml.client.registry.RenderingRegistry.getNextAvailableRenderId(); + cpw.mods.fml.client.registry.RenderingRegistry.registerBlockHandler(new RendererElectricMotor()); + cpw.mods.fml.client.registry.ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElectricMotor.class, new RendererElectricMotor()); + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + + ic2Dust = GameRegistry.findItem("IC2", "itemDust"); + cable = GameRegistry.findItem("IC2", "itemCable"); + + SSRecipes.pulverizer.add("oreCopper", new ItemStack(ic2Dust, 2, 3)); + SSRecipes.pulverizer.add("oreTin", new ItemStack(ic2Dust, 2, 7)); + + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(this.electricMotor, 1), + new Object[] { "xzx", "xyx", "pbp", + Character.valueOf('x'), "paneGlassColorless", + Character.valueOf('y'), SSItems.energyReactor, + Character.valueOf('z'), SSBlocks.steelShaft, + Character.valueOf('b'), new ItemStack(cable, 1, 0), + Character.valueOf('p'), "plateDenseTin" + })); + + } + + @Override + public void postPlugin(FMLPostInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + +} diff --git a/src/main/java/shift/sextiarysector/plugin/PluginMaid.java b/src/main/java/shift/sextiarysector/plugin/PluginMaid.java new file mode 100644 index 0000000..b78c500 --- /dev/null +++ b/src/main/java/shift/sextiarysector/plugin/PluginMaid.java @@ -0,0 +1,38 @@ +package shift.sextiarysector.plugin; + +import cpw.mods.fml.common.event.FMLInitializationEvent; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +public class PluginMaid implements IPlugin { + + @Override + public String getModName() { + return "Maid"; + } + + @Override + public void prePlugin(FMLPreInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public void preClientPlugin(FMLPreInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public void postPlugin(FMLPostInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + +} diff --git a/src/main/java/shift/sextiarysector/plugin/PluginRF.java b/src/main/java/shift/sextiarysector/plugin/PluginRF.java new file mode 100644 index 0000000..0fae71a --- /dev/null +++ b/src/main/java/shift/sextiarysector/plugin/PluginRF.java @@ -0,0 +1,67 @@ +package shift.sextiarysector.plugin; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraftforge.oredict.ShapedOreRecipe; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.block.BlockGFDynamo; +import shift.sextiarysector.item.ItemBlockDirection; +import shift.sextiarysector.renderer.block.RendererGFDynamo; +import shift.sextiarysector.tileentity.TileEntityGFDynamo; +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.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PluginRF implements IPlugin { + + @Override + public String getModName() { + return "RF"; + } + + public static int gfDynamoType; + public static Block gfDynamo; + + @Override + public void prePlugin(FMLPreInitializationEvent event) { + + gfDynamo = new BlockGFDynamo().setBlockName("ss.gf_dynamo").setBlockTextureName("stone").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(gfDynamo, ItemBlockDirection.class, "GFDynamo"); + GameRegistry.registerTileEntity(TileEntityGFDynamo.class, "GFDynamo"); + + } + + @Override + @SideOnly(Side.CLIENT) + public void preClientPlugin(FMLPreInitializationEvent event) { + + gfDynamoType = cpw.mods.fml.client.registry.RenderingRegistry.getNextAvailableRenderId(); + cpw.mods.fml.client.registry.RenderingRegistry.registerBlockHandler(new RendererGFDynamo()); + cpw.mods.fml.client.registry.ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGFDynamo.class, new RendererGFDynamo()); + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(this.gfDynamo, 1), + new Object[] { " z ", "yxy", "xax", + Character.valueOf('x'), "ingotSteel", + Character.valueOf('y'), SSItems.energyReactor, + Character.valueOf('z'), SSItems.redGel, + Character.valueOf('a'), "gearSteel", + })); + + } + + @Override + public void postPlugin(FMLPostInitializationEvent event) { + + } + +} diff --git a/src/main/java/shift/sextiarysector/plugin/PluginTC.java b/src/main/java/shift/sextiarysector/plugin/PluginTC.java new file mode 100644 index 0000000..452e6c2 --- /dev/null +++ b/src/main/java/shift/sextiarysector/plugin/PluginTC.java @@ -0,0 +1,100 @@ +package shift.sextiarysector.plugin; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.ForgeHooksClient; +import net.minecraftforge.client.event.DrawBlockHighlightEvent; +import net.minecraftforge.common.MinecraftForge; +import shift.sextiarysector.api.equipment.EquipmentType; +import shift.sextiarysector.item.ItemMagicContactLenses; +import shift.sextiarysector.player.EntityPlayerManager; +import shift.sextiarysector.player.EquipmentStats; +import thaumcraft.api.IGoggles; +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.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PluginTC implements IPlugin { + + private boolean eventDraw = false; + + public static Item magicContactLenses; + + @Override + public String getModName() { + return "Thaumcraft"; + } + + @Override + public void prePlugin(FMLPreInitializationEvent event) { + + magicContactLenses = new ItemMagicContactLenses().setUnlocalizedName("ss.magic_contact_lenses").setTextureName("sextiarysector:face/magic_contact_lenses"); + GameRegistry.registerItem(magicContactLenses, "MagicContactLenses"); + + } + + @Override + public void preClientPlugin(FMLPreInitializationEvent event) { + + if (event.getSide().isClient()) { + MinecraftForge.EVENT_BUS.register(this); + } + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + + } + + @Override + public void postPlugin(FMLPostInitializationEvent event) { + + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + //(priority = EventPriority.HIGHEST) + public void blockHighlight(DrawBlockHighlightEvent event) + { + + if (eventDraw) return; + + EntityPlayer player = event.player; + + EquipmentStats e = EntityPlayerManager.getEquipmentStats(player); + + ItemStack contactLenses = e.inventory.getStackInSlot(EquipmentType.Face.getSlot(0)); + + if (contactLenses == null) return; + + if (contactLenses.getItem() != this.magicContactLenses) return; + + ItemStack item = player.getEquipmentInSlot(4); + + if (item != null && item.getItem() instanceof IGoggles) return; + + eventDraw = true; + + player.setCurrentItemOrArmor(4, contactLenses); + ForgeHooksClient.onDrawBlockHighlight(event.context, player, event.target, event.subID, event.currentItem, event.partialTicks); + player.setCurrentItemOrArmor(4, item); + + eventDraw = false; + + } + + /* + @SideOnly(Side.CLIENT) + @SubscribeEvent(priority = EventPriority.LOWEST) + public void blockHighlightPost(DrawBlockHighlightEvent event) + { + + }*/ + +} diff --git a/src/main/java/shift/sextiarysector/plugin/PluginTHKaguya.java b/src/main/java/shift/sextiarysector/plugin/PluginTHKaguya.java index 28c9a3f..0e95760 100644 --- a/src/main/java/shift/sextiarysector/plugin/PluginTHKaguya.java +++ b/src/main/java/shift/sextiarysector/plugin/PluginTHKaguya.java @@ -4,19 +4,47 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; import shift.mceconomy2.api.MCEconomyAPI; +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.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; -public class PluginTHKaguya { +public class PluginTHKaguya implements IPlugin{ public static Item thSpellCard; - public static void initPlugin() { - System.out.println("BBBBBBBBBBBBBBBBB"); + @Override + public void prePlugin(FMLPreInitializationEvent event) { + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + thSpellCard = GameRegistry.findItem("THKaguyaMod", "Spell Card"); MCEconomyAPI.addPurchaseItem(new ItemStack(thSpellCard,1,OreDictionary.WILDCARD_VALUE), 500); } + @Override + public void postPlugin(FMLPostInitializationEvent event) { + + } + + @Override + public String getModName() { + return "THKaguya"; + } + + @Override + @SideOnly(Side.CLIENT) + public void preClientPlugin(FMLPreInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + } diff --git a/src/main/java/shift/sextiarysector/plugin/PluginTcon.java b/src/main/java/shift/sextiarysector/plugin/PluginTcon.java new file mode 100644 index 0000000..88ead6c --- /dev/null +++ b/src/main/java/shift/sextiarysector/plugin/PluginTcon.java @@ -0,0 +1,152 @@ +package shift.sextiarysector.plugin; + +import java.lang.reflect.Field; +import java.util.ArrayList; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraftforge.client.event.GuiScreenEvent; +import net.minecraftforge.common.MinecraftForge; +import shift.sextiarysector.gui.tab.TabManager; +import cpw.mods.fml.client.FMLClientHandler; +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.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PluginTcon implements IPlugin { + + @SideOnly(Side.CLIENT) + private static TconTab openTab; + + @SideOnly(Side.CLIENT) + private static Minecraft mc; + + @Override + public String getModName() { + return "TConstruct"; + } + + @Override + public void prePlugin(FMLPreInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public void preClientPlugin(FMLPreInitializationEvent event) { + + MinecraftForge.EVENT_BUS.register(this); + + mc = FMLClientHandler.instance().getClient(); + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @SideOnly(Side.CLIENT) + @SubscribeEvent + public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) + { + + if (openTab != null) + { + + int xSize = 176; + int ySize = 166; + int guiLeft = (event.gui.width - xSize) / 2; + int guiTop = (event.gui.height - ySize) / 2; + + if (TabManager.hasPotion()) + { + guiLeft = 160 + (event.gui.width - xSize - 200) / 2; + } + + TabManager.updateTabValues(guiLeft, guiTop, event.buttonList, openTab, false); + + openTab = null; + + } + + } + + @Override + public void postPlugin(FMLPostInitializationEvent event) { + + if (event.getSide().isClient()) clientPost(); + + } + + @SideOnly(Side.CLIENT) + public void clientPost() { + + ArrayList tabs = tconstruct.client.tabs.TabRegistry.getTabList(); + + for (int i = 1; i < tabs.size(); i++) { + TabManager.registerTab(new TconTab(tabs.get(i))); + } + + tabs.clear(); + + } + + public class TconTab extends shift.sextiarysector.gui.tab.AbstractTab { + + tconstruct.client.tabs.AbstractTab tab; + ItemStack item; + + public TconTab(tconstruct.client.tabs.AbstractTab tab) { + + this.tab = tab; + + try { + + Class c = tconstruct.client.tabs.AbstractTab.class; + Field f = c.getDeclaredField("renderStack"); + f.setAccessible(true); + this.item = (ItemStack) f.get(this.tab); + + } catch (IllegalArgumentException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } catch (NoSuchFieldException e) { + e.printStackTrace(); + } catch (SecurityException e) { + e.printStackTrace(); + } + + } + + @Override + public void onTabClicked() { + + openTab = this; + tab.onTabClicked(); + + } + + @Override + public ItemStack getItemStack() { + return this.item; + } + + @Override + public String getTabName() { + return "Tcon"; + } + + @Override + public boolean shouldAddToList() { + return tab.shouldAddToList(); + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/plugin/PluginTofu.java b/src/main/java/shift/sextiarysector/plugin/PluginTofu.java new file mode 100644 index 0000000..667b9c0 --- /dev/null +++ b/src/main/java/shift/sextiarysector/plugin/PluginTofu.java @@ -0,0 +1,80 @@ +package shift.sextiarysector.plugin; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.ShapedOreRecipe; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SSItems; +import shift.sextiarysector.api.SextiarySectorAPI; +import shift.sextiarysector.block.BlockTofuMotor; +import shift.sextiarysector.item.ItemBlockDirection; +import shift.sextiarysector.renderer.block.RendererTofuMotor; +import shift.sextiarysector.tileentity.TileEntityTofuMotor; +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.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PluginTofu implements IPlugin { + + @Override + public String getModName() { + return "TofuCraft"; + } + + public static int tofuMotorType; + public static Block tofuMotor; + + public static Item filterCloth; + + public static Item tfCircuit; + + @Override + public void prePlugin(FMLPreInitializationEvent event) { + tofuMotor = new BlockTofuMotor().setBlockName("ss.tofu_motor").setBlockTextureName("glass").setCreativeTab(SextiarySectorAPI.TabSSIndustry); + GameRegistry.registerBlock(tofuMotor, ItemBlockDirection.class, "TofuMotor"); + GameRegistry.registerTileEntity(TileEntityTofuMotor.class, "TofuMotor"); + + } + + @Override + @SideOnly(Side.CLIENT) + public void preClientPlugin(FMLPreInitializationEvent event) { + + tofuMotorType = cpw.mods.fml.client.registry.RenderingRegistry.getNextAvailableRenderId(); + cpw.mods.fml.client.registry.RenderingRegistry.registerBlockHandler(new RendererTofuMotor()); + cpw.mods.fml.client.registry.ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTofuMotor.class, new RendererTofuMotor()); + + } + + @Override + public void initPlugin(FMLInitializationEvent event) { + + filterCloth = GameRegistry.findItem("TofuCraft", "filterCloth"); + OreDictionary.registerOre("craftingFilterCloth", filterCloth); + + tfCircuit = GameRegistry.findItem("TofuCraft", "materials"); + + CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(this.tofuMotor, 1), + new Object[] { "xzx", "xyx", "pbp", + Character.valueOf('x'), "paneGlassColorless", + Character.valueOf('y'), SSItems.energyReactor, + Character.valueOf('z'), SSBlocks.stoneShaft, + Character.valueOf('b'), new ItemStack(tfCircuit, 1, 3), + Character.valueOf('p'), new ItemStack(tfCircuit, 1, 4) + })); + + } + + @Override + public void postPlugin(FMLPostInitializationEvent event) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + +} diff --git a/src/main/java/shift/sextiarysector/plugin/SSPlugins.java b/src/main/java/shift/sextiarysector/plugin/SSPlugins.java index bb544d9..8f1b191 100644 --- a/src/main/java/shift/sextiarysector/plugin/SSPlugins.java +++ b/src/main/java/shift/sextiarysector/plugin/SSPlugins.java @@ -1,5 +1,7 @@ package shift.sextiarysector.plugin; +import java.util.ArrayList; + import org.apache.logging.log4j.Level; import shift.sextiarysector.Config; @@ -7,28 +9,42 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class SSPlugins { + public static ArrayList plugins = new ArrayList(); + public static boolean modDCsAppleMilk; public static boolean modComputerCraft; public static boolean modTHKaguya; + public static boolean modIC2; + public static boolean modTofu; + public static boolean modTcon; + public static boolean modCleaver; + public static boolean modFMP; + public static boolean modRF; + public static boolean modTC; public static void initModHelper() { - modDCsAppleMilk = Loader.isModLoaded("DCsAppleMilk"); - modComputerCraft = Loader.isModLoaded("ComputerCraft"); - modTHKaguya = Loader.isModLoaded("THKaguyaMod"); - - } - - public static void initPlugins(FMLInitializationEvent event) { + modDCsAppleMilk = Loader.isModLoaded("DCsAppleMilk") && Config.modDCsAppleMilk; + modComputerCraft = Loader.isModLoaded("ComputerCraft") && Config.modComputerCraft; + modTHKaguya = Loader.isModLoaded("THKaguyaMod") && Config.modTHKaguya; + modIC2 = Loader.isModLoaded("IC2") && Config.modIC2; + modTofu = Loader.isModLoaded("TofuCraft") && Config.modTofu; + modTcon = Loader.isModLoaded("TConstruct") && Config.modTcon; + modCleaver = Loader.isModLoaded("schr0.cleaver") && Config.modCleaver; + modFMP = Loader.isModLoaded("ForgeMultipart") && Config.modFMP; + modRF = isRF() && Config.modRF; + modTC = Loader.isModLoaded("Thaumcraft") && Config.modTC; - if (modDCsAppleMilk && Config.modDCsAppleMilk) { + if (modDCsAppleMilk) { try { SextiarySector.Log.info("DCsAppleMilk Plugin is loaded"); + plugins.add(new PluginAppleMilk()); } catch (Exception e) { @@ -38,12 +54,12 @@ public static void initPlugins(FMLInitializationEvent event) { } } - if (modComputerCraft && Config.modComputerCraft) { + if (modComputerCraft) { try { - PluginComputerCraft.initPlugin(); SextiarySector.Log.info("ComputerCraft Plugin is loaded"); + plugins.add(new PluginComputerCraft()); } catch (Exception e) { @@ -53,13 +69,12 @@ public static void initPlugins(FMLInitializationEvent event) { } } - System.out.println("AAAAAA"+modTHKaguya+" : "+Config.modTHKaguya); - if (modTHKaguya && Config.modTHKaguya) { + if (modTHKaguya) { try { - PluginTHKaguya.initPlugin(); SextiarySector.Log.info("THKaguya Plugin is loaded"); + plugins.add(new PluginTHKaguya()); } catch (Exception e) { @@ -69,10 +84,187 @@ public static void initPlugins(FMLInitializationEvent event) { } } + if (modIC2) { + + try { + + SextiarySector.Log.info("IC2 Plugin is loaded"); + plugins.add(new PluginIC2()); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, "IC2 integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + if (modTofu) { + + try { + + SextiarySector.Log.info("TofuCraft Plugin is loaded"); + plugins.add(new PluginTofu()); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, "TofuCraft integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + if (modTcon) { + + try { + + SextiarySector.Log.info("TConstruct Plugin is loaded"); + plugins.add(new PluginTcon()); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, "TConstruct integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + if (modCleaver) { + + try { + + SextiarySector.Log.info("Cleaver Plugin is loaded"); + plugins.add(new PluginCleaver()); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, "Cleaver integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + if (modFMP) { + + try { + + SextiarySector.Log.info("ForgeMultipart Plugin is loaded"); + plugins.add(new PluginFMP()); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, "ForgeMultipart integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + if (modRF) { + + try { + + SextiarySector.Log.info("RF Plugin is loaded"); + plugins.add(new PluginRF()); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, "RF integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + if (modTC) { + + try { + + SextiarySector.Log.info("Thaumcraft Plugin is loaded"); + plugins.add(new PluginTC()); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, "Thaumcraft integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + } + + public static void prePlugins(FMLPreInitializationEvent event) { + + for (IPlugin p : plugins) + { + + SextiarySector.Log.info(p.getModName() + " Plugin is pre init"); + try { + + p.prePlugin(event); + SextiarySector.Log.info(p.getModName() + " Plugin was successful pre initialization"); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, p.getModName() + " integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + } + + public static void initPlugins(FMLInitializationEvent event) { + + for (IPlugin p : plugins) + { + SextiarySector.Log.info(p.getModName() + " Plugin is init"); + try { + + p.initPlugin(event); + SextiarySector.Log.info(p.getModName() + " Plugin was successful initialization"); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, p.getModName() + " integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + } public static void postPlugins(FMLPostInitializationEvent event) { + for (IPlugin p : plugins) + { + SextiarySector.Log.info(p.getModName() + " Plugin is post init"); + try { + + p.postPlugin(event); + SextiarySector.Log.info(p.getModName() + " Plugin was successful post initialization"); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, p.getModName() + " integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + } + + private static boolean isRF() { + + Class clazz; + try { + clazz = Class.forName("cofh.api.energy.IEnergyHandler"); + } catch (ClassNotFoundException e) { + return false; + } catch (Exception e) { + return false; + } + + return true; + } } diff --git a/src/main/java/shift/sextiarysector/potion/PotionBurn.java b/src/main/java/shift/sextiarysector/potion/PotionBurn.java new file mode 100644 index 0000000..d9720de --- /dev/null +++ b/src/main/java/shift/sextiarysector/potion/PotionBurn.java @@ -0,0 +1,25 @@ +package shift.sextiarysector.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; + +public class PotionBurn extends PotionSS{ + + public PotionBurn(int p_i1573_1_, boolean p_i1573_2_, int p_i1573_3_,int icon) { + super(p_i1573_1_, p_i1573_2_, p_i1573_3_, icon); + } + + public void performEffect(EntityLivingBase p_76394_1_, int p_76394_2_) + { + if (p_76394_1_.getHealth() > 1.0F) + { + p_76394_1_.attackEntityFrom(DamageSource.onFire, 1.0F); + } + } + + public boolean isReady(int p_76397_1_, int amplifier) + { + return p_76397_1_ % (5 - amplifier) == 0; + } + +} diff --git a/src/main/java/shift/sextiarysector/potion/PotionHotSprings.java b/src/main/java/shift/sextiarysector/potion/PotionHotSprings.java new file mode 100644 index 0000000..d25a421 --- /dev/null +++ b/src/main/java/shift/sextiarysector/potion/PotionHotSprings.java @@ -0,0 +1,46 @@ +package shift.sextiarysector.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import shift.sextiarysector.player.EntityPlayerManager; +import shift.sextiarysector.player.MoistureStats; +import shift.sextiarysector.player.StaminaStats; + +public class PotionHotSprings extends PotionSS { + + public PotionHotSprings(int id, boolean isBadEffect, int liquidColor, int icon) { + super(id, isBadEffect, liquidColor, icon); + } + + @Override + public void performEffect(EntityLivingBase p_76394_1_, int p_76394_2_) + { + + if (!(p_76394_1_ instanceof EntityPlayer)) return; + + EntityPlayer player = (EntityPlayer) p_76394_1_; + + if (player.worldObj.getTotalWorldTime() % 60 != 0) + return; + + StaminaStats stats = EntityPlayerManager.getStaminaStats(player); + if (stats == null) return; + + if (!stats.needStamina()) return; + + MoistureStats moistStats = EntityPlayerManager.getMoistureStats(player); + if (moistStats == null) return; + + if (moistStats.getMoistureLevel() < 3) return; + + stats.addStats(3, 0.7f); + moistStats.addExhaustion(1.9f); + + } + + @Override + public boolean isReady(int p_76397_1_, int amplifier) + { + return p_76397_1_ % (5 - Math.min(4, amplifier)) == 0; + } +} diff --git a/src/main/java/shift/sextiarysector/potion/PotionSS.java b/src/main/java/shift/sextiarysector/potion/PotionSS.java new file mode 100644 index 0000000..c4b3dd7 --- /dev/null +++ b/src/main/java/shift/sextiarysector/potion/PotionSS.java @@ -0,0 +1,44 @@ +package shift.sextiarysector.potion; + +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ResourceLocation; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class PotionSS extends Potion { + + protected static final ResourceLocation field_147001_a = new ResourceLocation("sextiarysector:textures/guis/potion.png"); + private final int iconID; + + public PotionSS(int id, boolean isBadEffect, int liquidColor, int icon) { + super(id, isBadEffect, liquidColor); + this.iconID = icon; + } + + @Override + @SideOnly(Side.CLIENT) + public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) { + + mc.getTextureManager().bindTexture(field_147001_a); + mc.currentScreen.drawTexturedModalRect(x + 6, y + 7, (iconID % 14) * 18, (iconID / 14) * 18, 18, 18); + + } + + /* + @Override + @SideOnly(Side.CLIENT) + public int getStatusIconIndex() + { + return this.iconID; + }*/ + + @Override + @SideOnly(Side.CLIENT) + public boolean hasStatusIcon() + { + //net.minecraft.client.Minecraft.getMinecraft().getTextureManager().bindTexture(field_147001_a); + return false; + } + +} diff --git a/src/main/java/shift/sextiarysector/proxy/ClientProxy.java b/src/main/java/shift/sextiarysector/proxy/ClientProxy.java index 56fdc65..ed92603 100644 --- a/src/main/java/shift/sextiarysector/proxy/ClientProxy.java +++ b/src/main/java/shift/sextiarysector/proxy/ClientProxy.java @@ -4,29 +4,78 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraftforge.client.MinecraftForgeClient; + +import org.apache.logging.log4j.Level; + +import shift.mceconomy2.packet.PacketHandler; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.entity.EntityMineboat; +import shift.sextiarysector.entity.EntityMineboatChest; +import shift.sextiarysector.entity.EntityMineboatTank; +import shift.sextiarysector.gui.tab.TabManager; +import shift.sextiarysector.packet.PacketGuiId; +import shift.sextiarysector.plugin.IPlugin; +import shift.sextiarysector.plugin.SSPlugins; +import shift.sextiarysector.renderer.block.RendererBlockBottle; import shift.sextiarysector.renderer.block.RendererChest; +import shift.sextiarysector.renderer.block.RendererFan; import shift.sextiarysector.renderer.block.RendererFarmland; +import shift.sextiarysector.renderer.block.RendererFigure; +import shift.sextiarysector.renderer.block.RendererFluidCrafter; +import shift.sextiarysector.renderer.block.RendererFunnel; +import shift.sextiarysector.renderer.block.RendererGearShaft; import shift.sextiarysector.renderer.block.RendererHole; +import shift.sextiarysector.renderer.block.RendererLargeWindmill; +import shift.sextiarysector.renderer.block.RendererLeafBed; import shift.sextiarysector.renderer.block.RendererMonitor; +import shift.sextiarysector.renderer.block.RendererOreStone; +import shift.sextiarysector.renderer.block.RendererPaddy; +import shift.sextiarysector.renderer.block.RendererPipe; +import shift.sextiarysector.renderer.block.RendererSaw; import shift.sextiarysector.renderer.block.RendererShaft; +import shift.sextiarysector.renderer.block.RendererSmallWaterwheel; import shift.sextiarysector.renderer.block.RendererSmallWindmill; +import shift.sextiarysector.renderer.block.RendererSquare; +import shift.sextiarysector.renderer.block.RendererSteamMotor; +import shift.sextiarysector.renderer.block.RendererTank; import shift.sextiarysector.renderer.block.RendererWindmill; +import shift.sextiarysector.renderer.block.RendererWood; +import shift.sextiarysector.renderer.block.RendererWoodHopper; +import shift.sextiarysector.renderer.block.RendererWoodenGutter; +import shift.sextiarysector.renderer.entity.RenderMineboat; +import shift.sextiarysector.renderer.entity.RenderMineboatTank; import shift.sextiarysector.renderer.item.RenderGF; +import shift.sextiarysector.tileentity.TileEntityBlockBottle; +import shift.sextiarysector.tileentity.TileEntityFan; +import shift.sextiarysector.tileentity.TileEntityFigure; +import shift.sextiarysector.tileentity.TileEntityFluidCrafter; +import shift.sextiarysector.tileentity.TileEntityGearShaft; +import shift.sextiarysector.tileentity.TileEntityLargeWindmill; import shift.sextiarysector.tileentity.TileEntityMonitor; +import shift.sextiarysector.tileentity.TileEntityPipe; import shift.sextiarysector.tileentity.TileEntitySSChest; +import shift.sextiarysector.tileentity.TileEntitySaw; import shift.sextiarysector.tileentity.TileEntityShaft; +import shift.sextiarysector.tileentity.TileEntitySmallWaterwheel; import shift.sextiarysector.tileentity.TileEntitySmallWindmill; +import shift.sextiarysector.tileentity.TileEntitySquare; +import shift.sextiarysector.tileentity.TileEntitySteamMotor; +import shift.sextiarysector.tileentity.TileEntityTank; import shift.sextiarysector.tileentity.TileEntityWindmill; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -public class ClientProxy extends CommonProxy{ +public class ClientProxy extends CommonProxy { + @SideOnly(Side.CLIENT) + public shift.sextiarysector.renderer.model.ModelShiftHat model = new shift.sextiarysector.renderer.model.ModelShiftHat(); @Override - public EntityPlayer getClientPlayer(){ + public EntityPlayer getClientPlayer() { return Minecraft.getMinecraft().thePlayer; } @@ -35,45 +84,131 @@ public void setCustomRenderers() { this.holeType = RenderingRegistry.getNextAvailableRenderId(); + this.bottleType = RenderingRegistry.getNextAvailableRenderId(); + + this.squareType = RenderingRegistry.getNextAvailableRenderId(); + + this.fluidCrafterType = RenderingRegistry.getNextAvailableRenderId(); + + this.woodHopperType = RenderingRegistry.getNextAvailableRenderId(); + + this.leafBedType = RenderingRegistry.getNextAvailableRenderId(); + + this.tankType = RenderingRegistry.getNextAvailableRenderId(); + this.funnelType = RenderingRegistry.getNextAvailableRenderId(); + this.pipeType = RenderingRegistry.getNextAvailableRenderId(); + this.woodenGutterType = RenderingRegistry.getNextAvailableRenderId(); + this.ShaftRenderType = RenderingRegistry.getNextAvailableRenderId(); + this.GearShaftRenderType = RenderingRegistry.getNextAvailableRenderId(); + this.smallWindMillType = RenderingRegistry.getNextAvailableRenderId(); this.windMillType = RenderingRegistry.getNextAvailableRenderId(); + this.largeWindMillType = RenderingRegistry.getNextAvailableRenderId(); + this.smallWaterwheel = RenderingRegistry.getNextAvailableRenderId(); + this.steamMotorType = RenderingRegistry.getNextAvailableRenderId(); + + this.fanType = RenderingRegistry.getNextAvailableRenderId(); + this.sawType = RenderingRegistry.getNextAvailableRenderId(); this.chestType = RenderingRegistry.getNextAvailableRenderId(); + this.oreStoneType = RenderingRegistry.getNextAvailableRenderId(); + this.monitorType = RenderingRegistry.getNextAvailableRenderId(); this.farmlandType = RenderingRegistry.getNextAvailableRenderId(); + this.paddyType = RenderingRegistry.getNextAvailableRenderId(); + + this.woodType = RenderingRegistry.getNextAvailableRenderId(); + RenderingRegistry.registerBlockHandler(new RendererHole()); + RenderingRegistry.registerBlockHandler(new RendererBlockBottle()); + + RenderingRegistry.registerBlockHandler(new RendererSquare()); + + RenderingRegistry.registerBlockHandler(new RendererFluidCrafter()); + + RenderingRegistry.registerBlockHandler(new RendererWoodHopper()); + + RenderingRegistry.registerBlockHandler(new RendererLeafBed()); + + RenderingRegistry.registerBlockHandler(new RendererTank()); + RenderingRegistry.registerBlockHandler(new RendererFunnel()); + RenderingRegistry.registerBlockHandler(new RendererPipe()); + RenderingRegistry.registerBlockHandler(new RendererWoodenGutter()); + RenderingRegistry.registerBlockHandler(new RendererShaft()); + RenderingRegistry.registerBlockHandler(new RendererGearShaft()); + RenderingRegistry.registerBlockHandler(new RendererSmallWindmill()); RenderingRegistry.registerBlockHandler(new RendererWindmill()); + RenderingRegistry.registerBlockHandler(new RendererLargeWindmill()); + RenderingRegistry.registerBlockHandler(new RendererSmallWaterwheel()); + RenderingRegistry.registerBlockHandler(new RendererSteamMotor()); + + RenderingRegistry.registerBlockHandler(new RendererFan()); + RenderingRegistry.registerBlockHandler(new RendererSaw()); RenderingRegistry.registerBlockHandler(new RendererChest()); + RenderingRegistry.registerBlockHandler(new RendererOreStone()); + RenderingRegistry.registerBlockHandler(new RendererMonitor()); RenderingRegistry.registerBlockHandler(new RendererFarmland()); + RenderingRegistry.registerBlockHandler(new RendererPaddy()); + RenderingRegistry.registerBlockHandler(new RendererWood()); this.setCustomClientRenderers(); } + @Override + public void setItemCustomRenderers() { + MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(SSBlocks.figure), new RendererFigure()); + } + @SideOnly(Side.CLIENT) public void setCustomClientRenderers() { + //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCraftFurnace.class, new RendererCraftFurnace()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShaft.class, new RendererShaft()); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBlockBottle.class, new RendererBlockBottle()); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySquare.class, new RendererSquare()); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTank.class, new RendererTank()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTank.class, new RendererTank()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPipe.class, new RendererPipe()); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFigure.class, new RendererFigure()); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFluidCrafter.class, new RendererFluidCrafter()); + + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityGearShaft.class, new RendererGearShaft()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmallWindmill.class, new RendererSmallWindmill()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityWindmill.class, new RendererWindmill()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLargeWindmill.class, new RendererLargeWindmill()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmallWaterwheel.class, new RendererSmallWaterwheel()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySteamMotor.class, new RendererSteamMotor()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFan.class, new RendererFan()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySaw.class, new RendererSaw()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySSChest.class, new RendererChest()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMonitor.class, new RendererMonitor()); + RenderingRegistry.registerEntityRenderingHandler(EntityMineboatChest.class, new RenderMineboat()); + RenderingRegistry.registerEntityRenderingHandler(EntityMineboatTank.class, new RenderMineboatTank()); + RenderingRegistry.registerEntityRenderingHandler(EntityMineboat.class, new RenderMineboat()); } @@ -82,4 +217,61 @@ public void registerItemRenderer(Item item) { MinecraftForgeClient.registerItemRenderer(item, new RenderGF()); } + @Override + public void openGUI(int id) { + PacketHandler.INSTANCE.sendToServer(new PacketGuiId(id)); + } + + @Override + public void registerInventoryTabs() + { + /* + if (!Loader.isModLoaded("TConstruct") || TabRegistry.getTabList().size() < 3) + { + TabRegistry.registerTab(new InventoryTabVanilla()); + } + + TabRegistry.registerTab(new InventoryTabSextiarysector()); + TabRegistry.registerTab(new InventoryTabSextiarysector()); + TabRegistry.registerTab(new InventoryTabSextiarysector()); + TabRegistry.registerTab(new InventoryTabSextiarysector()); + TabRegistry.registerTab(new InventoryTabSextiarysector()); + TabRegistry.registerTab(new InventoryTabSextiarysector()); + TabRegistry.registerTab(new InventoryTabSextiarysector()); + */ + TabManager.initTabManager(); + //TabManager.registerTab(new InventoryTabEquipment()); + //TabManager.registerTab(new InventoryTabEquipment()); + //TabManager.registerTab(new InventoryTabEquipment()); + //TabManager.registerTab(new InventoryTabEquipment()); + //TabManager.registerTab(new InventoryTabEquipment()); + //TabManager.registerTab(new InventoryTabEquipment()); + + } + + @Override + public void setPluginCustomRenderers(FMLPreInitializationEvent event) + { + + for (IPlugin p : SSPlugins.plugins) + { + try { + + p.preClientPlugin(event); + + } catch (Exception e) { + + SextiarySector.Log.log(Level.WARN, p.getModName() + " integration was unsuccessful - please contact the author of this mod to let them know that the API may have changed."); + SextiarySector.Log.catching(e); + + } + } + + } + + @Override + public Object getShiftHat() { + return model; + } + } diff --git a/src/main/java/shift/sextiarysector/proxy/CommonProxy.java b/src/main/java/shift/sextiarysector/proxy/CommonProxy.java index c03098d..86fb7c8 100644 --- a/src/main/java/shift/sextiarysector/proxy/CommonProxy.java +++ b/src/main/java/shift/sextiarysector/proxy/CommonProxy.java @@ -2,31 +2,79 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class CommonProxy { + public int leafBedType; + public int holeType; + public int bottleType; + public int squareType; + + public int fluidCrafterType; + + public int woodHopperType; + + public int pipeType; + public int tankType; + public int funnelType; + public int woodenGutterType; + public int ShaftRenderType; + + public int GearShaftRenderType; + public int smallWindMillType; public int windMillType; + public int largeWindMillType; + public int smallWaterwheel; + public int steamMotorType; + + public int fanType; + public int sawType; + + public int oreStoneType; public int monitorType; public int chestType; public int farmlandType; + public int paddyType; + public int woodType; - public EntityPlayer getClientPlayer(){ + public EntityPlayer getClientPlayer() { return null; } public void setCustomRenderers() { } + public void setItemCustomRenderers() { + } + public void registerItemRenderer(Item item) { } + public void openGUI(int id) { + + } + + public void registerInventoryTabs() + { + + } + + public void setPluginCustomRenderers(FMLPreInitializationEvent event) + { + + } + + public Object getShiftHat() { + return null; + } } diff --git a/src/main/java/shift/sextiarysector/recipe/RecipeSimpleFluid.java b/src/main/java/shift/sextiarysector/recipe/RecipeSimpleFluid.java new file mode 100644 index 0000000..74919ef --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipeSimpleFluid.java @@ -0,0 +1,122 @@ +package shift.sextiarysector.recipe; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; +import shift.sextiarysector.api.recipe.IFluidRecipe; + +public class RecipeSimpleFluid implements IFluidRecipe { + + protected final HashMap metaSimpleMachineList = new HashMap(); + protected final HashMap oreSimpleMachineList = new HashMap(); + + @Override + public void add(ItemStack par1ItemStack, ItemStack par2ItemStack, FluidStack par3FluidStack) + { + metaSimpleMachineList.put(par1ItemStack, new Object[] { par2ItemStack, par3FluidStack }); + } + + @Override + public void add(String par1String, ItemStack par2ItemStack, FluidStack par3FluidStack) + { + oreSimpleMachineList.put(par1String, new Object[] { par2ItemStack, par3FluidStack }); + } + + @Override + public ItemStack getResult(ItemStack item) + { + if (item == null) + { + return null; + } + for (String key : oreSimpleMachineList.keySet()) { + ArrayList items = OreDictionary.getOres(key); + for (int i = 0; i < items.size(); i++) { + if (checkItem(item, items.get(i))) { + if (oreSimpleMachineList.get(key)[0] == null) return null; + return ((ItemStack) (oreSimpleMachineList.get(key)[0])).copy(); + } + } + } + + Iterator iterator = this.metaSimpleMachineList.entrySet().iterator(); + Entry entry; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + entry = (Entry) iterator.next(); + } while (!this.checkItem(item, (ItemStack) entry.getKey())); + + if (((ItemStack) ((Object[]) entry.getValue())[0]) == null) return null; + + return ((ItemStack) ((Object[]) entry.getValue())[0]).copy(); + + //return metaSimpleMachineList.get( (Arrays.asList( item.itemID, item.getItemDamage() ) )); + } + + @Override + public FluidStack getFluidResult(ItemStack item) + { + if (item == null) + { + return null; + } + for (String key : oreSimpleMachineList.keySet()) { + ArrayList items = OreDictionary.getOres(key); + for (int i = 0; i < items.size(); i++) { + if (checkItem(item, items.get(i))) { + if ((FluidStack) oreSimpleMachineList.get(key)[1] == null) return null; + return ((FluidStack) oreSimpleMachineList.get(key)[1]).copy(); + } + } + } + + Iterator iterator = this.metaSimpleMachineList.entrySet().iterator(); + Entry entry; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + entry = (Entry) iterator.next(); + } while (!this.checkItem(item, (ItemStack) entry.getKey())); + + if ((FluidStack) ((Object[]) entry.getValue())[1] == null) return null; + + return ((FluidStack) ((Object[]) entry.getValue())[1]).copy(); + + //return metaSimpleMachineList.get( (Arrays.asList( item.itemID, item.getItemDamage() ) )); + } + + private boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == OreDictionary.WILDCARD_VALUE || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } + + @Override + public Map getMetaList() + { + return metaSimpleMachineList; + } + + @Override + public Map getOreList() + { + return oreSimpleMachineList; + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipeSimpleFuel.java b/src/main/java/shift/sextiarysector/recipe/RecipeSimpleFuel.java new file mode 100644 index 0000000..496b426 --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipeSimpleFuel.java @@ -0,0 +1,76 @@ +package shift.sextiarysector.recipe; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class RecipeSimpleFuel { + + protected final HashMap metaSimpleFuelList = new HashMap(); + protected final HashMap oreSimpleFuelList = new HashMap(); + + public void add(ItemStack par1ItemStack, int par2ItemStack) + { + metaSimpleFuelList.put(par1ItemStack, par2ItemStack); + } + + public void add(String par1String, int par2ItemStack) + { + oreSimpleFuelList.put(par1String, par2ItemStack); + } + + public int getResult(ItemStack item) + { + if (item == null) + { + return 0; + } + for (String key : oreSimpleFuelList.keySet()) { + ArrayList items = OreDictionary.getOres(key); + for(int i = 0; i< items.size() ; i++){ + if(checkItem(item,items.get(i))){ + return oreSimpleFuelList.get(key); + } + } + } + + Iterator iterator = this.metaSimpleFuelList.entrySet().iterator(); + Entry entry; + + do + { + if (!iterator.hasNext()) + { + return 0; + } + + entry = (Entry)iterator.next(); + } + while (!this.checkItem(item, (ItemStack)entry.getKey())); + + return (Integer) entry.getValue(); + + //return metaSimpleMachineList.get( (Arrays.asList( item.itemID, item.getItemDamage() ) )); + } + + private boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } + + public Map getMetaList() + { + return metaSimpleFuelList; + } + + public Map getOreList() + { + return oreSimpleFuelList; + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipeSimpleMachine.java b/src/main/java/shift/sextiarysector/recipe/RecipeSimpleMachine.java index c2fa4cb..1665830 100644 --- a/src/main/java/shift/sextiarysector/recipe/RecipeSimpleMachine.java +++ b/src/main/java/shift/sextiarysector/recipe/RecipeSimpleMachine.java @@ -8,69 +8,74 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; +import shift.sextiarysector.api.recipe.INormalRecipe; -public class RecipeSimpleMachine { +public class RecipeSimpleMachine implements INormalRecipe { protected final HashMap metaSimpleMachineList = new HashMap(); protected final HashMap oreSimpleMachineList = new HashMap(); + @Override public void add(ItemStack par1ItemStack, ItemStack par2ItemStack) - { - metaSimpleMachineList.put(par1ItemStack, par2ItemStack); - } + { + metaSimpleMachineList.put(par1ItemStack, par2ItemStack); + } + @Override public void add(String par1String, ItemStack par2ItemStack) - { + { oreSimpleMachineList.put(par1String, par2ItemStack); - } + } + @Override public ItemStack getResult(ItemStack item) - { - if (item == null) - { - return null; - } - for (String key : oreSimpleMachineList.keySet()) { - ArrayList items = OreDictionary.getOres(key); - for(int i = 0; i< items.size() ; i++){ - if(checkItem(item,items.get(i))){ - return oreSimpleMachineList.get(key).copy(); - } - } - } - - Iterator iterator = this.metaSimpleMachineList.entrySet().iterator(); - Entry entry; - - do - { - if (!iterator.hasNext()) - { - return null; - } - - entry = (Entry)iterator.next(); - } - while (!this.checkItem(item, (ItemStack)entry.getKey())); - - return (ItemStack) entry.getValue(); - - //return metaSimpleMachineList.get( (Arrays.asList( item.itemID, item.getItemDamage() ) )); - } + { + if (item == null) + { + return null; + } + for (String key : oreSimpleMachineList.keySet()) { + ArrayList items = OreDictionary.getOres(key); + for (int i = 0; i < items.size(); i++) { + if (checkItem(item, items.get(i))) { + return oreSimpleMachineList.get(key).copy(); + } + } + } + + Iterator iterator = this.metaSimpleMachineList.entrySet().iterator(); + Entry entry; + + do + { + if (!iterator.hasNext()) + { + return null; + } + + entry = (Entry) iterator.next(); + } while (!this.checkItem(item, (ItemStack) entry.getKey())); + + return ((ItemStack) entry.getValue()).copy(); + + //return metaSimpleMachineList.get( (Arrays.asList( item.itemID, item.getItemDamage() ) )); + } private boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) - { - return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); - } + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } + @Override public Map getMetaList() - { - return metaSimpleMachineList; - } + { + return metaSimpleMachineList; + } + @Override public Map getOreList() - { - return oreSimpleMachineList; - } + { + return oreSimpleMachineList; + } } diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesArmor.java b/src/main/java/shift/sextiarysector/recipe/RecipesArmor.java new file mode 100644 index 0000000..e70aad7 --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesArmor.java @@ -0,0 +1,37 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraftforge.oredict.ShapedOreRecipe; +import shift.sextiarysector.SSItems; + +public class RecipesArmor { + + public static void addRecipes(CraftingManager p_77608_1_) + { + + String[][] recipePatterns = new String[][] { { "XXX", "X X" }, { "X X", "XXX", "XXX" }, { "XXX", "X X", "X X" }, { "X X", "X X" } }; + Object[] materialItems = new String[] { + "ingotCopper", + "ingotNinja" + }; + ItemStack[][] recipeItems = new ItemStack[][] { + { new ItemStack(SSItems.copperHelmet), new ItemStack(SSItems.copperChestplate), new ItemStack(SSItems.copperLeggings), new ItemStack(SSItems.copperBoots) }, + { new ItemStack(SSItems.ninjaHelmet), new ItemStack(SSItems.ninjaChestplate), new ItemStack(SSItems.ninjaLeggings), new ItemStack(SSItems.ninjaBoots) } + }; + + for (int i = 0; i < materialItems.length; ++i) + { + Object object = materialItems[i]; + + for (int j = 0; j < recipeItems[i].length; ++j) + { + ItemStack item = recipeItems[i][j]; + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(item, new Object[] { recipePatterns[j], 'X', object })); + } + + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesCore.java b/src/main/java/shift/sextiarysector/recipe/RecipesCore.java index 487da3c..5de3d78 100644 --- a/src/main/java/shift/sextiarysector/recipe/RecipesCore.java +++ b/src/main/java/shift/sextiarysector/recipe/RecipesCore.java @@ -1,21 +1,222 @@ package shift.sextiarysector.recipe; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; import net.minecraft.init.Items; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; +import shift.sextiarysector.SSBlocks; import shift.sextiarysector.SSItems; public class RecipesCore { public static void addRecipes(CraftingManager p_77608_1_) - { - - p_77608_1_.addRecipe(new ItemStack(SSItems.calendar, 1), - new Object[] { - " y ", "yxy", " y ", - 'x', Items.redstone, - 'y', Items.paper, - }); - } + { + + p_77608_1_.addRecipe(new ItemStack(SSItems.calendar, 1), + new Object[] { + " y ", "yxy", " y ", + 'x', Items.redstone, + 'y', Items.paper, + }); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.emptyBottle, 4), + new Object[] { + "x", "x", + 'x', "paneGlassColorless", + })); + + p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(SSItems.redGel, 1), + new Object[] { + "dustRedstone", + "slimeball" + })); + + p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(SSItems.blueGel, 1), + new Object[] { + "dustBluestone", + "slimeball" + })); + + p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(SSItems.yellowGel, 1), + new Object[] { + "dustYellowstone", + "slimeball" + })); + + //驩ア遏ウ 繧、繝ウ繧エ繝繝--繝悶Ο繝繧ッ + Object[] oIngot = new Object[] { "ingotCopper", "ingotZinc", "ingotSilver", "ingotSteel", "ingotBrass", "ingotNinja", "ingotMithril", "gemOrichalcum" }; + Block[] block = new Block[] { SSBlocks.copperBlock, SSBlocks.zincBlock, SSBlocks.silverBlock, SSBlocks.steelBlock, SSBlocks.brassBlock, SSBlocks.ninjaBlock, SSBlocks.mithrilBlock, SSBlocks.orichalcumBlock }; + for (int i = 0; i < oIngot.length; i++) { + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(block[i], 1), + new Object[] { "xxx", "xxx", "xxx", + Character.valueOf('x'), oIngot[i], + })); + } + + Object[] oBlock = new Object[] { "blockCopper", "blockZinc", "blockSilver", "blockSteel", "blockBrass", "blockNinja", "blockMithril", "blockOrichalcum" }; + Item[] ingot = new Item[] { SSItems.copperIngot, SSItems.zincIngot, SSItems.silverIngot, SSItems.steelIngot, SSItems.brassIngot, SSItems.ninjaIngot, SSItems.mithrilIngot, SSItems.orichalcumGem }; + for (int i = 0; i < oBlock.length; i++) { + p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(ingot[i], 9), + new Object[] { + oBlock[i] + })); + } + + //驩ア遏ウ 繝翫ご繝繝--繧、繝ウ繧エ繝繝 + Object[] oNugget = new Object[] { "nuggetIron", "nuggetCopper", "nuggetZinc", "nuggetSilver", "nuggetSteel", "nuggetNinja" }; + ingot = new Item[] { Items.iron_ingot, SSItems.copperIngot, SSItems.zincIngot, SSItems.silverIngot, SSItems.steelIngot, SSItems.ninjaIngot }; + for (int i = 0; i < oNugget.length; i++) { + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(ingot[i], 1), + new Object[] { "xxx", "xxx", "xxx", + Character.valueOf('x'), oNugget[i], + })); + } + + oIngot = new Object[] { "ingotIron", "ingotCopper", "ingotZinc", "ingotSilver", "ingotSteel", "ingotNinja" }; + Item[] nugget = new Item[] { SSItems.ironNugget, SSItems.copperNugget, SSItems.zincNugget, SSItems.silverNugget, SSItems.steelNugget, SSItems.ninjaNugget }; + for (int i = 0; i < oIngot.length; i++) { + p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(nugget[i], 9), + new Object[] { + oIngot[i] + })); + } + + //縺昴ョ莉 + oNugget = new Object[] { "nuggetObsidian" }; + Block[] other = new Block[] { Blocks.obsidian }; + for (int i = 0; i < oNugget.length; i++) { + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(other[i], 1), + new Object[] { "xxx", "xxx", "xxx", + Character.valueOf('x'), oNugget[i], + })); + } + + /* + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.smallCloth, 1), + new Object[] { + "xx", "xx", + 'x', "craftingString", + }));*/ + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.leafBlock, 1), + new Object[] { + "xxx", "xxx", "xxx", + 'x', SSItems.leaf + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.leafBed, 1), + new Object[] { + "xxx", "yyy", + 'x', SSBlocks.leafBlock, + 'y', "plankWood", + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.silkBobbin, 1), + new Object[] { + "xxx", "xyx", "xxx", + 'x', Items.string, + 'y', "stickWood", + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.fleshBobbin, 1), + new Object[] { + "xxx", "xyx", "xxx", + 'x', SSItems.dryingFlesh, + 'y', "stickWood", + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.stringMass, 1), + new Object[] { + "xxx", "xxx", "xxx", + 'x', Items.string, + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.strongStringBobbin, 1), + new Object[] { + "xxx", "xyx", "xxx", + 'x', SSItems.strongString, + 'y', "stickWood", + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.woodHopper, 1), + new Object[] { + "y y", "yxy", " y ", + 'x', Blocks.chest, + 'y', "plateWood", + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.square, 1), + new Object[] { + "x x", "x x", "xxx", + 'x', "plateWood", + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.tank, 1), + new Object[] { + "xyx", "y y", "xyx", + 'x', Items.stick, + 'y', "paneGlassColorless", + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.funnel, 1), + new Object[] { + "y y", "yxy", " y ", + 'x', SSBlocks.tank, + 'y', "ingotCopper", + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.shippingBox, 1), + new Object[] { + "yyy", "yxy", "yyy", + 'x', Blocks.ender_chest, + 'y', "plateWood", + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.rucksack, 1), + new Object[] { + "xxx", "x x", "xxx", + 'x', SSItems.silkCloth, + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.oxygenTank, 1), + new Object[] { + "x x", "xyx", "x x", + 'x', SSItems.strongString, + 'y', SSBlocks.tank, + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.mineboatChest, 1), + new Object[] { + "x", "y", + 'x', Blocks.chest, + 'y', Items.boat, + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.mineboatTank, 1), + new Object[] { + "x", "y", + 'x', SSBlocks.tank, + 'y', Items.boat, + })); + + p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(Items.string, 1), + new Object[] { + "craftingSmallCloth", + "craftingToolKnife" + })); + + //譁咏炊 + p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(SSItems.riceBall, 1), + new Object[] { + "condimentSalt", + "cookingRice", + "cookingLaver" + })); + + } } diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesExtractor.java b/src/main/java/shift/sextiarysector/recipe/RecipesExtractor.java new file mode 100644 index 0000000..b70a1df --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesExtractor.java @@ -0,0 +1,25 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSFluids; +import shift.sextiarysector.api.EnumColor; + +public class RecipesExtractor { + + public static void addRecipes(RecipeSimpleFluid recipe) + { + + //recipe.add("logWood", null, new FluidStack(SSFluids.oxygen, 50)); + recipe.add("treeLeaves", null, new FluidStack(SSFluids.oxygen, 200)); + recipe.add(new ItemStack(Blocks.grass), new ItemStack(Items.clay_ball), new FluidStack(SSFluids.oxygen, 50)); + + for (int i = 0; i < SSFluids.color.length; i++) { + recipe.add("dye" + EnumColor.getColor(i).name(), null, new FluidStack(SSFluids.color[i], 200)); + } + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesFluidFurnace.java b/src/main/java/shift/sextiarysector/recipe/RecipesFluidFurnace.java new file mode 100644 index 0000000..954157e --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesFluidFurnace.java @@ -0,0 +1,39 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSFluids; +import shift.sextiarysector.SSItems; + +public class RecipesFluidFurnace { + + public static void addRecipes(RecipeSimpleFluid recipe) + { + + //recipe.add(new ItemStack(Blocks.netherrack,1),null, new FluidStack(SSFluids.drinkingWater, 50)); + recipe.add(new ItemStack(Items.water_bucket, 1), new ItemStack(Items.stick, 1), new FluidStack(SSFluids.drinkingWater, 1000)); + + recipe.add(new ItemStack(Items.rotten_flesh, 1), new ItemStack(SSItems.dryingFlesh, 1), new FluidStack(FluidRegistry.WATER, 500)); + + recipe.add(new ItemStack(Items.iron_door, 1), null, new FluidStack(SSFluids.iron, 5000)); + recipe.add(new ItemStack(Items.iron_ingot, 1), null, new FluidStack(SSFluids.iron, 1000)); + recipe.add(new ItemStack(Items.iron_axe, 1), new ItemStack(Items.stick, 2), new FluidStack(SSFluids.iron, 2500)); + recipe.add(new ItemStack(Items.iron_hoe, 1), new ItemStack(Items.stick, 2), new FluidStack(SSFluids.iron, 1500)); + recipe.add(new ItemStack(Items.iron_pickaxe, 1), new ItemStack(Items.stick, 2), new FluidStack(SSFluids.iron, 2500)); + recipe.add(new ItemStack(Items.iron_shovel, 1), new ItemStack(Items.stick, 2), new FluidStack(SSFluids.iron, 500)); + recipe.add(new ItemStack(Items.iron_sword, 1), new ItemStack(Items.stick, 1), new FluidStack(SSFluids.iron, 1500)); + + recipe.add(new ItemStack(Items.gold_ingot, 1), null, new FluidStack(SSFluids.gold, 1000)); + recipe.add(new ItemStack(Items.golden_axe, 1), new ItemStack(Items.stick, 2), new FluidStack(SSFluids.gold, 2500)); + recipe.add(new ItemStack(Items.golden_hoe, 1), new ItemStack(Items.stick, 2), new FluidStack(SSFluids.gold, 1500)); + recipe.add(new ItemStack(Items.golden_pickaxe, 1), new ItemStack(Items.stick, 2), new FluidStack(SSFluids.gold, 2500)); + recipe.add(new ItemStack(Items.golden_shovel, 1), new ItemStack(Items.stick, 2), new FluidStack(SSFluids.gold, 500)); + recipe.add(new ItemStack(Items.golden_sword, 1), new ItemStack(Items.stick, 1), new FluidStack(SSFluids.gold, 1500)); + + recipe.add("logWood", new ItemStack(Items.coal, 1, 1), new FluidStack(SSFluids.sap, 500)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesFoodSmokers.java b/src/main/java/shift/sextiarysector/recipe/RecipesFoodSmokers.java new file mode 100644 index 0000000..cff4a3c --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesFoodSmokers.java @@ -0,0 +1,22 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSFluids; +import shift.sextiarysector.SSItems; + +public class RecipesFoodSmokers { + + public static void addRecipes(RecipeSimpleFluid recipe) + { + + recipe.add(new ItemStack(Items.water_bucket,1),new ItemStack(SSItems.salt, 1), new FluidStack(SSFluids.steam, 1000)); + + recipe.add(new ItemStack(Items.chicken,1),new ItemStack(SSItems.chickenSmoked, 1), new FluidStack(SSFluids.steam, 100)); + recipe.add(new ItemStack(Items.porkchop,1),new ItemStack(SSItems.porkchopSmoked, 1), new FluidStack(SSFluids.steam, 100)); + recipe.add(new ItemStack(Items.beef,1),new ItemStack(SSItems.beefSmoked, 1), new FluidStack(SSFluids.steam, 100)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesFreezer.java b/src/main/java/shift/sextiarysector/recipe/RecipesFreezer.java new file mode 100644 index 0000000..7b5d851 --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesFreezer.java @@ -0,0 +1,19 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class RecipesFreezer { + + public static void addRecipes(RecipeSimpleMachine recipe) + { + + recipe.add("fluidWater",new ItemStack(Blocks.ice)); + + recipe.add("fluidIron",new ItemStack(Items.iron_ingot)); + recipe.add("fluidGold",new ItemStack(Items.gold_ingot)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesFurnace.java b/src/main/java/shift/sextiarysector/recipe/RecipesFurnace.java new file mode 100644 index 0000000..a8e31a9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesFurnace.java @@ -0,0 +1,34 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SSItems; +import cpw.mods.fml.common.registry.GameRegistry; + +public class RecipesFurnace { + + public static void addRecipes() + { + GameRegistry.addSmelting(new ItemStack(SSItems.ironDust), new ItemStack(Items.iron_ingot), 0.1f); + GameRegistry.addSmelting(new ItemStack(SSItems.goldDust), new ItemStack(Items.gold_ingot), 0.1f); + GameRegistry.addSmelting(new ItemStack(SSItems.copperDust), new ItemStack(SSItems.copperIngot), 0.1f); + GameRegistry.addSmelting(new ItemStack(SSItems.zincDust), new ItemStack(SSItems.zincIngot), 0.1f); + + GameRegistry.addSmelting(new ItemStack(SSBlocks.copperOre), new ItemStack(SSItems.copperIngot), 0.1f); + GameRegistry.addSmelting(new ItemStack(SSBlocks.zincOre), new ItemStack(SSItems.zincIngot), 0.1f); + GameRegistry.addSmelting(new ItemStack(SSBlocks.silverOre), new ItemStack(SSItems.silverIngot), 0.1f); + + GameRegistry.addSmelting(new ItemStack(SSBlocks.orichalcumOre), new ItemStack(SSItems.orichalcumGem), 0.1f); + GameRegistry.addSmelting(new ItemStack(SSBlocks.blueStoneOre), new ItemStack(SSItems.blueStoneDust), 0.1f); + GameRegistry.addSmelting(new ItemStack(SSBlocks.yellowStoneOre), new ItemStack(SSItems.yellowStoneDust), 0.1f); + + GameRegistry.addSmelting(new ItemStack(SSItems.laver), new ItemStack(SSItems.laverRoasted), 0.1f); + + GameRegistry.addSmelting(new ItemStack(Items.potionitem, 1, 0), new ItemStack(SSItems.drinkingWaterBottle), 0.1f); + + GameRegistry.addSmelting(new ItemStack(SSBlocks.leafBlock), new ItemStack(Items.dye, 1, 2), 0.1f); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesFurnaceCraft.java b/src/main/java/shift/sextiarysector/recipe/RecipesFurnaceCraft.java index b29e52f..6488b93 100644 --- a/src/main/java/shift/sextiarysector/recipe/RecipesFurnaceCraft.java +++ b/src/main/java/shift/sextiarysector/recipe/RecipesFurnaceCraft.java @@ -11,65 +11,304 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; import shift.sextiarysector.SSBlocks; import shift.sextiarysector.SSItems; - +import shift.sextiarysector.block.BlockMonitor; +import shift.sextiarysector.block.BlockMonitor.MonitorType; public class RecipesFurnaceCraft { public static void addRecipes(FurnaceCraftingManager p_77608_1_) - { + { //鬟イ縺ソ迚ゥ - p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.drinkingWaterSmallBottle, 1), - new Object[] { - new ItemStack(Items.potionitem), - })); + //p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.drinkingWaterBottle, 1), + // new Object[] { + // new ItemStack(Items.potionitem), + // })); //繧ケ繝ゥ繧、繝 + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.slime_ball, 1), + new Object[] { + SSItems.dustWaterLily, + "condimentSugar", + "fluidWater", + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.slime_ball, 1), + new Object[] { + "dyeGreen", + "fluidSap", + })); + + /* p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.slime_ball, 2), new Object[] { - SSItems.dustWaterLily, - "craftingSugar", - Items.water_bucket, - })); + "condimentSugar", + "condimentSugar", + "condimentSalt", + "fluidSap", + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.slime_ball, 2), + new Object[] { + "algaLaver", + "algaLaver", + "condimentSalt", + "fluidWater", + })); + */ + + //p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.drinkingWaterBottle, 2), + // new Object[] { + // SSItems.emptyBottle, + // SSItems.emptyBottle, + // SSItems.waterBottle, + // })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.chocolate, 1), + new Object[] { + "condimentSugar", + "condimentSugar", + "condimentSugar", + "condimentCocoa", + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.redGel, 2), + new Object[] { + "dustRedstone", + "slimeball" + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.blueGel, 2), + new Object[] { + "dustBluestone", + "slimeball" + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.yellowGel, 2), + new Object[] { + "dustYellowstone", + "slimeball" + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.steelIngot, 1), + new Object[] { + "dustCoal", + "dustIron" + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.brassIngot, 2), + new Object[] { + "dustCopper", + "dustCopper", + "dustZinc" + })); - p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.blueStoneSlimeBall, 1), + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.ninjaIngot, 1), new Object[] { - SSItems.blueStoneDust, - Items.slime_ball - })); + "dustMithril", + "dustDiamond" + })); + /* p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSItems.unit, 1), - new Object[] { "xxx", "xyx","xxx", - Character.valueOf('y'), SSItems.blueStoneSlimeBall, - Character.valueOf('x'), "cobblestone", - })); + new Object[] { "xxx", "xyx", "xxx", + Character.valueOf('y'), SSItems.blueGel, + Character.valueOf('x'), "cobblestone", + })); + */ + + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.machineFrame, 1), + new Object[] { "xxx", "xyx", "xxx", + Character.valueOf('y'), "gelBluestone", + Character.valueOf('x'), "cobblestone", + })); + + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSItems.emptyBottle, 8), + new Object[] { + "x", "x", + 'x', "paneGlassColorless", + })); + + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSItems.orichalcumGem, 1), + new Object[] { + "xyb", "aza", "byx", + 'x', "ingotBrass", + 'y', "ingotSilver", + 'z', "craftingMagic", + 'a', "ingotMithril", + 'b', "ingotGold" + })); //Hammer - p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSItems.hammer, 1), - new Object[] { "xxx", " y "," y ", - Character.valueOf('x'), "ingotIron", - Character.valueOf('y'), "stickWood", - })); - - //time - p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.chunkLoader, 1), - new Object[] { "xyx", "yzy","xyx", - Character.valueOf('x'), "ingotIron", - Character.valueOf('y'), Blocks.obsidian, - Character.valueOf('z'), Items.clock, - })); - - } + //p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSItems.ironSpanner, 1), + // new Object[] { "xxx", " y ", " y ", + // Character.valueOf('x'), "ingotIron", + // Character.valueOf('y'), "stickWood", + // })); + + //驩縺ョ繝ェ繝ウ繧ー + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSItems.ironRing, 1), + new Object[] { " x ", "x x", " x ", + Character.valueOf('x'), "ingotIron", + })); + + //繧ッ繝ェ繝シ繝代シ繝ェ繝ウ繧ー + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.creeperRing, 1), + new Object[] { + "ringIron", + SSItems.objectReactor, + BlockMonitor.getMonitor(MonitorType.creeper) + })); + + //MPRing + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.mpRing, 1), + new Object[] { + "ringIron", + SSItems.magicDust, + "dustGold" + })); + + //XPRing + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.xpRing, 1), + new Object[] { + "ringIron", + SSItems.magicDust, + new ItemStack(Items.dye, 1, 4) + })); + + //豸イ菴薙き繝槭ラ + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.fluidFurnace, 1), + new Object[] { "xxx", "xyx", "xxx", + Character.valueOf('x'), "cobblestone", + Character.valueOf('y'), Blocks.glass_pane, + })); + + //鬲疲ウ輔き繝槭ラ + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.magicFurnace, 1), + new Object[] { "xxx", "xyx", "xxx", + Character.valueOf('x'), "cobblestone", + Character.valueOf('y'), SSItems.magicDust, + })); + + //繝輔Μ繝シ繧カ繝シ + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSBlocks.freezer, 1), + new Object[] { + SSItems.objectReactor, + Blocks.ice, + Blocks.furnace, + })); + + //荵セ辯・讖 + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.foodSmokers, 1), + new Object[] { "xxx", "xyx", "xxx", + Character.valueOf('x'), "ingotSteel", + Character.valueOf('y'), Blocks.glass_pane, + })); + + //time + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.chunkLoader, 1), + new Object[] { "xyx", "yzy", "xyx", + Character.valueOf('x'), "ingotIron", + Character.valueOf('y'), Blocks.obsidian, + Character.valueOf('z'), Items.clock, + })); + + //繝代う繝 + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.copperPipe, 4), + new Object[] { + "x", "x", "x", + 'x', "ingotCopper", + })); + + //譁咏炊 + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.curryRice, 1), + new Object[] { + "containerWoodBowl", + "condimentCurryPowder", + "cookingRice", + "cropPotato", + "cropCarrot" + })); + + //繧ケ繝シ繝 + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.carrotSoup, 1), + new Object[] { + "containerWoodBowl", + "fluidWater", + "cropCarrot" + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.cornSoup, 1), + new Object[] { + "containerWoodBowl", + "fluidWater", + "cropCorn" + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.eggSoup, 1), + new Object[] { + "containerWoodBowl", + "fluidWater", + "eggChicken" + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.onionSoup, 1), + new Object[] { + "containerWoodBowl", + "fluidWater", + "cropOnion" + })); + + p_77608_1_.addRecipe(new ShapelessOreRecipe(new ItemStack(SSItems.tomatoSoup, 1), + new Object[] { + "containerWoodBowl", + "fluidWater", + "cropTomato" + })); + + //霈ク騾∫ウサ + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.poweredBuoy, 4), + new Object[] { "xyx", "yzy", "xyx", + Character.valueOf('x'), "ingotIron", + Character.valueOf('y'), SSItems.dustWaterLily, + Character.valueOf('z'), Items.redstone, + })); + + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.boardingBuoy, 4), + new Object[] { "xyx", "yzy", "xyx", + Character.valueOf('x'), "ingotGold", + Character.valueOf('y'), SSItems.dustWaterLily, + Character.valueOf('z'), Items.redstone, + })); + + p_77608_1_.addRecipe(new ShapedOreRecipe(new ItemStack(SSBlocks.detectorBuoy, 4), + new Object[] { "xyx", "yzy", "xyx", + Character.valueOf('z'), "ingotIron", + Character.valueOf('x'), SSItems.dustWaterLily, + Character.valueOf('y'), Items.redstone, + })); + + } public static void addVanillaRecipes() - { + { + + for (Map.Entry e : ((HashMap) FurnaceRecipes.smelting().getSmeltingList()).entrySet()) { + + if (e.getValue().getItem().hasContainerItem(e.getValue().copy()) && e.getKey().getItem().hasContainerItem(e.getKey().copy())) { + if (checkItem(e.getValue().getItem().getContainerItem(e.getValue().copy()), e.getKey().getItem().getContainerItem(e.getKey().copy()))) + continue; + } - for( Map.Entry e : ((HashMap)FurnaceRecipes.smelting().getSmeltingList()).entrySet()){ + FurnaceCraftingManager.getInstance().addShapelessRecipe(e.getValue(), new Object[] { e.getKey() }); - FurnaceCraftingManager.getInstance().addShapelessRecipe(e.getValue(), new Object[]{e.getKey()}); + } - } + } - } + private static boolean checkItem(ItemStack p_151397_1_, ItemStack p_151397_2_) + { + return p_151397_2_.getItem() == p_151397_1_.getItem() && (p_151397_2_.getItemDamage() == 32767 || p_151397_2_.getItemDamage() == p_151397_1_.getItemDamage()); + } } diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesIceFuel.java b/src/main/java/shift/sextiarysector/recipe/RecipesIceFuel.java new file mode 100644 index 0000000..fca81aa --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesIceFuel.java @@ -0,0 +1,15 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class RecipesIceFuel { + + public static void addRecipes(RecipeSimpleFuel recipe) + { + recipe.add(new ItemStack(Items.snowball,1), 200); + recipe.add(new ItemStack(Blocks.ice,1), 1600); + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesLoom.java b/src/main/java/shift/sextiarysector/recipe/RecipesLoom.java index d461d57..99c0197 100644 --- a/src/main/java/shift/sextiarysector/recipe/RecipesLoom.java +++ b/src/main/java/shift/sextiarysector/recipe/RecipesLoom.java @@ -1,18 +1,21 @@ package shift.sextiarysector.recipe; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSItems; public class RecipesLoom { public static void addRecipes(RecipeSimpleMachine recipe) - { + { - //繝舌ル繝ゥ - recipe.add(new ItemStack(Blocks.bedrock,1),new ItemStack(Items.dye, 4, 1)); + //鬚ィ霆 + recipe.add(new ItemStack(SSItems.silkBobbin, 1), new ItemStack(SSItems.silkCloth, 1)); + recipe.add(new ItemStack(SSItems.strongStringBobbin, 1), new ItemStack(SSItems.strongCloth, 1)); + recipe.add(new ItemStack(SSItems.fleshBobbin, 1), new ItemStack(Items.leather, 1)); + recipe.add(new ItemStack(Items.reeds, 1), new ItemStack(Items.paper, 2)); + //recipe.add(new ItemStack(Items,1),new ItemStack(SSItems.cloth, 1)); - - } + } } diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesMachine.java b/src/main/java/shift/sextiarysector/recipe/RecipesMachine.java index e285847..1690729 100644 --- a/src/main/java/shift/sextiarysector/recipe/RecipesMachine.java +++ b/src/main/java/shift/sextiarysector/recipe/RecipesMachine.java @@ -1,8 +1,11 @@ package shift.sextiarysector.recipe; +import net.minecraft.block.Block; import net.minecraft.init.Blocks; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; +import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import shift.sextiarysector.SSBlocks; @@ -11,75 +14,275 @@ public class RecipesMachine { public static void addRecipes(CraftingManager p_77608_1_) - { - - p_77608_1_.addRecipe(new ItemStack(SSBlocks.LargeFurnace, 1), - new Object[] { - "xyx", "xax", "xzx", - 'x', Blocks.stone, - 'y', Blocks.crafting_table, - 'z', Blocks.chest, - 'a', Blocks.furnace - }); - - //GF Block - p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.smallWindmill, 1), - new Object[] { "xzx", "zyz","xzx", - Character.valueOf('y'), SSItems.blueStoneSlimeBall, - Character.valueOf('x'), "plankWood", - Character.valueOf('z'), Blocks.wool - })); - - p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.woodShaft, 4), - new Object[] { "xzx", "xyx","xzx", - Character.valueOf('y'), SSItems.blueStoneDust, - Character.valueOf('x'), "plankWood", - Character.valueOf('z'), SSItems.blueStoneSlimeBall - })); - - p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.woodGFTank, 1), - new Object[] { "yay", "xzx","yxy", - Character.valueOf('y'), "plankWood", - Character.valueOf('x'), SSItems.woodGFStorage, - Character.valueOf('z'), SSItems.woodUnitGear, - Character.valueOf('a'), SSItems.woodGear - })); - - p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.woodGearBox, 1), - new Object[] { "yxy", "xzx","yxy", - Character.valueOf('y'), "plankWood", - Character.valueOf('x'), SSItems.woodGear, - Character.valueOf('z'), SSItems.woodUnitGear - })); - - p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.millstone, 1), - new Object[] { "yyy", "aza","yxy", - Character.valueOf('y'), "plankWood", - Character.valueOf('x'), SSItems.woodGFStorage, - Character.valueOf('z'), SSItems.woodUnitGear, - Character.valueOf('a'), "stone" - })); - - //GF Item - p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.woodGear, 2), - new Object[] { " x ", "xyx"," x ", - Character.valueOf('y'), SSItems.blueStoneDust, - Character.valueOf('x'), "plankWood" - })); - - p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.woodGFStorage, 1), - new Object[] { " y ", "xzx","xzx", - Character.valueOf('z'), SSItems.blueStoneDust, - Character.valueOf('x'), "plankWood", - Character.valueOf('y'), SSItems.woodGear, - })); - - p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(SSItems.woodUnitGear, 1), + { + + p_77608_1_.addRecipe(new ItemStack(SSBlocks.LargeFurnace, 1), new Object[] { - SSItems.unit, - SSItems.woodGear - })); + "xyx", "xax", "xzx", + 'x', Blocks.stone, + 'y', Blocks.crafting_table, + 'z', Blocks.chest, + 'a', Blocks.furnace + }); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.craftReactor, 1), + new Object[] { "xyx", "yzy", "xyx", + Character.valueOf('y'), "ingotSilver", + Character.valueOf('x'), "nuggetGold", + Character.valueOf('z'), "gelRedstone" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.energyReactor, 1), + new Object[] { "xyx", "yzy", "xyx", + Character.valueOf('y'), "ingotSilver", + Character.valueOf('x'), "nuggetCopper", + Character.valueOf('z'), "gelBluestone" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.objectReactor, 1), + new Object[] { "xyx", "yzy", "xyx", + Character.valueOf('y'), "ingotSilver", + Character.valueOf('x'), "nuggetNinja", + Character.valueOf('z'), "gelYellowstone" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.emptyBottle, 1), + new Object[] { "x", + Character.valueOf('x'), new ItemStack(SSItems.colorSpray, 1, OreDictionary.WILDCARD_VALUE) + })); + + Object[] material = new Object[] { "plankWood", "stone", "ingotSteel", "ingotNinja", "gemOrichalcum" }; + Item[] gear = new Item[] { SSItems.woodGear, SSItems.stoneGear, SSItems.steelGear, SSItems.ninjaGear, SSItems.orichalcumGear }; + String[] gearOre = new String[] { "gearWood", "gearStone", "gearSteel", "gearNinja", "gearOrichalcum" }; + Item[] unit = new Item[] { SSItems.woodUnitGear, SSItems.stoneUnitGear, SSItems.steelUnitGear, SSItems.ninjaUnitGear, SSItems.orichalcumUnitGear }; + Item[] storage = new Item[] { SSItems.woodGFStorage, SSItems.stoneGFStorage, SSItems.steelGFStorage, SSItems.ninjaGFStorage, SSItems.orichalcumGFStorage }; + Block[] shaft = new Block[] { SSBlocks.woodShaft, SSBlocks.stoneShaft, SSBlocks.steelShaft, SSBlocks.ninjaShaft, SSBlocks.orichalcumShaft }; + Block[] tank = new Block[] { SSBlocks.woodGFTank, SSBlocks.stoneGFTank, SSBlocks.steelGFTank, SSBlocks.ninjaGFTank, SSBlocks.orichalcumGFTank }; + Block[] box = new Block[] { SSBlocks.woodGearBox, SSBlocks.stoneGearBox, SSBlocks.steelGearBox, SSBlocks.ninjaGearBox, SSBlocks.orichalcumGearBox }; + + //GF Block + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.smallWindmill, 1), + new Object[] { "xzx", "zyz", "xzx", + Character.valueOf('y'), SSBlocks.woodShaft, + Character.valueOf('x'), "plankWood", + Character.valueOf('z'), "blockWool" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.canvas, 1), + new Object[] { "xxy", "xxy", " y", + Character.valueOf('y'), Blocks.fence, + Character.valueOf('x'), "itemCloth" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.windmill, 1), + new Object[] { " x ", "xyx", " x ", + Character.valueOf('y'), SSBlocks.stoneShaft, + Character.valueOf('x'), SSItems.canvas + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.smallWaterwheel, 1), + new Object[] { "xxx", "xyx", "xxx", + Character.valueOf('x'), "plateWood", + Character.valueOf('y'), SSBlocks.stoneShaft + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.steamMotor, 1), + new Object[] { "xzx", "xyx", "pbp", + Character.valueOf('x'), "paneGlassColorless", + Character.valueOf('y'), SSItems.energyReactor, + Character.valueOf('z'), SSBlocks.steelShaft, + Character.valueOf('b'), new ItemStack(SSItems.dustWaterLily, 1, 0), + Character.valueOf('p'), "ingotSteel" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSItems.strongCanvas, 1), + new Object[] { "xxy", "xxy", " y", + Character.valueOf('y'), "plankWood", + Character.valueOf('x'), SSItems.strongCloth + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.largeWindmill, 1), + new Object[] { " x ", "xyx", " x ", + Character.valueOf('y'), SSBlocks.steelShaft, + Character.valueOf('x'), SSItems.strongCanvas + })); + + for (int i = 0; i < 5; i++) { + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(shaft[i], 4), + new Object[] { "xzx", "xyx", "xzx", + Character.valueOf('y'), "dustBluestone", + Character.valueOf('x'), material[i], + Character.valueOf('z'), "gelBluestone" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(tank[i], 1), + new Object[] { "yay", "xzx", "yxy", + Character.valueOf('y'), material[i], + Character.valueOf('x'), storage[i], + Character.valueOf('z'), "gelBluestone",//unit[i], + Character.valueOf('a'), gearOre[i] + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(box[i], 1), + new Object[] { "yxy", "xzx", "yxy", + Character.valueOf('y'), material[i], + Character.valueOf('x'), gearOre[i], + Character.valueOf('z'), "gelBluestone",//unit[i] + })); + + } + + Block[] gearShaft = new Block[] { SSBlocks.woodStoneGearShaft, SSBlocks.stoneSteelGearShaft, SSBlocks.steelNinjaGearShaft, SSBlocks.ninjaOrichalcumGearShaft }; + + for (int i = 0; i < 4; i++) { + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(gearShaft[i], 1, 1), + new Object[] { "y", "z", "x", + Character.valueOf('y'), shaft[i], + Character.valueOf('x'), shaft[i + 1], + Character.valueOf('z'), SSItems.energyReactor + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(gearShaft[i], 1, 0), + new Object[] { "y", "z", "x", + Character.valueOf('y'), shaft[i + 1], + Character.valueOf('x'), shaft[i], + Character.valueOf('z'), SSItems.energyReactor + })); + + } + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.millstone, 1), + new Object[] { "yay", "aza", "yxy", + Character.valueOf('y'), "gearWood", + Character.valueOf('x'), SSItems.woodGFStorage, + Character.valueOf('z'), SSBlocks.machineFrame, + Character.valueOf('a'), "stone" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.loom, 1), + new Object[] { "y y", "aza", "yxy", + Character.valueOf('y'), "gearWood", + Character.valueOf('x'), SSItems.woodGFStorage, + Character.valueOf('z'), SSBlocks.machineFrame, + Character.valueOf('a'), "stickWood" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.sawmill, 1), + new Object[] { "y y", "aza", "yxy", + Character.valueOf('y'), "gearStone", + Character.valueOf('x'), SSItems.stoneGFStorage, + Character.valueOf('z'), SSBlocks.machineFrame, + Character.valueOf('a'), "ingotZinc" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.spinningMachine, 1), + new Object[] { "yby", "aza", "yxy", + Character.valueOf('y'), "gearStone", + Character.valueOf('x'), SSItems.stoneGFStorage, + Character.valueOf('z'), SSBlocks.machineFrame, + Character.valueOf('a'), "ingotSilver", + Character.valueOf('b'), "stickWood" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.pump, 1), + new Object[] { "yxy", "azx", "yxy", + Character.valueOf('x'), "plateWood", + Character.valueOf('y'), "gearStone", + Character.valueOf('z'), SSBlocks.tank, + Character.valueOf('a'), SSBlocks.woodGrate, + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.suctionMachine, 1), + new Object[] { "yay", "xzx", "yay", + Character.valueOf('x'), "plateWood", + Character.valueOf('y'), "gearStone", + Character.valueOf('z'), SSBlocks.tank, + Character.valueOf('a'), Blocks.iron_bars + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.pulverizer, 1), + new Object[] { "yay", "aza", "yxy", + Character.valueOf('y'), "gearSteel", + Character.valueOf('x'), SSItems.steelGFStorage, + Character.valueOf('z'), SSBlocks.machineFrame, + Character.valueOf('a'), "gemDiamond" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.extractor, 1), + new Object[] { "yby", "aza", "yxy", + Character.valueOf('y'), "gearSteel", + Character.valueOf('x'), SSItems.steelGFStorage, + Character.valueOf('z'), SSBlocks.machineFrame, + Character.valueOf('a'), "containerBottle", + Character.valueOf('b'), SSBlocks.tank + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.fan, 1), + new Object[] { "yay", "zxz", "zbz", + Character.valueOf('y'), "ingotBrass", + Character.valueOf('x'), "plateWood", + Character.valueOf('z'), "stone", + Character.valueOf('a'), Blocks.iron_bars, + Character.valueOf('b'), SSBlocks.steelShaft + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.saw, 1), + new Object[] { "yay", "zxz", "zbz", + Character.valueOf('y'), "ingotBrass", + Character.valueOf('x'), "plateIron", + Character.valueOf('z'), "stone", + Character.valueOf('a'), "dustDiamond", + Character.valueOf('b'), SSBlocks.steelShaft + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.rollingMachine, 1), + new Object[] { "yay", "aza", "yxy", + Character.valueOf('y'), "gearNinja", + Character.valueOf('x'), SSItems.ninjaGFStorage, + Character.valueOf('z'), SSBlocks.machineFrame, + Character.valueOf('a'), "ingotIron" + })); + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.timeMachine, 1), + new Object[] { "yby", "aza", "yxy", + Character.valueOf('y'), "gearOrichalcum", + Character.valueOf('x'), SSItems.orichalcumGFStorage, + Character.valueOf('z'), SSBlocks.machineFrame, + Character.valueOf('a'), SSBlocks.chunkLoader, + Character.valueOf('b'), "ingotMithril" + })); + + //GF Item + + for (int i = 0; i < 5; i++) { + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(gear[i], 2), + new Object[] { " x ", "xyx", " x ", + Character.valueOf('y'), "dustBluestone", + Character.valueOf('x'), material[i] + })); + + p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(unit[i], 1), + new Object[] { + SSItems.unit, + gearOre[i] + })); + + } + + for (int i = 0; i < 5; i++) { + + p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(storage[i], 1), + new Object[] { " y ", "xzx", "xzx", + Character.valueOf('z'), "dustBluestone", + Character.valueOf('x'), material[i], + Character.valueOf('y'), gearOre[i], + })); + + } - } + } } diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesMagicFuel.java b/src/main/java/shift/sextiarysector/recipe/RecipesMagicFuel.java new file mode 100644 index 0000000..148ca9a --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesMagicFuel.java @@ -0,0 +1,18 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSItems; + +public class RecipesMagicFuel { + + public static void addRecipes(RecipeSimpleFuel recipe) + { + recipe.add(new ItemStack(Items.ender_pearl, 1), 1000); + recipe.add("dustRedstone", 400); + recipe.add("dustBluestone", 400); + recipe.add("dustYellowstone", 400); + recipe.add(new ItemStack(SSItems.magicDust, 1), 1200); + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesMagicFurnace.java b/src/main/java/shift/sextiarysector/recipe/RecipesMagicFurnace.java new file mode 100644 index 0000000..d032879 --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesMagicFurnace.java @@ -0,0 +1,23 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SSItems; + +public class RecipesMagicFurnace { + + public static void addRecipes(RecipeSimpleMachine recipe) + { + recipe.add(new ItemStack(SSBlocks.mithrilOre,1),new ItemStack(SSItems.mithrilIngot, 1)); + recipe.add(new ItemStack(Items.slime_ball,1),new ItemStack(Items.ender_pearl, 1)); + recipe.add(new ItemStack(Items.gunpowder,1),new ItemStack(Items.blaze_powder, 1)); + + recipe.add("ingotSilver",new ItemStack(SSItems.mithrilIngot)); + + recipe.add("dustBluestone",new ItemStack(SSItems.blueStoneIngot)); + recipe.add("dustYellowstone",new ItemStack(SSItems.yellowStoneIngot)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesManaSqueezer.java b/src/main/java/shift/sextiarysector/recipe/RecipesManaSqueezer.java new file mode 100644 index 0000000..f110212 --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesManaSqueezer.java @@ -0,0 +1,15 @@ +package shift.sextiarysector.recipe; + +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSFluids; + +public class RecipesManaSqueezer { + + public static void addRecipes(RecipeSimpleFluid recipe) + { + + recipe.add("logWood", null, new FluidStack(SSFluids.mana, 200)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesMillstone.java b/src/main/java/shift/sextiarysector/recipe/RecipesMillstone.java index 509e5c5..1f4db41 100644 --- a/src/main/java/shift/sextiarysector/recipe/RecipesMillstone.java +++ b/src/main/java/shift/sextiarysector/recipe/RecipesMillstone.java @@ -5,23 +5,23 @@ import net.minecraft.item.ItemStack; import shift.sextiarysector.SSItems; - public class RecipesMillstone { public static void addRecipes(RecipeSimpleMachine recipe) - { + { //繝舌ル繝ゥ - recipe.add(new ItemStack(Blocks.red_flower,1),new ItemStack(Items.dye, 4, 1)); - recipe.add(new ItemStack(Blocks.yellow_flower,1),new ItemStack(Items.dye, 4, 11)); - recipe.add(new ItemStack(Blocks.gravel,1),new ItemStack(Items.flint, 4)); - recipe.add(new ItemStack(Items.reeds,1),new ItemStack(Items.sugar, 4)); - recipe.add(new ItemStack(Items.bone,1),new ItemStack(Items.dye, 4, 15)); + recipe.add(new ItemStack(Blocks.red_flower, 1), new ItemStack(Items.dye, 4, 1)); + recipe.add(new ItemStack(Blocks.yellow_flower, 1), new ItemStack(Items.dye, 4, 11)); + recipe.add(new ItemStack(Blocks.gravel, 1), new ItemStack(Items.flint, 4)); + recipe.add(new ItemStack(Items.reeds, 1), new ItemStack(Items.sugar, 4)); + recipe.add(new ItemStack(Items.bone, 1), new ItemStack(Items.dye, 4, 15)); //Mod - recipe.add(new ItemStack(Blocks.waterlily,1),new ItemStack(SSItems.dustWaterLily, 4)); + recipe.add(new ItemStack(Blocks.waterlily, 1), new ItemStack(SSItems.dustWaterLily, 4)); + recipe.add("cropRice", new ItemStack(SSItems.whiteRice, 2)); - } + } } diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesPulverizer.java b/src/main/java/shift/sextiarysector/recipe/RecipesPulverizer.java new file mode 100644 index 0000000..7e37411 --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesPulverizer.java @@ -0,0 +1,35 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSItems; + +public class RecipesPulverizer { + + public static void addRecipes(RecipeSimpleMachine recipe) + { + + recipe.add("oreCoal", new ItemStack(SSItems.coalDust, 2)); + recipe.add(new ItemStack(Items.coal, 1, 0), new ItemStack(SSItems.coalDust, 1)); + recipe.add(new ItemStack(Items.coal, 1, 1), new ItemStack(SSItems.coalDust, 1)); + recipe.add("oreIron", new ItemStack(SSItems.ironDust, 2)); + recipe.add("oreGold", new ItemStack(SSItems.goldDust, 2)); + recipe.add("oreCopper", new ItemStack(SSItems.copperDust, 2)); + recipe.add("oreZinc", new ItemStack(SSItems.zincDust, 2)); + recipe.add("oreSilver", new ItemStack(SSItems.silverDust, 2)); + recipe.add("gemDiamond", new ItemStack(SSItems.diamondDust, 1)); + + recipe.add("oreMithril", new ItemStack(SSItems.mithrilDust, 2)); + + recipe.add("ingotCoal", new ItemStack(SSItems.coalDust, 1)); + recipe.add("ingotIron", new ItemStack(SSItems.ironDust, 1)); + recipe.add("ingotGold", new ItemStack(SSItems.goldDust, 1)); + recipe.add("ingotCopper", new ItemStack(SSItems.copperDust, 1)); + recipe.add("ingotZinc", new ItemStack(SSItems.zincDust, 1)); + recipe.add("ingotSilver", new ItemStack(SSItems.silverDust, 1)); + + recipe.add("ingotMithril", new ItemStack(SSItems.mithrilDust, 1)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesRollingMachine.java b/src/main/java/shift/sextiarysector/recipe/RecipesRollingMachine.java new file mode 100644 index 0000000..b8d25be --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesRollingMachine.java @@ -0,0 +1,20 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSBlocks; + +public class RecipesRollingMachine { + + public static void addRecipes(RecipeSimpleMachine recipe) + { + + recipe.add("ingotIron", new ItemStack(SSBlocks.ironPlate, 1)); + recipe.add("ingotGold", new ItemStack(SSBlocks.goldPlate, 1)); + + recipe.add("ingotCopper", new ItemStack(SSBlocks.copperPlate, 1)); + recipe.add("ingotZinc", new ItemStack(SSBlocks.zincPlate, 1)); + recipe.add("ingotSilver", new ItemStack(SSBlocks.silverPlate, 1)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesSawmill.java b/src/main/java/shift/sextiarysector/recipe/RecipesSawmill.java new file mode 100644 index 0000000..c85c56d --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesSawmill.java @@ -0,0 +1,34 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSBlocks; + +public class RecipesSawmill { + + public static void addRecipes(RecipeSimpleMachine recipe) + { + + // + //recipe.add("plankWood", new ItemStack(SSBlocks.woodPlate, 4)); + + recipe.add(new ItemStack(Blocks.planks,1,0), new ItemStack(SSBlocks.woodOakPlate, 4)); + recipe.add(new ItemStack(Blocks.planks,1,1), new ItemStack(SSBlocks.woodSprucePlate, 4)); + recipe.add(new ItemStack(Blocks.planks,1,2), new ItemStack(SSBlocks.woodBirchPlate, 4)); + recipe.add(new ItemStack(Blocks.planks,1,3), new ItemStack(SSBlocks.woodJunglePlate, 4)); + recipe.add(new ItemStack(Blocks.planks,1,4), new ItemStack(SSBlocks.woodAcaciaPlate, 4)); + recipe.add(new ItemStack(Blocks.planks,1,5), new ItemStack(SSBlocks.woodBigOakPlate, 4)); + + for(int i=0;i<4;i++){ + recipe.add(new ItemStack(Blocks.log,1,i),new ItemStack(Blocks.planks, 6,i)); + } + recipe.add(new ItemStack(Blocks.log2,1,0),new ItemStack(Blocks.planks, 6,4)); + recipe.add(new ItemStack(Blocks.log2,1,1),new ItemStack(Blocks.planks, 6,5)); + recipe.add(new ItemStack(Items.wooden_door,1),new ItemStack(Items.stick, 16)); + recipe.add(new ItemStack(Items.bow,1),new ItemStack(Items.string, 3)); + + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesSpinningMachine.java b/src/main/java/shift/sextiarysector/recipe/RecipesSpinningMachine.java new file mode 100644 index 0000000..61c0a2b --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesSpinningMachine.java @@ -0,0 +1,23 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; +import shift.sextiarysector.SSItems; + +public class RecipesSpinningMachine { + + public static void addRecipes(RecipeSimpleMachine recipe) + { + + // + //recipe.add("plankWood", new ItemStack(SSBlocks.woodPlate, 4)); + + recipe.add("clothSilk", new ItemStack(Items.string, 4)); + recipe.add(new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.string, 4)); + recipe.add(new ItemStack(SSItems.stringMass, 1), new ItemStack(SSItems.strongString, 2)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesTimeMachine.java b/src/main/java/shift/sextiarysector/recipe/RecipesTimeMachine.java new file mode 100644 index 0000000..df1066a --- /dev/null +++ b/src/main/java/shift/sextiarysector/recipe/RecipesTimeMachine.java @@ -0,0 +1,37 @@ +package shift.sextiarysector.recipe; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SSItems; + +public class RecipesTimeMachine { + + public static void addRecipes(RecipeSimpleMachine recipe) + { + + recipe.add(new ItemStack(SSItems.turnip), new ItemStack(SSBlocks.turnip, 1)); + recipe.add(new ItemStack(SSItems.cucumber), new ItemStack(SSBlocks.cucumber, 1)); + recipe.add(new ItemStack(SSItems.ironTurnip), new ItemStack(SSBlocks.ironTurnip, 1)); + + recipe.add(new ItemStack(SSItems.onion), new ItemStack(SSBlocks.onion, 1)); + recipe.add(new ItemStack(SSItems.tomato), new ItemStack(SSBlocks.tomato, 1)); + recipe.add(new ItemStack(SSItems.corn), new ItemStack(SSBlocks.corn, 1)); + recipe.add(new ItemStack(SSItems.goldenCorn), new ItemStack(SSBlocks.goldenCorn, 1)); + + recipe.add(new ItemStack(SSItems.eggplant), new ItemStack(SSBlocks.eggplant, 1)); + recipe.add(new ItemStack(SSItems.sweetPotato), new ItemStack(SSBlocks.sweetPotato, 1)); + recipe.add(new ItemStack(SSItems.greenPepper), new ItemStack(SSBlocks.greenPepper, 1)); + + recipe.add(new ItemStack(SSItems.radish), new ItemStack(SSBlocks.radish, 1)); + + recipe.add(new ItemStack(SSItems.rice), new ItemStack(SSBlocks.rice, 1)); + + recipe.add(new ItemStack(Blocks.red_mushroom), new ItemStack(SSBlocks.redMushroom, 1)); + + recipe.add(new ItemStack(SSItems.attackRustUnit), new ItemStack(SSItems.attackUnit, 1)); + recipe.add(new ItemStack(SSItems.defenseRustUnit), new ItemStack(SSItems.defenseUnit, 1)); + + } + +} diff --git a/src/main/java/shift/sextiarysector/recipe/RecipesTool.java b/src/main/java/shift/sextiarysector/recipe/RecipesTool.java index e990e0b..cf106c8 100644 --- a/src/main/java/shift/sextiarysector/recipe/RecipesTool.java +++ b/src/main/java/shift/sextiarysector/recipe/RecipesTool.java @@ -9,28 +9,226 @@ public class RecipesTool { public static void addRecipes(CraftingManager p_77608_1_) - { + { //Scoop - Object[] material = new Object[]{"plankWood","cobblestone","ingotIron","ingotGold","gemDiamond"}; - Item[] scoop = new Item[]{SSItems.woodScoop,SSItems.stoneScoop,SSItems.ironScoop,SSItems.goldScoop,SSItems.diamondScoop}; - for(int i = 0;i> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererCraftFurnace.java b/src/main/java/shift/sextiarysector/renderer/block/RendererCraftFurnace.java new file mode 100644 index 0000000..22231d8 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererCraftFurnace.java @@ -0,0 +1,61 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.renderer.model.ModelCraftFurnace; +import shift.sextiarysector.tileentity.TileEntityCraftFurnace; + +public class RendererCraftFurnace extends TileEntitySpecialRenderer{ + + private static final ResourceLocation craftFurnaceTextures = new ResourceLocation("sextiarysector:textures/models/craft_furnace.png"); + + static public ModelCraftFurnace modelCraftFurnace = new ModelCraftFurnace(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x,double y, double z, float p_147500_8_) { + + + TileEntityCraftFurnace tile = (TileEntityCraftFurnace)tileentity; + + + if(!tile.isLarge())return; + + + //System.out.println("renderTileEntityAt"); + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + float scale = 0.0625f + 0.0001f; + GL11.glScalef(scale,scale,scale); + + this.bindTexture(craftFurnaceTextures); + + switch(tile.direction){ + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 1, 0, 0); + GL11.glRotatef(180, 0, 1, 0); + break; + case NORTH: + GL11.glRotatef(180, 1, 0, 0); + break; + default: + break; + } + + modelCraftFurnace.render(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererElectricMotor.java b/src/main/java/shift/sextiarysector/renderer/block/RendererElectricMotor.java new file mode 100644 index 0000000..3395305 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererElectricMotor.java @@ -0,0 +1,119 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.plugin.PluginIC2; +import shift.sextiarysector.renderer.model.ModelMotor; +import shift.sextiarysector.tileentity.TileEntityElectricMotor; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererElectricMotor extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + if(modelID!=this.getRenderId()){ + return ; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f; + GL11.glScalef(scale,scale,scale); + + GL11.glRotatef(90, 1, 0, 0); + GL11.glRotatef(180, 0, 1, 0); + + this.bind(electricMotorTextures); + + modelElectricMotor.render(null, 0,0,0, 0,0, 1.0f); + modelElectricMotor.renderShaft(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return PluginIC2.electricMotorType; + } + + private static final ResourceLocation electricMotorTextures = new ResourceLocation("sextiarysector:textures/models/electric_motor.png"); + + static public ModelMotor modelElectricMotor = new ModelMotor(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + TileEntityElectricMotor tile = (TileEntityElectricMotor)tileentity; + + //System.out.println("renderTileEntityAt"); + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + float scale = 0.0625f; + GL11.glScalef(scale,scale,scale); + + this.bindTexture(electricMotorTextures); + + switch(tile.direction){ + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + modelElectricMotor.render(null, 0,0,0, 0,0, 1.0f); + + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + + + modelElectricMotor.renderShaft(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + } + + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererFan.java b/src/main/java/shift/sextiarysector/renderer/block/RendererFan.java new file mode 100644 index 0000000..2d890d8 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererFan.java @@ -0,0 +1,116 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.renderer.model.ModelFan; +import shift.sextiarysector.tileentity.TileEntityFan; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererFan extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId,RenderBlocks renderer) { + + if(modelId!=this.getRenderId()){ + return ; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f; + GL11.glScalef(scale,scale,scale); + + //GL11.glRotatef(180, 1, 0, 0); + + this.bind(this.fanShaftTextures); + + modelFan.render(null, 0,0,0, 0,0, 1.0f); + modelFan.renderFan(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block block, int modelId, RenderBlocks renderer) { + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.fanType; + } + + private static final ResourceLocation fanShaftTextures = new ResourceLocation("sextiarysector:textures/models/fan.png"); + + static public ModelFan modelFan = new ModelFan(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x,double y, double z, float p_147500_8_) { + + TileEntityFan tile = (TileEntityFan)tileentity; + + //System.out.println("renderTileEntityAt"); + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + float scale = 0.0624f; + GL11.glScalef(scale,scale,scale); + + this.bindTexture(fanShaftTextures); + + switch(tile.direction){ + case UP: + GL11.glRotatef(90, -1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, 1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, -1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, 1, 0); + break; + case NORTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + modelFan.render(null, 0,0,0, 0,0, 1.0f); + + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + + modelFan.renderFan(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + } + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererFarmland.java b/src/main/java/shift/sextiarysector/renderer/block/RendererFarmland.java index 23c9719..9986a46 100644 --- a/src/main/java/shift/sextiarysector/renderer/block/RendererFarmland.java +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererFarmland.java @@ -51,7 +51,7 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block bl if(t!=null&&t.getFertilizer()!=null){ if(FertilizerManager.getFertilizer(t.getFertilizer())!=null){ - renderer.setOverrideBlockTexture(FertilizerManager.getFertilizer(t.getFertilizer()).getFertilizerIcon()); + renderer.setOverrideBlockTexture(FertilizerManager.getFertilizerIcon(t.getFertilizer()).getFertilizerIcon()); }else{ t.setFertilizer(null); } diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererFigure.java b/src/main/java/shift/sextiarysector/renderer/block/RendererFigure.java new file mode 100644 index 0000000..b3d1d88 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererFigure.java @@ -0,0 +1,289 @@ +package shift.sextiarysector.renderer.block; + +import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*; +import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.*; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.block.BlockFigure; +import shift.sextiarysector.tileentity.TileEntityFigure; +import cpw.mods.fml.client.FMLClientHandler; + +public class RendererFigure extends TileEntitySpecialRenderer implements IItemRenderer { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + private static RenderItem renderer; + private static EntityItem entityItem; + static { + renderer = new RenderItem(); + renderer.setRenderManager(RenderManager.instance); + entityItem = new EntityItem(null); + entityItem.hoverStart = 0; + } + + @Override + public void renderTileEntityAt(TileEntity p_147500_1_, double x, double y, double z, float p_147500_8_) { + + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.3F, (float) z + 0.5F); + //float scale = 0.0625f; + //GL11.glScalef(scale,scale,scale); + + TileEntityFigure t = (TileEntityFigure) p_147500_1_; + + if (t.getFigure() != null) { + + GL11.glColor4f(1, 1, 1, 1); + switch (t.direction) { + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + case NORTH: + GL11.glRotatef(360, 0, -1, 0); + break; + default: + break; + } + //EntityItem entityitem = new EntityItem(t.getWorldObj(), t.xCoord, t.yCoord, t.zCoord, t.getFigure()); + this.renderFigure(t.getFigure()); + //renderer.doRender(entityitem, x, y, z, 0, 0); + //RenderManager.instance.renderEntitySimple(entityitem, 1.0f); + //System.out.println("AAAACC"); + } + + GL11.glPopMatrix(); + + } + + public void renderFigure(ItemStack itemstack) + { + + GL11.glColor4f(1, 1, 1, 1); + entityItem.setEntityItemStack(itemstack); + + if (isLarge(itemstack)) { + + double d = 2; + if (isLarge(itemstack)) GL11.glScaled(d, d, d); + + renderer.doRender(entityItem, 0, 0.06, 0, 0, 0); + + } else { + + renderer.doRender(entityItem, 0, 0.03, 0, 0, 0); + + } + + } + + private boolean isLarge(ItemStack itemstack) { + + IItemRenderer customItemRenderer = MinecraftForgeClient.getItemRenderer(itemstack, ENTITY); + + if (itemstack.getItemSpriteNumber() == 0 && itemstack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemstack.getItem()).getRenderType())) + { + + int renderType = Block.getBlockFromItem(itemstack.getItem()).getRenderType(); + return !(renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2); + + } + + else if (customItemRenderer != null && customItemRenderer.shouldUseRenderHelper(ENTITY, itemstack, BLOCK_3D)) + { + + return true; + + } + + return false; + + } + + //Item + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch (type) { + case ENTITY: + case EQUIPPED: + case EQUIPPED_FIRST_PERSON: + case INVENTORY: + return true; + default: + return false; + } + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + switch (type) { + case ENTITY: { + return (helper == ItemRendererHelper.ENTITY_BOBBING || + helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.BLOCK_3D); + } + case EQUIPPED: { + return (helper == ItemRendererHelper.BLOCK_3D || helper == ItemRendererHelper.EQUIPPED_BLOCK); + } + case EQUIPPED_FIRST_PERSON: { + return (helper == ItemRendererHelper.EQUIPPED_BLOCK); + } + case INVENTORY: { + return (helper == ItemRendererHelper.INVENTORY_BLOCK); + } + default: { + return false; + } + } + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + + GL11.glPushMatrix(); + + boolean r = true; + + try { + + switch (type) { + case EQUIPPED: + case EQUIPPED_FIRST_PERSON: { + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + break; + } + case ENTITY: + case INVENTORY: { + GL11.glTranslatef(0.0F, -0.2F, 0.0F); + break; + } + default: + break; + } + + GL11.glRotatef(90, 0, 1, 0); + + ItemStack figure = BlockFigure.getFigureItem(item); + + if (figure != null) { + + float scale = 4.0f / 5.0f; + GL11.glScalef(scale, scale, scale); + + this.renderFigure(figure); + //GL11.glColor4f(2.0F, 2.0F, 2.0F, 0.75F); + //GL11.glDisable(GL12.GL_RESCALE_NORMAL); + //GL11.glDisable(GL11.GL_LIGHTING); + //GL11.glDisable(GL11.GL_DEPTH_TEST); + //RenderHelper.disableStandardItemLighting(); + //GL11.glDisable(GL11.GL_LIGHTING); + //GL11.glDisable(GL11.GL_LIGHT0); + //GL11.glDisable(GL11.GL_LIGHT1); + //GL11.glDisable(GL11.GL_COLOR_MATERIAL); + //GL11.glDisable(GL11.GL_BLEND); + //GL11.glEnable(GL11.GL_LIGHTING); + + } + } catch (NullPointerException e) { + SextiarySector.Log.catching(e); + r = false; + float scale = 2.0f; + //GL11.glScalef(scale, scale, scale); + //RenderHelper.disableStandardItemLighting(); + //GL11.glEnable(GL11.GL_BLEND); + } + + GL11.glPopMatrix(); + + if (r) { + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + float scale = 2.0f; + //GL11.glScalef(scale, scale, scale); + //GL11.glEnable(GL11.GL_LIGHTING); + //GL11.glEnable(GL11.GL_DEPTH_TEST); + //RenderHelper.enableStandardItemLighting(); + //RenderHelper.disableStandardItemLighting(); + //RenderHelper.enableGUIStandardItemLighting(); + } + + GL11.glPushMatrix(); + + switch (type) { + case EQUIPPED: + case EQUIPPED_FIRST_PERSON: { + break; + } + case ENTITY: + case INVENTORY: { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + break; + } + default: + break; + } + + this.bind(MC_BLOCK_SHEET); + + Tessellator tessellator = Tessellator.instance; + RenderBlocks renderer = (RenderBlocks) data[0]; + Block block = Block.getBlockFromItem(item.getItem()); + int metadata = item.getItemDamage(); + float f = 1.0f / 16.0f; + renderer.setRenderBounds(f * 2, 0, f * 2, f * 14, f * 4, f * 14); + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); + tessellator.draw(); + + GL11.glPopMatrix(); + + //RenderHelper.enableGUIStandardItemLighting(); + + } + + private static void bind(ResourceLocation res) { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererFluidCrafter.java b/src/main/java/shift/sextiarysector/renderer/block/RendererFluidCrafter.java new file mode 100644 index 0000000..808821a --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererFluidCrafter.java @@ -0,0 +1,222 @@ +package shift.sextiarysector.renderer.block; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.fluids.FluidRegistry; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.renderer.model.ModelFluidCrafter; +import shift.sextiarysector.tileentity.TileEntityFluidCrafter; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererFluidCrafter extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + private static final ResourceLocation bottleTextures = new ResourceLocation("sextiarysector:textures/models/fluid_crafter.png"); + + private final Minecraft mc = FMLClientHandler.instance().getClient(); + + private final RenderBlocks blockrender = new RenderBlocks(); + + public static ModelFluidCrafter modelFluidCrafter = new ModelFluidCrafter(); + + public static Random r = new Random(); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + GL11.glPushMatrix(); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor3f(1, 1, 1); + + this.bind(MC_BLOCK_SHEET); + + //GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + + GL11.glRotatef(-(FMLClientHandler.instance().getClient().getMinecraft().getSystemTime() / 50) % 360, 0, 1, 0); + + if (metadata != 0 && FluidRegistry.getFluid(metadata) != null) { + + IIcon icon = blockrender.getIconSafe(FluidRegistry.getFluid(metadata).getIcon()); + + setColor3ubFromInt(FluidRegistry.getFluid(metadata).getColor()); + + float i = 0.0625f; + + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + renderer.renderAllFaces = true; + renderer.setOverrideBlockTexture(icon); + renderer.setRenderBounds(-3.9f / 16.0f, -3.9f / 16.0f, -3.9f / 16.0f, 3.9f / 16.0f, 3.9 / 16.0f, 3.9f / 16.0f); + Tessellator tessellator = Tessellator.instance; + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + + renderer.renderAllFaces = false; + renderer.clearOverrideBlockTexture(); + + } + + this.bind(bottleTextures); + + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + GL11.glRotatef(180, 1, 0, 0); + + GL11.glColor3f(1, 1, 1); + + modelFluidCrafter.render(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + return true; + } + + @Override + public boolean shouldRender3DInInventory(int mate) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.fluidCrafterType; + } + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + GL11.glPushMatrix(); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glColor3f(1, 1, 1); + + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + + GL11.glRotatef(((TileEntityFluidCrafter) tileentity).x, 1, 0, 0); + GL11.glRotatef(((TileEntityFluidCrafter) tileentity).y, 0, 1, 0); + GL11.glRotatef(((TileEntityFluidCrafter) tileentity).z, 0, 0, 1); + + if (((TileEntityFluidCrafter) tileentity).hasFluid()) { + + IIcon icon = blockrender.getIconSafe(((TileEntityFluidCrafter) tileentity).getFluidIcon()); + Block block = tileentity.getBlockType(); + + //float i = 0.3125f; + + this.bindTexture(MC_BLOCK_SHEET); + + this.setColor3ubFromInt(((TileEntityFluidCrafter) tileentity).getFluidColor()); + + blockrender.blockAccess = tileentity.getWorldObj(); + + blockrender.renderAllFaces = true; + blockrender.setOverrideBlockTexture(icon); + //blockrender.setRenderBounds(i*2.3, -0.0625*6, i*2.3, 1-i*2.5,0.0625*1.8f, 1-i*2.3); + blockrender.setRenderBounds(-3.9f / 16.0f, -3.9f / 16.0f, -3.9f / 16.0f, 3.9f / 16.0f, 3.9 / 16.0f, 3.9f / 16.0f); + //blockrender.setRenderBounds(i, 0.0625*2, i, 1-i,0.0625*8f, 1-i); + //blockrender.renderStandardBlock(Block.blocksList[tileentity.getWorldObj().getBlockId(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord)], tileentity.xCoord, tileentity.yCoord,tileentity.zCoord); + + Tessellator tessellator = Tessellator.instance; + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + blockrender.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + blockrender.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + blockrender.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + blockrender.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + blockrender.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + blockrender.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + + blockrender.renderAllFaces = false; + blockrender.clearOverrideBlockTexture(); + + } + + this.bindTexture(bottleTextures); + + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + GL11.glRotatef(180, 1, 0, 0); + + GL11.glColor3f(1, 1, 1); + + modelFluidCrafter.render(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + } + + private void bind(ResourceLocation res) + { + mc.getTextureManager().bindTexture(res); + } + + public static void setColor3ubFromInt(int color) { + + GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererFunnel.java b/src/main/java/shift/sextiarysector/renderer/block/RendererFunnel.java new file mode 100644 index 0000000..9577d42 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererFunnel.java @@ -0,0 +1,211 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.block.BlockFunnel; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererFunnel implements ISimpleBlockRenderingHandler { + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + + this.renderBlockFunnel(block, x, y, z, renderer); + + return true; + } + + public boolean renderBlockFunnel(Block p_147803_1_, int p_147803_2_, int p_147803_3_, int p_147803_4_, RenderBlocks renderer) + { + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147803_1_.getMixedBrightnessForBlock(renderer.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_)); + int l = p_147803_1_.colorMultiplier(renderer.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_); + float f = (l >> 16 & 255) / 255.0F; + float f1 = (l >> 8 & 255) / 255.0F; + float f2 = (l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + return this.renderBlockFunnelMetadata(p_147803_1_, p_147803_2_, p_147803_3_, p_147803_4_, renderer.blockAccess.getBlockMetadata(p_147803_2_, p_147803_3_, p_147803_4_), false, renderer); + } + + public boolean renderBlockFunnelMetadata(Block p_147799_1_, int p_147799_2_, int p_147799_3_, int p_147799_4_, int p_147799_5_, boolean p_147799_6_, RenderBlocks renderer) + { + Tessellator tessellator = Tessellator.instance; + int i1 = 0;//BlockHopper.getDirectionFromMetadata(p_147799_5_); + double d0 = 0.625D; + renderer.setRenderBounds(0.0D, d0, 0.0D, 1.0D, 1.0D, 1.0D); + + if (p_147799_6_) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 0, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 1, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 2, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 3, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 4, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 5, p_147799_5_)); + tessellator.draw(); + } + else + { + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + float f1; + + if (!p_147799_6_) + { + tessellator.setBrightness(p_147799_1_.getMixedBrightnessForBlock(renderer.blockAccess, p_147799_2_, p_147799_3_, p_147799_4_)); + int j1 = p_147799_1_.colorMultiplier(renderer.blockAccess, p_147799_2_, p_147799_3_, p_147799_4_); + float f = (j1 >> 16 & 255) / 255.0F; + f1 = (j1 >> 8 & 255) / 255.0F; + float f2 = (j1 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + } + + IIcon iicon = ((BlockFunnel) SSBlocks.funnel).getFunnelIcon("funnel_outside"); + IIcon iicon1 = ((BlockFunnel) SSBlocks.funnel).getFunnelIcon("funnel_inside"); + f1 = 0.125F; + + if (p_147799_6_) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(p_147799_1_, -1.0F + f1, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(p_147799_1_, 1.0F - f1, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, -1.0F + f1, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, 1.0F - f1, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(p_147799_1_, 0.0D, -1.0D + d0, 0.0D, iicon1); + tessellator.draw(); + } + else + { + renderer.renderFaceXPos(p_147799_1_, p_147799_2_ - 1.0F + f1, p_147799_3_, p_147799_4_, iicon); + renderer.renderFaceXNeg(p_147799_1_, p_147799_2_ + 1.0F - f1, p_147799_3_, p_147799_4_, iicon); + renderer.renderFaceZPos(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_ - 1.0F + f1, iicon); + renderer.renderFaceZNeg(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_ + 1.0F - f1, iicon); + renderer.renderFaceYPos(p_147799_1_, p_147799_2_, p_147799_3_ - 1.0F + d0, p_147799_4_, iicon1); + } + + renderer.setOverrideBlockTexture(iicon); + double d3 = 0.125D;//0.25D; + double d4 = 0.375D;//0.25D; + renderer.setRenderBounds(d3, d4, d3, 1.0D - d3, d0 - 0.002D, 1.0D - d3); + + if (p_147799_6_) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + } + else + { + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (!p_147799_6_) + { + double d1 = 0.25D;//0.375D; + renderer.setOverrideBlockTexture(iicon); + + renderer.setRenderBounds(d1, 0.0D, d1, 1.0D - d1, d4, 1.0D - d1); + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + + } + + renderer.clearOverrideBlockTexture(); + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return false; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.funnelType; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererGFDynamo.java b/src/main/java/shift/sextiarysector/renderer/block/RendererGFDynamo.java new file mode 100644 index 0000000..55eabda --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererGFDynamo.java @@ -0,0 +1,120 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.plugin.PluginRF; +import shift.sextiarysector.renderer.model.ModelGFDynamo; +import shift.sextiarysector.tileentity.TileEntityGFDynamo; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererGFDynamo extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + if (modelID != this.getRenderId()) { + return; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + + GL11.glRotatef(90, 1, 0, 0); + GL11.glRotatef(180, 0, 1, 0); + + this.bind(gfDynamoTextures); + + modelGFDynamoMotor.render(null, 0, 0, 0, 0, 0, 1.0f); + modelGFDynamoMotor.renderShaft(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return PluginRF.gfDynamoType; + } + + private static final ResourceLocation gfDynamoTextures = new ResourceLocation("sextiarysector:textures/models/gf_dynamo.png"); + + static public ModelGFDynamo modelGFDynamoMotor = new ModelGFDynamo(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + TileEntityGFDynamo tile = (TileEntityGFDynamo) tileentity; + + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + //float scale = 0.0625f; + float scale = 0.0624f; + GL11.glScalef(scale, scale, scale); + + this.bindTexture(gfDynamoTextures); + + switch (tile.direction) { + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + GL11.glDisable(GL11.GL_CULL_FACE); + + modelGFDynamoMotor.render(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glEnable(GL11.GL_CULL_FACE); + + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + + modelGFDynamoMotor.renderShaft(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + } + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererGearShaft.java b/src/main/java/shift/sextiarysector/renderer/block/RendererGearShaft.java new file mode 100644 index 0000000..6fd1084 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererGearShaft.java @@ -0,0 +1,172 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.renderer.model.ModelGearShaftDown; +import shift.sextiarysector.renderer.model.ModelGearShaftUp; +import shift.sextiarysector.tileentity.TileEntityGearShaft; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererGearShaft extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + if(modelID!=this.getRenderId()){ + return ; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f; + GL11.glScalef(scale,scale,scale); + + GL11.glRotatef(90, 1, 0, 0); + + ModelGearShaftUp m; + if(metadata==0){ + m = this.modelShaftUp; + }else{ + m = this.modelShaftDown; + } + + + + if(block == SSBlocks.woodStoneGearShaft){ + this.bind(woodShaftTextures); + }else if(block == SSBlocks.stoneSteelGearShaft){ + this.bind(stoneShaftTextures); + }else if(block == SSBlocks.steelNinjaGearShaft){ + this.bind(steelShaftTextures); + }else if(block == SSBlocks.ninjaOrichalcumGearShaft){ + this.bind(ninjaShaftTextures); + } + + //this.bind(woodShaftTextures); + + m.render(null, 0,0,0, 0,0, 1.0f); + + GL11.glRotatef(-(FMLClientHandler.instance().getClient().getMinecraft().getSystemTime()/20)%360, 0, 0, 1); + + m.renderUp(null, 0,0,0, 0,0, 1.0f); + + GL11.glRotatef((FMLClientHandler.instance().getClient().getMinecraft().getSystemTime()/20)%360, 0, 0, 1); + GL11.glRotatef(-(FMLClientHandler.instance().getClient().getMinecraft().getSystemTime()/80)%360, 0, 0, 1); + + m.renderDown(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.instance.proxy.GearShaftRenderType; + } + + private static final ResourceLocation woodShaftTextures = new ResourceLocation("sextiarysector:textures/models/wood_gear_shaft.png"); + private static final ResourceLocation stoneShaftTextures = new ResourceLocation("sextiarysector:textures/models/stone_gear_shaft.png"); + private static final ResourceLocation steelShaftTextures = new ResourceLocation("sextiarysector:textures/models/steel_gear_shaft.png"); + private static final ResourceLocation ninjaShaftTextures = new ResourceLocation("sextiarysector:textures/models/ninja_gear_shaft.png"); + + static public ModelGearShaftUp modelShaftUp = new ModelGearShaftUp(); + static public ModelGearShaftDown modelShaftDown = new ModelGearShaftDown(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + TileEntityGearShaft tile = (TileEntityGearShaft)tileentity; + + //System.out.println("renderTileEntityAt"); + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + float scale = 0.0625f; + GL11.glScalef(scale,scale,scale); + + switch(tile.getMaxPowerStored(ForgeDirection.UP)){ + case 1:this.bindTexture(woodShaftTextures);break; + case 2:this.bindTexture(stoneShaftTextures);break; + case 3:this.bindTexture(steelShaftTextures);break; + case 4:this.bindTexture(ninjaShaftTextures);break; + } + + + switch(tile.direction){ + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + ModelGearShaftUp m; + if(tileentity.getBlockMetadata()==0){ + m = this.modelShaftUp; + }else{ + m = this.modelShaftDown; + } + + m.render(null, 0,0,0, 0,0, 1.0f); + + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.rotateDownStep, 0, 0, 1); + + m.renderDown(null, 0,0,0, 0,0, 1.0f); + + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(-tile.rotateDownStep, 0, 0, 1); + GL11.glRotatef(tile.rotateUpStep, 0, 0, 1); + + m.renderUp(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + } + + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererHole.java b/src/main/java/shift/sextiarysector/renderer/block/RendererHole.java index 1f8a39e..e4735da 100644 --- a/src/main/java/shift/sextiarysector/renderer/block/RendererHole.java +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererHole.java @@ -18,13 +18,13 @@ public class RendererHole implements ISimpleBlockRenderingHandler { public static RenderSSBlocks renderer = new RenderSSBlocks(); @Override - public void renderInventoryBlock(Block block, int metadata, int modelId,RenderBlocks renderer) { + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { } @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { - if(this.getRenderId()!=modelId)return false; + if (this.getRenderId() != modelId) return false; this.renderer.blockAccess = world; @@ -34,12 +34,10 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block bl this.renderer.renderStandardBlock(block, x, y, z); //Tessellator tessellator = Tessellator.instance; - //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y+1, z)); + //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y+1, z)); //renderer.setOverrideBlockTexture(Blocks.dirt.getIcon(0, 0)); - - float f = 0.125F; float minx = 0; @@ -47,228 +45,214 @@ public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block bl float maxx = 1; float maxz = 1; - - if(!this.isSame(world, x, y, z,block, ForgeDirection.getOrientation(4))){ + if (!this.isSame(world, x, y, z, block, ForgeDirection.getOrientation(4))) { //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y+1, z)); this.renderer.setRenderBounds(0.0f, 0.0F, 0.0F, f, 1.0F, 1.0F); this.renderer.renderStandardBlock(block, x, y, z, ForgeDirection.getOrientation(4)); minx = f; - } - - if(!this.isSame(world, x, y, z,block, ForgeDirection.getOrientation(2))){ - //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - this.renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); - this.renderer.renderStandardBlock(block, x, y, z, ForgeDirection.getOrientation(2)); - //this.renderStandardBlock(block, world, x, y, z, renderer); - minz = f; - } - - if(!this.isSame(world, x, y, z,block, ForgeDirection.getOrientation(5))){ - //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - this.renderer.setRenderBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - this.renderer.renderStandardBlock(block, x, y, z, ForgeDirection.getOrientation(5)); - //this.renderStandardBlock(block, world, x, y, z, renderer); - maxx = 1-f; - } - - if(!this.isSame(world, x, y, z,block, ForgeDirection.getOrientation(3))){ - //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - this.renderer.setRenderBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); - this.renderer.renderStandardBlock(block, x, y, z,ForgeDirection.getOrientation(3)); - //this.renderStandardBlock(block, world, x, y, z, renderer); - maxz = 1-f; - } - - - //Tessellator tessellator = Tessellator.instance; - //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - - //IIcon iicon = BlockLiquid.getLiquidIcon("water_still"); - //this.renderer.renderFaceYPos(block, (double)x, (double)((float)y - 1.0F + (15f/16f)), (double)z, iicon); - - - if(world.getBlockMetadata(x, y, z)==1){ - this.renderer.setRenderBounds(minx, 0.3125F, minz, maxx , 0.9375F, maxz); - this.renderer.setOverrideBlockTexture(Blocks.water.getIcon(0, 0)); - this.renderer.renderStandardBlock(block, x, y, z,ForgeDirection.getOrientation(1)); - this.renderer.clearOverrideBlockTexture(); - - this.renderer.clearOverrideBlockTexture(); - } + } + + if (!this.isSame(world, x, y, z, block, ForgeDirection.getOrientation(2))) { + //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + this.renderer.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); + this.renderer.renderStandardBlock(block, x, y, z, ForgeDirection.getOrientation(2)); + //this.renderStandardBlock(block, world, x, y, z, renderer); + minz = f; + } + + if (!this.isSame(world, x, y, z, block, ForgeDirection.getOrientation(5))) { + //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + this.renderer.setRenderBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + this.renderer.renderStandardBlock(block, x, y, z, ForgeDirection.getOrientation(5)); + //this.renderStandardBlock(block, world, x, y, z, renderer); + maxx = 1 - f; + } + + if (!this.isSame(world, x, y, z, block, ForgeDirection.getOrientation(3))) { + //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + this.renderer.setRenderBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); + this.renderer.renderStandardBlock(block, x, y, z, ForgeDirection.getOrientation(3)); + //this.renderStandardBlock(block, world, x, y, z, renderer); + maxz = 1 - f; + } + //Tessellator tessellator = Tessellator.instance; + //tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - this.renderer.field_152631_f = false; - this.renderer.renderAllFaces = false; + //IIcon iicon = BlockLiquid.getLiquidIcon("water_still"); + //this.renderer.renderFaceYPos(block, (double)x, (double)((float)y - 1.0F + (15f/16f)), (double)z, iicon); + this.renderer.field_152631_f = false; + this.renderer.renderAllFaces = false; - /* + /* renderer.renderStandardBlock(block, x, y, z); - Tessellator tessellator = Tessellator.instance; - tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); - int l = block.colorMultiplier(world, x, y, z); - f = (float)(l >> 16 & 255) / 255.0F; - float f1 = (float)(l >> 8 & 255) / 255.0F; - float f2 = (float)(l & 255) / 255.0F; - float f4; - - if (EntityRenderer.anaglyphEnable) - { - float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; - f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; - float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; - f = f3; - f1 = f4; - f2 = f5; - } - - tessellator.setColorOpaque_F(f, f1, f2); - IIcon iicon1 = block.getBlockTextureFromSide(2); - f4 = 0.125F; - renderer.renderFaceXPos(block, (double)((float)x - 1.0F + f4), (double)y, (double)z, iicon1); - renderer.renderFaceXNeg(block, (double)((float)x + 1.0F - f4), (double)y, (double)z, iicon1); - renderer.renderFaceZPos(block, (double)x, (double)y, (double)((float)z - 1.0F + f4), iicon1); - renderer.renderFaceZNeg(block, (double)x, (double)y, (double)((float)z + 1.0F - f4), iicon1); - IIcon iicon2 = block.getBlockTextureFromSide(2); - renderer.renderFaceYPos(block, (double)x, (double)((float)y - 1.0F + 0.25F), (double)z, iicon2); - renderer.renderFaceYNeg(block, (double)x, (double)((float)y + 1.0F - 0.75F), (double)z, iicon2); - */ - - return true; + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + int l = block.colorMultiplier(world, x, y, z); + f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + float f4; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + IIcon iicon1 = block.getBlockTextureFromSide(2); + f4 = 0.125F; + renderer.renderFaceXPos(block, (double)((float)x - 1.0F + f4), (double)y, (double)z, iicon1); + renderer.renderFaceXNeg(block, (double)((float)x + 1.0F - f4), (double)y, (double)z, iicon1); + renderer.renderFaceZPos(block, (double)x, (double)y, (double)((float)z - 1.0F + f4), iicon1); + renderer.renderFaceZNeg(block, (double)x, (double)y, (double)((float)z + 1.0F - f4), iicon1); + IIcon iicon2 = block.getBlockTextureFromSide(2); + renderer.renderFaceYPos(block, (double)x, (double)((float)y - 1.0F + 0.25F), (double)z, iicon2); + renderer.renderFaceYNeg(block, (double)x, (double)((float)y + 1.0F - 0.75F), (double)z, iicon2); + */ + + return true; } - private boolean isSame(IBlockAccess p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_ ,Block b, ForgeDirection d){ + protected boolean isSame(IBlockAccess p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, Block b, ForgeDirection d) { - if(p_149743_1_.getBlock(p_149743_2_ + d.offsetX, p_149743_3_ + d.offsetY, p_149743_4_ + d.offsetZ) == b)return true; + if (p_149743_1_.getBlock(p_149743_2_ + d.offsetX, p_149743_3_ + d.offsetY, p_149743_4_ + d.offsetZ) == b) return true; return false; } - public boolean renderStandardBlock(Block p_147784_1_,IBlockAccess world, int p_147784_2_, int p_147784_3_, int p_147784_4_,RenderBlocks renderer) - { - int l = p_147784_1_.colorMultiplier(world, p_147784_2_, p_147784_3_, p_147784_4_); - float f = (float)(l >> 16 & 255) / 255.0F; - float f1 = (float)(l >> 8 & 255) / 255.0F; - float f2 = (float)(l & 255) / 255.0F; - - if (EntityRenderer.anaglyphEnable) - { - float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; - float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; - float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; - f = f3; - f1 = f4; - f2 = f5; - } - - return Minecraft.isAmbientOcclusionEnabled() && p_147784_1_.getLightValue() == 0 ? (renderer.partialRenderBounds ? renderer.renderStandardBlockWithAmbientOcclusionPartial(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, f, f1, f2) : this.renderStandardBlockWithColorMultiplier(p_147784_1_, world, p_147784_2_, p_147784_3_, p_147784_4_, f, f1, f2, renderer)) : this.renderStandardBlockWithColorMultiplier(p_147784_1_, world, p_147784_2_, p_147784_3_, p_147784_4_, f, f1, f2, renderer); - - //return this.renderStandardBlockWithColorMultiplier(p_147784_1_, world, p_147784_2_, p_147784_3_, p_147784_4_, f, f1, f2, renderer); - } - - public boolean renderStandardBlockWithColorMultiplier(Block p_147736_1_,IBlockAccess world, int p_147736_2_, int p_147736_3_, int p_147736_4_, float p_147736_5_, float p_147736_6_, float p_147736_7_ ,RenderBlocks renderer) - { - System.out.println("AAA"); - renderer.enableAO = false; - Tessellator tessellator = Tessellator.instance; - boolean flag = false; - float f3 = 0.5F; - float f4 = 1.0F; - float f5 = 0.8F; - float f6 = 0.6F; - float f7 = f4 * p_147736_5_; - float f8 = f4 * p_147736_6_; - float f9 = f4 * p_147736_7_; - float f10 = f3; - float f11 = f5; - float f12 = f6; - float f13 = f3; - float f14 = f5; - float f15 = f6; - float f16 = f3; - float f17 = f5; - float f18 = f6; - - IBlockAccess blockAccess = world; - - - if (p_147736_1_ != Blocks.grass) - { - f10 = f3 * p_147736_5_; - f11 = f5 * p_147736_5_; - f12 = f6 * p_147736_5_; - f13 = f3 * p_147736_6_; - f14 = f5 * p_147736_6_; - f15 = f6 * p_147736_6_; - f16 = f3 * p_147736_7_; - f17 = f5 * p_147736_7_; - f18 = f6 * p_147736_7_; - } - - int l = p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_, p_147736_4_); - tessellator.setBrightness(l); - - if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_, p_147736_3_ - 1, p_147736_4_, 0)) - { - //tessellator.setBrightness(renderer.renderMinY > 0.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_ - 1, p_147736_4_)); - tessellator.setColorOpaque_F(f10, f13, f16); - renderer.renderFaceYNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 0)); - flag = true; - } - - if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_, p_147736_3_ + 1, p_147736_4_, 1)) - { - //tessellator.setBrightness(renderer.renderMaxY < 1.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_ + 1, p_147736_4_)); - tessellator.setColorOpaque_F(f7, f8, f9); - renderer.renderFaceYPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 1)); - flag = true; - } - - IIcon iicon; - - if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ - 1, 2)) - { - //tessellator.setBrightness(renderer.renderMinZ > 0.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ - 1)); - tessellator.setColorOpaque_F(f11, f14, f17); - iicon = renderer.getBlockIcon(p_147736_1_, renderer.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 2); - renderer.renderFaceZNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, iicon); - - flag = true; - } - - if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(renderer.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ + 1, 3)) - { - //tessellator.setBrightness(renderer.renderMaxZ < 1.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ + 1)); - tessellator.setColorOpaque_F(f11, f14, f17); - iicon = renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 3); - renderer.renderFaceZPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, iicon); - - flag = true; - } - - if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_ - 1, p_147736_3_, p_147736_4_, 4)) - { - //tessellator.setBrightness(renderer.renderMinX > 0.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_ - 1, p_147736_3_, p_147736_4_)); - tessellator.setColorOpaque_F(f12, f15, f18); - iicon = renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 4); - renderer.renderFaceXNeg(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, iicon); - - flag = true; - } - - if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_ + 1, p_147736_3_, p_147736_4_, 5)) - { - //tessellator.setBrightness(renderer.renderMaxX < 1.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_ + 1, p_147736_3_, p_147736_4_)); - tessellator.setColorOpaque_F(f12, f15, f18); - iicon = renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 5); - renderer.renderFaceXPos(p_147736_1_, (double)p_147736_2_, (double)p_147736_3_, (double)p_147736_4_, iicon); - - flag = true; - } - - return flag; - } + public boolean renderStandardBlock(Block p_147784_1_, IBlockAccess world, int p_147784_2_, int p_147784_3_, int p_147784_4_, RenderBlocks renderer) + { + int l = p_147784_1_.colorMultiplier(world, p_147784_2_, p_147784_3_, p_147784_4_); + float f = (l >> 16 & 255) / 255.0F; + float f1 = (l >> 8 & 255) / 255.0F; + float f2 = (l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + return Minecraft.isAmbientOcclusionEnabled() && p_147784_1_.getLightValue() == 0 ? (renderer.partialRenderBounds ? renderer.renderStandardBlockWithAmbientOcclusionPartial(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, f, f1, f2) : this + .renderStandardBlockWithColorMultiplier(p_147784_1_, world, p_147784_2_, p_147784_3_, p_147784_4_, f, f1, f2, renderer)) : this.renderStandardBlockWithColorMultiplier(p_147784_1_, world, p_147784_2_, p_147784_3_, p_147784_4_, f, f1, f2, + renderer); + + //return this.renderStandardBlockWithColorMultiplier(p_147784_1_, world, p_147784_2_, p_147784_3_, p_147784_4_, f, f1, f2, renderer); + } + public boolean renderStandardBlockWithColorMultiplier(Block p_147736_1_, IBlockAccess world, int p_147736_2_, int p_147736_3_, int p_147736_4_, float p_147736_5_, float p_147736_6_, float p_147736_7_, RenderBlocks renderer) + { + //System.out.println("AAA"); + renderer.enableAO = false; + Tessellator tessellator = Tessellator.instance; + boolean flag = false; + float f3 = 0.5F; + float f4 = 1.0F; + float f5 = 0.8F; + float f6 = 0.6F; + float f7 = f4 * p_147736_5_; + float f8 = f4 * p_147736_6_; + float f9 = f4 * p_147736_7_; + float f10 = f3; + float f11 = f5; + float f12 = f6; + float f13 = f3; + float f14 = f5; + float f15 = f6; + float f16 = f3; + float f17 = f5; + float f18 = f6; + + IBlockAccess blockAccess = world; + + if (p_147736_1_ != Blocks.grass) + { + f10 = f3 * p_147736_5_; + f11 = f5 * p_147736_5_; + f12 = f6 * p_147736_5_; + f13 = f3 * p_147736_6_; + f14 = f5 * p_147736_6_; + f15 = f6 * p_147736_6_; + f16 = f3 * p_147736_7_; + f17 = f5 * p_147736_7_; + f18 = f6 * p_147736_7_; + } + + int l = p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_, p_147736_4_); + tessellator.setBrightness(l); + + if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_, p_147736_3_ - 1, p_147736_4_, 0)) + { + //tessellator.setBrightness(renderer.renderMinY > 0.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_ - 1, p_147736_4_)); + tessellator.setColorOpaque_F(f10, f13, f16); + renderer.renderFaceYNeg(p_147736_1_, p_147736_2_, p_147736_3_, p_147736_4_, renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 0)); + flag = true; + } + + if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_, p_147736_3_ + 1, p_147736_4_, 1)) + { + //tessellator.setBrightness(renderer.renderMaxY < 1.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_ + 1, p_147736_4_)); + tessellator.setColorOpaque_F(f7, f8, f9); + renderer.renderFaceYPos(p_147736_1_, p_147736_2_, p_147736_3_, p_147736_4_, renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 1)); + flag = true; + } + + IIcon iicon; + + if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ - 1, 2)) + { + //tessellator.setBrightness(renderer.renderMinZ > 0.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ - 1)); + tessellator.setColorOpaque_F(f11, f14, f17); + iicon = renderer.getBlockIcon(p_147736_1_, renderer.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 2); + renderer.renderFaceZNeg(p_147736_1_, p_147736_2_, p_147736_3_, p_147736_4_, iicon); + + flag = true; + } + + if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(renderer.blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ + 1, 3)) + { + //tessellator.setBrightness(renderer.renderMaxZ < 1.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_, p_147736_3_, p_147736_4_ + 1)); + tessellator.setColorOpaque_F(f11, f14, f17); + iicon = renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 3); + renderer.renderFaceZPos(p_147736_1_, p_147736_2_, p_147736_3_, p_147736_4_, iicon); + + flag = true; + } + + if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_ - 1, p_147736_3_, p_147736_4_, 4)) + { + //tessellator.setBrightness(renderer.renderMinX > 0.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_ - 1, p_147736_3_, p_147736_4_)); + tessellator.setColorOpaque_F(f12, f15, f18); + iicon = renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 4); + renderer.renderFaceXNeg(p_147736_1_, p_147736_2_, p_147736_3_, p_147736_4_, iicon); + + flag = true; + } + + if (renderer.renderAllFaces || p_147736_1_.shouldSideBeRendered(blockAccess, p_147736_2_ + 1, p_147736_3_, p_147736_4_, 5)) + { + //tessellator.setBrightness(renderer.renderMaxX < 1.0D ? l : p_147736_1_.getMixedBrightnessForBlock(blockAccess, p_147736_2_ + 1, p_147736_3_, p_147736_4_)); + tessellator.setColorOpaque_F(f12, f15, f18); + iicon = renderer.getBlockIcon(p_147736_1_, blockAccess, p_147736_2_, p_147736_3_, p_147736_4_, 5); + renderer.renderFaceXPos(p_147736_1_, p_147736_2_, p_147736_3_, p_147736_4_, iicon); + + flag = true; + } + + return flag; + } @Override public boolean shouldRender3DInInventory(int modelId) { diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererLargeWindmill.java b/src/main/java/shift/sextiarysector/renderer/block/RendererLargeWindmill.java new file mode 100644 index 0000000..b59233e --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererLargeWindmill.java @@ -0,0 +1,118 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.renderer.model.ModelLargeWindmill; +import shift.sextiarysector.tileentity.TileEntityLargeWindmill; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererLargeWindmill extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + private static final ResourceLocation windmillTextures = new ResourceLocation("sextiarysector:textures/models/large_windmill.png"); + static public ModelBase modelWindmill = new ModelLargeWindmill(); + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + if (modelID != this.getRenderId()) { + return; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f / 6.0f; + GL11.glScalef(scale, scale, scale); + + //GL11.glRotatef(90, 1, 0, 0); + + GL11.glRotatef(90, 0, -1, 0); + this.bind(windmillTextures); + + ((ModelLargeWindmill) modelWindmill).renderinOut(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glRotatef(-(FMLClientHandler.instance().getClient().getMinecraft().getSystemTime() / 50) % 360, 0, 0, 1); + + modelWindmill.render(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.largeWindMillType; + } + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + TileEntityLargeWindmill tile = (TileEntityLargeWindmill) tileentity; + + //System.out.println("renderTileEntityAt"); + + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + float scale = 0.0625f; + //float scale = 0.125f; + GL11.glScalef(scale, scale, scale); + + switch (tile.direction) { + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + this.bindTexture(windmillTextures); + + ((ModelLargeWindmill) modelWindmill).renderinOut(null, 0, 0, 0, 0, 0, 1.0f); + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + + modelWindmill.render(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + } + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererLeafBed.java b/src/main/java/shift/sextiarysector/renderer/block/RendererLeafBed.java new file mode 100644 index 0000000..dbeb5a7 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererLeafBed.java @@ -0,0 +1,100 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.init.Blocks; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.SextiarySector; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererLeafBed implements ISimpleBlockRenderingHandler { + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + + if (this.getRenderId() != modelId) return false; + + float f = 0.125F; + + float minx = 0; + float minz = 0; + float maxx = 1; + float maxz = 1; + + renderer.setOverrideBlockTexture(Blocks.planks.getIcon(0, 0)); + + //蜿ウ + if (!this.isSame(world, x, y, z, block, ForgeDirection.getOrientation(5))) { + maxx = 1 - f; + renderer.setRenderBounds(14.0D / 16.0D, 0.0D, 0.0D, 1.0D, 2.0D / 16.0D, 1.0D); + renderer.renderStandardBlock(block, x, y, z); + } + + //蟾ヲ + if (!this.isSame(world, x, y, z, block, ForgeDirection.getOrientation(4))) { + minx = f; + renderer.setRenderBounds(0.0D, 0.0D, 0.0D, 2.0D / 16.0D, 2.0D / 16.0D, 1.0D); + renderer.renderStandardBlock(block, x, y, z); + } + + renderer.clearOverrideBlockTexture(); + + renderer.setOverrideBlockTexture(Blocks.planks.getIcon(0, 1)); + + //荳 + if (!this.isSame(world, x, y, z, block, ForgeDirection.getOrientation(2))) { + minz = f; + renderer.setRenderBounds(0.0D, 2.0D / 16.0D, 0.0D, 1.0D, 4.0D / 16.0D, 2.0D / 16.0D); + renderer.renderStandardBlock(block, x, y, z); + } + + //荳 + if (!this.isSame(world, x, y, z, block, ForgeDirection.getOrientation(3))) { + maxz = 1 - f; + renderer.setRenderBounds(0.0D, 2.0D / 16.0D, 14.0D / 16.0D, 1.0D, 4.0D / 16.0D, 1.0D); + renderer.renderStandardBlock(block, x, y, z); + } + + //闡峨▲縺ア + renderer.setOverrideBlockTexture(SSBlocks.leafBed.getIcon(0, 0)); + renderer.setRenderBounds(minx, 0.0D, minz, maxx, 1.0D / 16.0D, maxz); + renderer.renderStandardBlock(block, x, y, z); + + renderer.setOverrideBlockTexture(SSBlocks.leafBed.getIcon(0, 1)); + renderer.setRenderBounds(minx, 1.0D / 16.0D, minz, maxx, 2.0D / 16.0D, maxz); + renderer.renderStandardBlock(block, x, y, z); + + renderer.setOverrideBlockTexture(SSBlocks.leafBed.getIcon(0, 2)); + renderer.setRenderBounds(minx, 2.0D / 16.0D, minz, maxx, 3.0D / 16.0D, maxz); + renderer.renderStandardBlock(block, x, y, z); + + renderer.clearOverrideBlockTexture(); + + return true; + } + + protected boolean isSame(IBlockAccess p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, Block b, ForgeDirection d) { + + if (p_149743_1_.getBlock(p_149743_2_ + d.offsetX, p_149743_3_ + d.offsetY, p_149743_4_ + d.offsetZ) == b) return true; + + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return false; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.leafBedType; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererOreStone.java b/src/main/java/shift/sextiarysector/renderer/block/RendererOreStone.java new file mode 100644 index 0000000..ef2b6aa --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererOreStone.java @@ -0,0 +1,183 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.init.Blocks; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererOreStone implements ISimpleBlockRenderingHandler { + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + + GL11.glPushMatrix(); + + Tessellator tessellator = Tessellator.instance; + renderer.setOverrideBlockTexture(Blocks.stone.getIcon(0, 0)); + renderer.setRenderBounds(0.0001D, 0.0001D, 0.0001D, 0.9999D, 0.9999D, 0.9999D); + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + + renderer.clearOverrideBlockTexture(); + renderer.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + + metadata = 8; + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + + GL11.glPopMatrix(); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + + if (this.getRenderId() != modelId) return false; + + double s = 0.0001D; + + //renderer.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + //renderer.setRenderBounds(-0.0001D, -0.0001D, -0.0001D, 1.0001D, 1.0001D, 1.0001D); + //renderer.renderStandardBlock(block, x, y, z); + + //renderer.renderAllFaces = true; + + //renderer.setOverrideBlockTexture(Blocks.stone.getIcon(0, 0)); + //renderer.setRenderBounds(0.0001D, 0.0001D, 0.0001D, 0.9999D, 0.9999D, 0.9999D); + //renderer.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + ////renderer.renderStandardBlock(block, x, y, z); + //renderer.renderAllFaces = false; + + //renderer.clearOverrideBlockTexture(); + + ////int metadata = 8;//world.getBlockMetadata(x, y, z); + + //int mixedBrightness = block.getMixedBrightnessForBlock(world, x, y, z); + + ////Tessellator tesselator = Tessellator.instance; + + //tesselator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); + //tesselator.setColorOpaque_F(0.6F, 0.6F, 0.6F); + //tesselator.setColorOpaque_F(1.0F, 1.0F, 1.0F); + + /* + if (block.shouldSideBeRendered(world, x, y - 1, z, 0)) { + tesselator.setBrightness(block.getMixedBrightnessForBlock(world, x, y - 1, z)); + tesselator.setColorOpaque_F(0.45F, 0.45F, 0.45F); + renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); + } + + if (block.shouldSideBeRendered(world, x, y + 1, z, 1)) { + tesselator.setBrightness(block.getMixedBrightnessForBlock(world, x, y + 1, z)); + tesselator.setColorOpaque_F(0.88F, 0.88F, 0.88F); + renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); + } + + if (block.shouldSideBeRendered(world, x, y, z - 1, 2)) { + tesselator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z - 1)); + tesselator.setColorOpaque_F(0.7F, 0.7F, 0.7F); + renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); + } + + if (block.shouldSideBeRendered(world, x, y, z + 1, 3)) { + tesselator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z + 1)); + tesselator.setColorOpaque_F(0.7F, 0.7F, 0.7F); + renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); + } + + if (block.shouldSideBeRendered(world, x - 1, y, z, 4)) { + tesselator.setBrightness(block.getMixedBrightnessForBlock(world, x - 1, y, z)); + tesselator.setColorOpaque_F(0.6F, 0.6F, 0.6F); + renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); + } + + if (block.shouldSideBeRendered(world, x + 1, y, z, 5)) { + tesselator.setBrightness(block.getMixedBrightnessForBlock(world, x + 1, y, z)); + tesselator.setColorOpaque_F(0.6F, 0.6F, 0.6F); + renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); + } + + */ + + GL11.glPushMatrix(); + renderer.renderStandardBlock(Blocks.stone, x, y, z); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + renderer.renderStandardBlock(block, x, y, z); + GL11.glPopMatrix(); + + return true; + + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.oreStoneType; + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererPaddy.java b/src/main/java/shift/sextiarysector/renderer/block/RendererPaddy.java new file mode 100644 index 0000000..c241b82 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererPaddy.java @@ -0,0 +1,85 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.init.Blocks; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.module.FertilizerManager; +import shift.sextiarysector.tileentity.TileEntityPaddy; + +public class RendererPaddy extends RendererHole{ + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block block, int modelId, RenderBlocks renderer) { + + super.renderWorldBlock(world, x, y, z, block, modelId, renderer); + + this.renderer.renderAllFaces = true; + this.renderer.field_152631_f = true; + + + float f = 0.125F; + + float minx = 0; + float minz = 0; + float maxx = 1; + float maxz = 1; + + + if(!this.isSame(world, x, y, z,block, ForgeDirection.getOrientation(4))){ + minx = f; + } + + if(!this.isSame(world, x, y, z,block, ForgeDirection.getOrientation(2))){ + minz = f; + } + + if(!this.isSame(world, x, y, z,block, ForgeDirection.getOrientation(5))){ + maxx = 1-f; + } + + if(!this.isSame(world, x, y, z,block, ForgeDirection.getOrientation(3))){ + maxz = 1-f; + } + + //豌エ縺ョ謠丞 + //renderer.setRenderBounds(minx, 0.3125F, minz, maxx , 0.9375F, maxz); + renderer.setRenderBounds(minx, 0.9375F-0.001f, minz, maxx , 0.9375F, maxz); + renderer.setOverrideBlockTexture(Blocks.water.getIcon(0, 0)); + renderer.renderStandardBlock(block, x, y, z); + renderer.clearOverrideBlockTexture(); + + this.renderer.clearOverrideBlockTexture(); + // + + TileEntityPaddy t = (TileEntityPaddy) world.getTileEntity(x, y, z); + + if(t!=null&&t.getFertilizer()!=null){ + + if(FertilizerManager.getFertilizer(t.getFertilizer())!=null){ + renderer.setOverrideBlockTexture(FertilizerManager.getFertilizerIcon(t.getFertilizer()).getFertilizerIcon()); + }else{ + t.setFertilizer(null); + } + + renderer.setRenderBounds(minx, 1 - 0.01f, minz, maxx , 1 - 0.009f, maxz); + renderer.renderStandardBlock(block, x, y, z); + } + + renderer.clearOverrideBlockTexture(); + + this.renderer.field_152631_f = false; + this.renderer.renderAllFaces = false; + + return true; + + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.paddyType; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererPipe.java b/src/main/java/shift/sextiarysector/renderer/block/RendererPipe.java new file mode 100644 index 0000000..bfd03bf --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererPipe.java @@ -0,0 +1,152 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.api.EnumColor; +import shift.sextiarysector.block.BlockPipe; +import shift.sextiarysector.renderer.model.ModelPipe; +import shift.sextiarysector.tileentity.TileEntityPipe; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererPipe extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + + if (modelId != this.getRenderId()) { + return; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + + GL11.glRotatef(180, 0, 1, 0); + + this.bind(this.pipeTextures); + + modelPipe.render(null, 0, 0, 0, 0, 0, 1.0f); + modelPipe.renderPipe(null, 0, 0, 0, 0, 0, 1.0f, 0, false); + modelPipe.renderPipe(null, 0, 0, 0, 0, 0, 1.0f, 1, false); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.pipeType; + } + + private static final ResourceLocation pipeTextures = new ResourceLocation("sextiarysector:textures/models/copper_pipe.png"); + private static final ResourceLocation pipeColorTextures = new ResourceLocation("sextiarysector:textures/models/copper_pipe_color.png"); + + static public ModelPipe modelPipe = new ModelPipe(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x1, double y1, double z1, float p_147500_8_) { + + TileEntityPipe tile = (TileEntityPipe) tileentity; + + GL11.glPushMatrix(); + GL11.glTranslated(x1 + 0.5F, y1 + 0.5F, z1 + 0.5F); + float scale = 0.0623f; + GL11.glScalef(scale, scale, scale); + GL11.glDisable(GL11.GL_LIGHTING); + + this.bindTexture(pipeTextures); + + modelPipe.render(null, 0, 0, 0, 0, 0, 1.0f); + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + + if (BlockPipe.canConnect(tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, d)) { + modelPipe.renderPipe(null, 0, 0, 0, 0, 0, 1.0f, d.ordinal(), false); + } + + /* + int x = tile.xCoord + d.offsetX; + int y = tile.yCoord + d.offsetY; + int z = tile.zCoord + d.offsetZ; + + TileEntity t = tileentity.getWorldObj().getTileEntity(x, y, z); + + if (t instanceof IFluidHandler) { + modelPipe.renderPipe(null, 0, 0, 0, 0, 0, 1.0f, d.ordinal(), false); + }*/ + + } + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + + if (tile.color.ordinal() != EnumColor.Unknown.ordinal()) { + + GL11.glPushMatrix(); + GL11.glTranslated(x1 + 0.5F, y1 + 0.5F, z1 + 0.5F); + float scale2 = 0.0624f; + GL11.glScalef(scale2, scale2, scale2); + GL11.glDisable(GL11.GL_LIGHTING); + + this.bindTexture(pipeColorTextures); + byte color[] = tile.color.getGLColor3ub(); + GL11.glColor3ub(color[0], color[1], color[2]); + + modelPipe.render(null, 0, 0, 0, 0, 0, 1.0f); + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + + if (BlockPipe.canConnect(tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, d)) { + modelPipe.renderPipe(null, 0, 0, 0, 0, 0, 1.0f, d.ordinal(), true); + } + + /* + int x = tile.xCoord + d.offsetX; + int y = tile.yCoord + d.offsetY; + int z = tile.zCoord + d.offsetZ; + + TileEntity t = tileentity.getWorldObj().getTileEntity(x, y, z); + + if (t instanceof IFluidHandler) { + + }*/ + + } + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glPopMatrix(); + } + + } + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererSaw.java b/src/main/java/shift/sextiarysector/renderer/block/RendererSaw.java new file mode 100644 index 0000000..960a6fe --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererSaw.java @@ -0,0 +1,115 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.renderer.model.ModelSaw; +import shift.sextiarysector.tileentity.TileEntitySaw; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererSaw extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId,RenderBlocks renderer) { + + if(modelId!=this.getRenderId()){ + return ; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f; + GL11.glScalef(scale,scale,scale); + + GL11.glRotatef(180, 0, 1, 0); + + this.bind(this.fanShaftTextures); + + modelSaw.render(null, 0,0,0, 0,0, 1.0f); + modelSaw.renderBlade(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block block, int modelId, RenderBlocks renderer) { + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.sawType; + } + + private static final ResourceLocation fanShaftTextures = new ResourceLocation("sextiarysector:textures/models/saw.png"); + + static public ModelSaw modelSaw = new ModelSaw(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x,double y, double z, float p_147500_8_) { + + TileEntitySaw tile = (TileEntitySaw)tileentity; + + //System.out.println("renderTileEntityAt"); + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + float scale = 0.0624f; + GL11.glScalef(scale,scale,scale); + + this.bindTexture(fanShaftTextures); + + switch(tile.direction){ + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + modelSaw.render(null, 0,0,0, 0,0, 1.0f); + + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 1, 0); + + modelSaw.renderBlade(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + } + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererShaft.java b/src/main/java/shift/sextiarysector/renderer/block/RendererShaft.java index feb0761..fec68a7 100644 --- a/src/main/java/shift/sextiarysector/renderer/block/RendererShaft.java +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererShaft.java @@ -11,6 +11,7 @@ import shift.sextiarysector.SSBlocks; import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.fmp.IShaft; import shift.sextiarysector.renderer.model.ModelShaft; import shift.sextiarysector.tileentity.TileEntityShaft; import cpw.mods.fml.client.FMLClientHandler; @@ -20,34 +21,39 @@ public class RendererShaft extends TileEntitySpecialRenderer implements ISimpleB public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); - @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - if(modelID!=this.getRenderId()){ - return ; + if (modelID != this.getRenderId()) { + return; } GL11.glPushMatrix(); - float scale = 0.0625f; - GL11.glScalef(scale,scale,scale); - - GL11.glRotatef(90, 1, 0, 0); - - if(block == SSBlocks.woodShaft){ - this.bind(woodShaftTextures); - }else if(block == SSBlocks.stoneShaft){ - this.bind(stoneShaftTextures); - } + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + + GL11.glRotatef(90, 1, 0, 0); + + if (block == SSBlocks.woodShaft) { + this.bind(woodShaftTextures); + } else if (block == SSBlocks.stoneShaft) { + this.bind(stoneShaftTextures); + } else if (block == SSBlocks.steelShaft) { + this.bind(this.steelShaftTextures); + } else if (block == SSBlocks.ninjaShaft) { + this.bind(ninjaShaftTextures); + } else if (block == SSBlocks.orichalcumShaft) { + this.bind(orichalcumShaftTextures); + } - modelShaft.render(null, 0,0,0, 0,0, 1.0f); - modelShaft.renderIn(null, 0,0,0, 0,0, 1.0f); - modelShaft.renderOut(null, 0,0,0, 0,0, 1.0f); + modelShaft.render(null, 0, 0, 0, 0, 0, 1.0f); + modelShaft.renderIn(null, 0, 0, 0, 0, 0, 1.0f); + modelShaft.renderOut(null, 0, 0, 0, 0, 0, 1.0f); - GL11.glPopMatrix(); + GL11.glPopMatrix(); - this.bind(MC_BLOCK_SHEET); + this.bind(MC_BLOCK_SHEET); } @@ -69,109 +75,188 @@ public int getRenderId() { private static final ResourceLocation woodShaftTextures = new ResourceLocation("sextiarysector:textures/models/wood_shaft.png"); private static final ResourceLocation stoneShaftTextures = new ResourceLocation("sextiarysector:textures/models/stone_shaft.png"); + private static final ResourceLocation steelShaftTextures = new ResourceLocation("sextiarysector:textures/models/steel_shaft.png"); + private static final ResourceLocation ninjaShaftTextures = new ResourceLocation("sextiarysector:textures/models/ninja_shaft.png"); + private static final ResourceLocation orichalcumShaftTextures = new ResourceLocation("sextiarysector:textures/models/orichalcum_shaft.png"); static public ModelShaft modelShaft = new ModelShaft(); @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { - TileEntityShaft tile = (TileEntityShaft)tileentity; + TileEntityShaft tile = (TileEntityShaft) tileentity; //System.out.println("renderTileEntityAt"); GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); - float scale = 0.0625f; - GL11.glScalef(scale,scale,scale); - - switch(tile.getStorage().getMaxPowerStored()){ - case 1:this.bindTexture(woodShaftTextures);break; - case 2:this.bindTexture(stoneShaftTextures);break; - } - - - switch(tile.direction){ - case UP: - GL11.glRotatef(90, 1, 0, 0); - break; - case DOWN: - GL11.glRotatef(90, -1, 0, 0); - break; - case WEST: - GL11.glRotatef(90, 0, 1, 0); - break; - case EAST: - GL11.glRotatef(90, 0, -1, 0); - break; - case SOUTH: - GL11.glRotatef(180, 0, 1, 0); - break; + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + + switch (tile.getStorage().getMaxPower()) { + case 1: + this.bindTexture(woodShaftTextures); + break; + case 2: + this.bindTexture(stoneShaftTextures); + break; + case 3: + this.bindTexture(steelShaftTextures); + break; + case 4: + this.bindTexture(ninjaShaftTextures); + break; + case 5: + this.bindTexture(orichalcumShaftTextures); + break; + } + + switch (tile.direction) { + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; default: break; - } + } - if(!this.isIn(tileentity)){ - modelShaft.renderIn(null, 0,0,0, 0,0, 1.0f); - } + if (!this.isIn(tileentity)) { + modelShaft.renderIn(null, 0, 0, 0, 0, 0, 1.0f); + } - if(!this.isOut(tileentity)){ - modelShaft.renderOut(null, 0,0,0, 0,0, 1.0f); - } + if (!this.isOut(tileentity)) { + modelShaft.renderOut(null, 0, 0, 0, 0, 0, 1.0f); + } - //蛯セ縺阪ョ繧ケ繝斐シ繝 - GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); - modelShaft.render(null, 0,0,0, 0,0, 1.0f); + modelShaft.render(null, 0, 0, 0, 0, 0, 1.0f); - GL11.glPopMatrix(); + GL11.glPopMatrix(); } + public static void renderTileEntityAt2(TileEntity tileentity, double x, double y, double z, float f) { - private static void bind(ResourceLocation res) - { - FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); - } + if (!(tileentity instanceof IShaft)) return; + IShaft tile = (IShaft) tileentity; - public boolean isOut(TileEntity tileentity){ + //System.out.println("renderTileEntityAt"); - TileEntityShaft tile = (TileEntityShaft) tileentity; + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + + switch (tile.getStorage().getMaxPower()) { + case 1: + bind(woodShaftTextures); + break; + case 2: + bind(stoneShaftTextures); + break; + case 3: + bind(steelShaftTextures); + break; + case 4: + bind(ninjaShaftTextures); + break; + case 5: + bind(orichalcumShaftTextures); + break; + } + + switch (tile.getDirection()) { + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + if (!isIn(tileentity)) { + modelShaft.renderIn(null, 0, 0, 0, 0, 0, 1.0f); + } + + if (!isOut(tileentity)) { + modelShaft.renderOut(null, 0, 0, 0, 0, 0, 1.0f); + } + + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + + modelShaft.render(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + } + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } - int x = tile.xCoord + tile.direction.offsetX; - int y = tile.yCoord + tile.direction.offsetY; - int z = tile.zCoord + tile.direction.offsetZ; + public static boolean isOut(TileEntity tileentity) { - TileEntity tile2 = tile.getWorldObj().getTileEntity(x, y, z); + IShaft tile = (IShaft) tileentity; - if(tile2 instanceof TileEntityShaft && ((TileEntityShaft) tile2).getOutDirection().ordinal()==tile.getOutDirection().ordinal()){ + int x = tileentity.xCoord + tile.getDirection().offsetX; + int y = tileentity.yCoord + tile.getDirection().offsetY; + int z = tileentity.zCoord + tile.getDirection().offsetZ; + + TileEntity tile2 = tileentity.getWorldObj().getTileEntity(x, y, z); + + if (tile2 instanceof IShaft && ((IShaft) tile2).getDirection().ordinal() == tile.getDirection().ordinal()) { return true; - }else{ + } else { return false; } } - public boolean isIn(TileEntity tileentity){ + public static boolean isIn(TileEntity tileentity) { - TileEntityShaft tile = (TileEntityShaft) tileentity; + IShaft tile = (IShaft) tileentity; - int x = tile.xCoord - tile.direction.offsetX; - int y = tile.yCoord - tile.direction.offsetY; - int z = tile.zCoord - tile.direction.offsetZ; + int x = tileentity.xCoord - tile.getDirection().offsetX; + int y = tileentity.yCoord - tile.getDirection().offsetY; + int z = tileentity.zCoord - tile.getDirection().offsetZ; - TileEntity tile2 = tile.getWorldObj().getTileEntity(x, y, z); + TileEntity tile2 = tileentity.getWorldObj().getTileEntity(x, y, z); - if(tile2 instanceof TileEntityShaft && ((TileEntityShaft) tile2).getOutDirection().ordinal()==tile.getOutDirection().ordinal()){ + if (tile2 instanceof IShaft && ((IShaft) tile2).getDirection().ordinal() == tile.getDirection().ordinal()) { return true; - }else{ + } else { return false; } } - - /* public static boolean isOut(TileEntity tileentity){ diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererSmallWaterwheel.java b/src/main/java/shift/sextiarysector/renderer/block/RendererSmallWaterwheel.java new file mode 100644 index 0000000..368867c --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererSmallWaterwheel.java @@ -0,0 +1,124 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.renderer.model.ModelSmallWaterwheel; +import shift.sextiarysector.tileentity.TileEntitySmallWaterwheel; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererSmallWaterwheel extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler{ + + private static final ResourceLocation windmillTextures = new ResourceLocation("sextiarysector:textures/models/small_waterwheel.png"); + static public ModelBase modelWaterwheel = new ModelSmallWaterwheel(); + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + if(modelID!=this.getRenderId()){ + return ; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f/2.0f; + GL11.glScalef(scale,scale,scale); + + //GL11.glRotatef(90, 1, 0, 0); + + GL11.glRotatef(90, 0, -1, 0); + this.bind(windmillTextures); + + ((ModelSmallWaterwheel) modelWaterwheel).renderinOut(null, 0,0,0, 0,0, 1.0f); + + GL11.glRotatef(-(FMLClientHandler.instance().getClient().getMinecraft().getSystemTime()/50)%360, 0, 0, 1); + + modelWaterwheel.render(null, 0,0,0, 0,0, 1.0f); + + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.smallWaterwheel; + } + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + TileEntitySmallWaterwheel tile = (TileEntitySmallWaterwheel)tileentity; + + //System.out.println("renderTileEntityAt"); + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + float scale = 0.0625f; + //float scale = 0.125f; + GL11.glScalef(scale,scale,scale); + + switch(tile.direction){ + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + this.bindTexture(windmillTextures); + + + ((ModelSmallWaterwheel) modelWaterwheel).renderinOut(null, 0,0,0, 0,0, 1.0f); + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + + + + modelWaterwheel.render(null, 0,0,0, 0,0, 1.0f); + + + GL11.glPopMatrix(); + + } + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererSmallWindmill.java b/src/main/java/shift/sextiarysector/renderer/block/RendererSmallWindmill.java index 908abdc..5c6848f 100644 --- a/src/main/java/shift/sextiarysector/renderer/block/RendererSmallWindmill.java +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererSmallWindmill.java @@ -16,108 +16,116 @@ import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -public class RendererSmallWindmill extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler{ +public class RendererSmallWindmill extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { private static final ResourceLocation windmillTextures = new ResourceLocation("sextiarysector:textures/models/smallWindMill.png"); static public ModelBase modelWindmill = new ModelsmallWindMill(); public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); - @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { - if(modelID!=this.getRenderId()){ - return ; + if (modelID != this.getRenderId()) { + return; } GL11.glPushMatrix(); - float scale = 0.0625f/2.0f; - GL11.glScalef(scale,scale,scale); - - //GL11.glRotatef(90, 1, 0, 0); + float scale = 0.0625f / 2.0f; + GL11.glScalef(scale, scale, scale); - GL11.glRotatef(90, 0, -1, 0); - this.bind(windmillTextures); + //GL11.glRotatef(90, 1, 0, 0); - ((ModelsmallWindMill) modelWindmill).renderinOut(null, 0,0,0, 0,0, 1.0f); + GL11.glRotatef(90, 0, -1, 0); + this.bind(windmillTextures); - GL11.glRotatef(-(FMLClientHandler.instance().getClient().getMinecraft().getSystemTime()/50)%360, 0, 0, 1); + ((ModelsmallWindMill) modelWindmill).renderinOut(null, 0, 0, 0, 0, 0, 1.0f); - modelWindmill.render(null, 0,0,0, 0,0, 1.0f); + GL11.glRotatef(-(FMLClientHandler.instance().getClient().getMinecraft().getSystemTime() / 50) % 360, 0, 0, 1); + modelWindmill.render(null, 0, 0, 0, 0, 0, 1.0f); - GL11.glPopMatrix(); + GL11.glPopMatrix(); - this.bind(MC_BLOCK_SHEET); + this.bind(MC_BLOCK_SHEET); } + @Override - public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, - RenderBlocks renderer) { - // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + return false; + + //if (this.getRenderId() != modelId) return false; + + //renderer.setRenderBounds(2.0D / 16.0D, 0.0D, 2.0D / 16.0D, 14.0D / 16.0D, 15.0D / 16.0D, 14.0D / 16.0D); + //renderer.setOverrideBlockTexture(ClientEventHandler.breakIcon); + + //renderer.renderStandardBlock(block, x, y, z); + + //renderer.clearOverrideBlockTexture(); + + //return true; } + @Override public boolean shouldRender3DInInventory(int modelId) { return true; } + @Override public int getRenderId() { return SextiarySector.proxy.smallWindMillType; } + @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { - TileEntitySmallWindmill tile = (TileEntitySmallWindmill)tileentity; + TileEntitySmallWindmill tile = (TileEntitySmallWindmill) tileentity; //System.out.println("renderTileEntityAt"); GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); - float scale = 0.0625f; - //float scale = 0.125f; - GL11.glScalef(scale,scale,scale); - - switch(tile.direction){ - case UP: - GL11.glRotatef(90, 1, 0, 0); - break; - case DOWN: - GL11.glRotatef(90, -1, 0, 0); - break; - case WEST: - GL11.glRotatef(90, 0, 1, 0); - break; - case EAST: - GL11.glRotatef(90, 0, -1, 0); - break; - case SOUTH: - GL11.glRotatef(180, 0, 1, 0); - break; + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + float scale = 0.0625f; + //float scale = 0.125f; + GL11.glScalef(scale, scale, scale); + + switch (tile.direction) { + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; default: break; - } - - this.bindTexture(windmillTextures); - - - ((ModelsmallWindMill) modelWindmill).renderinOut(null, 0,0,0, 0,0, 1.0f); - //蛯セ縺阪ョ繧ケ繝斐シ繝 - GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); - + } + this.bindTexture(windmillTextures); - modelWindmill.render(null, 0,0,0, 0,0, 1.0f); + ((ModelsmallWindMill) modelWindmill).renderinOut(null, 0, 0, 0, 0, 0, 1.0f); + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + modelWindmill.render(null, 0, 0, 0, 0, 0, 1.0f); - GL11.glPopMatrix(); + GL11.glPopMatrix(); } private static void bind(ResourceLocation res) - { - FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); - } + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } } diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererSquare.java b/src/main/java/shift/sextiarysector/renderer/block/RendererSquare.java new file mode 100644 index 0000000..fcfc7e9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererSquare.java @@ -0,0 +1,205 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.renderer.model.ModelSquare; +import shift.sextiarysector.tileentity.TileEntitySquare; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererSquare extends TileEntitySpecialRenderer implements + ISimpleBlockRenderingHandler { + + private static final ResourceLocation squareTextures = new ResourceLocation("sextiarysector:textures/models/square.png"); + private static final ResourceLocation squareUunderTextures = new ResourceLocation("sextiarysector:textures/models/square_under.png"); + static public ModelSquare modelSquare = new ModelSquare(); + + private final RenderBlocks blockrender = new RenderBlocks(); + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + if (modelID != this.getRenderId()) { + return; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f / 1.0f; + GL11.glScalef(scale, scale, scale); + + GL11.glRotatef(180, 1, 0, 0); + + GL11.glRotatef(90, 0, -1, 0); + this.bind(squareTextures); + + modelSquare.render(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.squareType; + } + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + TileEntitySquare tile = (TileEntitySquare) tileentity; + + GL11.glPushMatrix(); + + GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + + float scale = 0.0625f; + // float scale = 0.125f; + GL11.glScalef(scale, scale, scale); + GL11.glRotatef(180, 1, 0, 0); + switch (tile.direction) { + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case NORTH: + GL11.glRotatef(180, 0, 1, 0); + default: + break; + } + + if (tile.direction.ordinal() == ForgeDirection.UP.ordinal()) { + this.bindTexture(squareTextures); + } else if (tile.direction.ordinal() == ForgeDirection.DOWN.ordinal()) { + this.bindTexture(squareUunderTextures); + } else { + this.bindTexture(squareTextures); + modelSquare.renderConnection(null, 0, 0, 0, 0, 0, 1.0f); + } + + modelSquare.render(null, 0, 0, 0, 0, 0, 1.0f); + + + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + + + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + + //GL11.glDisable(GL11.GL_DEPTH_TEST); + + GL11.glColor3f(1,1,1); + + + + GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + + // float scale = 0.125f; + + + if(tile.hasFluid()){ + + IIcon icon = tile.getFluidIcon(); + float fluidHeight = tile.getFluidHeight(); + Block block = tile.getBlockType(); + + //float i = 0.3125f; + + this.bindTexture(MC_BLOCK_SHEET); + + this.setColor3ubFromInt(tile.getFluidColor()); + + blockrender.blockAccess =tileentity.getWorldObj(); + + blockrender.renderAllFaces = true; + blockrender.setOverrideBlockTexture(icon); + blockrender.setRenderBounds(-5.99f/16.0f, -5.99f/16.0f, -5.99f/16.0f, 6.0f/16.0f ,fluidHeight-6.0f/16.0f, 6.0f/16.0f); + + Tessellator tessellator = Tessellator.instance; + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + blockrender.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + blockrender.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + blockrender.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + blockrender.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + blockrender.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + blockrender.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + + blockrender.renderAllFaces = false; + blockrender.clearOverrideBlockTexture(); + + } + + //GL11.glEnable(GL11.GL_DEPTH_TEST); + + GL11.glDisable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_LIGHTING); + + + + GL11.glColor3f(1,1,1); + + + + GL11.glPopMatrix(); + + } + + private static void bind(ResourceLocation res) { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } + + public static void setColor3ubFromInt(int color) { + + GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererSteamMotor.java b/src/main/java/shift/sextiarysector/renderer/block/RendererSteamMotor.java new file mode 100644 index 0000000..4aa0449 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererSteamMotor.java @@ -0,0 +1,121 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.renderer.model.ModelMotor; +import shift.sextiarysector.tileentity.TileEntitySteamMotor; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererSteamMotor extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + if (modelID != this.getRenderId()) { + return; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + + GL11.glRotatef(90, 1, 0, 0); + GL11.glRotatef(180, 0, 1, 0); + + this.bind(steamMotorTextures); + + modelSteamMotor.render(null, 0, 0, 0, 0, 0, 1.0f); + modelSteamMotor.renderShaft(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.steamMotorType; + } + + private static final ResourceLocation steamMotorTextures = new ResourceLocation("sextiarysector:textures/models/steam_motor.png"); + + static public ModelMotor modelSteamMotor = new ModelMotor(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + TileEntitySteamMotor tile = (TileEntitySteamMotor) tileentity; + + //System.out.println("renderTileEntityAt"); + + GL11.glPushMatrix(); + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + + GL11.glDisable(GL11.GL_CULL_FACE); + + this.bindTexture(steamMotorTextures); + + switch (tile.direction) { + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + modelSteamMotor.render(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glEnable(GL11.GL_CULL_FACE); + + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + + modelSteamMotor.renderShaft(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + } + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererTank.java b/src/main/java/shift/sextiarysector/renderer/block/RendererTank.java new file mode 100644 index 0000000..d7d6836 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererTank.java @@ -0,0 +1,168 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.renderer.model.ModelTank; +import shift.sextiarysector.tileentity.TileEntityTank; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererTank extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + private static final ResourceLocation bottleTextures = new ResourceLocation("sextiarysector:textures/models/tank.png"); + + private final Minecraft mc = FMLClientHandler.instance().getClient(); + + private final RenderBlocks blockrender = new RenderBlocks(); + + static public ModelTank modelTank = new ModelTank(); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + GL11.glPushMatrix(); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + this.bind(bottleTextures); + + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + GL11.glRotatef(180, 1, 0, 0); + + GL11.glColor3f(1, 1, 1); + + modelTank.render(null, 0, 0, 0, 0, 0, 1.0f); + + GL11.glPopMatrix(); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.tankType; + } + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + GL11.glPushMatrix(); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + //GL11.glDisable(GL11.GL_CULL_FACE); + + GL11.glTranslatef((float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F); + + if (((TileEntityTank) tileentity).hasFluidStack()) { + + //System.out.println("renderTileEntityAt"); + IIcon icon = ((TileEntityTank) tileentity).getFluidStack().getFluid().getIcon(((TileEntityTank) tileentity).getFluidStack()); + icon = blockrender.getIconSafe(icon); + + float i = 0.4375f; + + float f1 = ((TileEntityTank) tileentity).getRendererAmount(); + if (f1 >= 0.99) f1 = 0.98f; + + this.bindTexture(MC_BLOCK_SHEET); + + setColor3ub(((TileEntityTank) tileentity).getFluidStack().getFluid().getColor()); + + blockrender.blockAccess = tileentity.getWorldObj(); + + blockrender.renderAllFaces = true; + blockrender.setOverrideBlockTexture(icon); + //blockrender.setRenderBounds(i*2.3, -0.0625*6, i*2.3, 1-i*2.5,0.0625*1.8f, 1-i*2.3); + blockrender.setRenderBounds(-i + 0.01f, -0.49f, -i + 0.01f, i - 0.01f, f1 - 0.49f, i - 0.01f); + //blockrender.setRenderBounds(i, 0.0625*2, i, 1-i,0.0625*8f, 1-i); + //blockrender.renderStandardBlock(Block.blocksList[tileentity.getWorldObj().getBlockId(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord)], tileentity.xCoord, tileentity.yCoord,tileentity.zCoord); + + Tessellator tessellator = Tessellator.instance; + + Block block = tileentity.getWorldObj().getBlock(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord); + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + blockrender.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + blockrender.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + blockrender.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + blockrender.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + blockrender.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + blockrender.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + + blockrender.renderAllFaces = false; + blockrender.clearOverrideBlockTexture(); + + } + + this.bindTexture(bottleTextures); + + float scale = 0.0625f; + GL11.glScalef(scale, scale, scale); + GL11.glRotatef(180, 1, 0, 0); + + GL11.glColor3f(1, 1, 1); + + modelTank.render(null, 0, 0, 0, 0, 0, 1.0f); + + //GL11.glEnable(GL11.GL_CULL_FACE); + + GL11.glPopMatrix(); + + } + + private void bind(ResourceLocation res) + { + mc.getTextureManager().bindTexture(res); + } + + public static void setColor3ub(int color) { + + GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererTofuMotor.java b/src/main/java/shift/sextiarysector/renderer/block/RendererTofuMotor.java new file mode 100644 index 0000000..7f7c437 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererTofuMotor.java @@ -0,0 +1,119 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.plugin.PluginTofu; +import shift.sextiarysector.renderer.model.ModelMotor; +import shift.sextiarysector.tileentity.TileEntityTofuMotor; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererTofuMotor extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler { + + public static final ResourceLocation MC_BLOCK_SHEET = new ResourceLocation("textures/atlas/blocks.png"); + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { + + if(modelID!=this.getRenderId()){ + return ; + } + + GL11.glPushMatrix(); + + float scale = 0.0625f; + GL11.glScalef(scale,scale,scale); + + GL11.glRotatef(90, 1, 0, 0); + GL11.glRotatef(180, 0, 1, 0); + + this.bind(tofuMotorTextures); + + modelElectricMotor.render(null, 0,0,0, 0,0, 1.0f); + modelElectricMotor.renderShaft(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + this.bind(MC_BLOCK_SHEET); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return PluginTofu.tofuMotorType; + } + + private static final ResourceLocation tofuMotorTextures = new ResourceLocation("sextiarysector:textures/models/tofu_motor.png"); + + static public ModelMotor modelElectricMotor = new ModelMotor(); + + @Override + public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { + + TileEntityTofuMotor tile = (TileEntityTofuMotor)tileentity; + + //System.out.println("renderTileEntityAt"); + + GL11.glPushMatrix(); + GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F); + float scale = 0.0625f; + GL11.glScalef(scale,scale,scale); + + this.bindTexture(tofuMotorTextures); + + switch(tile.direction){ + case UP: + GL11.glRotatef(90, 1, 0, 0); + break; + case DOWN: + GL11.glRotatef(90, -1, 0, 0); + break; + case WEST: + GL11.glRotatef(90, 0, 1, 0); + break; + case EAST: + GL11.glRotatef(90, 0, -1, 0); + break; + case SOUTH: + GL11.glRotatef(180, 0, 1, 0); + break; + default: + break; + } + + modelElectricMotor.render(null, 0,0,0, 0,0, 1.0f); + + //蛯セ縺阪ョ繧ケ繝斐シ繝 + GL11.glRotatef(tile.getRotateStep(), 0, 0, 1); + + + modelElectricMotor.renderShaft(null, 0,0,0, 0,0, 1.0f); + + GL11.glPopMatrix(); + + } + + + private static void bind(ResourceLocation res) + { + FMLClientHandler.instance().getClient().getTextureManager().bindTexture(res); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererWood.java b/src/main/java/shift/sextiarysector/renderer/block/RendererWood.java new file mode 100644 index 0000000..b9f07af --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererWood.java @@ -0,0 +1,93 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.IBlockAccess; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.module.FertilizerManager; +import shift.sextiarysector.tileentity.TileEntityWood; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererWood implements ISimpleBlockRenderingHandler{ + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId,RenderBlocks renderer) { + + GL11.glPushMatrix(); + + Tessellator tessellator = Tessellator.instance; + renderer.setRenderBounds(2.0D/16.0D, 0.0D, 2.0D/16.0D, 14.0D/16.0D, 15.0D/16.0D, 14.0D/16.0D); + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata)); + tessellator.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + + GL11.glPopMatrix(); + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block block, int modelId, RenderBlocks renderer) { + + if(this.getRenderId()!=modelId)return false; + + renderer.setRenderBounds(2.0D/16.0D, 0.0D, 2.0D/16.0D, 14.0D/16.0D, 15.0D/16.0D, 14.0D/16.0D); + renderer.renderStandardBlock(block, x, y, z); + + TileEntityWood t = (TileEntityWood) world.getTileEntity(x, y, z); + + if(t!=null&&t.getFertilizer()!=null){ + + if(FertilizerManager.getFertilizer(t.getFertilizer())!=null){ + renderer.setOverrideBlockTexture(FertilizerManager.getFertilizerIcon(t.getFertilizer()).getFertilizerIcon()); + }else{ + t.setFertilizer(null); + } + + renderer.setRenderBounds(2.0D/16.0D, 1 - 0.01f, 2.0D/16.0D, 14.0D/16.0D, 15.0D/16.0D + 0.009f, 14.0D/16.0D); + renderer.renderStandardBlock(block, x, y, z); + } + + renderer.clearOverrideBlockTexture(); + + return true; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.woodType; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererWoodHopper.java b/src/main/java/shift/sextiarysector/renderer/block/RendererWoodHopper.java new file mode 100644 index 0000000..5e2e0b1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererWoodHopper.java @@ -0,0 +1,237 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockHopper; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import shift.sextiarysector.SextiarySector; +import shift.sextiarysector.block.BlockWoodHopper; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererWoodHopper implements ISimpleBlockRenderingHandler{ + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId,RenderBlocks renderer) { + // TODO 閾ェ蜍慕函謌舌&繧後◆繝。繧ス繝繝峨サ繧ケ繧ソ繝 + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,Block block, int modelId, RenderBlocks renderer) { + return renderBlockHopper(world,(BlockWoodHopper) block, x, y, z, renderer); + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return false; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.woodHopperType; + } + + + public boolean renderBlockHopper(IBlockAccess world,BlockWoodHopper p_147803_1_, int p_147803_2_, int p_147803_3_, int p_147803_4_, RenderBlocks renderer) + { + Tessellator tessellator = Tessellator.instance; + tessellator.setBrightness(p_147803_1_.getMixedBrightnessForBlock((IBlockAccess) world, p_147803_2_, p_147803_3_, p_147803_4_)); + int l = p_147803_1_.colorMultiplier((IBlockAccess) world, p_147803_2_, p_147803_3_, p_147803_4_); + float f = (float)(l >> 16 & 255) / 255.0F; + float f1 = (float)(l >> 8 & 255) / 255.0F; + float f2 = (float)(l & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + return renderBlockHopperMetadata(world,p_147803_1_, p_147803_2_, p_147803_3_, p_147803_4_, world.getBlockMetadata(p_147803_2_, p_147803_3_, p_147803_4_), false, renderer); + } + + public boolean renderBlockHopperMetadata(IBlockAccess world, BlockWoodHopper p_147799_1_, int p_147799_2_, int p_147799_3_, int p_147799_4_, int p_147799_5_, boolean p_147799_6_, RenderBlocks renderer) + { + Tessellator tessellator = Tessellator.instance; + int i1 = BlockHopper.getDirectionFromMetadata(p_147799_5_); + double d0 = 0.625D; + renderer.setRenderBounds(0.0D, d0, 0.0D, 1.0D, 1.0D, 1.0D); + + if (p_147799_6_) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 0, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 1, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 2, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 3, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 4, p_147799_5_)); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(p_147799_1_, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(p_147799_1_, 5, p_147799_5_)); + tessellator.draw(); + } + else + { + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + float f1; + + if (!p_147799_6_) + { + tessellator.setBrightness(p_147799_1_.getMixedBrightnessForBlock(world, p_147799_2_, p_147799_3_, p_147799_4_)); + int j1 = p_147799_1_.colorMultiplier(world, p_147799_2_, p_147799_3_, p_147799_4_); + float f = (float)(j1 >> 16 & 255) / 255.0F; + f1 = (float)(j1 >> 8 & 255) / 255.0F; + float f2 = (float)(j1 & 255) / 255.0F; + + if (EntityRenderer.anaglyphEnable) + { + float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; + float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; + float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; + f = f3; + f1 = f4; + f2 = f5; + } + + tessellator.setColorOpaque_F(f, f1, f2); + } + + IIcon iicon = p_147799_1_.getHopperIcon2("hopper_outside"); + IIcon iicon1 = p_147799_1_.getHopperIcon2("hopper_inside"); + f1 = 0.125F; + + if (p_147799_6_) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(p_147799_1_, (double)(-1.0F + f1), 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(p_147799_1_, (double)(1.0F - f1), 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, (double)(-1.0F + f1), iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, (double)(1.0F - f1), iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(p_147799_1_, 0.0D, -1.0D + d0, 0.0D, iicon1); + tessellator.draw(); + } + else + { + renderer.renderFaceXPos(p_147799_1_, (double)((float)p_147799_2_ - 1.0F + f1), (double)p_147799_3_, (double)p_147799_4_, iicon); + renderer.renderFaceXNeg(p_147799_1_, (double)((float)p_147799_2_ + 1.0F - f1), (double)p_147799_3_, (double)p_147799_4_, iicon); + renderer.renderFaceZPos(p_147799_1_, (double)p_147799_2_, (double)p_147799_3_, (double)((float)p_147799_4_ - 1.0F + f1), iicon); + renderer.renderFaceZNeg(p_147799_1_, (double)p_147799_2_, (double)p_147799_3_, (double)((float)p_147799_4_ + 1.0F - f1), iicon); + renderer.renderFaceYPos(p_147799_1_, (double)p_147799_2_, (double)((float)p_147799_3_ - 1.0F) + d0, (double)p_147799_4_, iicon1); + } + + renderer.setOverrideBlockTexture(iicon); + double d3 = 0.25D; + double d4 = 0.25D; + renderer.setRenderBounds(d3, d4, d3, 1.0D - d3, d0 - 0.002D, 1.0D - d3); + + if (p_147799_6_) + { + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(p_147799_1_, 0.0D, 0.0D, 0.0D, iicon); + tessellator.draw(); + } + else + { + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (!p_147799_6_) + { + double d1 = 0.375D; + double d2 = 0.25D; + renderer.setOverrideBlockTexture(iicon); + + if (i1 == 0) + { + renderer.setRenderBounds(d1, 0.0D, d1, 1.0D - d1, 0.25D, 1.0D - d1); + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (i1 == 2) + { + renderer.setRenderBounds(d1, d4, 0.0D, 1.0D - d1, d4 + d2, d3); + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (i1 == 3) + { + renderer.setRenderBounds(d1, d4, 1.0D - d3, 1.0D - d1, d4 + d2, 1.0D); + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (i1 == 4) + { + renderer.setRenderBounds(0.0D, d4, d1, d3, d4 + d2, 1.0D - d1); + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + + if (i1 == 5) + { + renderer.setRenderBounds(1.0D - d3, d4, d1, 1.0D, d4 + d2, 1.0D - d1); + renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); + } + } + + renderer.clearOverrideBlockTexture(); + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/block/RendererWoodenGutter.java b/src/main/java/shift/sextiarysector/renderer/block/RendererWoodenGutter.java new file mode 100644 index 0000000..441a913 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/block/RendererWoodenGutter.java @@ -0,0 +1,31 @@ +package shift.sextiarysector.renderer.block; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.world.IBlockAccess; +import shift.sextiarysector.SextiarySector; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + +public class RendererWoodenGutter implements ISimpleBlockRenderingHandler { + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + + } + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + return false; + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return false; + } + + @Override + public int getRenderId() { + return SextiarySector.proxy.woodenGutterType; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/entity/ModelDecoration.java b/src/main/java/shift/sextiarysector/renderer/entity/ModelDecoration.java new file mode 100644 index 0000000..814f753 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/entity/ModelDecoration.java @@ -0,0 +1,73 @@ +package shift.sextiarysector.renderer.entity; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.model.TextureOffset; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; + +public class ModelDecoration extends ModelBase { + + public float onGround; + public boolean isRiding; + public List boxList = new ArrayList(); + public boolean isChild = true; + private final Map modelTextureMap = new HashMap(); + public int textureWidth = 64; + public int textureHeight = 32; + + public ModelBase base; + + public void setModel(ModelBase base) { + + this.base = base; + this.onGround = base.onGround; + this.isRiding = base.isRiding; + this.boxList = base.boxList; + this.isChild = base.isChild; + this.textureWidth = base.textureWidth; + this.textureHeight = base.textureHeight; + //this.modelTextureMap = base.modelTextureMap; + + } + + @Override + public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) { + this.base.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); + } + + @Override + public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity p_78087_7_) { + this.base.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, p_78087_7_); + } + + @Override + public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) { + this.setLivingAnimations(p_78086_1_, p_78086_2_, p_78086_3_, p_78086_4_); + } + + @Override + public ModelRenderer getRandomModelBox(Random p_85181_1_) + { + return (ModelRenderer) this.boxList.get(p_85181_1_.nextInt(this.boxList.size())); + } + + @Override + protected void setTextureOffset(String p_78085_1_, int p_78085_2_, int p_78085_3_) + { + this.modelTextureMap.put(p_78085_1_, new TextureOffset(p_78085_2_, p_78085_3_)); + } + + @Override + public TextureOffset getTextureOffset(String p_78084_1_) + { + return (TextureOffset) this.modelTextureMap.get(p_78084_1_); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/entity/RenderMineboat.java b/src/main/java/shift/sextiarysector/renderer/entity/RenderMineboat.java new file mode 100644 index 0000000..ce53724 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/entity/RenderMineboat.java @@ -0,0 +1,90 @@ +package shift.sextiarysector.renderer.entity; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.entity.RenderBoat; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.entity.EntityMineboat; +import shift.sextiarysector.renderer.model.ModelMineboat; + +public class RenderMineboat extends RenderBoat{ + + private static final ResourceLocation field_110782_f = new ResourceLocation("textures/entity/boat.png"); + + protected final RenderBlocks blockrender; + + public RenderMineboat() + { + this.shadowSize = 0.5F; + this.modelBoat = new ModelMineboat(); + // + this.blockrender = new RenderBlocks(); + } + + public void renderMineboat(EntityMineboat par1EntityBoat, double par2, double par4, double par6, float par8, float par9) + { + GL11.glPushMatrix(); + GL11.glTranslatef((float)par2, (float)par4, (float)par6); + GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); + float f2 = par1EntityBoat.getTimeSinceHit() - par9; + float f3 = par1EntityBoat.getDamageTaken() - par9; + + if (f3 < 0.0F) + { + f3 = 0.0F; + } + + if (f2 > 0.0F) + { + GL11.glRotatef(MathHelper.sin(f2) * f2 * f3 / 10.0F * par1EntityBoat.getForwardDirection(), 1.0F, 0.0F, 0.0F); + } + + //kokokara + int j = 4;//par1EntityBoat.getDisplayTileOffset(); + Block block = par1EntityBoat.getDisplayTile(); + int k = par1EntityBoat.getDisplayTileData(); + + if (block != null) + { + GL11.glPushMatrix(); + this.bindTexture(TextureMap.locationBlocksTexture); + float f8 = 1.0f;//0.75F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(0.0F, j / 16.0F, 0.0F); + this.renderBlockInMinecart(par1EntityBoat, par9, block, k); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.bindEntityTexture(par1EntityBoat); + } + //kokomade + + float f4 = 0.75F; + GL11.glScalef(f4, f4, f4); + GL11.glScalef(1.0F / f4, 1.0F / f4, 1.0F / f4); + this.bindEntityTexture(par1EntityBoat); + GL11.glScalef(-1.0F, -1.0F, 1.0F); + this.modelBoat.render(par1EntityBoat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + + // + protected void renderBlockInMinecart(EntityMineboat par1EntityMineboat, float par2, Block par3Block, int par4) + { + float f1 = par1EntityMineboat.getBrightness(par2); + GL11.glPushMatrix(); + this.blockrender.renderBlockAsItem(par3Block, par4, f1); + GL11.glPopMatrix(); + } + + @Override + public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) + { + this.renderMineboat((EntityMineboat)par1Entity, par2, par4, par6, par8, par9); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/entity/RenderMineboatTank.java b/src/main/java/shift/sextiarysector/renderer/entity/RenderMineboatTank.java new file mode 100644 index 0000000..1e995d9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/entity/RenderMineboatTank.java @@ -0,0 +1,128 @@ +package shift.sextiarysector.renderer.entity; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.init.Blocks; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; + +import org.lwjgl.opengl.GL11; + +import shift.sextiarysector.entity.EntityMineboat; +import shift.sextiarysector.entity.EntityMineboatTank; + +public class RenderMineboatTank extends RenderMineboat { + + @Override + public void renderMineboat(EntityMineboat par1EntityBoat, double par2, double par4, double par6, float par8, float par9) + { + super.renderMineboat(par1EntityBoat, par2, par4, par6, par8, par9); + + GL11.glPushMatrix(); + GL11.glTranslatef((float) par2, (float) par4, (float) par6); + GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); + float f2 = par1EntityBoat.getTimeSinceHit() - par9; + float f3 = par1EntityBoat.getDamageTaken() - par9; + + if (f3 < 0.0F) + { + f3 = 0.0F; + } + + if (f2 > 0.0F) + { + GL11.glRotatef(MathHelper.sin(f2) * f2 * f3 / 10.0F * par1EntityBoat.getForwardDirection(), 1.0F, 0.0F, 0.0F); + } + + float f8 = 1.0f; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(0.0F, 4 / 16.0F, 0.0F); + + if (((EntityMineboatTank) par1EntityBoat).hasFluidStack()) { + + EntityMineboatTank boat = (EntityMineboatTank) par1EntityBoat; + + IIcon icon = boat.getFluidStack().getFluid().getIcon(boat.getFluidStack()); + icon = blockrender.getIconSafe(icon); + + float i = 0.4375f; + + float f1 = boat.getRendererAmount(); + if (f1 >= 0.99) f1 = 0.98f; + + this.bindTexture(TextureMap.locationBlocksTexture); + + setColor3ub(boat.getFluidStack().getFluid().getColor()); + + blockrender.blockAccess = boat.worldObj; + + blockrender.renderAllFaces = true; + blockrender.setOverrideBlockTexture(icon); + //blockrender.setRenderBounds(i*2.3, -0.0625*6, i*2.3, 1-i*2.5,0.0625*1.8f, 1-i*2.3); + blockrender.setRenderBounds(-i + 0.01f, -0.49f, -i + 0.01f, i - 0.01f, f1 - 0.49f, i - 0.01f); + //blockrender.setRenderBounds(i, 0.0625*2, i, 1-i,0.0625*8f, 1-i); + //blockrender.renderStandardBlock(Block.blocksList[tileentity.getWorldObj().getBlockId(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord)], tileentity.xCoord, tileentity.yCoord,tileentity.zCoord); + + Tessellator tessellator = Tessellator.instance; + + Block block = Blocks.air;//boat.worldObj.getBlock(boat.posX, boat.posY, boat.posZ); + + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + blockrender.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 1.0F, 0.0F); + blockrender.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, -1.0F); + blockrender.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + blockrender.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(-1.0F, 0.0F, 0.0F); + blockrender.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + tessellator.startDrawingQuads(); + tessellator.setNormal(1.0F, 0.0F, 0.0F); + blockrender.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, icon); + tessellator.draw(); + + blockrender.renderAllFaces = false; + blockrender.clearOverrideBlockTexture(); + + } + + /* + //kokokara + int j = 4;//par1EntityBoat.getDisplayTileOffset(); + Block block = par1EntityBoat.getDisplayTile(); + int k = par1EntityBoat.getDisplayTileData(); + + if (block != null) + { + GL11.glPushMatrix(); + this.bindTexture(TextureMap.locationBlocksTexture); + float f8 = 1.0f;//0.75F; + GL11.glScalef(f8, f8, f8); + GL11.glTranslatef(0.0F, j / 16.0F, 0.0F); + this.renderBlockInMinecart(par1EntityBoat, par9, block, k); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.bindEntityTexture(par1EntityBoat); + }*/ + + GL11.glPopMatrix(); + + } + + public static void setColor3ub(int color) { + + GL11.glColor3ub((byte) (color >> 16 & 0xFF), (byte) (color >> 8 & 0xFF), (byte) (color & 0xFF)); + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/item/RenderGF.java b/src/main/java/shift/sextiarysector/renderer/item/RenderGF.java index a0b76bd..797c2ab 100644 --- a/src/main/java/shift/sextiarysector/renderer/item/RenderGF.java +++ b/src/main/java/shift/sextiarysector/renderer/item/RenderGF.java @@ -10,8 +10,8 @@ import org.lwjgl.opengl.GL11; -import shift.sextiarysector.api.machine.item.GearForceItem; -import shift.sextiarysector.api.machine.item.IGearForceItem; +import shift.sextiarysector.api.gearforce.item.GearForceItemAPI; +import shift.sextiarysector.api.gearforce.item.IGearForceItem; import shift.sextiarysector.event.ClientEventHandler; import cpw.mods.fml.client.FMLClientHandler; @@ -38,7 +38,7 @@ public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if(item.getItem() instanceof IGearForceItem && type == ItemRenderType.INVENTORY) { - int k = (int)Math.round(GearForceItem.manager.getSpeed(item) * 13.0D / ((IGearForceItem)item.getItem()).getMaxSpeedStored(item)); + int k = (int)Math.round(GearForceItemAPI.manager.getSpeed(item) * 13.0D / ((IGearForceItem)item.getItem()).getMaxSpeed(item)); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_ALPHA_TEST); diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelBlockBottle.java b/src/main/java/shift/sextiarysector/renderer/model/ModelBlockBottle.java new file mode 100644 index 0000000..816cf1f --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelBlockBottle.java @@ -0,0 +1,51 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelBlockBottle extends ModelBase +{ + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape1; + + public ModelBlockBottle() + { + textureWidth = 64; + textureHeight = 64; + + Shape2 = new ModelRenderer(this, 0, 0); + Shape2.addBox(-5.5F, -8F, -5.5F, 11, 2, 11); + Shape2.setRotationPoint(0F, 0F, 0F); + Shape2.setTextureSize(64, 64); + Shape2.mirror = true; + Shape3 = new ModelRenderer(this, 0, 14); + Shape3.addBox(-2F, -6F, -2F, 4, 5, 4); + Shape3.setRotationPoint(0F, 0F, 0F); + Shape3.setTextureSize(64, 64); + Shape3.mirror = true; + Shape4 = new ModelRenderer(this, 0, 23); + Shape4.addBox(-6F, -3F, -6F, 12, 11, 12); + Shape4.setRotationPoint(0F, 0F, 0F); + Shape4.setTextureSize(64, 64); + Shape4.mirror = true; + Shape1 = new ModelRenderer(this, 0, 46); + Shape1.addBox(-3F, -5F, -3F, 6, 2, 6); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(64, 64); + Shape1.mirror = true; + } + + 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); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape1.render(f5); + } + + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelCraftFurnace.java b/src/main/java/shift/sextiarysector/renderer/model/ModelCraftFurnace.java new file mode 100644 index 0000000..48633d5 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelCraftFurnace.java @@ -0,0 +1,34 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelCraftFurnace extends ModelBase { + + ModelRenderer Shape1; + + public ModelCraftFurnace() { + textureWidth = 256; + textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-24F, -24F, -24F, 48, 48, 48); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(256, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + } + + 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); + Shape1.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelFan.java b/src/main/java/shift/sextiarysector/renderer/model/ModelFan.java new file mode 100644 index 0000000..365b6cc --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelFan.java @@ -0,0 +1,91 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelFan extends ModelBase +{ + //fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + ModelRenderer Shape6; + ModelRenderer Shape7; + + public ModelFan() + { + textureWidth = 64; + textureHeight = 64; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-8F, -8F, -8F, 16, 16, 12); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(64, 64); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 48); + Shape2.addBox(-2F, -2F, 4.5F, 4, 4, 3); + Shape2.setRotationPoint(0F, 0F, 0F); + Shape2.setTextureSize(64, 64); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 55); + Shape3.addBox(-2F, -6F, 5.5F, 2, 4, 1); + Shape3.setRotationPoint(0F, 0F, 0F); + Shape3.setTextureSize(64, 64); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0.1745329F, 0F); + Shape4 = new ModelRenderer(this, 0, 55); + Shape4.addBox(0F, 2F, 5.5F, 2, 4, 1); + Shape4.setRotationPoint(0F, 0F, 0F); + Shape4.setTextureSize(64, 64); + Shape4.mirror = true; + setRotation(Shape4, 0F, -0.1745329F, 0F); + Shape5 = new ModelRenderer(this, 6, 55); + Shape5.addBox(2F, -2F, 5.5F, 4, 2, 1); + Shape5.setRotationPoint(0F, 0F, 0F); + Shape5.setTextureSize(64, 64); + Shape5.mirror = true; + setRotation(Shape5, -0.1745329F, 0F, 0F); + Shape6 = new ModelRenderer(this, 6, 55); + Shape6.addBox(-6F, 0F, 5.5F, 4, 2, 1); + Shape6.setRotationPoint(0F, 0F, 0F); + Shape6.setTextureSize(64, 64); + Shape6.mirror = true; + setRotation(Shape6, 0.1745329F, 0F, 0F); + Shape7 = new ModelRenderer(this, 0, 28); + Shape7.addBox(-8F, -8F, 4F, 16, 16, 4); + Shape7.setRotationPoint(0F, 0F, 0F); + Shape7.setTextureSize(64, 64); + Shape7.mirror = true; + setRotation(Shape7, 0F, 0F, 0F); + } + + 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); + Shape1.render(f5); + Shape7.render(f5); + } + + public void renderFan(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelFluidCrafter.java b/src/main/java/shift/sextiarysector/renderer/model/ModelFluidCrafter.java new file mode 100644 index 0000000..fc1b8cf --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelFluidCrafter.java @@ -0,0 +1,28 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelFluidCrafter extends ModelBase { + ModelRenderer Shape1; + + public ModelFluidCrafter() { + textureWidth = 64; + textureHeight = 32; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-4F, -4F, -4F, 8, 8, 8); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(64, 32); + Shape1.mirror = true; + + } + + 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); + Shape1.render(f5); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelGFDynamo.java b/src/main/java/shift/sextiarysector/renderer/model/ModelGFDynamo.java new file mode 100644 index 0000000..5b094e4 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelGFDynamo.java @@ -0,0 +1,86 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelGFDynamo extends ModelBase +{ + + ModelRenderer Base1; + ModelRenderer Base2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + ModelRenderer Shape6; + + public ModelGFDynamo() + { + + textureWidth = 64; + textureHeight = 64; + + Base1 = new ModelRenderer(this, 0, 0); + Base1.addBox(-8F, -8F, -8F, 16, 16, 10); + Base1.setRotationPoint(0F, 0F, 0F); + Base1.setTextureSize(64, 64); + Base1.mirror = true; + setRotation(Base1, 0F, 0F, 0F); + Base2 = new ModelRenderer(this, 0, 26); + Base2.addBox(-3F, -3F, 2F, 6, 6, 6); + Base2.setRotationPoint(0F, 0F, 0F); + Base2.setTextureSize(64, 64); + Base2.mirror = true; + setRotation(Base2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 38); + Shape3.addBox(-1F, -7F, -7.5F, 2, 14, 9); + Shape3.setRotationPoint(0F, 0F, 0F); + Shape3.setTextureSize(64, 64); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 0, 38); + Shape4.addBox(-1F, -7F, -7.5F, 2, 14, 9); + Shape4.setRotationPoint(0F, 0F, 0F); + Shape4.setTextureSize(64, 64); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0.7853982F); + Shape5 = new ModelRenderer(this, 0, 38); + Shape5.addBox(-1F, -7F, -7.5F, 2, 14, 9); + Shape5.setRotationPoint(0F, 0F, 0F); + Shape5.setTextureSize(64, 64); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 1.570796F); + Shape6 = new ModelRenderer(this, 0, 38); + Shape6.addBox(-1F, -7F, -7.5F, 2, 14, 9); + Shape6.setRotationPoint(0F, 0F, 0F); + Shape6.setTextureSize(64, 64); + Shape6.mirror = true; + setRotation(Shape6, 0F, 0F, 2.356194F); + } + + @Override + 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); + Base1.render(f5); + Base2.render(f5); + } + + public void renderShaft(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + Shape3.render(f5); + Shape4.render(f5); + Shape5.render(f5); + Shape6.render(f5); + + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelGearShaftDown.java b/src/main/java/shift/sextiarysector/renderer/model/ModelGearShaftDown.java new file mode 100644 index 0000000..e41415b --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelGearShaftDown.java @@ -0,0 +1,87 @@ +// Date: 2014/10/27 23:04:54 +// Template version 1.1 +// Java generated by Techne +// Keep in mind that you still need to fill in some blanks +// - ZeuX + +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelGearShaftDown extends ModelGearShaftUp { + // fields + ModelRenderer b; + ModelRenderer out; + ModelRenderer in; + ModelRenderer d1; + ModelRenderer d2; + ModelRenderer d3; + ModelRenderer d4; + ModelRenderer u1; + + public ModelGearShaftDown() { + textureWidth = 64; + textureHeight = 32; + + b = new ModelRenderer(this, 0, 0); + b.addBox(-1F, -1F, -7F, 2, 2, 14); + b.setRotationPoint(0F, 0F, 0F); + b.setTextureSize(64, 32); + b.mirror = true; + out = new ModelRenderer(this, 33, 0); + out.addBox(-4F, -4F, -8F, 8, 8, 4); + out.setRotationPoint(0F, 0F, 0F); + out.setTextureSize(64, 32); + out.mirror = true; + in = new ModelRenderer(this, 33, 13); + in.addBox(-4F, -4F, 4F, 8, 8, 4); + in.setRotationPoint(0F, 0F, 0F); + in.setTextureSize(64, 32); + in.mirror = true; + d1 = new ModelRenderer(this, 0, 0); + d1.addBox(-1F, -7F, -3F, 2, 2, 2); + d1.setRotationPoint(0F, 0F, 0F); + d1.setTextureSize(64, 32); + d1.mirror = true; + d2 = new ModelRenderer(this, 0, 0); + d2.addBox(-7F, -1F, -3F, 2, 2, 2); + d2.setRotationPoint(0F, 0F, 0F); + d2.setTextureSize(64, 32); + d2.mirror = true; + d3 = new ModelRenderer(this, 0, 0); + d3.addBox(5F, -1F, -3F, 2, 2, 2); + d3.setRotationPoint(0F, 0F, 0F); + d3.setTextureSize(64, 32); + d3.mirror = true; + d4 = new ModelRenderer(this, 0, 0); + d4.addBox(-1F, 5F, -3F, 2, 2, 2); + d4.setRotationPoint(0F, 0F, 0F); + d4.setTextureSize(64, 32); + d4.mirror = true; + u1 = new ModelRenderer(this, 0, 4); + u1.addBox(-1F, -7F, 1F, 2, 2, 2); + u1.setRotationPoint(0F, 0F, 0F); + u1.setTextureSize(64, 32); + u1.mirror = true; + } + + 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); + b.render(f5); + out.render(f5); + in.render(f5); + } + + public void renderDown(Entity entity, float f, float f1, float f2, float f3,float f4, float f5) { + d1.render(f5); + d2.render(f5); + d3.render(f5); + d4.render(f5); + } + + public void renderUp(Entity entity, float f, float f1, float f2, float f3,float f4, float f5) { + u1.render(f5); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelGearShaftUp.java b/src/main/java/shift/sextiarysector/renderer/model/ModelGearShaftUp.java new file mode 100644 index 0000000..c3d7c65 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelGearShaftUp.java @@ -0,0 +1,130 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelGearShaftUp extends ModelBase { + + ModelRenderer b; + ModelRenderer out; + ModelRenderer in; + + ModelRenderer d1; + ModelRenderer d2; + ModelRenderer d3; + ModelRenderer d4; + + ModelRenderer d5; + ModelRenderer d6; + ModelRenderer d7; + ModelRenderer d8; + + ModelRenderer u1; + + public ModelGearShaftUp() { + textureWidth = 64; + textureHeight = 32; + + b = new ModelRenderer(this, 0, 0); + b.addBox(-1F, -1F, -7F, 2, 2, 14); + b.setRotationPoint(0F, 0F, 0F); + b.setTextureSize(64, 32); + b.mirror = true; + out = new ModelRenderer(this, 33, 0); + out.addBox(-4F, -4F, -8F, 8, 8, 4); + out.setRotationPoint(0F, 0F, 0F); + out.setTextureSize(64, 32); + out.mirror = true; + in = new ModelRenderer(this, 33, 13); + in.addBox(-4F, -4F, 4F, 8, 8, 4); + in.setRotationPoint(0F, 0F, 0F); + in.setTextureSize(64, 32); + in.mirror = true; + + d1 = new ModelRenderer(this, 0, 0); + d1.addBox(-1F, -7F, 1F, 2, 2, 2); + d1.setRotationPoint(0F, 0F, 0F); + d1.setTextureSize(64, 32); + d1.mirror = true; + d2 = new ModelRenderer(this, 0, 0); + d2.addBox(-7F, -1F, 1F, 2, 2, 2); + d2.setRotationPoint(0F, 0F, 0F); + d2.setTextureSize(64, 32); + d2.mirror = true; + d3 = new ModelRenderer(this, 0, 0); + d3.addBox(5F, -1F, 1F, 2, 2, 2); + d3.setRotationPoint(0F, 0F, 0F); + d3.setTextureSize(64, 32); + d3.mirror = true; + d4 = new ModelRenderer(this, 0, 0); + d4.addBox(-1F, 5F, 1F, 2, 2, 2); + d4.setRotationPoint(0F, 0F, 0F); + d4.setTextureSize(64, 32); + d4.mirror = true; + + d5 = new ModelRenderer(this, 0, 0); + d5.addBox(-1F, -7F, 0F, 2, 2, 2); + d5.setRotationPoint(0F, 0F, 0F); + d5.setTextureSize(64, 32); + d5.mirror = true; + this.setRotation(d5, 0, 0, 0.90F); + d6 = new ModelRenderer(this, 0, 0); + d6.addBox(-7F, -1F, 0F, 2, 2, 2); + d6.setRotationPoint(0F, 0F, 0F); + d6.setTextureSize(64, 32); + d6.mirror = true; + this.setRotation(d6, 0, 0, 0.90F); + d7 = new ModelRenderer(this, 0, 0); + d7.addBox(5F, -1F, 0F, 2, 2, 2); + d7.setRotationPoint(0F, 0F, 0F); + d7.setTextureSize(64, 32); + d7.mirror = true; + this.setRotation(d7, 0, 0, 0.90F); + d8 = new ModelRenderer(this, 0, 0); + d8.addBox(-1F, 5F, 0F, 2, 2, 2); + d8.setRotationPoint(0F, 0F, 0F); + d8.setTextureSize(64, 32); + d8.mirror = true; + this.setRotation(d8, 0, 0, 0.90F); + + u1 = new ModelRenderer(this, 0, 4); + u1.addBox(-1F, -7F, -3F, 2, 2, 2); + u1.setRotationPoint(0F, 0F, 0F); + u1.setTextureSize(64, 32); + u1.mirror = true; + } + + @Override + 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); + b.render(f5); + out.render(f5); + in.render(f5); + } + + public void renderDown(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + d1.render(f5); + d2.render(f5); + d3.render(f5); + d4.render(f5); + + d5.render(f5); + d6.render(f5); + d7.render(f5); + d8.render(f5); + } + + public void renderUp(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + u1.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelLargeWindmill.java b/src/main/java/shift/sextiarysector/renderer/model/ModelLargeWindmill.java new file mode 100644 index 0000000..112264b --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelLargeWindmill.java @@ -0,0 +1,124 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelLargeWindmill extends ModelBase +{ + + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape41; + ModelRenderer Shape42; + ModelRenderer Shape51; + ModelRenderer Shape52; + ModelRenderer Shape61; + ModelRenderer Shape71; + ModelRenderer Shape62; + ModelRenderer Shape72; + + public ModelLargeWindmill() + { + + this.textureWidth = 128; + this.textureHeight = 128; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-2F, -2F, -8.1F, 4, 4, 16); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(128, 128); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 20); + Shape2.addBox(-4F, -4F, 4F, 8, 8, 4); + Shape2.setRotationPoint(0F, 0F, 0F); + Shape2.setTextureSize(128, 128); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 42, 1); + Shape3.addBox(-4F, -4F, -7F, 8, 8, 8); + Shape3.setRotationPoint(0F, 0F, 0F); + Shape3.setTextureSize(128, 128); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape41 = new ModelRenderer(this, 0, 32); + Shape41.addBox(-3F, -54F, -6F, 6, 50, 6); + Shape41.setRotationPoint(0F, 0F, 0F); + Shape41.setTextureSize(128, 128); + Shape41.mirror = true; + setRotation(Shape41, 0F, 0F, 0F); + Shape42 = new ModelRenderer(this, 24, 44); + Shape42.addBox(2F, -50F, -6F, 20, 40, 4); + Shape42.setRotationPoint(0F, 0F, 0F); + Shape42.setTextureSize(128, 128); + Shape42.mirror = true; + setRotation(Shape42, 0F, -0.3490659F, 0F); + Shape51 = new ModelRenderer(this, 0, 32); + Shape51.addBox(-3F, 4F, -6F, 6, 50, 6); + Shape51.setRotationPoint(0F, 0F, 0F); + Shape51.setTextureSize(128, 128); + Shape51.mirror = true; + setRotation(Shape51, 0F, 0F, 0F); + Shape52 = new ModelRenderer(this, 24, 44); + Shape52.addBox(-22F, 10F, -6F, 20, 40, 4); + Shape52.setRotationPoint(0F, 0F, 0F); + Shape52.setTextureSize(128, 128); + Shape52.mirror = true; + setRotation(Shape52, 0F, 0.3490659F, 0F); + Shape61 = new ModelRenderer(this, 0, 88); + Shape61.addBox(4F, -3F, -6F, 50, 6, 6); + Shape61.setRotationPoint(0F, 0F, 0F); + Shape61.setTextureSize(128, 128); + Shape61.mirror = true; + setRotation(Shape61, 0F, 0F, 0F); + Shape71 = new ModelRenderer(this, 0, 88); + Shape71.addBox(-54F, -3F, -6F, 50, 6, 6); + Shape71.setRotationPoint(0F, 0F, 0F); + Shape71.setTextureSize(128, 128); + Shape71.mirror = true; + setRotation(Shape71, 0F, 0F, 0F); + Shape62 = new ModelRenderer(this, 0, 100); + Shape62.addBox(10F, 2F, -6F, 40, 20, 4); + Shape62.setRotationPoint(0F, 0F, 0F); + Shape62.setTextureSize(128, 128); + Shape62.mirror = true; + setRotation(Shape62, 0.3490659F, 0F, 0F); + Shape72 = new ModelRenderer(this, 0, 100); + Shape72.addBox(-50F, -22F, -6F, 40, 20, 4); + Shape72.setRotationPoint(0F, 0F, 0F); + Shape72.setTextureSize(128, 128); + Shape72.mirror = true; + setRotation(Shape72, -0.3490659F, 0F, 0F); + } + + @Override + 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); + Shape3.render(f5); + Shape41.render(f5); + Shape42.render(f5); + Shape51.render(f5); + Shape52.render(f5); + Shape61.render(f5); + Shape71.render(f5); + Shape62.render(f5); + Shape72.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void renderinOut(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + Shape1.render(f5); + Shape2.render(f5); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelMineboat.java b/src/main/java/shift/sextiarysector/renderer/model/ModelMineboat.java new file mode 100644 index 0000000..4f4b9f6 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelMineboat.java @@ -0,0 +1,55 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBoat; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelMineboat extends ModelBoat{ + + public ModelRenderer[] boatSides = new ModelRenderer[7]; + + public ModelMineboat() + { + this.boatSides[0] = new ModelRenderer(this, 0, 8); + this.boatSides[1] = new ModelRenderer(this, 0, 0); + this.boatSides[2] = new ModelRenderer(this, 0, 0); + this.boatSides[3] = new ModelRenderer(this, 0, 0); + this.boatSides[4] = new ModelRenderer(this, 0, 0); + this.boatSides[5] = new ModelRenderer(this, 44, 10); + byte b0 = 24; + byte b1 = 6; + byte b2 = 20; + byte b3 = 4; + this.boatSides[0].addBox(-b0 / 2, -b2 / 2 + 2, -3.0F, b0, b2 - 4, 4, 0.0F); + this.boatSides[0].setRotationPoint(0.0F, b3, 0.0F); + this.boatSides[5].addBox(-b0 / 2 + 1, -b2 / 2 + 1, -1.0F, b0 - 2, b2 - 2, 1, 0.0F); + this.boatSides[5].setRotationPoint(0.0F, b3, 0.0F); + this.boatSides[1].addBox(-b0 / 2 + 2, -b1 - 1, -1.0F, b0 - 4, b1, 2, 0.0F); + this.boatSides[1].setRotationPoint(-b0 / 2 + 1, b3, 0.0F); + this.boatSides[2].addBox(-b0 / 2 + 2, -b1 - 1, -1.0F, b0 - 4, b1, 2, 0.0F); + this.boatSides[2].setRotationPoint(b0 / 2 - 1, b3, 0.0F); + this.boatSides[3].addBox(-b0 / 2 + 2, -b1 - 1, -1.0F, b0 - 4, b1, 2, 0.0F); + this.boatSides[3].setRotationPoint(0.0F, b3, -b2 / 2 + 1); + this.boatSides[4].addBox(-b0 / 2 + 2, -b1 - 1, -1.0F, b0 - 4, b1, 2, 0.0F); + this.boatSides[4].setRotationPoint(0.0F, b3, b2 / 2 - 1); + this.boatSides[0].rotateAngleX = ((float)Math.PI / 2F); + this.boatSides[1].rotateAngleY = ((float)Math.PI * 3F / 2F); + this.boatSides[2].rotateAngleY = ((float)Math.PI / 2F); + this.boatSides[3].rotateAngleY = (float)Math.PI; + this.boatSides[5].rotateAngleX = -((float)Math.PI / 2F); + } + + /** + * Sets the models various rotation angles then renders the model. + */ + @Override + public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) + { + this.boatSides[5].rotationPointY = 4.0F - par4; + + for (int i = 0; i < 6; ++i) + { + this.boatSides[i].render(par7); + } + } +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelMotor.java b/src/main/java/shift/sextiarysector/renderer/model/ModelMotor.java new file mode 100644 index 0000000..631d962 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelMotor.java @@ -0,0 +1,49 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelMotor extends ModelBase +{ + //fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + + public ModelMotor() + { + textureWidth = 64; + textureHeight = 64; + + Shape1 = new ModelRenderer(this, 0, 40); + Shape1.addBox(-2F, -2F, -7F, 4, 4, 14); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(64, 64); + Shape1.mirror = true; + Shape2 = new ModelRenderer(this, 0, 0); + Shape2.addBox(-8F, -8F, -8F, 16, 16, 6); + Shape2.setRotationPoint(0F, 0F, 0F); + Shape2.setTextureSize(64, 64); + Shape2.mirror = true; + Shape3 = new ModelRenderer(this, 0, 22); + Shape3.addBox(-4F, -4F, -2F, 8, 8, 10); + Shape3.setRotationPoint(0F, 0F, 0F); + Shape3.setTextureSize(64, 64); + Shape3.mirror = true; + } + + 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); + + Shape2.render(f5); + Shape3.render(f5); + } + + public void renderShaft(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + Shape1.render(f5); + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelPipe.java b/src/main/java/shift/sextiarysector/renderer/model/ModelPipe.java new file mode 100644 index 0000000..864b863 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelPipe.java @@ -0,0 +1,160 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelPipe extends ModelBase +{ + + ModelRenderer Core; + ModelRenderer Pipe01; + ModelRenderer Pipe02; + ModelRenderer Pipe11; + ModelRenderer Pipe12; + ModelRenderer Pipe21; + ModelRenderer Pipe22; + ModelRenderer Pipe31; + ModelRenderer Pipe32; + ModelRenderer Pipe41; + ModelRenderer Pipe42; + ModelRenderer Pipe51; + ModelRenderer Pipe52; + + public ModelPipe() + { + textureWidth = 64; + textureHeight = 64; + + Core = new ModelRenderer(this, 0, 0); + Core.addBox(-3F, -3F, -3F, 6, 6, 6); + Core.setRotationPoint(0F, 0F, 0F); + Core.setTextureSize(64, 64); + Core.mirror = true; + setRotation(Core, 0F, 0F, 0F); + Pipe11 = new ModelRenderer(this, 0, 12); + Pipe11.addBox(-3F, 3F, -3F, 6, 5, 6); + Pipe11.setRotationPoint(0F, 0F, 0F); + Pipe11.setTextureSize(64, 64); + Pipe11.mirror = true; + setRotation(Pipe11, 0F, 0F, 0F); + Pipe12 = new ModelRenderer(this, 0, 23); + Pipe12.addBox(-4F, 6F, -4F, 8, 2, 8); + Pipe12.setRotationPoint(0F, 0F, 0F); + Pipe12.setTextureSize(64, 64); + Pipe12.mirror = true; + setRotation(Pipe12, 0F, 0F, 0F); + Pipe01 = new ModelRenderer(this, 0, 12); + Pipe01.addBox(-3F, -8F, -3F, 6, 5, 6); + Pipe01.setRotationPoint(0F, 0F, 0F); + Pipe01.setTextureSize(64, 64); + Pipe01.mirror = true; + setRotation(Pipe01, 0F, 0F, 0F); + Pipe02 = new ModelRenderer(this, 0, 23); + Pipe02.addBox(-4F, -8F, -4F, 8, 2, 8); + Pipe02.setRotationPoint(0F, 0F, 0F); + Pipe02.setTextureSize(64, 64); + Pipe02.mirror = true; + setRotation(Pipe02, 0F, 0F, 0F); + Pipe51 = new ModelRenderer(this, 0, 33); + Pipe51.addBox(3F, -3F, -3F, 5, 6, 6); + Pipe51.setRotationPoint(0F, 0F, 0F); + Pipe51.setTextureSize(64, 64); + Pipe51.mirror = true; + setRotation(Pipe51, 0F, 0F, 0F); + Pipe52 = new ModelRenderer(this, 0, 45); + Pipe52.addBox(6F, -4F, -4F, 2, 8, 8); + Pipe52.setRotationPoint(0F, 0F, 0F); + Pipe52.setTextureSize(64, 64); + Pipe52.mirror = true; + setRotation(Pipe52, 0F, 0F, 0F); + Pipe41 = new ModelRenderer(this, 0, 33); + Pipe41.addBox(-8F, -3F, -3F, 5, 6, 6); + Pipe41.setRotationPoint(0F, 0F, 0F); + Pipe41.setTextureSize(64, 64); + Pipe41.mirror = true; + setRotation(Pipe41, 0F, 0F, 0F); + Pipe42 = new ModelRenderer(this, 0, 45); + Pipe42.addBox(-8F, -4F, -4F, 2, 8, 8); + Pipe42.setRotationPoint(0F, 0F, 0F); + Pipe42.setTextureSize(64, 64); + Pipe42.mirror = true; + setRotation(Pipe42, 0F, 0F, 0F); + Pipe21 = new ModelRenderer(this, 32, 0); + Pipe21.addBox(-3F, -3F, -8F, 6, 6, 5); + Pipe21.setRotationPoint(0F, 0F, 0F); + Pipe21.setTextureSize(64, 64); + Pipe21.mirror = true; + setRotation(Pipe21, 0F, 0F, 0F); + Pipe22 = new ModelRenderer(this, 32, 11); + Pipe22.addBox(-4F, -4F, -8F, 8, 8, 2); + Pipe22.setRotationPoint(0F, 0F, 0F); + Pipe22.setTextureSize(64, 64); + Pipe22.mirror = true; + setRotation(Pipe22, 0F, 0F, 0F); + Pipe31 = new ModelRenderer(this, 32, 0); + Pipe31.addBox(-3F, -3F, 3F, 6, 6, 5); + Pipe31.setRotationPoint(0F, 0F, 0F); + Pipe31.setTextureSize(64, 64); + Pipe31.mirror = true; + setRotation(Pipe31, 0F, 0F, 0F); + Pipe32 = new ModelRenderer(this, 32, 11); + Pipe32.addBox(-4F, -4F, 6F, 8, 8, 2); + Pipe32.setRotationPoint(0F, 0F, 0F); + Pipe32.setTextureSize(64, 64); + Pipe32.mirror = true; + setRotation(Pipe32, 0F, 0F, 0F); + } + + @Override + 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); + Core.render(f5); + } + + public void renderPipe(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, int direction, boolean isStraight) + { + + if (direction == 0) { + + Pipe01.render(f5); + if (!isStraight) Pipe02.render(f5); + + } else if (direction == 1) { + + Pipe11.render(f5); + if (!isStraight) Pipe12.render(f5); + + } else if (direction == 2) { + + Pipe21.render(f5); + if (!isStraight) Pipe22.render(f5); + + } else if (direction == 3) { + + Pipe31.render(f5); + if (!isStraight) Pipe32.render(f5); + + } else if (direction == 4) { + + Pipe41.render(f5); + if (!isStraight) Pipe42.render(f5); + + } else if (direction == 5) { + + Pipe51.render(f5); + if (!isStraight) Pipe52.render(f5); + + } + + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelSaw.java b/src/main/java/shift/sextiarysector/renderer/model/ModelSaw.java new file mode 100644 index 0000000..d6f306d --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelSaw.java @@ -0,0 +1,60 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelSaw extends ModelBase { + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + + public ModelSaw() { + textureWidth = 64; + textureHeight = 64; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-8F, -8F, -4F, 16, 16, 12); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(64, 64); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 28); + Shape2.addBox(-5.5F, -1F, -5.5F, 11, 2, 11); + Shape2.setRotationPoint(0F, 0F, 0F); + Shape2.setTextureSize(64, 64); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 28); + Shape3.addBox(-5.5F, -1.1F, -5.5F, 11, 2, 11); + Shape3.setRotationPoint(0F, 0F, 0F); + Shape3.setTextureSize(64, 64); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0.5235988F, 0F); + Shape4 = new ModelRenderer(this, 0, 28); + Shape4.addBox(-5.5F, -0.9F, -5.5F, 11, 2, 11); + Shape4.setRotationPoint(0F, 0F, 0F); + Shape4.setTextureSize(64, 64); + Shape4.mirror = true; + setRotation(Shape4, 0F, 1.047198F, 0F); + } + + 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); + Shape1.render(f5); + } + + public void renderBlade(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelSmallWaterwheel.java b/src/main/java/shift/sextiarysector/renderer/model/ModelSmallWaterwheel.java new file mode 100644 index 0000000..04ebafd --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelSmallWaterwheel.java @@ -0,0 +1,84 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelSmallWaterwheel extends ModelBase +{ + //fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape2_1; + ModelRenderer Shape2_2; + ModelRenderer Shape2_3; + ModelRenderer Shape3; + + public ModelSmallWaterwheel() + { + textureWidth = 64; + textureHeight = 64; + + Shape1 = new ModelRenderer(this, 18, 0); + Shape1.addBox(-2F, -2F, -8F, 4, 4, 16); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(64, 64); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 0); + Shape2.addBox(-1F, -24F, -6F, 2, 48, 7); + Shape2.setRotationPoint(0F, 0F, 0F); + Shape2.setTextureSize(64, 64); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape2_1 = new ModelRenderer(this, 0, 0); + Shape2_1.addBox(-1F, -24F, -6F, 2, 48, 7); + Shape2_1.setRotationPoint(0F, 0F, 0F); + Shape2_1.setTextureSize(64, 64); + Shape2_1.mirror = true; + setRotation(Shape2_1, 0F, 0F, 0.7853982F); + Shape2_2 = new ModelRenderer(this, 0, 0); + Shape2_2.addBox(-1F, -24F, -6F, 2, 48, 7); + Shape2_2.setRotationPoint(0F, 0F, 0F); + Shape2_2.setTextureSize(64, 64); + Shape2_2.mirror = true; + setRotation(Shape2_2, 0F, 0F, -0.7853982F); + Shape2_3 = new ModelRenderer(this, 0, 0); + Shape2_3.addBox(-1F, -24F, -6F, 2, 48, 7); + Shape2_3.setRotationPoint(0F, 0F, 0F); + Shape2_3.setTextureSize(64, 64); + Shape2_3.mirror = true; + setRotation(Shape2_3, 0F, 0F, 1.570796F); + Shape3 = new ModelRenderer(this, 18, 20); + Shape3.addBox(-4F, -4F, 4.11F, 8, 8, 4); + Shape3.setRotationPoint(0F, 0F, 0F); + Shape3.setTextureSize(64, 64); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + } + + 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); + Shape2.render(f5); + Shape2_1.render(f5); + Shape2_2.render(f5); + Shape2_3.render(f5); + Shape1.render(f5); + } + + public void renderinOut(Entity entity, float f, float f1, float f2,float f3, float f4, float f5) { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + Shape3.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelSquare.java b/src/main/java/shift/sextiarysector/renderer/model/ModelSquare.java new file mode 100644 index 0000000..19e3e32 --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelSquare.java @@ -0,0 +1,78 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelSquare extends ModelBase { + + ModelRenderer side1; + ModelRenderer side2; + ModelRenderer side3; + ModelRenderer side4; + ModelRenderer under; + ModelRenderer connection; + + public ModelSquare() { + + textureWidth = 64; + textureHeight = 64; + + side1 = new ModelRenderer(this, 0, 0); + side1.addBox(-7F, -6F, 5F, 12, 14, 2); + side1.setRotationPoint(0F, 0F, 0F); + side1.setTextureSize(64, 64); + side1.mirror = true; + setRotation(side1, 0F, 0F, 0F); + side2 = new ModelRenderer(this, 0, 16); + side2.addBox(5F, -6F, -5F, 2, 14, 12); + side2.setRotationPoint(0F, 0F, 0F); + side2.setTextureSize(64, 64); + side2.mirror = true; + setRotation(side2, 0F, 0F, 0F); + side3 = new ModelRenderer(this, 28, 0); + side3.addBox(-5F, -6F, -7F, 12, 14, 2); + side3.setRotationPoint(0F, 0F, 0F); + side3.setTextureSize(64, 64); + side3.mirror = true; + setRotation(side3, 0F, 0F, 0F); + side4 = new ModelRenderer(this, 28, 16); + side4.addBox(-7F, -6F, -7F, 2, 14, 12); + side4.setRotationPoint(0F, 0F, 0F); + side4.setTextureSize(64, 64); + side4.mirror = true; + setRotation(side4, 0F, 0F, 0F); + under = new ModelRenderer(this, 0, 52); + under.addBox(-5F, 6F, -5F, 10, 2, 10); + under.setRotationPoint(0F, 0F, 0F); + under.setTextureSize(64, 64); + under.mirror = true; + setRotation(under, 0F, 0F, 0F); + connection = new ModelRenderer(this, 31, 49); + connection.addBox(-4F, -4F, -8F, 8, 8, 4); + connection.setRotationPoint(0F, 0F, 0F); + connection.setTextureSize(64, 64); + connection.mirror = true; + setRotation(connection, 0F, 0F, 0F); + } + + 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); + side1.render(f5); + side2.render(f5); + side3.render(f5); + side4.render(f5); + under.render(f5); + } + + public void renderConnection(Entity entity, float f, float f1, float f2, float f3,float f4, float f5) { + connection.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + +} diff --git a/src/main/java/shift/sextiarysector/renderer/model/ModelTank.java b/src/main/java/shift/sextiarysector/renderer/model/ModelTank.java new file mode 100644 index 0000000..bb47c5c --- /dev/null +++ b/src/main/java/shift/sextiarysector/renderer/model/ModelTank.java @@ -0,0 +1,77 @@ +package shift.sextiarysector.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class ModelTank extends ModelBase +{ + //fields + ModelRenderer Shape1; + ModelRenderer Shape2; + ModelRenderer Shape3; + ModelRenderer Shape4; + ModelRenderer Shape5; + + public ModelTank() + { + textureWidth = 64; + textureHeight = 32; + + Shape1 = new ModelRenderer(this, 0, 0); + Shape1.addBox(-7F, -8F, -7F, 1, 16, 1); + Shape1.setRotationPoint(0F, 0F, 0F); + Shape1.setTextureSize(64, 32); + Shape1.mirror = true; + setRotation(Shape1, 0F, 0F, 0F); + Shape2 = new ModelRenderer(this, 0, 0); + Shape2.addBox(-7F, -8F, 6F, 1, 16, 1); + Shape2.setRotationPoint(0F, 0F, 0F); + Shape2.setTextureSize(64, 32); + Shape2.mirror = true; + setRotation(Shape2, 0F, 0F, 0F); + Shape3 = new ModelRenderer(this, 0, 0); + Shape3.addBox(6F, -8F, -7F, 1, 16, 1); + Shape3.setRotationPoint(0F, 0F, 0F); + Shape3.setTextureSize(64, 32); + Shape3.mirror = true; + setRotation(Shape3, 0F, 0F, 0F); + Shape4 = new ModelRenderer(this, 0, 0); + Shape4.addBox(6F, -8F, 6F, 1, 16, 1); + Shape4.setRotationPoint(0F, 0F, 0F); + Shape4.setTextureSize(64, 32); + Shape4.mirror = true; + setRotation(Shape4, 0F, 0F, 0F); + Shape5 = new ModelRenderer(this, 5, 0); + Shape5.addBox(-7F, -8F, -7F, 14, 16, 14); + Shape5.setRotationPoint(0F, 0F, 0F); + Shape5.setTextureSize(64, 32); + Shape5.mirror = true; + setRotation(Shape5, 0F, 0F, 0F); + } + + @Override + 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); + setRotationAngles(f, f1, f2, f3, f4, f5); + Shape1.render(f5); + Shape2.render(f5); + Shape3.render(f5); + Shape4.render(f5); + 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) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, null); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEmptyCauldron.java b/src/main/java/shift/sextiarysector/tileentity/TileEmptyCauldron.java new file mode 100644 index 0000000..fbdfd54 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEmptyCauldron.java @@ -0,0 +1,46 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class TileEmptyCauldron extends TileEntity implements IFluidHandler{ + + private FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 1); + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { + return tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource,boolean doDrain) { + return tank.drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { + return tank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) { + return new FluidTankInfo[]{tank.getInfo()}; + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityBlockBottle.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityBlockBottle.java new file mode 100644 index 0000000..8e01b2e --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityBlockBottle.java @@ -0,0 +1,139 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class TileEntityBlockBottle extends TileEntity implements IFluidHandler { + + protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); + + private int lastFluid; + + @Override + public void updateEntity() { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() { + } + + private void updateServerEntity() { + + if ((lastFluid) != (tank.getFluidAmount() / 100)) { + this.lastFluid = (tank.getFluidAmount() / 100); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + /* IFluidHandler */ + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + return tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + return tank.drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return tank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } + + public boolean hasFluid() { + return this.tank.getFluidAmount() > 0; + } + + public IIcon getFluidIcon() { + return this.tank.getFluid().getFluid().getIcon(this.tank.getFluid()); + } + + public int getFluidColor() { + return this.tank.getFluid().getFluid().getColor(this.tank.getFluid()); + } + + public float getFluidHeight() { + return ((float) this.tank.getFluidAmount() / (float) this.tank.getCapacity()) * (10.0f / 16.0f); + } + + public int getFluidID() { + return tank.getFluid().getFluid().getID(); + } + + public FluidStack getFluidStack() { + return this.tank.getFluid(); + } + + /* NBT */ + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + tank.readFromNBT(par1nbtTagCompound); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + tank.writeToNBT(par1nbtTagCompound); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityCraftFurnace.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityCraftFurnace.java new file mode 100644 index 0000000..ef51e20 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityCraftFurnace.java @@ -0,0 +1,384 @@ +package shift.sextiarysector.tileentity; + +import java.util.UUID; + +import net.minecraft.block.Block; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraft.world.WorldServer; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import shift.sextiarysector.container.InventoryFurnaceCrafting; +import shift.sextiarysector.container.ItemBox; +import shift.sextiarysector.recipe.FurnaceCraftingManager; + +import com.mojang.authlib.GameProfile; + +public class TileEntityCraftFurnace extends TileEntitySimpleFurnace { + + protected static final int[] slots_top = new int[] { 2,3,4,5,6,7,8,9,10 }; + protected static final int[] slots_bottom = new int[] { 1, 0 }; + protected static final int[] slots_sides = new int[] { 1 }; + + protected static FakePlayer player;// = new FakePlayer(worldObj, null); + + private int time = 0; + + //0 辯譁 ,1 螳梧仙刀 + protected ItemBox items = new ItemBox("Base", 2); + + //2,3,4,5,6,7,8,9,10 邏譚 + public InventoryFurnaceCrafting craftMatrix = new InventoryFurnaceCrafting(3, 3); + + + private boolean large = false; + + + @Override + public void updateServerEntity() + { + super.updateServerEntity(); + + if(large)return; + + if(time<=100){ + time++; + return; + }else{ + time = 0; + } + + + if(!checkLarge()){ + return; + }else{ + this.large = true; + setLarge(); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + private boolean checkLarge(){ + + System.out.println("AAA"); + int h = 1; + + for(int i = h*-1; i<=h; i++){ + for(int j = h*-1; j<=h; j++){ + for(int k = h*-1; k<=h; k++){ + + if(i == 0 && j == 0 && k==0)continue; + + int x = this.xCoord + i; + int y = this.yCoord + j; + int z = this.zCoord + k; + + //if(this.worldObj.getBlock(x, y, z) != SSBlocks.stoneFrame)return false; + + } + } + } + + return true; + } + + private void setLarge(){ + + int h = 1; + + for(int i = h*-1; i<=h; i++){ + for(int j = h*-1; j<=h; j++){ + for(int k = h*-1; k<=h; k++){ + + if(i == 0 && j == 0 && k==0)continue; + + int x = this.xCoord + i; + int y = this.yCoord + j; + int z = this.zCoord + k; + + TileEntityStoneFrame t = (TileEntityStoneFrame) this.worldObj.getTileEntity(x, y, z); + + t.setLarge(xCoord, yCoord, zCoord); + + } + } + } + + } + + public void breakLarge(){ + + int h = 1; + + for(int i = h*-1; i<=h; i++){ + for(int j = h*-1; j<=h; j++){ + for(int k = h*-1; k<=h; k++){ + + if(i == 0 && j == 0 && k==0)continue; + + int x = this.xCoord + i; + int y = this.yCoord + j; + int z = this.zCoord + k; + + TileEntityStoneFrame t = (TileEntityStoneFrame) this.worldObj.getTileEntity(x, y, z); + + t.large = false; + + Block block = this.worldObj.getBlock(x, y, z); + block.dropBlockAsItem(worldObj, x, y, z, 0, 0); + worldObj.setBlock(x, y, z, Blocks.air, 0, 3); + + + this.worldObj.markBlockForUpdate(x, y, z); + + } + } + } + + Block block = this.worldObj.getBlock(xCoord, yCoord, zCoord); + block.dropBlockAsItem(worldObj, xCoord, yCoord, zCoord, 0, 0); + worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.air, 0, 3); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + + public boolean canWork() + { + if (!hasMaterialItems() || !isLarge())return false; + + + ItemStack itemstack = this.getResult(); + + if (itemstack == null) return false; + + return this.checkItem(itemstack) ; + + } + + public boolean isLarge(){ + + return large; + + } + + private boolean hasMaterialItems(){ + + for(ItemStack item : craftMatrix.stackList){ + if(item!=null)return true; + } + + return false; + } + + public void workItem() + { + if (this.canWork()) + { + ItemStack itemstack = this.getResult(); + + //item + if (this.getItems().getStackInSlot(getResultItemSlot()) == null) + { + this.setInventorySlotContents(getResultItemSlot(), itemstack.copy()); + } + else if (this.getItems().getStackInSlot(getResultItemSlot()).isItemEqual(itemstack)) + { + this.getItems().getStackInSlot(getResultItemSlot()).stackSize += itemstack.stackSize; + } + + this.reduceMaterialStackSize(); + + this.markDirty(); + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + } + + + @Override + protected ItemStack getFuelItem() { + return items.getStackInSlot(0); + } + + protected int getFuelItemSlot(){ + return 0; + } + + @Override + protected void reduceFuelStackSize(){ + this.items.reduceStackSize(0, 1); + } + + @Override + @Deprecated + protected ItemStack getMaterialItem() { + return null; + } + + @Override + protected int getResultItemSlot(){ + return 1; + } + + @Override + protected void reduceMaterialStackSize() { + + for (int i = 0; i < this.craftMatrix.getSizeInventory(); ++i) + { + ItemStack itemstack1 = this.craftMatrix.getStackInSlot(i); + + if (itemstack1 != null) + { + this.craftMatrix.decrStackSize(i, 1); + + if (itemstack1.getItem().hasContainerItem(itemstack1)) + { + ItemStack itemstack2 = itemstack1.getItem().getContainerItem(itemstack1); + + if(itemstack2 == null){ + continue; + } + + if (itemstack2 != null && itemstack2.isItemStackDamageable() && itemstack2.getItemDamage() > itemstack2.getMaxDamage()) + { + MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(player, itemstack2)); + continue; + } + + if (!itemstack1.getItem().doesContainerItemLeaveCraftingGrid(itemstack1)) + { + if (this.craftMatrix.getStackInSlot(i) == null) + { + this.craftMatrix.setInventorySlotContents(i, itemstack2); + } + else + { + this.worldObj.spawnEntityInWorld(new EntityItem(worldObj, xCoord + 0.5f, yCoord + 3, zCoord + 0.5f, itemstack2)); + } + } + } + } + } + + } + + private FakePlayer getFakePlayer(){ + + if(player == null){ + this.player = new FakePlayer((WorldServer) this.worldObj, new GameProfile(new UUID(66, 66), "CraftFurnace")); + } + + return player; + } + + private ItemStack getResult() { + return FurnaceCraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj); + } + + @Override + @Deprecated + protected ItemStack getResult(ItemStack stackInSlot) { + return this.getResult(); + } + + @Override + public int getItemFuelTime(ItemStack p_145952_0_) + { + if (p_145952_0_ == null) + { + return 0; + } + else + { + return TileEntityFurnace.getItemBurnTime(p_145952_0_); + } + } + + @Override + protected ItemBox getItems() { + return items; + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + + if(i == 0|| i ==1){ + getItems().setInventorySlotContents(i, itemstack); + }else if(2<=i && i <=10){ + this.craftMatrix.setInventorySlotContents(i - 2, itemstack); + } + } + + @Override + public String getInventoryName() { + return "gui.ss.craft_furnace"; + } + + @Override + public void markDirty(){ + super.markDirty(); + this.craftMatrix.markDirty(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 128.0D; + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + + if (i == 0) { + return this.getItemFuelTime(itemstack) > 0; + } + + return i != 1; + } + + //ISidedInventory髢「菫 + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + return var1 == 0 ? slots_bottom : (var1 == 1 ? slots_top : slots_sides); + } + + @Override + public boolean canInsertItem(int i, ItemStack itemstack, int j) { + return this.isItemValidForSlot(i, itemstack); + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) + { + return p_102008_3_ != 0 || p_102008_1_ != 1 || p_102008_2_.getItem() == Items.bucket; + } + + //NBT髢「菫 + @Override + public void readFromNBT(NBTTagCompound nbt) { + + super.readFromNBT(nbt); + items.readFromNBT(nbt); + craftMatrix.readFromNBT(nbt); + large = nbt.getBoolean("large"); + + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + + super.writeToNBT(nbt); + items.writeToNBT(nbt); + craftMatrix.writeToNBT(nbt); + nbt.setBoolean("large", large); + + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityElectricMotor.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityElectricMotor.java new file mode 100644 index 0000000..f2c58c9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityElectricMotor.java @@ -0,0 +1,157 @@ +package shift.sextiarysector.tileentity; + +import ic2.api.energy.prefab.BasicSink; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; + +public class TileEntityElectricMotor extends TileEntityDirection implements IGearForceHandler, IGearForceGrid{ + + private BasicSink ic2EnergySink = new BasicSink(this, 2000, 1){ + + @Override + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { + + return ((TileEntityDirection)this.parent).direction.ordinal() == direction.ordinal(); + + } + + }; + + private double lastEnergy; + + public float rotateStep = 360; + + @Override + public void invalidate() { + ic2EnergySink.invalidate(); // notify the energy sink + + super.invalidate(); // this is important for mc! + } + + @Override + public void onChunkUnload() { + ic2EnergySink.onChunkUnload(); // notify the energy sink + + } + + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + + ic2EnergySink.readFromNBT(tag); + + } + + @Override + public void writeToNBT(NBTTagCompound tag) { + super.writeToNBT(tag); + + ic2EnergySink.writeToNBT(tag); + + } + + @Override + public void updateEntity() { + ic2EnergySink.updateEntity(); + + + + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + + public void updateClientEntity() { + if(this.ic2EnergySink.getEnergyStored()>0){ + rotateStep-=8; + if(rotateStep<0){ + rotateStep+=360; + } + } + } + + private void updateServerEntity() { + + if(this.ic2EnergySink.getEnergyStored()!=lastEnergy){ + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + this.lastEnergy = this.ic2EnergySink.getEnergyStored(); + } + + if(this.ic2EnergySink.canUseEnergy(20)){ + + TileEntity t =this.worldObj.getTileEntity(xCoord-this.direction.offsetX, yCoord-this.direction.offsetY, zCoord-this.direction.offsetZ); + if(t!=null && t instanceof IGearForceHandler){ + + int i = ((IGearForceHandler)t).addEnergy(this.direction, 3, 40, false); + this.ic2EnergySink.useEnergy(i); + + + } + + } + + } + + + + public float getRotateStep() { + return rotateStep; + } + + + @Override + public int addEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + return 0; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public boolean canIn(ForgeDirection from) { + return false; + } + + @Override + public boolean canOut(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFan.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFan.java new file mode 100644 index 0000000..ea3acc1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFan.java @@ -0,0 +1,201 @@ +package shift.sextiarysector.tileentity; + +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; + +public class TileEntityFan extends TileEntityDirection implements IGearForceHandler ,IGearForceGrid{ + + public float rotateStep = 360; + private int speed = 0; + private int time = 0; + + public EnergyStorage storage = new EnergyStorage("Base", 3, 3000); + + @Override + public void updateEntity() { + + super.updateEntity(); + + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + this.updateServerEntity(); + } + + if(this.canWork()){ + this.workFan(); + this.addFire(); + } + + } + + public void updateClientEntity() { + + this.rotateStep += speed; + + } + + private void updateServerEntity() { + + if(time>=10){ + this.changeSpeed(); + time=0; + }else{ + time++; + } + + } + + private void addFire(){ + + for(int i=1; i<6; i++){ + + int x = this.xCoord + this.direction.offsetX * i; + int y = this.yCoord + this.direction.offsetY * i; + int z = this.zCoord + this.direction.offsetZ * i; + + if(this.worldObj.getBlock(x, y, z) != Blocks.fire)continue; + + this.worldObj.setBlock(x, y, z, SSBlocks.blueFire); + + } + + } + + private void changeSpeed(){ + + int use = this.storage.drawEnergy(3, 200, false); + + int i = this.speed; + + if(use>=180){ + speed = Math.min(16, speed + 1); + }else{ + speed = Math.max(0, speed - 1); + } + + if(i!=speed){ + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + public boolean canWork(){ + + return speed >= 14; + + } + + private void workFan(){ + + AxisAlignedBB aabb = getDirectionAABB(); + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)null, aabb, null); + + for(Entity e :list){ + if(e instanceof EntityPlayer)continue; + e.motionX+=(this.direction.offsetX/10.0f); + e.motionY+=(this.direction.offsetY/10.0f); + e.motionZ+=(this.direction.offsetZ/10.0f); + } + + } + + private AxisAlignedBB getDirectionAABB(){ + + int minX = 0, minY = 0, minZ = 0; + int maxX = 1, maxY = 1, maxZ = 1; + + switch(direction){ + case DOWN: minY = -5; break; + case UP: maxY = 6; break; + case NORTH: minZ = -5; break; + case SOUTH: maxZ = 6; break; + case WEST: minX = -5; break; + case EAST: maxX = 6; break; + default:break; + } + + return AxisAlignedBB.getBoundingBox(this.xCoord + minX, this.yCoord + minY, this.zCoord + minZ, this.xCoord + maxX, this.yCoord + maxY, this.zCoord + maxZ); + + } + + public float getRotateStep() { + return rotateStep; + } + + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + this.speed = par1nbtTagCompound.getInteger("speed"); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + par1nbtTagCompound.setInteger("speed", this.speed); + } + + @Override + public int addEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + + if(!canInterface(from))return 0; + + int i = storage.addEnergy(power, speed, simulate); + + return i; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + + return 0; + + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.getDirection().getOpposite().ordinal() == from.ordinal(); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return storage.getPowerStored(); + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return storage.getSpeedStored(); + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return storage.getMaxPower(); + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return storage.getMaxSpeed(); + } + + @Override + public boolean canIn(ForgeDirection from) { + return this.getDirection().getOpposite().ordinal() == from.ordinal(); + } + + @Override + public boolean canOut(ForgeDirection from) { + return false; + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFarmland.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFarmland.java index 5f95a7f..99eb22e 100644 --- a/src/main/java/shift/sextiarysector/tileentity/TileEntityFarmland.java +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFarmland.java @@ -9,20 +9,22 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.SSFluids; +import shift.sextiarysector.api.agriculture.IFarmland; -public class TileEntityFarmland extends TileEntity implements IFluidHandler{ +public class TileEntityFarmland extends TileEntity implements IFluidHandler, IFarmland { //豌エ protected FluidTank water = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); + @Override public void updateEntity() { - if(!this.worldObj.isRemote){ + if (!this.worldObj.isRemote) { this.updateServerEntity(); } @@ -30,12 +32,12 @@ public void updateEntity() { public void updateServerEntity() { - if(this.getBlockMetadata()==0&&water.getFluidAmount()>500){ + if (this.getBlockMetadata() == 0 && water.getFluidAmount() > 500) { this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 4); this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } - if(this.getBlockMetadata()==1&&water.getFluidAmount()<=500){ + if (this.getBlockMetadata() == 1 && water.getFluidAmount() <= 500) { this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 4); this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } @@ -43,41 +45,43 @@ public void updateServerEntity() { } //閧・譁 - public String fertilizer; - public ItemStack fertilizerItem; + //public String fertilizer; + private ItemStack fertilizerItem; public ItemStack getFertilizer() { return fertilizerItem; } public void setFertilizer(ItemStack fertilizer) { - if(fertilizer==null){ + if (fertilizer == null) { this.fertilizerItem = null; - }else{ + } else { this.fertilizerItem = fertilizer.copy(); } } - public void clearFertilizer(){ + public void clearFertilizer() { this.fertilizerItem = null; } - public boolean canGrowth(){ - return water.getFluidAmount()>=500; + @Override + public boolean canGrowth() { + return water.getFluidAmount() >= 500; } - public void growth(){ + @Override + public void growth() { this.water.drain(500, true); } @Override public void readFromNBT(NBTTagCompound par1nbtTagCompound) { super.readFromNBT(par1nbtTagCompound); - if(par1nbtTagCompound.hasKey("fertilizer")){ - this.fertilizer = par1nbtTagCompound.getString("fertilizer"); - } - if(par1nbtTagCompound.hasKey("fertilizeritem")){ + //if(par1nbtTagCompound.hasKey("fertilizer")){ + // this.fertilizer = par1nbtTagCompound.getString("fertilizer"); + //} + if (par1nbtTagCompound.hasKey("fertilizeritem")) { this.fertilizerItem = ItemStack.loadItemStackFromNBT(par1nbtTagCompound.getCompoundTag("fertilizeritem")); } @@ -87,9 +91,9 @@ public void readFromNBT(NBTTagCompound par1nbtTagCompound) { @Override public void writeToNBT(NBTTagCompound par1nbtTagCompound) { super.writeToNBT(par1nbtTagCompound); - if(fertilizer!=null)par1nbtTagCompound.setString("fertilizer", fertilizer); - if(fertilizerItem!=null){ - NBTTagCompound itemNBT =new NBTTagCompound(); + //if(fertilizer!=null)par1nbtTagCompound.setString("fertilizer", fertilizer); + if (fertilizerItem != null) { + NBTTagCompound itemNBT = new NBTTagCompound(); fertilizerItem.writeToNBT(itemNBT); par1nbtTagCompound.setTag("fertilizeritem", itemNBT); } @@ -113,7 +117,7 @@ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { - if(!this.canFill(from, resource.getFluid())){ + if (!this.canFill(from, resource.getFluid())) { return 0; } @@ -122,7 +126,7 @@ public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { } @Override - public FluidStack drain(ForgeDirection from, FluidStack resource,boolean doDrain) { + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { return null; } @@ -133,7 +137,7 @@ public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { @Override public boolean canFill(ForgeDirection from, Fluid fluid) { - return fluid.getID()==FluidRegistry.WATER.getID(); + return fluid.getID() == SSFluids.drinkingWater.getID(); } @Override diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFigure.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFigure.java new file mode 100644 index 0000000..320c82d --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFigure.java @@ -0,0 +1,88 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; + +public class TileEntityFigure extends TileEntityDirection{ + + private ItemStack figure; + private String edition = ""; + //public float rotateStep = 0; + + @Override + public void updateEntity() { + + super.updateEntity(); + + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + this.updateServerEntity(); + } + + } + + public void updateClientEntity() { + + //this.rotateStep -= 1.2f; + + } + + private void updateServerEntity() { + + } + + public ItemStack getFigure() { + return figure; + } + + public void setFigure(ItemStack figure) { + this.figure = figure; + } + + public String getEdition() { + return edition; + } + + public void setEdition(String edition) { + this.edition = edition; + } + + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + if(par1nbtTagCompound.hasKey("figure")){ + NBTTagCompound fNBT = par1nbtTagCompound.getCompoundTag("figure"); + figure = ItemStack.loadItemStackFromNBT(fNBT); + edition = par1nbtTagCompound.getString("edition"); + } + + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + if(figure!=null){ + NBTTagCompound fNBT = new NBTTagCompound(); + figure.writeToNBT(fNBT); + par1nbtTagCompound.setTag("figure", fNBT); + par1nbtTagCompound.setString("edition", edition); + } + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidCrafter.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidCrafter.java new file mode 100644 index 0000000..524774c --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidCrafter.java @@ -0,0 +1,101 @@ +package shift.sextiarysector.tileentity; + +import java.util.Random; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.FluidStack; + +public class TileEntityFluidCrafter extends TileEntity { + + public static Random r = new Random(); + + public FluidStack f ; + + public int x = 0; + public int y = 0; + public int z = 0; + + @Override + public void updateEntity() { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() { + + x+=r.nextInt(2)+4; + y+=r.nextInt(2)+4; + z+=r.nextInt(2)+4; + + } + + private void updateServerEntity() { + + } + + public boolean hasFluid() { + return f!=null; + } + + public IIcon getFluidIcon(){ + return this.f.getFluid().getIcon(f); + } + + public int getFluidColor(){ + return this.f.getFluid().getColor(this.f); + } + + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + if(par1nbtTagCompound.hasKey("fluid")){ + + NBTTagCompound nbt = par1nbtTagCompound.getCompoundTag("fluid"); + + this.f = FluidStack.loadFluidStackFromNBT(nbt); + } + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + if(f!=null){ + + NBTTagCompound nbt = new NBTTagCompound(); + + f.writeToNBT(nbt); + + par1nbtTagCompound.setTag("fluid", nbt); + + } + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + //this.worldObj.func_147479_m(xCoord, yCoord, zCoord); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidFGFMachineBase.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidFGFMachineBase.java new file mode 100644 index 0000000..23788ac --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidFGFMachineBase.java @@ -0,0 +1,652 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidContainerItem; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.api.gearforce.item.GearForceItemAPI; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.block.BlockFluidFGFMachine; +import shift.sextiarysector.container.ItemBox; + +public class TileEntityFluidFGFMachineBase extends TileEntityDirection implements ISidedInventory, IFluidHandler, IGearForceHandler, IGearForceGrid { + + protected static final int[] slots_top = new int[] { 0, 4 }; + protected static final int[] slots_bottom = new int[] { 2, 1, 3, 5 }; + protected static final int[] slots_sides = new int[] { 1 }; + + protected static final int[] material = new int[] { 0 }; + protected static final int[] empty_bottle = new int[] { 4 }; + + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 ,3 邏譚舌ョ繧ウ繝ウ繝繝 ,4 遨コ縺ョ繝懊ヨ繝ォ , 5 豸イ菴薙ョ蜈・縺」縺溘懊ヨ繝ォ + protected ItemBox items = new ItemBox("Base", 6); + + //豸イ菴 + private final FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 10); + + //GF + public EnergyStorage storage = new EnergyStorage("Base", 1, 10000); + + //陦ィ遉コ逕ィ + public int inPower = 0, inSpeed = 0; + + public int lastSeed = 0; + + //菴懈・ュ縺ョ騾イ謐 + public int machineWorkProgressTime; + + //菴懈・ュ縺ョ騾イ謐励ョ譛螟ァ蛟、 縺薙ョ謨ー蟄励↓縺ェ繧九→螳御コ縺吶k 200Speed豸郁イサ + public int machineMaxProgressTime = 2000; + + private int cooltime; + + //辯譁吶→謚募・縺輔l縺ヲ縺繧狗譁吶ョ繝槭ャ繧ッ繧ケ迥カ諷九ョ驥 + public int fuel; + public int fuelMax; + + public boolean on; + + public TileEntityFluidFGFMachineBase() { + } + + public TileEntityFluidFGFMachineBase(int type) { + this.storage.setPowerCapacity(type); + } + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + } + + public void updateServerEntity() + { + if (this.inSpeed == 0) inPower = 0; + if (lastSeed != this.storage.getSpeedStored()) { + this.inSpeed = this.storage.getSpeedStored() - lastSeed; + this.lastSeed = this.storage.getSpeedStored(); + } else { + this.inSpeed = 0; + } + + if (this.storage.getSpeedStored() <= 0) { + this.storage.setPowerStored(0); + } + + if (this.isCharging()) { + this.updateChargeEntity(); + } + + if (cooltime <= 10) { + this.cooltime++; + } else { + + this.cooltime = 0; + + if (this.isFuel() && this.canWork()) { + + this.machineWorkProgressTime += this.storage.drawEnergy(this.storage.getMaxPower(), 100, false); + + if (this.machineWorkProgressTime >= machineMaxProgressTime) + { + this.machineWorkProgressTime = 0; + this.workItem(); + + if (this.storage.getSpeedStored() == 0) { + this.storage.setPowerStored(0); + } + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + this.markDirty(); + + } + + } + + } + + this.chargeFluid(); + this.chargeFluidContainerItem(); + if (this.on && this.tank.getFluidAmount() > 0) this.chargeUPFluid(); + + } + + private void chargeUPFluid() { + + if (this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) instanceof IFluidHandler) { + IFluidHandler f = (IFluidHandler) this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); + + if (f.canFill(ForgeDirection.DOWN, this.tank.getFluid().getFluid())) { + int i = f.fill(ForgeDirection.DOWN, this.tank.getFluid(), true); + this.tank.drain(i, true); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + } + + private void chargeFluid() { + + if (canChargeFluid()) { + + ItemStack empty = items.getStackInSlot(4); + + for (FluidContainerData f : FluidContainerRegistry.getRegisteredFluidContainerData()) { + + if (f.emptyContainer.isItemEqual(empty) && f.fluid.isFluidEqual(this.tank.getFluid()) && f.fluid.amount <= this.tank.getFluidAmount()) { + + ItemStack item = FluidContainerRegistry.fillFluidContainer(this.tank.getFluid(), empty); + if (this.items.getStackInSlot(5) == null) + { + this.setInventorySlotContents(5, item.copy()); + } + else if (this.items.getStackInSlot(5).isItemEqual(item)) + { + this.items.getStackInSlot(5).stackSize += item.stackSize; + } + + this.tank.drain(f.fluid.amount, true); + + this.items.reduceStackSize(4, 1); + + this.markDirty(); + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + return; + } + + } + + } + + } + + private void chargeFluidContainerItem() { + + if (this.tank.getFluidAmount() == 0) return; + ItemStack container = items.getStackInSlot(4); + if (container == null || !(container.getItem() instanceof IFluidContainerItem) || items.getStackInSlot(5) != null) return; + + IFluidContainerItem f = (IFluidContainerItem) container.getItem(); + + int add = f.fill(container, this.tank.getFluid(), true); + this.tank.drain(add, true); + + if (add != 0) { + + this.items.setInventorySlotContents(5, container); + + this.items.reduceStackSize(4, 1); + + this.markDirty(); + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + + } + + public boolean canChargeFluid() + { + if (items.getStackInSlot(4) == null) return false; + ItemStack item = FluidContainerRegistry.fillFluidContainer(this.tank.getFluid(), items.getStackInSlot(4)); + if (item == null) return false; + if (this.items.getStackInSlot(5) == null) return true; + int result = this.items.getStackInSlot(5).stackSize + item.stackSize; + return (result <= getInventoryStackLimit() && result <= item.getMaxStackSize()); + } + + public boolean isCharging() + { + + boolean f1, f2, f3; + + if (this.items.getStackInSlot(1) == null) return false; + + f1 = this.storage.getMaxSpeed() > this.storage.getSpeedStored(); + f2 = (this.items.getStackInSlot(1) != null && GearForceItemAPI.manager.isGearForceItem(this.items.getStackInSlot(1))); + f3 = GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), 1, true) > 0; + + //System.out.println(f1+" "+f2+" "+f3); + + return f1 && f2 && f3; + } + + public void updateChargeEntity() + { + if (this.items.getStackInSlot(1) == null) return; + + if (GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), 1, true) > 0) { + int s = GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), 20, true); + + int i = this.storage.addEnergy(this.storage.getMaxPower(), s, false); + GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), i, false); + if (i > 0) this.inPower = this.storage.getMaxPower(); + //this.inSpeed += (int) i; + + this.markDirty(); + + } + } + + public boolean isFuel() + { + return this.storage.getSpeedStored() > 0; + } + + public boolean canWork() + { + if (this.items.getStackInSlot(0) == null) + { + return false; + } + else + { + ItemStack itemstack = this.getResult(this.items.getStackInSlot(0)); + FluidStack fluidstack = this.getFluidResult(this.items.getStackInSlot(0)); + if (itemstack == null && fluidstack == null) return false; + return this.checkItem(itemstack) && this.checkFluid(fluidstack) && this.checkContainerItem(this.items.getStackInSlot(0)); + } + } + + private boolean checkItem(ItemStack itemstack) { + + if (this.items.getStackInSlot(2) == null || itemstack == null) return true; + if (!this.items.getStackInSlot(2).isItemEqual(itemstack)) return false; + int result = this.items.getStackInSlot(2).stackSize + itemstack.stackSize; + return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); + } + + private boolean checkContainerItem(ItemStack itemstack) { + + if (!itemstack.getItem().hasContainerItem(itemstack)) return true; + ItemStack itemstackC = itemstack.getItem().getContainerItem(itemstack.copy()); + if (this.items.getStackInSlot(3) == null || itemstackC == null) return true; + if (!this.items.getStackInSlot(3).isItemEqual(itemstackC)) return false; + int result = this.items.getStackInSlot(3).stackSize + itemstackC.stackSize; + return (result <= getInventoryStackLimit() && result <= itemstackC.getMaxStackSize()); + + } + + private boolean checkFluid(FluidStack fluidstack) { + + if (this.getTank().getFluidAmount() == 0 || fluidstack == null) return true; + if (!this.getTank().getFluid().isFluidEqual(fluidstack)) return false; + int result = this.getTank().getFluidAmount() + fluidstack.amount; + return (result <= this.getTank().getCapacity()); + + } + + public void workItem() + { + if (this.canWork()) + { + ItemStack itemstack = this.getResult(this.items.getStackInSlot(0)); + FluidStack fluidstack = this.getFluidResult(this.items.getStackInSlot(0)); + + //item + if (itemstack != null) { + + if (this.items.getStackInSlot(2) == null) + { + this.setInventorySlotContents(2, itemstack.copy()); + } + else if (this.items.getStackInSlot(2).isItemEqual(itemstack)) + { + this.items.getStackInSlot(2).stackSize += itemstack.stackSize; + } + + } + + //CItem + if (this.items.getStackInSlot(0).getItem().hasContainerItem(this.items.getStackInSlot(0))) { + + ItemStack itemC = this.items.getStackInSlot(0).getItem().getContainerItem(this.items.getStackInSlot(0).copy()); + + if (this.items.getStackInSlot(3) == null) + { + this.setInventorySlotContents(3, itemC); + } + else if (this.items.getStackInSlot(3).isItemEqual(itemC)) + { + this.items.getStackInSlot(3).stackSize += itemC.stackSize; + } + } + + //fluid + this.getTank().fill(fluidstack, true); + + this.items.reduceStackSize(0, 1); + + this.markDirty(); + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + } + + public ItemStack getResult(ItemStack itemstack) { + return ((BlockFluidFGFMachine) this.getBlockType()).getResult(itemstack); + } + + public FluidStack getFluidResult(ItemStack stackInSlot) { + return ((BlockFluidFGFMachine) this.getBlockType()).getFluidResult(stackInSlot); + } + + //GUI + public boolean isWorking() + { + return this.machineWorkProgressTime > 0 && this.storage.getPowerStored() > 0; + } + + public int getWorkProgressScaled(int par1) + { + return this.machineWorkProgressTime / (machineMaxProgressTime / par1); + } + + public int getEnergyProgressScaled(int par1) + { + return this.storage.getSpeedStored() / (this.storage.getMaxSpeed() / par1); + } + + public FluidTank getTank() { + return tank; + } + + public boolean isFluid() { + return this.getTank().getFluidAmount() > 0; + } + + //IInventory髢「菫 + @Override + public int getSizeInventory() { + return items.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int i) { + return items.getStackInSlot(i); + } + + @Override + public ItemStack decrStackSize(int i, int j) { + return items.decrStackSize(i, j); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return items.getStackInSlotOnClosing(i); + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + items.setInventorySlotContents(i, itemstack); + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return items.getInventoryStackLimit(); + } + + @Override + public void markDirty() { + super.markDirty(); + items.onInventoryChanged(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer + .getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + @Override + public String getInventoryName() { + return "gui." + ((BlockFluidFGFMachine) this.blockType).getGUIUnlocalizedName(); + } + + /*蜈・繧後k*/ + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + + if (i == 1) { + return GearForceItemAPI.manager.isGearForceItem(itemstack); + } + + return i == 0 || i == 1 || i == 4; + } + + //ISidedInventory髢「菫 + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 ,3 邏譚舌ョ繧ウ繝ウ繝繝 ,4 遨コ縺ョ繝懊ヨ繝ォ , 5 豸イ菴薙ョ蜈・縺」縺溘懊ヨ繝ォ + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + + if (var1 == 0) { + return slots_bottom; + } + + if (var1 == 1) { + return slots_top; + } + + if (var1 == this.getDirection().ordinal()) { + return this.material; + } + + if (var1 == this.getDirection().getOpposite().ordinal()) { + return this.empty_bottle; + } + + return slots_sides; + } + + @Override + public boolean canInsertItem(int i, ItemStack itemstack, int j) { + return this.isItemValidForSlot(i, itemstack); + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) + { + + if (p_102008_1_ == 2 || p_102008_1_ == 3 || p_102008_1_ == 5) { + return true; + } + + if (p_102008_3_ == 0 && p_102008_2_.getItem() == Items.bucket) { + return true; + } + + return false; + } + + //IFluidHandler髢「菫 + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + return 0;//tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(getTank().getFluid())) + { + return null; + } + return getTank().drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return getTank().drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return false; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { getTank().getInfo() }; + } + + //EnergyStorage縺ョ蛻ゥ逕ィ + @Override + public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + + if (!this.canInterface(from)) + return 0; + + int i = storage.addEnergy(power, speed, simulate); + + if (!simulate && i > 0) { + this.inPower = power; + //this.inSpeed+=i; + } + + return i; + + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + + if (!this.canInterface(from)) + return 0; + + return 0;//storage.drawEnergy(power, speed, simulate); + + } + + @Override + public boolean canInterface(ForgeDirection from) { + + return this.direction.ordinal() != from.ordinal(); + + } + + @Override + public int getPowerStored(ForgeDirection from) { + + return storage.getPowerStored(); + + } + + @Override + public int getSpeedStored(ForgeDirection from) { + + return storage.getSpeedStored(); + + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + + return storage.getMaxPower(); + + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + + return storage.getMaxSpeed(); + + } + + @Override + public boolean canIn(ForgeDirection from) { + return true; + } + + @Override + public boolean canOut(ForgeDirection from) { + return false; + } + + //NBT髢「菫 + @Override + public void readFromNBT(NBTTagCompound nbt) { + + super.readFromNBT(nbt); + items.readFromNBT(nbt); + storage.readFromNBT(nbt); + getTank().readFromNBT(nbt); + if (nbt.hasKey("Empty") && tank.getFluidAmount() > 0) this.tank.setFluid(null); + this.machineWorkProgressTime = nbt.getShort("WorkTime"); + this.inPower = nbt.getInteger("inPower"); + this.inSpeed = nbt.getInteger("inSpeed"); + this.on = nbt.getBoolean("on"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + + super.writeToNBT(nbt); + items.writeToNBT(nbt); + storage.writeToNBT(nbt); + getTank().writeToNBT(nbt); + nbt.setShort("WorkTime", (short) this.machineWorkProgressTime); + nbt.setInteger("inPower", this.inPower); + nbt.setInteger("inSpeed", this.inSpeed); + nbt.setBoolean("on", this.on); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + this.readFromNBT(pkt.func_148857_g()); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidFurnace.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidFurnace.java new file mode 100644 index 0000000..88d04d2 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidFurnace.java @@ -0,0 +1,24 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSRecipes; + +public class TileEntityFluidFurnace extends TileEntityFluidMachineBase{ + + @Override + protected ItemStack getResult(ItemStack stackInSlot) { + return SSRecipes.fluidFurnace.getResult(stackInSlot); + } + + @Override + protected FluidStack getFluidResult(ItemStack stackInSlot) { + return SSRecipes.fluidFurnace.getFluidResult(stackInSlot); + } + + @Override + public String getInventoryName() { + return "gui.ss.fluid_furnace"; + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidMachineBase.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidMachineBase.java new file mode 100644 index 0000000..90775b7 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFluidMachineBase.java @@ -0,0 +1,485 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.container.ItemBox; + +public abstract class TileEntityFluidMachineBase extends TileEntityDirection implements ISidedInventory, IFluidHandler { + + protected static final int[] slots_top = new int[] { 0, 4 }; + protected static final int[] slots_bottom = new int[] { 2, 1, 3, 5 }; + protected static final int[] slots_sides = new int[] { 1 }; + + protected static final int[] material = new int[] { 0 }; + protected static final int[] empty_bottle = new int[] { 4 }; + + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 ,3 邏譚舌ョ繧ウ繝ウ繝繝 ,4 遨コ縺ョ繝懊ヨ繝ォ , 5 豸イ菴薙ョ蜈・縺」縺溘懊ヨ繝ォ + protected ItemBox items = new ItemBox("Base", 6); + + //豸イ菴 + private FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 10); + + //菴懈・ュ縺ョ騾イ謐 + public int machineWorkProgressTime; + + //菴懈・ュ縺ョ騾イ謐励ョ譛螟ァ蛟、 縺薙ョ謨ー蟄励↓縺ェ繧九→螳御コ縺吶k + public int machineMaxProgressTime = 200; + + //辯譁吶→謚募・縺輔l縺ヲ縺繧狗譁吶ョ繝槭ャ繧ッ繧ケ迥カ諷九ョ驥 + public int fuel; + public int fuelMax; + + public boolean on; + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + } + + public void updateServerEntity() + { + if(fuel>0){ + fuel--; + if(fuel==0){ + this.fuelMax=0; + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + //this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + }else{ + if(this.canWork()){ + this.chargeFuel(); + } + + } + + if(this.isFuel() && this.canWork()){ + + machineWorkProgressTime++; + + if(machineWorkProgressTime>=machineMaxProgressTime){ + this.workItem(); + machineWorkProgressTime=0; + } + + } + + this.chargeFluid(); + if(this.on && this.tank.getFluidAmount() > 0)this.chargeUPFluid(); + + } + + private void chargeUPFluid(){ + + if(this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) instanceof IFluidHandler){ + IFluidHandler f = (IFluidHandler) this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); + + if(f.canFill(ForgeDirection.DOWN, this.tank.getFluid().getFluid())){ + int i = f.fill(ForgeDirection.DOWN, this.tank.getFluid(), true); + this.tank.drain(i, true); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + } + + private void chargeFluid(){ + + if(canChargeFluid()){ + + ItemStack empty = items.getStackInSlot(4); + + for(FluidContainerData f : FluidContainerRegistry.getRegisteredFluidContainerData()){ + + if(f.emptyContainer.isItemEqual(empty) && f.fluid.isFluidEqual(this.tank.getFluid()) && f.fluid.amount <= this.tank.getFluidAmount()){ + + ItemStack item = FluidContainerRegistry.fillFluidContainer(this.tank.getFluid(), empty); + if (this.items.getStackInSlot(5) == null) + { + this.setInventorySlotContents(5, item.copy()); + } + else if (this.items.getStackInSlot(5).isItemEqual(item)) + { + this.items.getStackInSlot(5).stackSize += item.stackSize; + } + + this.tank.drain(f.fluid.amount, true); + + this.items.reduceStackSize(4, 1); + + this.markDirty(); + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + return ; + } + + } + + } + + } + + public boolean canChargeFluid() + { + if(items.getStackInSlot(4) == null)return false; + ItemStack item = FluidContainerRegistry.fillFluidContainer(this.tank.getFluid(), items.getStackInSlot(4)); + if(item == null)return false; + if(this.items.getStackInSlot(5) == null)return true; + int result = this.items.getStackInSlot(5).stackSize + item.stackSize; + return (result <= getInventoryStackLimit() && result <= item.getMaxStackSize()); + } + + protected void chargeFuel(){ + + if(TileEntityFurnace.isItemFuel(this.items.getStackInSlot(1))){ + this.fuel = this.fuelMax = TileEntityFurnace.getItemBurnTime(this.items.getStackInSlot(1)); + + if(this.items.getStackInSlot(1).stackSize == 1){ + this.items.setInventorySlotContents(1, this.items.getStackInSlot(1).getItem().getContainerItem(this.items.getStackInSlot(1))); + }else{ + this.items.reduceStackSize(1, 1); + } + + this.markDirty(); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + + } + + public boolean isFuel() + { + return this.fuel > 0; + } + + public boolean canWork() + { + if (this.items.getStackInSlot(0) == null) + { + return false; + } + else + { + ItemStack itemstack = this.getResult(this.items.getStackInSlot(0)); + FluidStack fluidstack = this.getFluidResult(this.items.getStackInSlot(0)); + if (itemstack == null && fluidstack == null) return false; + return this.checkItem(itemstack) && this.checkFluid(fluidstack) && this.checkContainerItem(this.items.getStackInSlot(0)); + } + } + + private boolean checkItem(ItemStack itemstack){ + + if (this.items.getStackInSlot(2) == null || itemstack == null) return true; + if (!this.items.getStackInSlot(2).isItemEqual(itemstack)) return false; + int result = this.items.getStackInSlot(2).stackSize + itemstack.stackSize; + return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); + } + + private boolean checkContainerItem(ItemStack itemstack){ + + if(!itemstack.getItem().hasContainerItem(itemstack)) return true; + ItemStack itemstackC = itemstack.getItem().getContainerItem(itemstack.copy()); + if (this.items.getStackInSlot(3) == null || itemstackC == null) return true; + if (!this.items.getStackInSlot(3).isItemEqual(itemstackC)) return false; + int result = this.items.getStackInSlot(3).stackSize + itemstackC.stackSize; + return (result <= getInventoryStackLimit() && result <= itemstackC.getMaxStackSize()); + + } + + private boolean checkFluid(FluidStack fluidstack){ + + if (this.getTank().getFluidAmount()==0 || fluidstack == null) return true; + if (!this.getTank().getFluid().isFluidEqual(fluidstack)) return false; + int result = this.getTank().getFluidAmount() + fluidstack.amount; + return (result <= this.getTank().getCapacity()); + + } + + public void workItem() + { + if (this.canWork()) + { + ItemStack itemstack = this.getResult(this.items.getStackInSlot(0)); + FluidStack fluidstack = this.getFluidResult(this.items.getStackInSlot(0)); + + //item + if(itemstack!=null){ + + if (this.items.getStackInSlot(2) == null) + { + this.setInventorySlotContents(2, itemstack.copy()); + } + else if (this.items.getStackInSlot(2).isItemEqual(itemstack)) + { + this.items.getStackInSlot(2).stackSize += itemstack.stackSize; + } + + } + + + //CItem + if(this.items.getStackInSlot(0).getItem().hasContainerItem(this.items.getStackInSlot(0))){ + + ItemStack itemC = this.items.getStackInSlot(0).getItem().getContainerItem(this.items.getStackInSlot(0).copy()); + + if (this.items.getStackInSlot(3) == null) + { + this.setInventorySlotContents(3, itemC); + } + else if (this.items.getStackInSlot(3).isItemEqual(itemC)) + { + this.items.getStackInSlot(3).stackSize += itemC.stackSize; + } + } + + + //fluid + this.getTank().fill(fluidstack, true); + + this.items.reduceStackSize(0, 1); + + this.markDirty(); + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + } + + + abstract protected ItemStack getResult(ItemStack stackInSlot); + + abstract protected FluidStack getFluidResult(ItemStack stackInSlot); + + + //GUI + public int getWorkProgressScaled(int par1) + { + return this.machineWorkProgressTime / (machineMaxProgressTime / par1); + } + + public int getEnergyProgressScaled(int par1) + { + return (int) (this.fuel / (this.fuelMax / par1)); + } + + public FluidTank getTank() { + return tank; + } + + public boolean isFluid(){ + return this.getTank().getFluidAmount() > 0; + } + + //IInventory髢「菫 + @Override + public int getSizeInventory() { + return items.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int i) { + return items.getStackInSlot(i); + } + + @Override + public ItemStack decrStackSize(int i, int j) { + return items.decrStackSize(i, j); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return items.getStackInSlotOnClosing(i); + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + items.setInventorySlotContents(i, itemstack); + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return items.getInventoryStackLimit(); + } + + @Override + public void markDirty(){ + super.markDirty(); + items.onInventoryChanged(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer + .getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + /*蜈・繧後k*/ + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + + if (i == 1) { + return TileEntityFurnace.getItemBurnTime(itemstack) > 0; + } + + return i == 0 || i == 1 || i == 4 ; + } + + //ISidedInventory髢「菫 + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 ,3 邏譚舌ョ繧ウ繝ウ繝繝 ,4 遨コ縺ョ繝懊ヨ繝ォ , 5 豸イ菴薙ョ蜈・縺」縺溘懊ヨ繝ォ + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + + if(var1 == 0){ + return slots_bottom; + } + + if(var1 == 1){ + return slots_top; + } + + if(var1 == this.getDirection().ordinal()){ + return this.material; + } + + if(var1 == this.getDirection().getOpposite().ordinal()){ + return this.empty_bottle; + } + + return slots_sides; + } + + @Override + public boolean canInsertItem(int i, ItemStack itemstack, int j) { + return this.isItemValidForSlot(i, itemstack); + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) + { + + if(p_102008_1_ == 2 || p_102008_1_ == 3 || p_102008_1_ == 5){ + return true; + } + + if(p_102008_3_ == 0 && p_102008_2_.getItem() == Items.bucket){ + return true; + } + + return false; + } + + //IFluidHandler髢「菫 + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + return 0;//tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(getTank().getFluid())) + { + return null; + } + return getTank().drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return getTank().drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return false; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { getTank().getInfo() }; + } + + //NBT髢「菫 + @Override + public void readFromNBT(NBTTagCompound nbt) { + + super.readFromNBT(nbt); + items.readFromNBT(nbt); + getTank().readFromNBT(nbt); + if(nbt.hasKey("Empty") && tank.getFluidAmount() > 0)this.tank.setFluid(null); + this.machineWorkProgressTime = nbt.getShort("WorkTime"); + this.fuel = nbt.getInteger("fuel"); + this.fuelMax = nbt.getInteger("fuelMax"); + this.on = nbt.getBoolean("on"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + + super.writeToNBT(nbt); + items.writeToNBT(nbt); + getTank().writeToNBT(nbt); + nbt.setShort("WorkTime", (short)this.machineWorkProgressTime); + nbt.setInteger("fuel", this.fuel); + nbt.setInteger("fuelMax", this.fuelMax); + nbt.setBoolean("on", this.on); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ + this.readFromNBT(pkt.func_148857_g()); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFoodSmokers.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFoodSmokers.java new file mode 100644 index 0000000..4415ef1 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFoodSmokers.java @@ -0,0 +1,36 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityFurnace; +import net.minecraftforge.fluids.FluidStack; +import shift.sextiarysector.SSRecipes; + +public class TileEntityFoodSmokers extends TileEntityFluidMachineBase{ + + @Override + protected ItemStack getResult(ItemStack stackInSlot) { + return SSRecipes.foodSmokers.getResult(stackInSlot); + } + + @Override + protected FluidStack getFluidResult(ItemStack stackInSlot) { + return SSRecipes.foodSmokers.getFluidResult(stackInSlot); + } + + protected void chargeFuel(){ + + if(TileEntityFurnace.isItemFuel(this.items.getStackInSlot(1))){ + this.fuel = this.fuelMax = ( TileEntityFurnace.getItemBurnTime(this.items.getStackInSlot(1))/2 ); + this.items.reduceStackSize(1, 1); + this.markDirty(); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + @Override + public String getInventoryName() { + return "gui.ss.food_smokers"; + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFreezer.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFreezer.java new file mode 100644 index 0000000..0875385 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFreezer.java @@ -0,0 +1,90 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.container.ItemBox; + +public class TileEntityFreezer extends TileEntitySimpleFurnace{ + + protected static final int[] slots_top = new int[] { 0 }; + protected static final int[] slots_bottom = new int[] { 2, 1 }; + protected static final int[] slots_sides = new int[] { 1 }; + + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 + protected ItemBox items = new ItemBox("Base", 3); + + protected ItemStack getFuelItem(){ + return this.items.getStackInSlot(1); + } + + protected int getFuelItemSlot(){ + return 1; + } + + protected void reduceFuelStackSize(){ + this.items.reduceStackSize(1, 1); + } + + protected ItemStack getMaterialItem(){ + return this.items.getStackInSlot(0); + } + + protected int getResultItemSlot(){ + return 2; + } + + protected void reduceMaterialStackSize(){ + this.items.reduceStackSize(0, 1); + } + + protected ItemStack getResult(ItemStack stackInSlot) { + return SSRecipes.freezer.getResult(stackInSlot); + } + + public int getItemFuelTime(ItemStack p_145952_0_) + { + if (p_145952_0_ == null) + { + return 0; + } + else + { + return SSRecipes.iceFuel.getResult(p_145952_0_); + } + } + + protected ItemBox getItems(){ + return items; + } + + @Override + public String getInventoryName() { + return "gui.ss.freezer";//+SimpleMachine.values()[this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord)].icon+".name"; + } + + //NBT髢「菫 + @Override + public void readFromNBT(NBTTagCompound nbt) { + + super.readFromNBT(nbt); + items.readFromNBT(nbt); + + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + + super.writeToNBT(nbt); + items.writeToNBT(nbt); + + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ + this.readFromNBT(pkt.func_148857_g()); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityFunnel.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityFunnel.java new file mode 100644 index 0000000..047cd3f --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityFunnel.java @@ -0,0 +1,508 @@ +package shift.sextiarysector.tileentity; + +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.container.ItemBox; + +public class TileEntityFunnel extends TileEntity implements ISidedInventory, IFluidHandler { + + protected static final int[] slots_top = new int[] { 0 }; + protected static final int[] slots_bottom = new int[] { 1 }; + protected static final int[] slots_sides = new int[] { 0, 1 }; + + protected ItemBox items = new ItemBox("Base", 2); + + public FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 32); + protected int lastAmount; + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + + } + + private void updateServerEntity() { + + /* + if (this.tank.getFluidAmount() * (0.01f) != lastAmount) { + //System.out.println(this.tank.getFluidAmount()); + lastAmount = (int) (this.tank.getFluidAmount() * (0.01f)); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + }*/ + + if (items.getStackInSlot(0) != null) { + this.doSlotFluid(); + } + + this.addDownFluidEntity(); + this.getUPFluidEntity(); + + this.addFluidBlock(); + this.getUPFluidBlock(); + + } + + private void addFluidBlock() { + + if (this.tank.getFluidAmount() == 0) return; + + TileEntity t = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); + + if (!(t instanceof IFluidHandler)) return; + + IFluidHandler f = (IFluidHandler) t; + + FluidStack fs = this.tank.getFluid().copy(); + if (fs.amount > 50) fs.amount = 50; + + int i = f.fill(ForgeDirection.DOWN.getOpposite(), fs, true); + this.tank.drain(i, true); + + } + + private void getUPFluidBlock() { + + TileEntity t = this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); + + if (!(t instanceof IFluidHandler)) return; + + IFluidHandler f = (IFluidHandler) t; + + if (this.tank.getFluid() == null) { + + if (f.getTankInfo(ForgeDirection.UP.getOpposite()) != null && f.getTankInfo(ForgeDirection.UP.getOpposite())[0].fluid != null && f.canDrain(ForgeDirection.UP.getOpposite(), f.getTankInfo(ForgeDirection.UP.getOpposite())[0].fluid.getFluid())) { + + FluidStack fs = f.drain(ForgeDirection.UP.getOpposite(), 50, true); + this.tank.fill(fs, true); + } + + } else if (f.canDrain(ForgeDirection.UP.getOpposite(), this.tank.getFluid().getFluid())) { + FluidStack fs = f.drain(ForgeDirection.UP.getOpposite(), 50, false); + + int fill = this.tank.fill(fs, true); + + f.drain(ForgeDirection.UP.getOpposite(), fill, true); + + } + + } + + private void getUPFluidEntity() { + + //if (this.tank.getFluidAmount() == 0) return; + + AxisAlignedBB aabb = getDirectionAABB(ForgeDirection.UP); + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity) null, aabb, null); + IFluidHandler f = null; + + for (Entity e : list) { + if (!(e instanceof IFluidHandler)) continue; + f = (IFluidHandler) e; + break; + } + + if (f == null) return; + + if (this.tank.getFluid() == null) { + + if (f.getTankInfo(ForgeDirection.UP.getOpposite()) != null && f.getTankInfo(ForgeDirection.UP.getOpposite())[0].fluid != null && f.canDrain(ForgeDirection.UP.getOpposite(), f.getTankInfo(ForgeDirection.UP.getOpposite())[0].fluid.getFluid())) { + + FluidStack fs = f.drain(ForgeDirection.UP.getOpposite(), 50, true); + this.tank.fill(fs, true); + } + + } else if (f.canDrain(ForgeDirection.UP.getOpposite(), this.tank.getFluid().getFluid())) { + FluidStack fs = f.drain(ForgeDirection.UP.getOpposite(), 50, false); + + int fill = this.tank.fill(fs, true); + + f.drain(ForgeDirection.UP.getOpposite(), fill, true); + + } + + //this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + + private void addDownFluidEntity() { + + if (this.tank.getFluidAmount() == 0) return; + + AxisAlignedBB aabb = getDirectionAABB(ForgeDirection.DOWN); + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity) null, aabb, null); + IFluidHandler f = null; + + for (Entity e : list) { + if (!(e instanceof IFluidHandler)) continue; + f = (IFluidHandler) e; + break; + } + + if (f == null) return; + + if (f.canFill(ForgeDirection.DOWN.getOpposite(), this.tank.getFluid().getFluid())) { + + FluidStack fs = this.tank.getFluid().copy(); + if (fs.amount > 50) fs.amount = 50; + + int i = f.fill(ForgeDirection.DOWN.getOpposite(), fs, true); + this.tank.drain(i, true); + + //this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + + } + + private AxisAlignedBB getDirectionAABB(ForgeDirection d) { + + int minX = 0, minY = 0, minZ = 0; + int maxX = 1, maxY = 1, maxZ = 1; + + switch (d) { + case DOWN: + minY = -2; + break; + case UP: + maxY = 3; + break; + default: + break; + } + + return AxisAlignedBB.getBoundingBox(this.xCoord + minX, this.yCoord + minY, this.zCoord + minZ, this.xCoord + maxX, this.yCoord + maxY, this.zCoord + maxZ); + } + + private void doSlotFluid() { + + if (this.canChargeFluid()) { + this.chargeFluid(); + } + + if (this.canDrainFluid()) { + this.drainFluid(); + } + + } + + public void chargeFluid() { + + FluidStack f = FluidContainerRegistry.getFluidForFilledItem(items.getStackInSlot(0)); + this.fill(ForgeDirection.UP, f, true); + ItemStack item = FluidContainerRegistry.drainFluidContainer(items.getStackInSlot(0));//items.getStackInSlot(0).getItem().getContainerItem(items.getStackInSlot(0)); + + if (item != null) { + + if (this.items.getStackInSlot(1) == null) + { + this.setInventorySlotContents(1, item.copy()); + } + else if (this.items.getStackInSlot(1).isItemEqual(item)) + { + this.items.getStackInSlot(1).stackSize += item.stackSize; + } + + } + + this.items.reduceStackSize(0, 1); + + this.markDirty(); + + //this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + + public boolean canChargeFluid() { + + FluidStack f = FluidContainerRegistry.getFluidForFilledItem(items.getStackInSlot(0)); + + if (f == null) return false; + + int i = this.fill(ForgeDirection.UP, f, false); + + if (i != f.amount) return false; + + if (items.getStackInSlot(0) == null) return false; + if (this.items.getStackInSlot(1) == null) return true; + ItemStack item = FluidContainerRegistry.drainFluidContainer(items.getStackInSlot(0));// items.getStackInSlot(0).getItem().getContainerItem(items.getStackInSlot(0).copy()); + if (item == null) return true; + int result = this.items.getStackInSlot(1).stackSize + item.stackSize; + return (result <= getInventoryStackLimit() && result <= item.getMaxStackSize()); + + } + + private void drainFluid() { + + if (canDrainFluid()) { + + ItemStack empty = items.getStackInSlot(0); + + for (FluidContainerData f : FluidContainerRegistry.getRegisteredFluidContainerData()) { + + if (f.emptyContainer.isItemEqual(empty) && f.fluid.isFluidEqual(this.tank.getFluid()) && f.fluid.amount <= this.tank.getFluidAmount()) { + + ItemStack item = FluidContainerRegistry.fillFluidContainer(this.tank.getFluid(), empty); + if (this.items.getStackInSlot(1) == null) + { + this.setInventorySlotContents(1, item.copy()); + } + else if (this.items.getStackInSlot(1).isItemEqual(item)) + { + this.items.getStackInSlot(1).stackSize += item.stackSize; + } + + this.tank.drain(f.fluid.amount, true); + + this.items.reduceStackSize(0, 1); + + this.markDirty(); + + //this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + return; + } + + } + + } + + } + + public boolean canDrainFluid() + { + if (items.getStackInSlot(0) == null) return false; + ItemStack item = FluidContainerRegistry.fillFluidContainer(this.tank.getFluid(), items.getStackInSlot(0)); + if (item == null) return false; + if (this.items.getStackInSlot(1) == null) return true; + int result = this.items.getStackInSlot(1).stackSize + item.stackSize; + return (result <= getInventoryStackLimit() && result <= item.getMaxStackSize()); + } + + public float getRendererAmount() { + return (float) this.tank.getFluidAmount() / (float) this.tank.getCapacity(); + } + + public boolean hasFluidStack() { + return tank.getFluidAmount() > 0; + } + + public FluidStack getFluidStack() { + return tank.getFluid(); + } + + //GUI + public FluidTank getTank() { + return tank; + } + + public boolean isFluid() { + return this.getTank().getFluidAmount() > 0; + } + + //IInventory髢「菫 + @Override + public int getSizeInventory() { + return items.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int i) { + return items.getStackInSlot(i); + } + + @Override + public ItemStack decrStackSize(int i, int j) { + return items.decrStackSize(i, j); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return items.getStackInSlotOnClosing(i); + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + items.setInventorySlotContents(i, itemstack); + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return items.getInventoryStackLimit(); + } + + @Override + public void markDirty() { + super.markDirty(); + items.onInventoryChanged(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + /*蜈・繧後k*/ + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + + return i == 0; + + } + + //ISidedInventory髢「菫 + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 ,3 邏譚舌ョ繧ウ繝ウ繝繝 ,4 遨コ縺ョ繝懊ヨ繝ォ , 5 豸イ菴薙ョ蜈・縺」縺溘懊ヨ繝ォ + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + + if (var1 == 0) { + return slots_bottom; + } + + if (var1 == 1) { + return slots_top; + } + + return slots_sides; + + } + + @Override + public boolean canInsertItem(int i, ItemStack itemstack, int j) { + return this.isItemValidForSlot(i, itemstack); + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) + { + + if (p_102008_1_ == 1) { + return true; + } + + return false; + } + + @Override + public String getInventoryName() { + return "gui.ss.funnel"; + } + + /* IFluidHandler */ + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + return tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + return tank.drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return tank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } + + //NBT + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + this.items.readFromNBT(par1nbtTagCompound); + tank.readFromNBT(par1nbtTagCompound); + if (par1nbtTagCompound.hasKey("Empty") && tank.getFluidAmount() > 0) this.tank.setFluid(null); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + this.items.writeToNBT(par1nbtTagCompound); + tank.writeToNBT(par1nbtTagCompound); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + //this.worldObj.func_147479_m(xCoord, yCoord, zCoord); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityGFDynamo.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityGFDynamo.java new file mode 100644 index 0000000..e73ee81 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityGFDynamo.java @@ -0,0 +1,171 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import cofh.api.energy.IEnergyProvider; +import cofh.api.energy.IEnergyReceiver; + +public class TileEntityGFDynamo extends TileEntityDirection implements IGearForceHandler, IGearForceGrid, IEnergyProvider { + + public float rotateStep = 0; + public EnergyStorage storage = new EnergyStorage("Base", 3, 30000); + public boolean isActivity = false; + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + + if (!isActivity) return; + + if (this.rotateStep > 360) { + this.rotateStep -= 360; + } + + this.rotateStep += 6; + + } + + public void updateServerEntity() + { + + ForgeDirection d = this.getDirection().getOpposite(); + + TileEntity t = this.worldObj.getTileEntity(xCoord + d.offsetX, yCoord + d.offsetY, zCoord + d.offsetZ); + + if (t instanceof IEnergyReceiver && this.canWork()) { + + IEnergyReceiver rf = (IEnergyReceiver) t; + + int add = this.storage.drawEnergy(3, 14, true); + int add2 = rf.receiveEnergy(direction, add, false); + this.storage.drawEnergy(3, add2, false); + + if (isActivity == false && add2 != 0) { + this.isActivity = true; + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } else if (isActivity) { + this.isActivity = false; + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + public boolean canWork() { + return this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord) && this.storage.getSpeedStored() > 10; + } + + public float getRotateStep() { + return rotateStep; + } + + //GF + @Override + public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + + if (!this.canInterface(from)) return 0; + + int i = storage.addEnergy(power, speed, simulate); + + return i; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.getDirection().ordinal() == from.ordinal(); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return storage.getPowerStored(); + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return storage.getSpeedStored(); + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return storage.getMaxPower(); + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return storage.getMaxSpeed(); + } + + @Override + public boolean canIn(ForgeDirection from) { + return this.getDirection().ordinal() == from.ordinal(); + } + + @Override + public boolean canOut(ForgeDirection from) { + return false; + } + + //RF + @Override + public boolean canConnectEnergy(ForgeDirection paramForgeDirection) { + return this.getDirection().getOpposite().ordinal() == paramForgeDirection.ordinal(); + } + + @Override + public int extractEnergy(ForgeDirection paramForgeDirection, int paramInt, boolean paramBoolean) { + return 0; + } + + @Override + public int getEnergyStored(ForgeDirection paramForgeDirection) { + return 0; + } + + @Override + public int getMaxEnergyStored(ForgeDirection paramForgeDirection) { + return 10000; + } + + //NBT + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + + super.readFromNBT(par1nbtTagCompound); + this.storage.readFromNBT(par1nbtTagCompound); + this.isActivity = par1nbtTagCompound.getBoolean("isActivity"); + + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + + super.writeToNBT(par1nbtTagCompound); + this.storage.writeToNBT(par1nbtTagCompound); + par1nbtTagCompound.setBoolean("isActivity", isActivity); + + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityGFTank.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityGFTank.java index 568ced6..9b7b596 100644 --- a/src/main/java/shift/sextiarysector/tileentity/TileEntityGFTank.java +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityGFTank.java @@ -6,12 +6,13 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import shift.sextiarysector.api.machine.energy.EnergyStorage; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; -import shift.sextiarysector.api.machine.item.GearForceItem; +import shift.sextiarysector.api.gearforce.item.GearForceItemAPI; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; import shift.sextiarysector.container.ItemBox; -public class TileEntityGFTank extends TileEntityDirection implements ISidedInventory, IEnergyHandler { +public class TileEntityGFTank extends TileEntityDirection implements ISidedInventory, IGearForceHandler ,IGearForceGrid{ protected static final int[] slots_top = new int[] { 0 }; protected static final int[] slots_bottom = new int[] { 1 }; @@ -92,12 +93,12 @@ public void updateChargeEntity() if(this.items.getStackInSlot(1)==null)return; - if(GearForceItem.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPowerStored(), 1, true)>0){ - int s = GearForceItem.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPowerStored(), 20, true); + if(GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), 1, true)>0){ + int s = GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), 20, true); - int i = this.storage.addEnergy(this.storage.getMaxPowerStored(), s, false); - GearForceItem.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPowerStored(), i, false); - if(i>0)this.inPower = this.storage.getMaxPowerStored(); + int i = this.storage.addEnergy(this.storage.getMaxPower(), s, false); + GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), i, false); + if(i>0)this.inPower = this.storage.getMaxPower(); //this.inSpeed += (int) i; this.markDirty(); @@ -109,16 +110,16 @@ public void updateChargeItem(){ if(this.items.getStackInSlot(0)==null)return; - if(this.storage.drawEnergy(this.storage.getMaxPowerStored(), 1, true)>0&&this.items.getStackInSlot(0)!=null){ + if(this.storage.drawEnergy(this.storage.getMaxPower(), 1, true)>0&&this.items.getStackInSlot(0)!=null){ - int i = this.storage.drawEnergy(this.storage.getMaxPowerStored(), 20, true); + int i = this.storage.drawEnergy(this.storage.getMaxPower(), 20, true); - int s = GearForceItem.manager.addEnergy(this.items.getStackInSlot(0), this.storage.getMaxPowerStored(), i, false); + int s = GearForceItemAPI.manager.addEnergy(this.items.getStackInSlot(0), this.storage.getMaxPower(), i, false); - int j = this.storage.drawEnergy(this.storage.getMaxPowerStored(), s, false); + int j = this.storage.drawEnergy(this.storage.getMaxPower(), s, false); this.outSpeed+=j; - if(j>0)this.outPower=this.storage.getMaxPowerStored(); + if(j>0)this.outPower=this.storage.getMaxPower(); //int i = this.storage.addEnergy(this.storage.getMaxPowerStored(), s, false); //if(i>0)this.inPower = this.storage.getMaxPowerStored(); @@ -134,16 +135,16 @@ public void addOutEnergy(){ TileEntity t = this.worldObj.getTileEntity(xCoord + this.getDirection().offsetX, yCoord + this.getDirection().offsetY, zCoord + this.getDirection().offsetZ); - if(t instanceof IEnergyHandler && ((IEnergyHandler)t).canInterface(getDirection().getOpposite())){ + if(t instanceof IGearForceHandler && ((IGearForceHandler)t).canInterface(getDirection().getOpposite())){ - int i = ((IEnergyHandler)t).addEnergy(getDirection().getOpposite(), this.storage.getMaxPowerStored(), Math.min(160, this.storage.getSpeedStored()), true); + int i = ((IGearForceHandler)t).addEnergy(getDirection().getOpposite(), this.storage.getMaxPower(), Math.min(160, this.storage.getSpeedStored()), true); - int j = this.storage.drawEnergy(this.storage.getMaxPowerStored(), i, false); + int j = this.storage.drawEnergy(this.storage.getMaxPower(), i, false); - ((IEnergyHandler)t).addEnergy(getDirection().getOpposite(), this.storage.getMaxPowerStored(), j, false); + ((IGearForceHandler)t).addEnergy(getDirection().getOpposite(), this.storage.getMaxPower(), j, false); this.outSpeed+=j; - if(j>0)this.outPower=this.storage.getMaxPowerStored(); + if(j>0)this.outPower=this.storage.getMaxPower(); } @@ -177,7 +178,7 @@ public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) { @Override public String getInventoryName() { - return "gui.ss.gf_tank_"+this.storage.getMaxPowerStored(); + return "gui.ss.gf_tank_"+this.storage.getMaxPower(); } @Override @@ -252,24 +253,24 @@ public int getPowerStored(ForgeDirection from) { } @Override - public long getSpeedStored(ForgeDirection from) { + public int getSpeedStored(ForgeDirection from) { return storage.getSpeedStored(); } @Override public int getMaxPowerStored(ForgeDirection from) { - return storage.getMaxPowerStored(); + return storage.getMaxPower(); } @Override - public long getMaxSpeedStored(ForgeDirection from) { - return storage.getMaxSpeedStored(); + public int getMaxSpeedStored(ForgeDirection from) { + return storage.getMaxSpeed(); } //gui public int getEnergyProgressScaled(int par1) { - return (int) (this.storage.getSpeedStored() / ((float)this.storage.getMaxSpeedStored() / (float)par1)); + return (int) (this.storage.getSpeedStored() / ((float)this.storage.getMaxSpeed() / (float)par1)); } //NBT髢「菫 @@ -293,4 +294,14 @@ public void writeToNBT(NBTTagCompound nbt) { nbt.setInteger("inSpeed", this.inSpeed); } + @Override + public boolean canIn(ForgeDirection from) { + return this.getDirection().ordinal() != from.ordinal(); + } + + @Override + public boolean canOut(ForgeDirection from) { + return this.getDirection().ordinal() == from.ordinal(); + } + } diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityGearBox.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityGearBox.java index 205bc92..72a830b 100644 --- a/src/main/java/shift/sextiarysector/tileentity/TileEntityGearBox.java +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityGearBox.java @@ -3,10 +3,11 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import shift.sextiarysector.api.machine.energy.EnergyStorage; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; -public class TileEntityGearBox extends TileEntityDirection implements IEnergyHandler { +public class TileEntityGearBox extends TileEntityDirection implements IGearForceHandler ,IGearForceGrid{ public EnergyStorage storage = new EnergyStorage("Base", 1, 960, 160); @@ -50,11 +51,11 @@ public void updateServerEntity() { TileEntity t = this.worldObj.getTileEntity(x, y, z); - if(t instanceof IEnergyHandler){ + if(t instanceof IGearForceHandler){ - int j = ((IEnergyHandler) t).addEnergy(d.getOpposite(), this.storage.getMaxPowerStored(), i, false); + int j = ((IGearForceHandler) t).addEnergy(d.getOpposite(), this.storage.getMaxPower(), i, false); - this.storage.drawEnergy(this.storage.getMaxPowerStored(), j, false); + this.storage.drawEnergy(this.storage.getMaxPower(), j, false); } @@ -76,7 +77,7 @@ public int getConnect(){ TileEntity t = this.worldObj.getTileEntity(x, y, z); - if(t instanceof IEnergyHandler && ((IEnergyHandler) t).addEnergy(d.getOpposite(), 1, 1, true)>0){ + if(t instanceof IGearForceHandler && ((IGearForceHandler) t).addEnergy(d.getOpposite(), this.storage.getMaxPower(), 1, true)>0){ i++; } @@ -133,7 +134,7 @@ public int getPowerStored(ForgeDirection from) { } @Override - public long getSpeedStored(ForgeDirection from) { + public int getSpeedStored(ForgeDirection from) { return storage.getSpeedStored(); @@ -142,15 +143,25 @@ public long getSpeedStored(ForgeDirection from) { @Override public int getMaxPowerStored(ForgeDirection from) { - return storage.getMaxPowerStored(); + return storage.getMaxPower(); } @Override - public long getMaxSpeedStored(ForgeDirection from) { + public int getMaxSpeedStored(ForgeDirection from) { - return storage.getMaxSpeedStored(); + return storage.getMaxSpeed(); } + @Override + public boolean canIn(ForgeDirection from) { + return this.getDirection().ordinal() == from.ordinal(); + } + + @Override + public boolean canOut(ForgeDirection from) { + return this.getDirection().ordinal() != from.ordinal(); + } + } diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityGearShaft.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityGearShaft.java new file mode 100644 index 0000000..aa0427d --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityGearShaft.java @@ -0,0 +1,144 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; + +public class TileEntityGearShaft extends TileEntityDirection implements IGearForceHandler, IGearForceGrid { + + public float rotateUpStep = 0; + public float rotateDownStep = 0; + private final EnergyStorage storage = new EnergyStorage("Base", 1, 320, 160); + + public TileEntityGearShaft() { + + } + + public TileEntityGearShaft(int i) { + storage.setPowerCapacity(i); + } + + @Override + public void updateEntity() { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() { + this.rotateUpStep += 2; + this.rotateDownStep += 8; + } + + private void updateServerEntity() { + + if (!(this.getOutTileEntity() instanceof IGearForceHandler)) { + return; + } + + IGearForceHandler out = (IGearForceHandler) this.getOutTileEntity(); + + int i = storage.drawEnergy(storage.getMaxPower(), storage.getMaxSpeed(), true); + + if (this.isUP()) { + + int add = (int) (i / 8.0f); + int a = out.addEnergy(getDirection().getOpposite(), this.storage.getMaxPower() + 1, add, true); + storage.drawEnergy(storage.getMaxPower(), a * 8, false); + out.addEnergy(getDirection().getOpposite(), this.storage.getMaxPower() + 1, add, false); + + } else { + + int a = out.addEnergy(getDirection().getOpposite(), this.storage.getMaxPower(), i, true); + storage.drawEnergy(storage.getMaxPower(), a, false); + out.addEnergy(getDirection().getOpposite(), this.storage.getMaxPower(), i, false); + + } + + } + + private TileEntity getOutTileEntity() { + return this.worldObj.getTileEntity(xCoord + this.direction.offsetX, yCoord + this.direction.offsetY, zCoord + this.direction.offsetZ); + } + + private boolean isUP() { + return this.getBlockMetadata() == 0; + } + + // NBT髢「菫 + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + storage.readFromNBT(par1nbtTagCompound); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + storage.writeToNBT(par1nbtTagCompound); + } + + @Override + public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + + if (!this.canInterface(from)) return 0; + + if (power == this.storage.getMaxPower() && this.isUP()) { + return this.storage.addEnergy(power, speed, simulate); + } else if (power == this.storage.getMaxPower() + 1 && !this.isUP()) { + return (int) (this.storage.addEnergy(power - 1, speed * 4, simulate) / 4.0f); + } + + return 0; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed, + boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.direction.getOpposite().equals(from); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return storage.getPowerStored(); + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return storage.getSpeedStored(); + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return storage.getMaxPower(); + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return storage.getMaxSpeed(); + } + + @Override + public boolean canIn(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + + @Override + public boolean canOut(ForgeDirection from) { + return this.direction.ordinal() == from.ordinal(); + } +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityLargeWindmill.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityLargeWindmill.java new file mode 100644 index 0000000..fbd9b9e --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityLargeWindmill.java @@ -0,0 +1,123 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; + +public class TileEntityLargeWindmill extends TileEntityDirection implements IGearForceHandler, IGearForceGrid { + + public float rotateStep = 0; + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + + if (!this.isWork()) { + return; + } + + if (this.rotateStep > 360) { + this.rotateStep -= 360; + } + + this.rotateStep += 2; + + } + + public void updateServerEntity() + { + TileEntity t = this.worldObj.getTileEntity(xCoord - this.direction.offsetX, yCoord - this.direction.offsetY, zCoord - this.direction.offsetZ); + if (t != null && t instanceof IGearForceHandler && this.isWork()) { + + ((IGearForceHandler) t).addEnergy(this.direction, 3, 20, false); + } + + } + + boolean isWork() { + + ForgeDirection d1 = this.getDirection().getRotation(ForgeDirection.UP); + + int ra1 = 5; + for (int i = ra1 * -1; i <= ra1; i++) { + + int ra2 = 5; + for (int j = ra2 * -1; j <= ra2; j++) { + int x = xCoord + d1.offsetX * j; + int y = yCoord + i; + int z = zCoord + d1.offsetZ * j; + + if (i == 0 && j == 0) continue; + + if (!this.worldObj.isAirBlock(x, y, z)) return false; + + } + + } + + return true; + } + + public float getRotateStep() { + return -rotateStep; + } + + @Override + public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + return 0; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public boolean canIn(ForgeDirection direction) { + return false; + } + + @Override + public boolean canOut(ForgeDirection direction) { + return this.direction.getOpposite().ordinal() == direction.ordinal(); + } +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityMagicFurnace.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityMagicFurnace.java new file mode 100644 index 0000000..4749e08 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityMagicFurnace.java @@ -0,0 +1,86 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import shift.sextiarysector.SSRecipes; +import shift.sextiarysector.container.ItemBox; + +public class TileEntityMagicFurnace extends TileEntitySimpleFurnace{ + + protected static final int[] slots_top = new int[] { 0 }; + protected static final int[] slots_bottom = new int[] { 2, 1 }; + protected static final int[] slots_sides = new int[] { 1 }; + + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 + protected ItemBox items = new ItemBox("Base", 3); + + protected ItemStack getFuelItem(){ + return this.items.getStackInSlot(1); + } + + protected int getFuelItemSlot(){ + return 1; + } + + protected void reduceFuelStackSize(){ + this.items.reduceStackSize(1, 1); + } + + protected ItemStack getMaterialItem(){ + return this.items.getStackInSlot(0); + } + + protected int getResultItemSlot(){ + return 2; + } + + protected void reduceMaterialStackSize(){ + this.items.reduceStackSize(0, 1); + } + + protected ItemStack getResult(ItemStack stackInSlot) { + return SSRecipes.magicFurnace.getResult(stackInSlot); + } + + public int getItemFuelTime(ItemStack p_145952_0_) + { + if (p_145952_0_ == null) + { + return 0; + } + else + { + return SSRecipes.magicFuel.getResult(p_145952_0_); + } + } + + protected ItemBox getItems(){ + return items; + } + + //NBT髢「菫 + @Override + public void readFromNBT(NBTTagCompound nbt) { + + super.readFromNBT(nbt); + items.readFromNBT(nbt); + + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + + super.writeToNBT(nbt); + items.writeToNBT(nbt); + + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ + this.readFromNBT(pkt.func_148857_g()); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityMonitor.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityMonitor.java index 89140ac..854f858 100644 --- a/src/main/java/shift/sextiarysector/tileentity/TileEntityMonitor.java +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityMonitor.java @@ -2,11 +2,12 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -import shift.sextiarysector.api.machine.energy.EnergyStorage; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; import shift.sextiarysector.block.BlockMonitor.MonitorType; -public class TileEntityMonitor extends TileEntityDirection implements IEnergyHandler{ +public class TileEntityMonitor extends TileEntityDirection implements IGearForceHandler ,IGearForceGrid{ public EnergyStorage storage = new EnergyStorage("Base", 1, 10000); public MonitorType type = MonitorType.unknown; @@ -89,7 +90,7 @@ public int getPowerStored(ForgeDirection from) { } @Override - public long getSpeedStored(ForgeDirection from) { + public int getSpeedStored(ForgeDirection from) { if(!this.canInterface(from))return 0; return 0; } @@ -97,13 +98,23 @@ public long getSpeedStored(ForgeDirection from) { @Override public int getMaxPowerStored(ForgeDirection from) { if(!this.canInterface(from))return 0; - return this.storage.getMaxPowerStored(); + return this.storage.getMaxPower(); } @Override - public long getMaxSpeedStored(ForgeDirection from) { + public int getMaxSpeedStored(ForgeDirection from) { if(!this.canInterface(from))return 0; - return this.storage.getMaxSpeedStored(); + return this.storage.getMaxSpeed(); + } + + @Override + public boolean canIn(ForgeDirection from) { + return from.ordinal() == ForgeDirection.DOWN.ordinal(); + } + + @Override + public boolean canOut(ForgeDirection from) { + return false; } } diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityPaddy.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityPaddy.java new file mode 100644 index 0000000..d61c64b --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityPaddy.java @@ -0,0 +1,114 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.api.agriculture.IFarmland; + +public class TileEntityPaddy extends TileEntity implements IFluidHandler , IFarmland{ + + protected FluidTank water = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); + + private ItemStack fertilizerItem; + + public ItemStack getFertilizer() { + return fertilizerItem; + } + + public void setFertilizer(ItemStack fertilizer) { + if(fertilizer==null){ + this.fertilizerItem = null; + }else{ + this.fertilizerItem = fertilizer.copy(); + } + + } + + @Override + public boolean canGrowth() { + return true; + } + + @Override + public void growth() { + + } + + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + if(par1nbtTagCompound.hasKey("fertilizeritem")){ + this.fertilizerItem = ItemStack.loadItemStackFromNBT(par1nbtTagCompound.getCompoundTag("fertilizeritem")); + } + + this.water.readFromNBT(par1nbtTagCompound); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + + if(fertilizerItem!=null){ + NBTTagCompound itemNBT =new NBTTagCompound(); + fertilizerItem.writeToNBT(itemNBT); + par1nbtTagCompound.setTag("fertilizeritem", itemNBT); + } + + this.water.writeToNBT(par1nbtTagCompound); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { + return 0; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource,boolean doDrain) { + return null; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { + return null; + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) { + return false; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) { + return false; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) { + return new FluidTankInfo[] { this.water.getInfo() }; + } + + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityPipe.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityPipe.java new file mode 100644 index 0000000..022863f --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityPipe.java @@ -0,0 +1,276 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.api.EnumColor; +import shift.sextiarysector.block.BlockPipe; + +public class TileEntityPipe extends TileEntity implements IFluidHandler { + + protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 16); + private final boolean isIN[] = { false, false, false, false, false, false }; + public EnumColor color = EnumColor.Unknown; + + @Override + public void updateEntity() { + + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() { + } + + public void updateServerEntity() { + + if (this.tank.getFluidAmount() > 0 && getConnectSize() > 0) this.addFluid(); + this.clearIN(); + + } + + private void addFluid() { + + int add = Math.min(50, this.tank.getFluidAmount() / getConnectSize()); + int doAdd = 0; + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + + if (!BlockPipe.canConnect(getWorldObj(), xCoord, yCoord, zCoord, d)) continue; + + TileEntity t = this.worldObj.getTileEntity(xCoord + d.offsetX, yCoord + d.offsetY, zCoord + d.offsetZ); + + if (!isIN[d.ordinal()] && t instanceof IFluidHandler) { + + FluidStack f = this.tank.getFluid().copy(); + f.amount = add; + + int i = ((IFluidHandler) t).fill(d.getOpposite(), f, true); + if (i > 0) doAdd += i; + + } + + } + + this.tank.drain(doAdd, true); + + } + + private void clearIN() { + + for (int i = 0; i < isIN.length; i++) { + isIN[i] = false; + } + + } + + private int getConnectSize() { + + int i = 0; + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + + if (!BlockPipe.canConnect(getWorldObj(), xCoord, yCoord, zCoord, d)) continue; + + TileEntity t = this.worldObj.getTileEntity(xCoord + d.offsetX, yCoord + d.offsetY, zCoord + d.offsetZ); + + if (!isIN[d.ordinal()] && t instanceof IFluidHandler && ((IFluidHandler) t).fill(d.getOpposite(), tank.getFluid(), false) > 0) { + i++; + } + + } + + return i; + + } + + private int getIsIN() { + + int i = 0; + + for (boolean b : isIN) { + if (b) i++; + } + + return i; + + } + + public void getFluidFromSuctionMachine(ForgeDirection direction) { + + int i = 0; + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + + if (!BlockPipe.canConnect(getWorldObj(), xCoord, yCoord, zCoord, d)) continue; + + TileEntity t = this.worldObj.getTileEntity(xCoord + d.offsetX, yCoord + d.offsetY, zCoord + d.offsetZ); + + if (t instanceof IFluidHandler) { + i++; + } + + } + + if (i > 2) return; + + for (ForgeDirection d : ForgeDirection.VALID_DIRECTIONS) { + + if (direction.equals(d)) continue; + + int x = this.xCoord + d.offsetX; + int y = this.yCoord + d.offsetY; + int z = this.zCoord + d.offsetZ; + + TileEntity t = this.worldObj.getTileEntity(x, y, z); + + if (t instanceof TileEntityPipe) { + ((TileEntityPipe) t).getFluidFromSuctionMachine(d.getOpposite()); + break; + } else if (t instanceof IFluidHandler) { + this.updateServerInWorkEntity(d); + } + + } + + } + + public void updateServerInWorkEntity(ForgeDirection direction) + { + + int x = this.xCoord + direction.offsetX; + int y = this.yCoord + direction.offsetY; + int z = this.zCoord + direction.offsetZ; + + if (this.worldObj.getTileEntity(x, y, z) instanceof IFluidHandler) { + + IFluidHandler t = (IFluidHandler) this.worldObj.getTileEntity(x, y, z); + + if (this.tank.getFluid() == null) { + + if (t.getTankInfo(direction.getOpposite()) != null && t.getTankInfo(direction.getOpposite())[0].fluid != null && t.canDrain(direction.getOpposite(), t.getTankInfo(direction.getOpposite())[0].fluid.getFluid())) { + FluidStack fs = t.drain(direction.getOpposite(), FluidContainerRegistry.BUCKET_VOLUME, true); + this.fill(direction, fs, true); + } + + } else if (t.canDrain(direction.getOpposite(), this.tank.getFluid().getFluid())) { + FluidStack fs = t.drain(direction.getOpposite(), FluidContainerRegistry.BUCKET_VOLUME - this.tank.getFluidAmount(), true); + this.fill(direction, fs, true); + } + + } + + } + + /* IFluidHandler */ + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + int i = tank.fill(resource, doFill); + + if (i > 0 && doFill) { + this.isIN[from.ordinal()] = true; + } + + return i; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + return tank.drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return tank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } + + /* NBT */ + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + + super.readFromNBT(par1nbtTagCompound); + tank.readFromNBT(par1nbtTagCompound); + if (par1nbtTagCompound.hasKey("Empty") && tank.getFluidAmount() > 0) this.tank.setFluid(null); + color = EnumColor.getColor(par1nbtTagCompound.getInteger("color")); + + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + + super.writeToNBT(par1nbtTagCompound); + tank.writeToNBT(par1nbtTagCompound); + par1nbtTagCompound.setInteger("color", color.ordinal()); + + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + //this.worldObj.func_147479_m(xCoord, yCoord, zCoord); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + public boolean isStraight() { + + int i = 0; + int x = this.xCoord; + int y = this.yCoord; + int z = this.zCoord; + + if (this.worldObj.getBlock(x + 1, y, z) == this.getBlockType() && this.worldObj.getBlock(x - 1, y, z) == this.getBlockType()) i++; + if (this.worldObj.getBlock(x, y + 1, z) == this.getBlockType() && this.worldObj.getBlock(x, y - 1, z) == this.getBlockType()) i++; + if (this.worldObj.getBlock(x, y, z + 1) == this.getBlockType() && this.worldObj.getBlock(x, y, z - 1) == this.getBlockType()) i++; + + return i == 1; + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityPump.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityPump.java new file mode 100644 index 0000000..9e8a451 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityPump.java @@ -0,0 +1,223 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidBlock; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; + +public class TileEntityPump extends TileEntityDirection implements IFluidHandler, IGearForceHandler, IGearForceGrid { + + protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); + + public EnergyStorage storage = new EnergyStorage("Base", 2, 3000); + + private int cooltime = 0; + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + this.updateServerEntity(); + } + + } + + public void updateClientEntity() + { + } + + public void updateServerEntity() + { + + cooltime++; + if (cooltime > 10) { + cooltime = 0; + + if (storage.drawEnergy(2, 20, false) >= 18) { + this.updateServerOutWorkEntity(); + this.updateServerInWorkEntity(); + } + + } + + } + + public void updateServerInWorkEntity() + { + + int x = this.xCoord + this.direction.offsetX; + int y = this.yCoord + this.direction.offsetY; + int z = this.zCoord + this.direction.offsetZ; + + Block block = this.getWorldObj().getBlock(x, y, z); + + Fluid f = FluidRegistry.lookupFluidForBlock(block); + + if (block instanceof BlockLiquid || block instanceof IFluidBlock) { + if (this.getWorldObj().getBlockMetadata(x, y, z) != 0) return; + } + + if (f != null && this.tank.getFluid() == null) { + + this.worldObj.removeTileEntity(x, y, z); + this.worldObj.setBlock(x, y, z, Blocks.air, 0, 3); + this.tank.setFluid(new FluidStack(f, FluidContainerRegistry.BUCKET_VOLUME)); + + } else if (this.worldObj.getTileEntity(x, y, z) instanceof IFluidHandler) { + + IFluidHandler t = (IFluidHandler) this.worldObj.getTileEntity(x, y, z); + + if (this.tank.getFluid() == null) { + + if (t.getTankInfo(direction.getOpposite()) != null && t.getTankInfo(direction.getOpposite())[0].fluid != null && t.canDrain(this.direction.getOpposite(), t.getTankInfo(direction.getOpposite())[0].fluid.getFluid())) { + FluidStack fs = t.drain(direction.getOpposite(), FluidContainerRegistry.BUCKET_VOLUME, true); + this.tank.fill(fs, true); + } + + } else if (t.canDrain(this.direction.getOpposite(), this.tank.getFluid().getFluid())) { + FluidStack fs = t.drain(direction.getOpposite(), FluidContainerRegistry.BUCKET_VOLUME - this.tank.getFluidAmount(), true); + this.tank.fill(fs, true); + } + + } + + } + + public void updateServerOutWorkEntity() + { + int x = this.xCoord + ForgeDirection.UP.offsetX; + int y = this.yCoord + ForgeDirection.UP.offsetY; + int z = this.zCoord + ForgeDirection.UP.offsetZ; + + FluidStack f = this.tank.getFluid(); + + if (f != null) { + + if (this.worldObj.isAirBlock(x, y, z) && f.getFluid().canBePlacedInWorld()) { + + this.worldObj.setBlock(x, y, z, this.tank.getFluid().getFluid().getBlock()); + this.tank.setFluid(null); + + } else if (this.worldObj.getTileEntity(x, y, z) instanceof IFluidHandler && ((IFluidHandler) this.worldObj.getTileEntity(x, y, z)).canFill(ForgeDirection.DOWN, f.getFluid())) { + + int i = ((IFluidHandler) this.worldObj.getTileEntity(x, y, z)).fill(ForgeDirection.DOWN, f, true); + this.tank.drain(i, true); + + } + + } + + } + + @Override + public void readFromNBT(NBTTagCompound tag) + { + super.readFromNBT(tag); + tank.readFromNBT(tag); + storage.readFromNBT(tag); + } + + @Override + public void writeToNBT(NBTTagCompound tag) + { + super.writeToNBT(tag); + tank.writeToNBT(tag); + storage.writeToNBT(tag); + } + + @Override + public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + + if (this.getDirection().ordinal() == from.ordinal()) return 0; + + int i = storage.addEnergy(power, speed, simulate); + return i; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return true; + } + + @Override + public int getPowerStored(ForgeDirection from) { + return storage.getPowerStored(); + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return storage.getSpeedStored(); + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return storage.getMaxPower(); + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return storage.getMaxSpeed(); + } + + @Override + public boolean canIn(ForgeDirection from) { + return this.getDirection().ordinal() != from.ordinal(); + } + + @Override + public boolean canOut(ForgeDirection from) { + return false; + } + + //IFluidHandler + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { + return 0; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { + return null; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { + return null; + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) { + return from.ordinal() == ForgeDirection.UP.ordinal(); + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) { + return from.ordinal() == ForgeDirection.UP.ordinal(); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) { + return new FluidTankInfo[] { tank.getInfo() }; + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntitySSCrop.java b/src/main/java/shift/sextiarysector/tileentity/TileEntitySSCrop.java index 8c49ffe..e7b65fd 100644 --- a/src/main/java/shift/sextiarysector/tileentity/TileEntitySSCrop.java +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntitySSCrop.java @@ -10,26 +10,27 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; -import shift.sextiarysector.SSBlocks; +import shift.sextiarysector.api.agriculture.IFarmland; import shift.sextiarysector.api.season.Season; import shift.sextiarysector.api.season.SeasonAPI; import shift.sextiarysector.block.BlockSSCrop; import shift.sextiarysector.block.BlockSSCrop.CropStatus; -public class TileEntitySSCrop extends TileEntity implements IFluidHandler{ +public class TileEntitySSCrop extends TileEntity implements IFluidHandler { private int lastMinutes = 0; - private int lastDay =0; + private int lastDay = 0; //謌宣聞菴墓律逶ョ縺 - private int day=0; + private int day = 0; //蜀榊庶遨ォ - private int day2=0; + private int day2 = 0; + @Override public void updateEntity() { - if(!this.worldObj.isRemote){ + if (!this.worldObj.isRemote) { this.updateServerEntity(); } @@ -37,29 +38,33 @@ public void updateEntity() { public void updateServerEntity() { - if(lastMinutes==0){ - lastMinutes=SeasonAPI.getMinute(getWorldObj()); + if (this.getBlockMetadata() == 4 && !this.getStatus().isReHarvest()) { + this.worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 3, 0); + } + + if (lastMinutes == 0) { + lastMinutes = SeasonAPI.getMinute(getWorldObj()); } - if(lastMinutes==SeasonAPI.getMinute(getWorldObj())&&lastDay!=SeasonAPI.getDay(getWorldObj())){ + if (lastMinutes == SeasonAPI.getMinute(getWorldObj()) && lastDay != SeasonAPI.getDay(getWorldObj())) { Season[] s = this.getStatus().getSeason(); boolean notB = false; - for(int i = 0;i=10){ + this.changeSpeed(); + time=0; + }else{ + time++; + } + + } + + private void changeSpeed(){ + + int use = this.storage.drawEnergy(3, 200, false); + + int i = this.speed; + + if(use>=180){ + speed = Math.min(16, speed + 1); + }else{ + speed = Math.max(0, speed - 1); + } + + if(i!=speed){ + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + public boolean canWork(){ + + return speed >= 14; + + } + + private void workSaw(){ + + Block b = this.worldObj.getBlock(xCoord + this.getDirection().offsetX, yCoord + this.getDirection().offsetY, zCoord + this.getDirection().offsetZ); + + if(b != null && b.isNormalCube() && b.getBlockHardness(worldObj, xCoord + this.getDirection().offsetX, yCoord + this.getDirection().offsetY, zCoord + this.getDirection().offsetZ) != -1.0f){ + this.worldObj.func_147480_a(this.xCoord + this.getDirection().offsetX, this.yCoord + this.getDirection().offsetY, this.zCoord + this.getDirection().offsetZ, true); + this.worldObj.removeTileEntity(xCoord + this.getDirection().offsetX, yCoord + this.getDirection().offsetY, zCoord + this.getDirection().offsetZ); + } + + } + + private void addDamage(){ + + AxisAlignedBB aabb = getDirectionAABB(); + + List list = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)null, aabb, null); + + for(Entity e :list){ + if(e instanceof EntityItem)continue; + e.attackEntityFrom(DamageSource.cactus, 1.0f); + } + + } + + private AxisAlignedBB getDirectionAABB(){ + + int minX = 0, minY = 0, minZ = 0; + int maxX = 1, maxY = 1, maxZ = 1; + + switch(direction){ + case DOWN: minY = -1; break; + case UP: maxY = 2; break; + case NORTH: minZ = -1; break; + case SOUTH: maxZ = 2; break; + case WEST: minX = -1; break; + case EAST: maxX = 2; break; + default:break; + } + + return AxisAlignedBB.getBoundingBox(this.xCoord + minX, this.yCoord + minY, this.zCoord + minZ, this.xCoord + maxX, this.yCoord + maxY, this.zCoord + maxZ); + + } + + public float getRotateStep() { + return rotateStep; + } + + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + this.speed = par1nbtTagCompound.getInteger("speed"); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + par1nbtTagCompound.setInteger("speed", this.speed); + } + + @Override + public int addEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + + if(!canInterface(from))return 0; + + int i = storage.addEnergy(power, speed, simulate); + + return i; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + + return 0; + + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.getDirection().getOpposite().ordinal() == from.ordinal(); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return storage.getPowerStored(); + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return storage.getSpeedStored(); + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return storage.getMaxPower(); + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return storage.getMaxSpeed(); + } + + @Override + public boolean canIn(ForgeDirection from) { + return this.getDirection().getOpposite().ordinal() == from.ordinal(); + } + + @Override + public boolean canOut(ForgeDirection from) { + return false; + } +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityShaft.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityShaft.java index aed0357..2a6dd9b 100644 --- a/src/main/java/shift/sextiarysector/tileentity/TileEntityShaft.java +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityShaft.java @@ -3,28 +3,32 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -import shift.sextiarysector.api.machine.energy.EnergyStorage; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; +import shift.sextiarysector.fmp.IShaft; -public class TileEntityShaft extends TileEntityDirection implements IEnergyHandler { +public class TileEntityShaft extends TileEntityDirection implements IGearForceHandler, IGearForceGrid, IShaft { public float rotateStep = 360; - private EnergyStorage storage = new EnergyStorage("Base", 1, 320, 160); + private final EnergyStorage storage = new EnergyStorage("Base", 1, 320, 160); // 陦ィ遉コ逕ィ public int lastSpeed = 0; private final int cooltime = 0; - public TileEntityShaft(){ + public TileEntityShaft() { } - public TileEntityShaft(int i){ + public TileEntityShaft(int i) { this.getStorage().setPowerCapacity(i); } @Override public void updateEntity() { + super.updateEntity(); + if (this.worldObj.isRemote) { this.updateClientEntity(); } else { @@ -41,7 +45,7 @@ public void updateClientEntity() { yCoord + this.getInDirection().offsetY, zCoord + this.getInDirection().offsetZ); - if (t instanceof TileEntityShaft&& ((TileEntityShaft) t).getDirection().ordinal() == this.direction.ordinal()) { + if (t instanceof IShaft && ((IShaft) t).getDirection().ordinal() == this.direction.ordinal()) { return; } @@ -49,17 +53,17 @@ public void updateClientEntity() { * if(this.rotateStep>=360){ this.rotateStep-=360; } */ - this.rotateStep += (float)this.lastSpeed/10.0f; + this.rotateStep += this.lastSpeed / 10.0f; - t = this.worldObj.getTileEntity(xCoord + this.getOutDirection().offsetX,yCoord + this.getOutDirection().offsetY,zCoord + this.getOutDirection().offsetZ); + t = this.worldObj.getTileEntity(xCoord + this.getOutDirection().offsetX, yCoord + this.getOutDirection().offsetY, zCoord + this.getOutDirection().offsetZ); - for (int i = 2; t instanceof TileEntityShaft&& ((TileEntityShaft) t).getDirection().ordinal() == this.direction.ordinal(); i++) { + for (int i = 2; t instanceof IShaft && ((IShaft) t).getDirection().ordinal() == this.direction.ordinal(); i++) { // System.out.println("b"); - ((TileEntityShaft) t).rotateStep = this.rotateStep; + ((IShaft) t).setRotateStep(this.rotateStep); //if(this.worldObj.rand.nextInt(30)==1)this.worldObj.spawnParticle("reddust", t.xCoord+0.5f, t.yCoord+0.5f, t.zCoord+0.5f, -0.3D, 0.0D, 1.0D); - t = this.worldObj.getTileEntity(xCoord+ this.getOutDirection().offsetX * i,yCoord + this.getOutDirection().offsetY * i,zCoord + this.getOutDirection().offsetZ * i); + t = this.worldObj.getTileEntity(xCoord + this.getOutDirection().offsetX * i, yCoord + this.getOutDirection().offsetY * i, zCoord + this.getOutDirection().offsetZ * i); } } @@ -67,14 +71,14 @@ public void updateClientEntity() { public void updateServerEntity() { if (this.getStorage().getSpeedStored() != lastSpeed) { - lastSpeed = (int) (this.getStorage().getSpeedStored()); + lastSpeed = (this.getStorage().getSpeedStored()); // PacketDispatcher.sendPacketToAllPlayers(this.getDescriptionPacket()); this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); } if (this.getStorage().getSpeedStored() > 0) { - this.getStorage().drawEnergy(this.getStorage().getMaxPowerStored(), 10, false); + this.getStorage().drawEnergy(this.getStorage().getMaxPower(), 10, false); } /* @@ -106,8 +110,8 @@ public void updateServerEntity() { public int getShaftLength() { - TileEntityShaft in = this.getInTileEntityShaft(); - TileEntityShaft out = this.getOutTileEntityShaft(); + TileEntity in = (TileEntity) this.getInTileEntityShaft(); + TileEntity out = (TileEntity) this.getOutTileEntityShaft(); int x = Math.abs(in.xCoord - out.yCoord); int y = Math.abs(in.yCoord - out.yCoord); @@ -117,41 +121,42 @@ public int getShaftLength() { } - public TileEntityShaft getInTileEntityShaft() { + @Override + public IShaft getInTileEntityShaft() { if (this.isInShaft()) { return this; } else { - return ((TileEntityShaft) this.getInTileEntity()) - .getInTileEntityShaft(); + return ((IShaft) this.getInTileEntity()).getInTileEntityShaft(); } } - public TileEntityShaft getOutTileEntityShaft() { + @Override + public IShaft getOutTileEntityShaft() { if (this.isOutShaft()) { return this; } else { - return ((TileEntityShaft) this.getOutTileEntity()).getOutTileEntityShaft(); + return ((IShaft) this.getOutTileEntity()).getOutTileEntityShaft(); } } public boolean isInShaft() { - return !(this.getInTileEntity() instanceof TileEntityShaft)|| ((TileEntityShaft) this.getInTileEntity()).getDirection().ordinal() != this.getDirection().ordinal(); + return !(this.getInTileEntity() instanceof IShaft) || ((IShaft) this.getInTileEntity()).getDirection().ordinal() != this.getDirection().ordinal(); } public boolean isOutShaft() { - return !(this.getOutTileEntity() instanceof TileEntityShaft)|| ((TileEntityShaft) this.getOutTileEntity()).getDirection().ordinal() != this.getDirection().ordinal(); + return !(this.getOutTileEntity() instanceof IShaft) || ((IShaft) this.getOutTileEntity()).getDirection().ordinal() != this.getDirection().ordinal(); } public TileEntity getInTileEntity() { - return this.worldObj.getTileEntity(xCoord+ this.getInDirection().offsetX, yCoord+ this.getInDirection().offsetY, zCoord+ this.getInDirection().offsetZ); + return this.worldObj.getTileEntity(xCoord + this.getInDirection().offsetX, yCoord + this.getInDirection().offsetY, zCoord + this.getInDirection().offsetZ); } public TileEntity getOutTileEntity() { - return this.worldObj.getTileEntity(xCoord+ this.getOutDirection().offsetX,yCoord + this.getOutDirection().offsetY,zCoord + this.getOutDirection().offsetZ); + return this.worldObj.getTileEntity(xCoord + this.getOutDirection().offsetX, yCoord + this.getOutDirection().offsetY, zCoord + this.getOutDirection().offsetZ); } public ForgeDirection getInDirection() { @@ -177,19 +182,27 @@ public void writeToNBT(NBTTagCompound par1nbtTagCompound) { par1nbtTagCompound.setInteger("lastSpeed", lastSpeed); } + @Override public float getRotateStep() { return rotateStep / 2.0f; } + @Override + public void setRotateStep(float r) { + this.rotateStep = r; + } + @Override public ForgeDirection getDirection() { return direction; } + @Override public void setDirection(ForgeDirection d) { direction = d; } + @Override public EnergyStorage getStorage() { //if(storage==null){ @@ -201,15 +214,15 @@ public EnergyStorage getStorage() { // EnergyStorage縺ョ蛻ゥ逕ィ @Override - public int addEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate) { if (this.getInDirection().ordinal() != from.ordinal()) return 0; - if (!(this.getOutTileEntity() instanceof IEnergyHandler) || power != this.getStorage().getMaxPowerStored()) + if (!(this.getOutTileEntity() instanceof IGearForceHandler) || power != this.getStorage().getMaxPower()) return 0; - int i = ((IEnergyHandler) this.getOutTileEntity()).addEnergy(from,power, speed, simulate); + int i = ((IGearForceHandler) this.getOutTileEntity()).addEnergy(from, power, speed, simulate); // storage.addEnergy(power, speed, simulate); if (!simulate) @@ -248,7 +261,7 @@ public int getPowerStored(ForgeDirection from) { } @Override - public long getSpeedStored(ForgeDirection from) { + public int getSpeedStored(ForgeDirection from) { return this.getStorage().getSpeedStored(); @@ -257,15 +270,25 @@ public long getSpeedStored(ForgeDirection from) { @Override public int getMaxPowerStored(ForgeDirection from) { - return this.getStorage().getMaxPowerStored(); + return this.getStorage().getMaxPower(); } @Override - public long getMaxSpeedStored(ForgeDirection from) { + public int getMaxSpeedStored(ForgeDirection from) { + + return this.getStorage().getMaxSpeed(); + + } - return this.getStorage().getMaxSpeedStored(); + @Override + public boolean canIn(ForgeDirection from) { + return this.getInDirection().ordinal() == from.ordinal(); + } + @Override + public boolean canOut(ForgeDirection from) { + return this.getOutDirection().ordinal() == from.ordinal(); } } diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityShippingBox.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityShippingBox.java new file mode 100644 index 0000000..7251805 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityShippingBox.java @@ -0,0 +1,318 @@ +package shift.sextiarysector.tileentity; + +import java.util.ArrayList; +import java.util.UUID; + +import net.minecraft.entity.item.EntityFireworkRocket; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDye; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import shift.mceconomy2.api.MCEconomyAPI; +import shift.sextiarysector.api.season.SeasonAPI; +import shift.sextiarysector.container.ItemBox; +import shift.sextiarysector.module.ModuleStatistics; + +public class TileEntityShippingBox extends TileEntity implements IInventory, IFluidHandler { + + public UUID player = null; + public double mp = 0; + public double lastmp = 0; + protected ItemBox items = new ItemBox("Base", 1); + public FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 8); + + public void setPlayer(EntityPlayer p) { + + player = p.getGameProfile().getId(); + + } + + @Override + public void updateEntity() { + + if (!this.worldObj.isRemote) { + this.updateServerEntity(); + } + + } + + public void updateServerEntity() { + + if (SeasonAPI.getHour(getWorldObj(), 1) != 7 || SeasonAPI.getMinute(getWorldObj()) != 0) return; + + if (lastmp > 0) { + + mp += lastmp; + + ItemStack p_77648_1_ = this.getFireworks(); + + EntityFireworkRocket entityfireworkrocket = new EntityFireworkRocket(worldObj, xCoord + 0.5f, yCoord + 1.2f, zCoord + 0.5f, p_77648_1_); + getWorldObj().spawnEntityInWorld(entityfireworkrocket); + + if (lastmp > 1000) { + + ItemStack p_77648_2_ = this.getFireworks(); + + EntityFireworkRocket entityfireworkrocket2 = new EntityFireworkRocket(worldObj, xCoord + 0.5f, yCoord + 1.7f, zCoord + 0.5f, p_77648_2_); + getWorldObj().spawnEntityInWorld(entityfireworkrocket2); + + } + + if (lastmp > 10000) { + + for (int i = 0; i < 4; i++) { + + ItemStack p_77648_3_ = this.getFireworks(); + + EntityFireworkRocket entityfireworkrocket3 = new EntityFireworkRocket(worldObj, xCoord + this.worldObj.rand.nextFloat(), yCoord + 1.7f, zCoord + this.worldObj.rand.nextFloat(), p_77648_3_); + getWorldObj().spawnEntityInWorld(entityfireworkrocket3); + + } + + } + + lastmp = 0; + + } + + } + + private ItemStack getFireworks() { + + ItemStack p_77648_1_ = new ItemStack(Items.fireworks); + + NBTTagCompound nbttagcompound = new NBTTagCompound();//Explosion + + ArrayList arraylist = new ArrayList(); + arraylist.add(Integer.valueOf(ItemDye.field_150922_c[2])); + int[] aint1 = new int[arraylist.size()]; + + for (int l2 = 0; l2 < aint1.length; ++l2) + { + aint1[l2] = ((Integer) arraylist.get(l2)).intValue(); + } + + if (SeasonAPI.getHour(getWorldObj(), 0) == 7) { + nbttagcompound.setBoolean("Flicker", true); + } else { + nbttagcompound.setBoolean("Trail", true); + } + + nbttagcompound.setIntArray("Colors", aint1); + nbttagcompound.setByte("Type", (byte) 3); + + NBTTagCompound nbttagcompound1 = new NBTTagCompound(); + NBTTagCompound nbttagcompound2 = new NBTTagCompound(); + NBTTagList nbttaglist = new NBTTagList(); + + nbttaglist.appendTag(nbttagcompound); + + nbttagcompound1.setTag("Explosions", nbttaglist); + nbttagcompound1.setByte("Flight", (byte) 3); + nbttagcompound2.setTag("Fireworks", nbttagcompound1); + + p_77648_1_.setTagCompound(nbttagcompound2); + + return p_77648_1_; + + } + + //IInventory髢「菫 + @Override + public int getSizeInventory() { + return items.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int i) { + return items.getStackInSlot(i); + } + + @Override + public ItemStack decrStackSize(int i, int j) { + return items.decrStackSize(i, j); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return items.getStackInSlotOnClosing(i); + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + //items.setInventorySlotContents(i, itemstack); + + if (i != 0 || itemstack == null) return; + + int mp = 0; + + mp = MCEconomyAPI.getPurchase(itemstack) * itemstack.stackSize; + + if (mp > 0 && player != null && this.worldObj.func_152378_a(player) != null) { + this.worldObj.func_152378_a(player).addStat(ModuleStatistics.objectSellStats[Item.getIdFromItem(itemstack.getItem())], itemstack.stackSize); + } + + this.lastmp += mp; + + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return items.getInventoryStackLimit(); + } + + @Override + public void markDirty() { + super.markDirty(); + items.onInventoryChanged(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + @Override + public String getInventoryName() { + return "ss.shipping_box"; + } + + @Override + public boolean isItemValidForSlot(int p_94041_1_, ItemStack itemstack) { + + if (itemstack == null) return false; + + return MCEconomyAPI.hasPurchase(itemstack); + + } + + /* IFluidHandler */ + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + //return tank.fill(resource, doFill); + + double mp = 0; + + if (!MCEconomyAPI.hasFluidPurchase(resource.getFluid())) return 0; + + mp = MCEconomyAPI.getFluidPurchase(resource.getFluid()) * resource.amount; + + if (mp > 0 && doFill) { + this.lastmp += mp; + } + + return resource.amount; + + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + return tank.drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return tank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } + + //NBT + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + this.items.readFromNBT(par1nbtTagCompound); + tank.readFromNBT(par1nbtTagCompound); + if (par1nbtTagCompound.hasKey("Empty") && tank.getFluidAmount() > 0) this.tank.setFluid(null); + this.mp = par1nbtTagCompound.getDouble("mp"); + this.lastmp = par1nbtTagCompound.getDouble("lastmp"); + if (par1nbtTagCompound.hasKey("owner")) { + long i = par1nbtTagCompound.getLong("uuid1"); + long j = par1nbtTagCompound.getLong("uuid2"); + this.player = new UUID(i, j); + } + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + this.items.writeToNBT(par1nbtTagCompound); + tank.writeToNBT(par1nbtTagCompound); + par1nbtTagCompound.setDouble("mp", this.mp); + par1nbtTagCompound.setDouble("lastmp", this.lastmp); + if (this.player != null) { + par1nbtTagCompound.setBoolean("owner", true); + + par1nbtTagCompound.setLong("uuid1", this.player.getMostSignificantBits()); + par1nbtTagCompound.setLong("uuid2", this.player.getLeastSignificantBits()); + + } + + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + //this.worldObj.func_147479_m(xCoord, yCoord, zCoord); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntitySimpleFurnace.java b/src/main/java/shift/sextiarysector/tileentity/TileEntitySimpleFurnace.java new file mode 100644 index 0000000..43842be --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntitySimpleFurnace.java @@ -0,0 +1,298 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import shift.sextiarysector.container.ItemBox; + +public abstract class TileEntitySimpleFurnace extends TileEntityDirection implements ISidedInventory{ + + protected static final int[] slots_top = new int[] { 0 }; + protected static final int[] slots_bottom = new int[] { 2, 1 }; + protected static final int[] slots_sides = new int[] { 1 }; + + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 + //protected ItemBox items = new ItemBox("Base", 3); + + //菴懈・ュ縺ョ騾イ謐 + public int machineWorkProgressTime; + + //菴懈・ュ縺ョ騾イ謐励ョ譛螟ァ蛟、 縺薙ョ謨ー蟄励↓縺ェ繧九→螳御コ縺吶k + public int machineMaxProgressTime = 200; + + //辯譁吶→謚募・縺輔l縺ヲ縺繧狗譁吶ョ繝槭ャ繧ッ繧ケ迥カ諷九ョ驥 + public int fuel; + public int fuelMax; + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + } + + public void updateServerEntity() + { + if(fuel>0){ + fuel--; + if(fuel==0){ + this.fuelMax=0; + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + }else{ + if(this.canWork()){ + this.chargeFuel(); + } + + } + + if(this.isFuel() && this.canWork()){ + + machineWorkProgressTime++; + + if(machineWorkProgressTime>=machineMaxProgressTime){ + this.workItem(); + machineWorkProgressTime=0; + } + + } + + } + + + protected void chargeFuel(){ + + if(this.isItemFuel(this.getFuelItem() )){ + this.fuel = this.fuelMax = this.getItemFuelTime(this.getFuelItem()); + + if(this.getItems().getStackInSlot(getFuelItemSlot()).stackSize == 1){ + this.getItems().setInventorySlotContents(1, this.getItems().getStackInSlot(getFuelItemSlot()).getItem().getContainerItem(this.getItems().getStackInSlot(getFuelItemSlot()))); + }else{ + this.reduceFuelStackSize(); + } + + //this.reduceFuelStackSize(); + this.markDirty(); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + abstract protected ItemStack getFuelItem(); + + abstract protected int getFuelItemSlot(); + + abstract protected void reduceFuelStackSize(); + + public boolean isFuel() + { + return this.fuel > 0; + } + + public boolean canWork() + { + if (this.getMaterialItem() == null) + { + return false; + } + else + { + ItemStack itemstack = this.getResult(this.getMaterialItem()); + if (itemstack == null) return false; + return this.checkItem(itemstack) ; + } + } + + protected boolean checkItem(ItemStack itemstack){ + + if (this.getItems().getStackInSlot(getResultItemSlot()) == null || itemstack == null) return true; + if (!this.getItems().getStackInSlot(getResultItemSlot()).isItemEqual(itemstack)) return false; + int result = this.getItems().getStackInSlot(getResultItemSlot()).stackSize + itemstack.stackSize; + return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); + } + + public void workItem() + { + if (this.canWork()) + { + ItemStack itemstack = this.getResult(this.getMaterialItem()); + + //item + if (this.getItems().getStackInSlot(getResultItemSlot()) == null) + { + this.setInventorySlotContents(getResultItemSlot(), itemstack.copy()); + } + else if (this.getItems().getStackInSlot(getResultItemSlot()).isItemEqual(itemstack)) + { + this.getItems().getStackInSlot(getResultItemSlot()).stackSize += itemstack.stackSize; + } + + this.reduceMaterialStackSize(); + + this.markDirty(); + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + } + + abstract protected ItemStack getMaterialItem(); + + abstract protected int getResultItemSlot(); + + abstract protected void reduceMaterialStackSize(); + + abstract protected ItemStack getResult(ItemStack stackInSlot); + + abstract public int getItemFuelTime(ItemStack p_145952_0_); + + public boolean isItemFuel(ItemStack p_145954_0_) + { + return getItemFuelTime(p_145954_0_) > 0; + } + + abstract protected ItemBox getItems(); + + //GUI + public int getWorkProgressScaled(int par1) + { + return this.machineWorkProgressTime / (machineMaxProgressTime / par1); + } + + public int getEnergyProgressScaled(int par1) + { + return (int) (this.fuel / (this.fuelMax / par1)); + } + + + //IInventory髢「菫 + @Override + public int getSizeInventory() { + return getItems().getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int i) { + return getItems().getStackInSlot(i); + } + + @Override + public ItemStack decrStackSize(int i, int j) { + return getItems().decrStackSize(i, j); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return getItems().getStackInSlotOnClosing(i); + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + getItems().setInventorySlotContents(i, itemstack); + } + + @Override + public String getInventoryName() { + return "gui.ss.magic_furnace";//+SimpleMachine.values()[this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord)].icon+".name"; + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return getItems().getInventoryStackLimit(); + } + + @Override + public void markDirty(){ + super.markDirty(); + getItems().onInventoryChanged(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + + if (i == 1) { + return this.getItemFuelTime(itemstack) > 0; + } + + return i != 2; + } + + //ISidedInventory髢「菫 + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + return var1 == 0 ? slots_bottom : (var1 == 1 ? slots_top : slots_sides); + } + + @Override + public boolean canInsertItem(int i, ItemStack itemstack, int j) { + return this.isItemValidForSlot(i, itemstack); + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) + { + return p_102008_3_ != 0 || p_102008_1_ != 1 || p_102008_2_.getItem() == Items.bucket; + } + + //NBT髢「菫 + @Override + public void readFromNBT(NBTTagCompound nbt) { + + super.readFromNBT(nbt); + getItems().readFromNBT(nbt); + this.machineWorkProgressTime = nbt.getShort("WorkTime"); + this.fuel = nbt.getInteger("fuel"); + this.fuelMax = nbt.getInteger("fuelMax"); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + + super.writeToNBT(nbt); + getItems().writeToNBT(nbt); + nbt.setShort("WorkTime", (short)this.machineWorkProgressTime); + nbt.setInteger("fuel", this.fuel); + nbt.setInteger("fuelMax", this.fuelMax); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt){ + this.readFromNBT(pkt.func_148857_g()); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntitySimpleMachine.java b/src/main/java/shift/sextiarysector/tileentity/TileEntitySimpleMachine.java index 2bdb2c7..4fede7a 100644 --- a/src/main/java/shift/sextiarysector/tileentity/TileEntitySimpleMachine.java +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntitySimpleMachine.java @@ -5,13 +5,14 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; -import shift.sextiarysector.api.machine.energy.EnergyStorage; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; -import shift.sextiarysector.api.machine.item.GearForceItem; +import shift.sextiarysector.api.gearforce.item.GearForceItemAPI; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; import shift.sextiarysector.block.BlockSimpleMachine; import shift.sextiarysector.container.ItemBox; -public class TileEntitySimpleMachine extends TileEntityDirection implements ISidedInventory, IEnergyHandler { +public class TileEntitySimpleMachine extends TileEntityDirection implements ISidedInventory, IGearForceHandler, IGearForceGrid { protected static final int[] slots_top = new int[] { 0 }; protected static final int[] slots_bottom = new int[] { 2, 1 }; @@ -25,22 +26,21 @@ public class TileEntitySimpleMachine extends TileEntityDirection implements ISid //菴懈・ュ縺ョ騾イ謐 public int machineWorkProgressTime; - //菴懈・ュ縺ョ騾イ謐励ョ譛螟ァ蛟、 縺薙ョ謨ー蟄励↓縺ェ繧九→螳御コ縺吶k + //菴懈・ュ縺ョ騾イ謐励ョ譛螟ァ蛟、 縺薙ョ謨ー蟄励↓縺ェ繧九→螳御コ縺吶k 200Speed豸郁イサ public int machineMaxProgressTime = 2000; //陦ィ遉コ逕ィ - public int inPower = 0,inSpeed = 0; + public int inPower = 0, inSpeed = 0; public int lastSeed = 0; - public boolean In ; + public boolean In; private int cooltime = 0; public TileEntitySimpleMachine() { } - public TileEntitySimpleMachine(int type) { this.storage.setPowerCapacity(type); } @@ -68,56 +68,55 @@ public void updateServerEntity() { //System.out.println("updateServerEntity"+this.storage.getSpeedStored()); - if(this.inSpeed==0)inPower=0; - if(lastSeed!=this.storage.getSpeedStored()){ - this.inSpeed = this.storage.getSpeedStored()-lastSeed; + if (this.inSpeed == 0) inPower = 0; + if (lastSeed != this.storage.getSpeedStored()) { + this.inSpeed = this.storage.getSpeedStored() - lastSeed; this.lastSeed = this.storage.getSpeedStored(); - }else{ + } else { this.inSpeed = 0; } - if(this.storage.getSpeedStored()<=0){ + if (this.storage.getSpeedStored() <= 0) { this.storage.setPowerStored(0); } - if(this.isCharging()){ + if (this.isCharging()) { this.updateChargeEntity(); } - if(cooltime<=10){ + if (cooltime <= 10) { this.cooltime++; - }else{ + } else { + + this.cooltime = 0; - this.cooltime=0; + if (this.canWork()) + { + if (this.storage.getSpeedStored() >= 1) { - if (this.canWork() ) - { - if(this.storage.getSpeedStored()>=1){ - //++this.machineWorkProgressTime; - this.machineWorkProgressTime+=this.storage.drawEnergy(this.storage.getMaxPowerStored(), 100, false); + this.machineWorkProgressTime += this.storage.drawEnergy(this.storage.getMaxPower(), 100, false); - if (this.machineWorkProgressTime >= machineMaxProgressTime) - { - this.machineWorkProgressTime = 0; - this.workItem(); + if (this.machineWorkProgressTime >= machineMaxProgressTime) + { + this.machineWorkProgressTime = 0; + this.workItem(); - if(this.storage.getSpeedStored() == 0){ - this.storage.setPowerStored(0); - } + if (this.storage.getSpeedStored() == 0) { + this.storage.setPowerStored(0); + } - //PacketDispatcher.sendPacketToAllPlayers(getDescriptionPacket()); - this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - this.markDirty(); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + this.markDirty(); - } - } + } + } - } - else - { + } + else + { - this.machineWorkProgressTime = 0; - } + this.machineWorkProgressTime = 0; + } } @@ -125,14 +124,14 @@ public void updateServerEntity() public void updateChargeEntity() { - if(this.items.getStackInSlot(1)==null)return; + if (this.items.getStackInSlot(1) == null) return; - if(GearForceItem.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPowerStored(), 1, true)>0){ - int s = GearForceItem.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPowerStored(), 20, true); + if (GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), 1, true) > 0) { + int s = GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), 20, true); - int i = this.storage.addEnergy(this.storage.getMaxPowerStored(), s, false); - GearForceItem.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPowerStored(), i, false); - if(i>0)this.inPower = this.storage.getMaxPowerStored(); + int i = this.storage.addEnergy(this.storage.getMaxPower(), s, false); + GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), i, false); + if (i > 0) this.inPower = this.storage.getMaxPower(); //this.inSpeed += (int) i; this.markDirty(); @@ -141,66 +140,66 @@ public void updateChargeEntity() } public boolean canWork() - { - if (this.items.getStackInSlot(0) == null) - { - return false; - } - else - { - ItemStack itemstack = this.getResult(this.items.getStackInSlot(0)); - if (itemstack == null) return false; - if (this.items.getStackInSlot(2) == null) return true; - if (!this.items.getStackInSlot(2).isItemEqual(itemstack)) return false; - int result = this.items.getStackInSlot(2).stackSize + itemstack.stackSize; - return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); - } - } + { + if (this.items.getStackInSlot(0) == null) + { + return false; + } + else + { + ItemStack itemstack = this.getResult(this.items.getStackInSlot(0)); + if (itemstack == null) return false; + if (this.items.getStackInSlot(2) == null) return true; + if (!this.items.getStackInSlot(2).isItemEqual(itemstack)) return false; + int result = this.items.getStackInSlot(2).stackSize + itemstack.stackSize; + return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize()); + } + } public void workItem() - { - if (this.canWork()) - { - ItemStack itemstack = this.getResult(this.items.getStackInSlot(0)); + { + if (this.canWork()) + { + ItemStack itemstack = this.getResult(this.items.getStackInSlot(0)); - if (this.items.getStackInSlot(2) == null) - { - this.setInventorySlotContents(2, itemstack.copy()); - } - else if (this.items.getStackInSlot(2).isItemEqual(itemstack)) - { - this.items.getStackInSlot(2).stackSize += itemstack.stackSize; - } + if (this.items.getStackInSlot(2) == null) + { + this.setInventorySlotContents(2, itemstack.copy()); + } + else if (this.items.getStackInSlot(2).isItemEqual(itemstack)) + { + this.items.getStackInSlot(2).stackSize += itemstack.stackSize; + } - this.items.reduceStackSize(0, 1); + this.items.reduceStackSize(0, 1); - } - } + } + } - public ItemStack getResult(ItemStack itemstack){ - return ((BlockSimpleMachine)this.getBlockType()).getResult(itemstack); + public ItemStack getResult(ItemStack itemstack) { + return ((BlockSimpleMachine) this.getBlockType()).getResult(itemstack); } public boolean isWorking() - { - return this.machineWorkProgressTime > 0&&this.storage.getPowerStored()>0; - } + { + return this.machineWorkProgressTime > 0 && this.storage.getPowerStored() > 0; + } public boolean isCharging() - { + { - boolean f1,f2,f3; + boolean f1, f2, f3; - if(this.items.getStackInSlot(1)==null)return false; + if (this.items.getStackInSlot(1) == null) return false; - f1=this.storage.getMaxSpeedStored()>this.storage.getSpeedStored(); - f2=(this.items.getStackInSlot(1)!=null&&GearForceItem.manager.isGearForceItem(this.items.getStackInSlot(1))); - f3=GearForceItem.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPowerStored(), 1, true)>0; + f1 = this.storage.getMaxSpeed() > this.storage.getSpeedStored(); + f2 = (this.items.getStackInSlot(1) != null && GearForceItemAPI.manager.isGearForceItem(this.items.getStackInSlot(1))); + f3 = GearForceItemAPI.manager.reduceEnergy(this.items.getStackInSlot(1), this.storage.getMaxPower(), 1, true) > 0; //System.out.println(f1+" "+f2+" "+f3); - return f1&&f2&&f3; - } + return f1 && f2 && f3; + } //IInventory髢「菫 @Override @@ -230,7 +229,7 @@ public void setInventorySlotContents(int i, ItemStack itemstack) { @Override public String getInventoryName() { - return "gui."+((BlockSimpleMachine)this.blockType).getGUIUnlocalizedName();//+SimpleMachine.values()[this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord)].icon+".name"; + return "gui." + ((BlockSimpleMachine) this.blockType).getGUIUnlocalizedName();//+SimpleMachine.values()[this.worldObj.getBlockMetadata(xCoord, yCoord, zCoord)].icon+".name"; } @Override @@ -244,7 +243,7 @@ public int getInventoryStackLimit() { } @Override - public void markDirty(){ + public void markDirty() { super.markDirty(); items.onInventoryChanged(); } @@ -267,7 +266,7 @@ public void closeInventory() { public boolean isItemValidForSlot(int i, ItemStack itemstack) { if (i == 1) { - return GearForceItem.manager.isGearForceItem(itemstack); + return GearForceItemAPI.manager.isGearForceItem(itemstack); } return i != 2; @@ -282,12 +281,11 @@ public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate int i = storage.addEnergy(power, speed, simulate); - if(!simulate&&i>0){ - this.inPower=power; + if (!simulate && i > 0) { + this.inPower = power; //this.inSpeed+=i; } - return i; } @@ -317,7 +315,7 @@ public int getPowerStored(ForgeDirection from) { } @Override - public long getSpeedStored(ForgeDirection from) { + public int getSpeedStored(ForgeDirection from) { return storage.getSpeedStored(); @@ -326,14 +324,14 @@ public long getSpeedStored(ForgeDirection from) { @Override public int getMaxPowerStored(ForgeDirection from) { - return storage.getMaxPowerStored(); + return storage.getMaxPower(); } @Override - public long getMaxSpeedStored(ForgeDirection from) { + public int getMaxSpeedStored(ForgeDirection from) { - return storage.getMaxSpeedStored(); + return storage.getMaxSpeed(); } @@ -351,18 +349,18 @@ public boolean canInsertItem(int i, ItemStack itemstack, int j) { @Override public boolean canExtractItem(int i, ItemStack itemstack, int j) { return j != 0 || i != 1 - || (GearForceItem.manager.isGearForceItem(itemstack) && !GearForceItem.manager.canUse(itemstack, 1)); + || (GearForceItemAPI.manager.isGearForceItem(itemstack) && !GearForceItemAPI.manager.canUse(itemstack, 1)); } public int getWorkProgressScaled(int par1) - { - return this.machineWorkProgressTime / (machineMaxProgressTime / par1); - } + { + return this.machineWorkProgressTime / (machineMaxProgressTime / par1); + } public int getEnergyProgressScaled(int par1) - { - return (int) (this.storage.getSpeedStored() / (this.storage.getMaxSpeedStored() / par1)); - } + { + return this.storage.getSpeedStored() / (this.storage.getMaxSpeed() / par1); + } //NBT髢「菫 @Override @@ -382,9 +380,19 @@ public void writeToNBT(NBTTagCompound nbt) { super.writeToNBT(nbt); storage.writeToNBT(nbt); items.writeToNBT(nbt); - nbt.setShort("WorkTime", (short)this.machineWorkProgressTime); + nbt.setShort("WorkTime", (short) this.machineWorkProgressTime); nbt.setInteger("inPower", this.inPower); nbt.setInteger("inSpeed", this.inSpeed); } + @Override + public boolean canIn(ForgeDirection from) { + return true; + } + + @Override + public boolean canOut(ForgeDirection from) { + return false; + } + } diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntitySmallWaterwheel.java b/src/main/java/shift/sextiarysector/tileentity/TileEntitySmallWaterwheel.java new file mode 100644 index 0000000..0bdf1f7 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntitySmallWaterwheel.java @@ -0,0 +1,137 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; + +public class TileEntitySmallWaterwheel extends TileEntityDirection implements IGearForceHandler,IGearForceGrid{ + + public float rotateStep = 0; + + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + if(!this.isWork()){ + return; + } + + if(this.rotateStep>360){ + this.rotateStep-=360; + } + + this.rotateStep+=2; + + } + + public void updateServerEntity() + { + TileEntity t =this.worldObj.getTileEntity(xCoord-this.direction.offsetX, yCoord-this.direction.offsetY, zCoord-this.direction.offsetZ); + if(t!=null && t instanceof IGearForceHandler && this.isWork()){ + + ((IGearForceHandler)t).addEnergy(this.direction, 2, 40, false); + } + + } + + public float getRotateStep() { + return -rotateStep; + } + + boolean isWork(){ + + ForgeDirection d1 = this.getDirection().getRotation(ForgeDirection.UP); + ForgeDirection d2 = this.getDirection().getRotation(ForgeDirection.UP).getOpposite(); + + for(int i=0;i<2;i++){ + + int ra = 1; + for(int j=ra*-1;j<=ra;j++){ + int x = xCoord + d1.offsetX * j; + int y = yCoord + i; + int z = zCoord + d1.offsetZ * j; + + if(i==0&& j == 0)continue; + + if(!this.worldObj.isAirBlock(x, y, z))return false; + + } + + + + } + + + Block b31 = this.getWorldObj().getBlock(xCoord + d1.offsetX, yCoord - 1, zCoord + d1.offsetZ); + Block b32 = this.getWorldObj().getBlock(xCoord, yCoord - 1, zCoord); + Block b33 = this.getWorldObj().getBlock(xCoord + d2.offsetX, yCoord - 1, zCoord + d1.offsetZ); + + if(!(b31 instanceof BlockLiquid) || !(b32 instanceof BlockLiquid) || !(b33 instanceof BlockLiquid)){ + return false; + } + + return true; + } + + @Override + public int addEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + return 0; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public boolean canIn(ForgeDirection from) { + return false; + } + + @Override + public boolean canOut(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntitySmallWindmill.java b/src/main/java/shift/sextiarysector/tileentity/TileEntitySmallWindmill.java index c263105..f5c815b 100644 --- a/src/main/java/shift/sextiarysector/tileentity/TileEntitySmallWindmill.java +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntitySmallWindmill.java @@ -1,9 +1,11 @@ package shift.sextiarysector.tileentity; import net.minecraft.tileentity.TileEntity; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; -public class TileEntitySmallWindmill extends TileEntityDirection{ +public class TileEntitySmallWindmill extends TileEntityDirection implements IGearForceHandler,IGearForceGrid { public float rotateStep = 0; @@ -24,6 +26,11 @@ public void updateEntity() public void updateClientEntity() { + + if(!this.isWork()){ + return; + } + if(this.rotateStep>360){ this.rotateStep-=360; } @@ -35,15 +42,84 @@ public void updateClientEntity() public void updateServerEntity() { TileEntity t =this.worldObj.getTileEntity(xCoord-this.direction.offsetX, yCoord-this.direction.offsetY, zCoord-this.direction.offsetZ); - if(t!=null && t instanceof IEnergyHandler){ + if(t!=null && t instanceof IGearForceHandler && this.isWork()){ - ((IEnergyHandler)t).addEnergy(this.direction, 1, 20, false); + ((IGearForceHandler)t).addEnergy(this.direction, 1, 20, false); } } + boolean isWork(){ + + ForgeDirection d1 = this.getDirection().getRotation(ForgeDirection.UP); + + int ra1 = 2; + for(int i=ra1*-1;i<=ra1;i++){ + + int ra2 = 2; + for(int j=ra2*-1;j<=ra2;j++){ + int x = xCoord + d1.offsetX * j; + int y = yCoord + i; + int z = zCoord + d1.offsetZ * j; + + if(i==0&& j == 0)continue; + + if(!this.worldObj.isAirBlock(x, y, z))return false; + + } + + } + + return true; + } + public float getRotateStep() { return -rotateStep; } + @Override + public int addEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + return 0; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public boolean canIn(ForgeDirection from) { + return false; + } + + @Override + public boolean canOut(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + } diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntitySquare.java b/src/main/java/shift/sextiarysector/tileentity/TileEntitySquare.java new file mode 100644 index 0000000..7127d03 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntitySquare.java @@ -0,0 +1,172 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.block.BlockFire; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.SSFluids; +import shift.sextiarysector.block.BlockBlueFire; + +public class TileEntitySquare extends TileEntityDirection implements IFluidHandler { + + protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 16); + + private int lastFluid; + + @Override + public void updateEntity() { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() { + } + + private void updateServerEntity() { + + if ((lastFluid) != (tank.getFluidAmount() / 10)) { + this.lastFluid = (tank.getFluidAmount() / 10); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + if (this.direction.ordinal() != ForgeDirection.UP.ordinal() && this.tank.getFluidAmount() > 0) this.chargeFluid(); + if (canChargeSteam()) this.chargeSteam(); + + } + + private void chargeFluid() { + + if (this.worldObj.getTileEntity(xCoord + this.direction.offsetX, yCoord + this.direction.offsetY, zCoord + this.direction.offsetZ) instanceof IFluidHandler) { + IFluidHandler f = (IFluidHandler) this.worldObj.getTileEntity(xCoord + this.direction.offsetX, yCoord + this.direction.offsetY, zCoord + this.direction.offsetZ); + + if (f.canFill(this.getDirection().getOpposite(), this.tank.getFluid().getFluid())) { + FluidStack fs = this.tank.getFluid().copy(); + if (fs.amount > 500) fs.amount = 500; + int i = f.fill(this.getDirection().getOpposite(), fs, true); + this.tank.drain(i, true); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + } + + private boolean canChargeSteam() { + return this.tank.getFluidAmount() >= 10 && this.tank.getFluid().getFluid().getName().equals("water") && this.worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof BlockFire; + } + + private void chargeSteam() { + + if (this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord) instanceof IFluidHandler) { + IFluidHandler f = (IFluidHandler) this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord); + + if (f.canFill(ForgeDirection.DOWN, SSFluids.steam)) { + + int fire = 2; + if (this.worldObj.getBlock(xCoord, yCoord - 1, zCoord) instanceof BlockBlueFire) fire = 10; + + FluidStack fs = new FluidStack(SSFluids.steam, fire); + int i = f.fill(ForgeDirection.DOWN, fs, true); + this.tank.drain(i, true); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + } + + } + + /* IFluidHandler */ + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + if (from.ordinal() == this.getDirection().ordinal()) return 0; + return tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + return tank.drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return tank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + if (from.ordinal() == this.getDirection().ordinal()) return false; + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } + + public boolean hasFluid() { + return this.tank.getFluidAmount() > 0; + } + + public IIcon getFluidIcon() { + return this.tank.getFluid().getFluid().getIcon(this.tank.getFluid()); + } + + public int getFluidColor() { + return this.tank.getFluid().getFluid().getColor(this.tank.getFluid()); + } + + public float getFluidHeight() { + return ((float) this.tank.getFluidAmount() / (float) this.tank.getCapacity()) * (11.0f / 16.0f); + } + + public int getFluidID() { + return tank.getFluid().getFluid().getID(); + } + + public FluidStack getFluidStack() { + return this.tank.getFluid(); + } + + /* NBT */ + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + tank.readFromNBT(par1nbtTagCompound); + if (par1nbtTagCompound.hasKey("Empty") && tank.getFluidAmount() > 0) this.tank.setFluid(null); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + tank.writeToNBT(par1nbtTagCompound); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntitySteamMotor.java b/src/main/java/shift/sextiarysector/tileentity/TileEntitySteamMotor.java new file mode 100644 index 0000000..9bbb9e9 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntitySteamMotor.java @@ -0,0 +1,374 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.container.ItemBox; + +public class TileEntitySteamMotor extends TileEntityDirection implements IGearForceHandler, IGearForceGrid, ISidedInventory, IFluidHandler { + + protected static final int[] slots_top = new int[] { 0 }; + protected static final int[] slots_bottom = new int[] { 1 }; + protected static final int[] slots_sides = new int[] { 0 }; + + protected ItemBox items = new ItemBox("Base", 2); + + //豸イ菴 + private final FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 15); + + private int lastSteam = 0; + private boolean lastWork = false; + public float rotateStep = 0; + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + if (lastWork && this.canWork()) { + rotateStep -= 10; + } + } + + public void updateServerEntity() + { + + if (lastSteam != this.tank.getFluidAmount()) { + lastSteam = this.tank.getFluidAmount(); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + if (this.canWork()) { + this.work(); + } + + if (this.canCharge()) { + this.chargeSteam(); + } + + } + + public boolean canWork() { + return this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord) && this.tank.getFluidAmount() > 0; + } + + public void work() { + + int use = this.tank.drain(20, false) == null ? 0 : this.tank.drain(20, true).amount; + + if (use == 0) { + if (lastWork) { + lastWork = false; + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + return; + } + + if (!lastWork) { + lastWork = true; + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + TileEntity t = this.worldObj.getTileEntity(xCoord - this.direction.offsetX, yCoord - this.direction.offsetY, zCoord - this.direction.offsetZ); + if (t != null && t instanceof IGearForceHandler && this.canWork()) { + + ((IGearForceHandler) t).addEnergy(this.direction, 3, (int) (use * 2.2f), false); + + } + + } + + public void chargeSteam() { + + FluidStack f = FluidContainerRegistry.getFluidForFilledItem(items.getStackInSlot(0)); + this.fill(ForgeDirection.UP, f, true); + ItemStack item = items.getStackInSlot(0).getItem().getContainerItem(items.getStackInSlot(0)); + + if (item != null) { + + if (this.items.getStackInSlot(1) == null) + { + this.setInventorySlotContents(1, item.copy()); + } + else if (this.items.getStackInSlot(1).isItemEqual(item)) + { + this.items.getStackInSlot(1).stackSize += item.stackSize; + } + + } + + this.items.reduceStackSize(0, 1); + + this.markDirty(); + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + + public boolean canCharge() { + + FluidStack f = FluidContainerRegistry.getFluidForFilledItem(items.getStackInSlot(0)); + + if (f == null) return false; + + int i = this.fill(ForgeDirection.UP, f, false); + + if (i != f.amount) return false; + + if (items.getStackInSlot(0) == null) return false; + if (this.items.getStackInSlot(1) == null) return true; + ItemStack item = items.getStackInSlot(0).getItem().getContainerItem(items.getStackInSlot(0).copy()); + if (item == null) return true; + int result = this.items.getStackInSlot(1).stackSize + item.stackSize; + return (result <= getInventoryStackLimit() && result <= item.getMaxStackSize()); + + } + + public float getRotateStep() { + return rotateStep; + } + + //GUI + public FluidTank getTank() { + return tank; + } + + public boolean isFluid() { + return this.getTank().getFluidAmount() > 0; + } + + //IInventory髢「菫 + @Override + public int getSizeInventory() { + return items.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int i) { + return items.getStackInSlot(i); + } + + @Override + public ItemStack decrStackSize(int i, int j) { + return items.decrStackSize(i, j); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return items.getStackInSlotOnClosing(i); + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + items.setInventorySlotContents(i, itemstack); + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return items.getInventoryStackLimit(); + } + + @Override + public void markDirty() { + super.markDirty(); + items.onInventoryChanged(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer.getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + /*蜈・繧後k*/ + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + + return i == 0; + + } + + //ISidedInventory髢「菫 + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 ,3 邏譚舌ョ繧ウ繝ウ繝繝 ,4 遨コ縺ョ繝懊ヨ繝ォ , 5 豸イ菴薙ョ蜈・縺」縺溘懊ヨ繝ォ + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + + if (var1 == 0) { + return slots_bottom; + } + + if (var1 == 1) { + return slots_top; + } + + return slots_sides; + + } + + @Override + public boolean canInsertItem(int i, ItemStack itemstack, int j) { + return this.isItemValidForSlot(i, itemstack); + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) + { + + if (p_102008_1_ == 1) { + return true; + } + + return false; + } + + @Override + public String getInventoryName() { + return "gui.ss.steam_motor"; + } + + //GF + @Override + public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + return 0; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public boolean canIn(ForgeDirection from) { + return false; + } + + @Override + public boolean canOut(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + + //IFluidHandler髢「菫 + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + if (resource == null || resource.getFluid() == null) return 0; + if (!canFill(from, resource.getFluid())) return 0; + + return tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(getTank().getFluid())) + { + return null; + } + return getTank().drain(resource.amount, doDrain); + + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return getTank().drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + if (!fluid.getName().equals("steam")) return false; + + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { getTank().getInfo() }; + } + + //NBT + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + this.items.readFromNBT(par1nbtTagCompound); + this.tank.readFromNBT(par1nbtTagCompound); + if (par1nbtTagCompound.hasKey("Empty") && this.tank.getFluidAmount() > 0) this.tank.setFluid(null); + this.lastWork = par1nbtTagCompound.getBoolean("lastwork"); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + this.items.writeToNBT(par1nbtTagCompound); + this.tank.writeToNBT(par1nbtTagCompound); + par1nbtTagCompound.setBoolean("lastwork", this.lastWork); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityStoneFrame.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityStoneFrame.java new file mode 100644 index 0000000..6ecff33 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityStoneFrame.java @@ -0,0 +1,82 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; + +public class TileEntityStoneFrame extends TileEntity{ + + public boolean large; + + public int largeX; + public int largeY; + public int largeZ; + + public void setLarge(int x, int y, int z){ + + this.largeX = x; + this.largeY = y; + this.largeZ = z; + + this.large = true; + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + + public void breakLarge(){ + + if(!large)return; + + large = false; + + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + TileEntityCraftFurnace t = (TileEntityCraftFurnace) this.worldObj.getTileEntity(largeX, largeY, largeZ); + + t.breakLarge(); + + } + + public TileEntityCraftFurnace getCraftFurnace(){ + + if(!large)return null; + + return (TileEntityCraftFurnace) this.worldObj.getTileEntity(largeX, largeY, largeZ); + + } + + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + large = par1nbtTagCompound.getBoolean("large"); + largeX = par1nbtTagCompound.getInteger("largex"); + largeY = par1nbtTagCompound.getInteger("largey"); + largeZ = par1nbtTagCompound.getInteger("largez"); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + par1nbtTagCompound.setBoolean("large", large); + par1nbtTagCompound.setInteger("largex", largeX); + par1nbtTagCompound.setInteger("largey", largeY); + par1nbtTagCompound.setInteger("largez", largeZ); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntitySuctionMachine.java b/src/main/java/shift/sextiarysector/tileentity/TileEntitySuctionMachine.java new file mode 100644 index 0000000..6d62298 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntitySuctionMachine.java @@ -0,0 +1,237 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLiquid; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidBlock; +import net.minecraftforge.fluids.IFluidHandler; +import shift.sextiarysector.api.gearforce.tileentity.EnergyStorage; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; + +public class TileEntitySuctionMachine extends TileEntityDirection implements IFluidHandler, IGearForceHandler, IGearForceGrid { + + protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME); + + public EnergyStorage storage = new EnergyStorage("Base", 2, 3000); + + private int cooltime = 0; + + public TileEntitySuctionMachine() { + this.direction = ForgeDirection.DOWN; + } + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + this.updateServerEntity(); + } + + } + + public void updateClientEntity() + { + } + + public void updateServerEntity() + { + + cooltime++; + if (cooltime > 10) { + cooltime = 0; + + if (storage.drawEnergy(2, 40, false) >= 34) { + this.updateServerOutWorkEntity(); + this.updateServerInWorkEntity(); + this.getFluidFromSuctionMachine(); + } + + } + + } + + public void updateServerInWorkEntity() + { + + int x = this.xCoord + this.direction.offsetX; + int y = this.yCoord + this.direction.offsetY; + int z = this.zCoord + this.direction.offsetZ; + + Block block = this.getWorldObj().getBlock(x, y, z); + + Fluid f = FluidRegistry.lookupFluidForBlock(block); + + if (block instanceof BlockLiquid || block instanceof IFluidBlock) { + if (this.getWorldObj().getBlockMetadata(x, y, z) != 0) return; + } + + if (f != null && this.tank.getFluid() == null) { + + this.worldObj.removeTileEntity(x, y, z); + this.worldObj.setBlock(x, y, z, Blocks.air, 0, 3); + this.tank.setFluid(new FluidStack(f, FluidContainerRegistry.BUCKET_VOLUME)); + + } else if (this.worldObj.getTileEntity(x, y, z) instanceof IFluidHandler) { + + IFluidHandler t = (IFluidHandler) this.worldObj.getTileEntity(x, y, z); + + if (this.tank.getFluid() == null) { + + if (t.getTankInfo(direction.getOpposite()) != null && t.getTankInfo(direction.getOpposite())[0].fluid != null && t.canDrain(this.direction.getOpposite(), t.getTankInfo(direction.getOpposite())[0].fluid.getFluid())) { + FluidStack fs = t.drain(direction.getOpposite(), FluidContainerRegistry.BUCKET_VOLUME, true); + this.tank.fill(fs, true); + } + + } else if (t.canDrain(this.direction.getOpposite(), this.tank.getFluid().getFluid())) { + FluidStack fs = t.drain(direction.getOpposite(), FluidContainerRegistry.BUCKET_VOLUME - this.tank.getFluidAmount(), true); + this.tank.fill(fs, true); + } + + } + + } + + public void updateServerOutWorkEntity() + { + int x = this.xCoord + ForgeDirection.UP.offsetX; + int y = this.yCoord + ForgeDirection.UP.offsetY; + int z = this.zCoord + ForgeDirection.UP.offsetZ; + + FluidStack f = this.tank.getFluid(); + + if (f != null) { + + if (this.worldObj.isAirBlock(x, y, z) && f.getFluid().canBePlacedInWorld()) { + + this.worldObj.setBlock(x, y, z, this.tank.getFluid().getFluid().getBlock()); + this.tank.setFluid(null); + + } else if (this.worldObj.getTileEntity(x, y, z) instanceof IFluidHandler && ((IFluidHandler) this.worldObj.getTileEntity(x, y, z)).canFill(ForgeDirection.DOWN, f.getFluid())) { + + int i = ((IFluidHandler) this.worldObj.getTileEntity(x, y, z)).fill(ForgeDirection.DOWN, f, true); + this.tank.drain(i, true); + + } + + } + + } + + private void getFluidFromSuctionMachine() { + + if (!(this.getWorldObj().getTileEntity(xCoord, yCoord - 1, zCoord) instanceof TileEntityPipe)) return; + + TileEntityPipe p = (TileEntityPipe) this.getWorldObj().getTileEntity(xCoord, yCoord - 1, zCoord); + + p.getFluidFromSuctionMachine(ForgeDirection.UP); + + } + + @Override + public void readFromNBT(NBTTagCompound tag) + { + super.readFromNBT(tag); + tank.readFromNBT(tag); + storage.readFromNBT(tag); + } + + @Override + public void writeToNBT(NBTTagCompound tag) + { + super.writeToNBT(tag); + tank.writeToNBT(tag); + storage.writeToNBT(tag); + } + + @Override + public int addEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + + if (this.getDirection().ordinal() == from.ordinal()) return 0; + + int i = storage.addEnergy(power, speed, simulate); + return i; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed, boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return true; + } + + @Override + public int getPowerStored(ForgeDirection from) { + return storage.getPowerStored(); + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return storage.getSpeedStored(); + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return storage.getMaxPower(); + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return storage.getMaxSpeed(); + } + + @Override + public boolean canIn(ForgeDirection from) { + return this.getDirection().ordinal() != from.ordinal(); + } + + @Override + public boolean canOut(ForgeDirection from) { + return false; + } + + //IFluidHandler + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { + return 0; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { + return null; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { + return null; + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) { + return from.ordinal() == ForgeDirection.UP.ordinal(); + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) { + return from.ordinal() == ForgeDirection.UP.ordinal(); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) { + return new FluidTankInfo[] { tank.getInfo() }; + } +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityTank.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityTank.java new file mode 100644 index 0000000..228c713 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityTank.java @@ -0,0 +1,130 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +public class TileEntityTank extends TileEntity implements IFluidHandler { + + public FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME * 32); + protected int lastAmount; + + @Override + public void updateEntity() + { + super.updateEntity(); + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() + { + + } + + private void updateServerEntity() { + + if (this.tank.getFluidAmount() * (0.1f) != lastAmount) { + //System.out.println(this.tank.getFluidAmount()); + lastAmount = (int) (this.tank.getFluidAmount() * (0.1f)); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + + } + } + + public float getRendererAmount() { + return (float) this.tank.getFluidAmount() / (float) this.tank.getCapacity(); + } + + public boolean hasFluidStack() { + return tank.getFluidAmount() > 0; + } + + public FluidStack getFluidStack() { + return tank.getFluid(); + } + + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + tank.readFromNBT(par1nbtTagCompound); + if (par1nbtTagCompound.hasKey("Empty") && tank.getFluidAmount() > 0) this.tank.setFluid(null); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + tank.writeToNBT(par1nbtTagCompound); + } + + /* IFluidHandler */ + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + return tank.fill(resource, doFill); + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if (resource == null || !resource.isFluidEqual(tank.getFluid())) + { + return null; + } + return tank.drain(resource.amount, doDrain); + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + return tank.drain(maxDrain, doDrain); + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return true; + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + return new FluidTankInfo[] { tank.getInfo() }; + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + //this.worldObj.func_147479_m(xCoord, yCoord, zCoord); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityTofuMotor.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityTofuMotor.java new file mode 100644 index 0000000..ecebe5c --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityTofuMotor.java @@ -0,0 +1,97 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import tsuteto.tofu.api.tileentity.ITfConsumer; + + +public class TileEntityTofuMotor extends TileEntityDirection implements ITfConsumer{ + + private double lastEnergy; + + public float rotateStep = 360; + + public double tofu = 0; + public final double MAX_TOFU = 80.0d; + + @Override + public void updateEntity() { + + if (this.worldObj.isRemote) { + this.updateClientEntity(); + } else { + + this.updateServerEntity(); + + } + + } + + public void updateClientEntity() { + if(this.tofu>0){ + rotateStep-=8; + if(rotateStep<0){ + rotateStep+=360; + } + } + } + + private void updateServerEntity() { + + if(this.tofu!=lastEnergy){ + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + this.lastEnergy = this.tofu; + } + + if(this.tofu>0.4){ + + TileEntity t =this.worldObj.getTileEntity(xCoord-this.direction.offsetX, yCoord-this.direction.offsetY, zCoord-this.direction.offsetZ); + + if(t!=null && t instanceof IGearForceHandler){ + + int i = ((IGearForceHandler)t).addEnergy(this.direction, 2, 40, false); + this.tofu-=(i/100.0); + + } + + } + + } + + @Override + public void readFromNBT(NBTTagCompound tag) { + super.readFromNBT(tag); + + tofu = tag.getDouble("tofu"); + + } + + @Override + public void writeToNBT(NBTTagCompound tag) { + super.writeToNBT(tag); + + tag.setDouble("tofu", tofu); + + } + + @Override + public double getMaxTfCapacity() { + return MAX_TOFU; + } + + @Override + public double getCurrentTfConsumed() { + return 40; + } + + @Override + public void chargeTf(double amount) { + tofu = Math.max(0, Math.min(tofu+amount, MAX_TOFU)); + } + + public float getRotateStep() { + return rotateStep; + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityTrap.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityTrap.java new file mode 100644 index 0000000..6b2494e --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityTrap.java @@ -0,0 +1,133 @@ +package shift.sextiarysector.tileentity; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.tileentity.TileEntity; +import shift.sextiarysector.container.ItemBox; + +public class TileEntityTrap extends TileEntity implements ISidedInventory { + + protected ItemBox items = new ItemBox("Base", 1); + public int use = 0; + public boolean isGrass = false; + protected static final int[] material = new int[] { 0 }; + + @Override + public void readFromNBT(NBTTagCompound par1nbtTagCompound) { + super.readFromNBT(par1nbtTagCompound); + items.readFromNBT(par1nbtTagCompound); + } + + @Override + public void writeToNBT(NBTTagCompound par1nbtTagCompound) { + super.writeToNBT(par1nbtTagCompound); + items.writeToNBT(par1nbtTagCompound); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + writeToNBT(nbt); + return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 1, nbt); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + readFromNBT(pkt.func_148857_g()); + //this.worldObj.func_147479_m(xCoord, yCoord, zCoord); + this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } + + //IInventory髢「菫 + @Override + public int getSizeInventory() { + return items.getSizeInventory(); + } + + @Override + public ItemStack getStackInSlot(int i) { + return items.getStackInSlot(i); + } + + @Override + public ItemStack decrStackSize(int i, int j) { + return items.decrStackSize(i, j); + } + + @Override + public ItemStack getStackInSlotOnClosing(int i) { + return items.getStackInSlotOnClosing(i); + } + + @Override + public void setInventorySlotContents(int i, ItemStack itemstack) { + items.setInventorySlotContents(i, itemstack); + } + + @Override + public boolean hasCustomInventoryName() { + return false; + } + + @Override + public int getInventoryStackLimit() { + return items.getInventoryStackLimit(); + } + + @Override + public void markDirty() { + super.markDirty(); + items.onInventoryChanged(); + } + + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) { + return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : entityplayer + .getDistanceSq(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D) <= 64.0D; + } + + @Override + public void openInventory() { + } + + @Override + public void closeInventory() { + } + + /*蜈・繧後k*/ + @Override + public boolean isItemValidForSlot(int i, ItemStack itemstack) { + + return false; + } + + //ISidedInventory髢「菫 + //0 邏譚 ,1 辯譁 ,2 螳梧仙刀 ,3 邏譚舌ョ繧ウ繝ウ繝繝 ,4 遨コ縺ョ繝懊ヨ繝ォ , 5 豸イ菴薙ョ蜈・縺」縺溘懊ヨ繝ォ + @Override + public int[] getAccessibleSlotsFromSide(int var1) { + + return material; + } + + @Override + public boolean canInsertItem(int i, ItemStack itemstack, int j) { + return this.isItemValidForSlot(i, itemstack); + } + + @Override + public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) + { + return true; + } + + @Override + public String getInventoryName() { + return "ss.trap"; + } + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityWindmill.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityWindmill.java index 4488283..0b8a9ce 100644 --- a/src/main/java/shift/sextiarysector/tileentity/TileEntityWindmill.java +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityWindmill.java @@ -1,9 +1,11 @@ package shift.sextiarysector.tileentity; import net.minecraft.tileentity.TileEntity; -import shift.sextiarysector.api.machine.energy.IEnergyHandler; +import net.minecraftforge.common.util.ForgeDirection; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceHandler; +import shift.sextiarysector.api.gearforce.tileentity.IGearForceGrid; -public class TileEntityWindmill extends TileEntityDirection{ +public class TileEntityWindmill extends TileEntityDirection implements IGearForceHandler ,IGearForceGrid{ public float rotateStep = 0; @@ -24,6 +26,11 @@ public void updateEntity() public void updateClientEntity() { + + if(!this.isWork()){ + return; + } + if(this.rotateStep>360){ this.rotateStep-=360; } @@ -35,15 +42,84 @@ public void updateClientEntity() public void updateServerEntity() { TileEntity t =this.worldObj.getTileEntity(xCoord-this.direction.offsetX, yCoord-this.direction.offsetY, zCoord-this.direction.offsetZ); - if(t!=null && t instanceof IEnergyHandler){ + if(t!=null && t instanceof IGearForceHandler && this.isWork()){ - ((IEnergyHandler)t).addEnergy(this.direction, 2, 20, false); + ((IGearForceHandler)t).addEnergy(this.direction, 2, 20, false); } } + boolean isWork(){ + + ForgeDirection d1 = this.getDirection().getRotation(ForgeDirection.UP); + + int ra1 = 3; + for(int i=ra1*-1;i<=ra1;i++){ + + int ra2 = 3; + for(int j=ra2*-1;j<=ra2;j++){ + int x = xCoord + d1.offsetX * j; + int y = yCoord + i; + int z = zCoord + d1.offsetZ * j; + + if(i==0&& j == 0)continue; + + if(!this.worldObj.isAirBlock(x, y, z))return false; + + } + + } + + return true; + } + public float getRotateStep() { return -rotateStep; } + @Override + public int addEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + return 0; + } + + @Override + public int drawEnergy(ForgeDirection from, int power, int speed,boolean simulate) { + return 0; + } + + @Override + public boolean canInterface(ForgeDirection from) { + return this.direction.getOpposite().ordinal() == from.ordinal(); + } + + @Override + public int getPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxPowerStored(ForgeDirection from) { + return 0; + } + + @Override + public int getMaxSpeedStored(ForgeDirection from) { + return 0; + } + + @Override + public boolean canIn(ForgeDirection direction) { + return false; + } + + @Override + public boolean canOut(ForgeDirection direction) { + return this.direction.getOpposite().ordinal() == direction.ordinal(); + } + } diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityWood.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityWood.java new file mode 100644 index 0000000..5dcfdcd --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityWood.java @@ -0,0 +1,5 @@ +package shift.sextiarysector.tileentity; + +public class TileEntityWood extends TileEntityFarmland{ + +} diff --git a/src/main/java/shift/sextiarysector/tileentity/TileEntityWoodenGutter.java b/src/main/java/shift/sextiarysector/tileentity/TileEntityWoodenGutter.java new file mode 100644 index 0000000..66e7387 --- /dev/null +++ b/src/main/java/shift/sextiarysector/tileentity/TileEntityWoodenGutter.java @@ -0,0 +1,5 @@ +package shift.sextiarysector.tileentity; + +public class TileEntityWoodenGutter extends TileEntityDirection { + +} diff --git a/src/main/java/shift/sextiarysector/world/biome/BiomeGenMagicDesert.java b/src/main/java/shift/sextiarysector/world/biome/BiomeGenMagicDesert.java new file mode 100644 index 0000000..d6b0baa --- /dev/null +++ b/src/main/java/shift/sextiarysector/world/biome/BiomeGenMagicDesert.java @@ -0,0 +1,33 @@ +package shift.sextiarysector.world.biome; + +import java.awt.Color; + +import net.minecraft.world.biome.BiomeGenDesert; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BiomeGenMagicDesert extends BiomeGenDesert{ + + public BiomeGenMagicDesert(int p_i1977_1_) { + super(p_i1977_1_); + } + + @SideOnly(Side.CLIENT) + public int getSkyColorByTemp(float p_76731_1_) + { + p_76731_1_ /= 3.0F; + + if (p_76731_1_ < -1.0F) + { + p_76731_1_ = -1.0F; + } + + if (p_76731_1_ > 1.0F) + { + p_76731_1_ = 1.0F; + } + + return Color.getHSBColor(0.62222224F - p_76731_1_ * 0.05F, 0.5F + p_76731_1_ * 0.1F, 1.0F).getRGB(); + } + +} diff --git a/src/main/java/shift/sextiarysector/world/generator/WorldGenSpringWater.java b/src/main/java/shift/sextiarysector/world/generator/WorldGenSpringWater.java new file mode 100644 index 0000000..0168fdd --- /dev/null +++ b/src/main/java/shift/sextiarysector/world/generator/WorldGenSpringWater.java @@ -0,0 +1,63 @@ +package shift.sextiarysector.world.generator; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + +public class WorldGenSpringWater extends WorldGenerator{ + + private Block water; + + public WorldGenSpringWater(Block water) + { + this.water = water; + } + + @Override + public boolean generate(World p_76484_1_, Random p_76484_2_,int x, int y, int z) { + + if(p_76484_2_.nextInt(6)!=0)return false; + + for(int i=0;i<50 && (y + i)<=255;i++){ + if(p_76484_1_.getBlock(x, y + i, z) == Blocks.dirt || p_76484_1_.getBlock(x, y + i, z) == Blocks.grass){ + y = y + i; + break; + } + } + + if(!this.canGenerate(p_76484_1_, p_76484_2_, x, y, z))return false; + + int h = 1; + + for(int i=h*-1;i<=h;i++){ + for(int j=h*-1;j<=h;j++){ + + p_76484_1_.setBlock(x+i, y, z+j, this.water); + + } + } + + System.out.println("AAA :" + x + " : "+ y + " : " + z); + + return true; + } + + private boolean canGenerate(World p_76484_1_, Random p_76484_2_,int x, int y, int z){ + + int h = 1; + + for(int i=h*-1;i<=h;i++){ + for(int j=h*-1;j<=h;j++){ + + if(p_76484_1_.getBlock(x + i, y, z + j) != Blocks.dirt && p_76484_1_.getBlock(x + i, y, z + j) != Blocks.grass)return false; + + } + } + + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/world/village/ComponentWell.java b/src/main/java/shift/sextiarysector/world/village/ComponentWell.java new file mode 100644 index 0000000..a9fc204 --- /dev/null +++ b/src/main/java/shift/sextiarysector/world/village/ComponentWell.java @@ -0,0 +1,82 @@ +package shift.sextiarysector.world.village; + +import java.util.List; +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import shift.sextiarysector.SSBlocks; + +public class ComponentWell extends StructureVillagePieces.Village{ + + public ComponentWell(){ + + } + + public ComponentWell(StructureVillagePieces.Start p_i2107_1_, int p_i2107_2_, Random p_i2106_3_, StructureBoundingBox p_i2106_4_, int p_i2106_5_) + { + super(p_i2107_1_,p_i2107_2_); + this.coordBaseMode = p_i2106_5_; + this.boundingBox = p_i2106_4_; + } + + public void buildComponent(StructureComponent p_74861_1_, List p_74861_2_, Random p_74861_3_) + { + super.buildComponent(p_74861_1_, p_74861_2_, p_74861_3_); + } + + public static Object buildComponent(StructureVillagePieces.Start startPiece,List pieces, Random random, int p1, int p2, int p3, int p4, int p5) { + + StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 4, 15, 4, p4); + return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentWell(startPiece, p5, random, structureboundingbox, p4) : null; + + } + + public boolean addComponentParts(World p_74875_1_, Random p_74875_2_, StructureBoundingBox p_74875_3_) + { + if (this.field_143015_k < 0) + { + this.field_143015_k = this.getAverageGroundLevel(p_74875_1_, p_74875_3_); + + if (this.field_143015_k < 0) + { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 3, 0); + } + + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 0, 1, 4, 12, 4, Blocks.cobblestone, SSBlocks.drinkingWater, false); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 12, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 3, 12, 2, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 2, 12, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.air, 0, 3, 12, 3, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 13, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 14, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 13, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 14, 1, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 13, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 1, 14, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 13, 4, p_74875_3_); + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.fence, 0, 4, 14, 4, p_74875_3_); + this.fillWithBlocks(p_74875_1_, p_74875_3_, 1, 15, 1, 4, 15, 4, Blocks.cobblestone, Blocks.cobblestone, false); + + for (int i = 0; i <= 5; ++i) + { + for (int j = 0; j <= 5; ++j) + { + if (j == 0 || j == 5 || i == 0 || i == 5) + { + this.placeBlockAtCurrentPosition(p_74875_1_, Blocks.gravel, 0, j, 11, i, p_74875_3_); + this.clearCurrentPositionBlocksUpwards(p_74875_1_, j, 12, i, p_74875_3_); + } + } + } + + return true; + } + +} diff --git a/src/main/java/shift/sextiarysector/world/village/VillageCreationHandlerWell.java b/src/main/java/shift/sextiarysector/world/village/VillageCreationHandlerWell.java new file mode 100644 index 0000000..c470453 --- /dev/null +++ b/src/main/java/shift/sextiarysector/world/village/VillageCreationHandlerWell.java @@ -0,0 +1,28 @@ +package shift.sextiarysector.world.village; + +import java.util.List; +import java.util.Random; + +import net.minecraft.util.MathHelper; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraft.world.gen.structure.StructureVillagePieces.PieceWeight; +import net.minecraft.world.gen.structure.StructureVillagePieces.Start; +import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler; + +public class VillageCreationHandlerWell implements IVillageCreationHandler { + + @Override + public PieceWeight getVillagePieceWeight(Random random, int i) { + return new StructureVillagePieces.PieceWeight(getComponentClass(), 22, MathHelper.getRandomIntegerInRange(random, i, i+1)); + } + + @Override + public Class getComponentClass() { + return VillageCreationHandlerWell.class; + } + + @Override + public Object buildComponent(PieceWeight villagePiece, Start startPiece,List pieces, Random random, int p1, int p2, int p3, int p4, int p5) { + return ComponentWell.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5); + } +} diff --git a/src/main/resources/assets/sextiarysector/lang/en_US.lang b/src/main/resources/assets/sextiarysector/lang/en_US.lang index 558a996..7dd2de5 100644 --- a/src/main/resources/assets/sextiarysector/lang/en_US.lang +++ b/src/main/resources/assets/sextiarysector/lang/en_US.lang @@ -2,45 +2,145 @@ #Block tile.ss.large_furnace.name=Large Furnace +tile.ss.fluid_furnace.name=Fluid Furnace + +tile.ss.food_smokers.name=Food Smokers + +tile.ss.magic_furnace.name=Magic Furnace +tile.ss.freezer.name=Freezer tile.ss.wood_grate.name=Wood Grate -tile.ss.wood_plate.name=Wood Plate +tile.ss.oak_wood_plate.name=Oak Wood Plate +tile.ss.birch_wood_plate.name=Birch Wood Plate +tile.ss.spruce_wood_plate.name=Spruce Wood Plate +tile.ss.jungle_wood_plate.name=Jungle Wood Plate +tile.ss.acacia_wood_plate.name=Acacia Wood Plate +tile.ss.big_oak_wood_plate.name=Big Oak Wood Plate + +tile.ss.iron_plate.name=Iron Plate +tile.ss.gold_plate.name=Gold Plate + +tile.ss.copper_plate.name=Copper Plate +tile.ss.zinc_plate.name=Zinc Plate +tile.ss.silver_plate.name=Silver Plate tile.ss.hole.name=Hole -tile.ss.farmland.name=farmland +tile.ss.farmland.name=Farm Land +tile.ss.paddy.name=Paddy +tile.ss.wood.name=Wood + +tile.ss.bottle.name=Fluid Bottle +tile.ss.fluid_crafter.name=Fluid Crafter +tile.ss.square.name=Wood Square + +tile.ss.tank.name=Tank +tile.ss.funnel.name=Funnel +tile.ss.copper_pipe.name=Copper Pipe + + +tile.ss.wood_hopper.name=Wood Hopper tile.ss.chunk_loader.name=Time Loader +tile.ss.figure.name=Figure + + + +tile.ss.leaf_block.name=Leaf Block + +tile.ss.trap.name=Trap + +tile.ss.leaf_bed.name=Leaf Bed + +tile.ss.drinking_water.name=Drinking Water +tile.ss.hot_springs.name=Hot Springs + + +tile.ss.blue_stone.name=Blue Stone Ore +tile.ss.yellow_stone.name=Yellow Stone Ore + +tile.ss.copper_ore.name=Copper Ore +tile.ss.zinc_ore.name=Zinc Ore +tile.ss.silver_ore.name=Silver Ore + +tile.ss.mithril_ore.name=Mithril Ore +tile.ss.orichalcum_ore.name=Orichalcum Ore + +tile.ss.coal_large_ore.name=Coal Large Ore +tile.ss.iron_large_ore.name=Iron Large Ore +tile.ss.gold_large_ore.name=Gold Large Ore + +tile.ss.silver_large_ore.name=Silver Large Ore + +tile.ss.copper_block.name=Copper Block +tile.ss.zinc_block.name=Zinc Block +tile.ss.silver_block.name=Silver Block +tile.ss.steel_block.name=Steel Block +tile.ss.brass_block.name=Brass Block +tile.ss.ninja_block.name=Ninja Block +tile.ss.mithril_block.name=Mithril Block +tile.ss.orichalcum_block.name=Orichalcum Block + + tile.ss.small_windmill.name=Small Windmill tile.ss.windmill.name=Windmill +tile.ss.large_windmill.name=Large Windmill +tile.ss.small_waterwheel.name=Small Waterwheel +tile.ss.steam_motor.name=Steam Motor tile.ss.wood_shaft.name=Wood Shaft tile.ss.stone_shaft.name=Stone Shaft +tile.ss.steel_shaft.name=Steel Shaft +tile.ss.ninja_shaft.name=Ninja Shaft +tile.ss.orichalcum_shaft.name=Orichalcum Shaft tile.ss.wood_gear_box.name=Wood Gear Box tile.ss.stone_gear_box.name=Stone Gear Box +tile.ss.steel_gear_box.name=Steel Gear Box +tile.ss.ninja_gear_box.name=Ninja Gear Box +tile.ss.orichalcum_gear_box.name=Orichalcum Gear Box tile.ss.wood_gf_tank.name=Wood GF Tank tile.ss.stone_gf_tank.name=Stone GF Tank +tile.ss.steel_gf_tank.name=Steel GF Tank +tile.ss.ninja_gf_tank.name=Ninja GF Tank +tile.ss.orichalcum_gf_tank.name=Orichalcum GF Tank + +tile.ss.wood_stone_gear_shaft.name=Wood Stone Gear Shaft +tile.ss.stone_steel_gear_shaft.name=Stone Steel Gear Shaft +tile.ss.steel_ninja_gear_shaft.name=Steel Ninja Gear Shaft +tile.ss.ninja_orichalcum_gear_shaft.name=Ninja Orichalcum Gear Shaft +tile.ss.machine_frame.name=Machine Frame tile.ss.millstone.name=Millstone -tile.ss.loom.name=loom +tile.ss.loom.name=Loom +tile.ss.sawmill.name=Sawmill +tile.ss.spinning_machine.name=Spinning Machine +tile.ss.pulverizer.name=Pulverizer +tile.ss.extractor.name=Extractor +tile.ss.rolling_machine.name=Rolling Machine +tile.ss.mana_squeezer.name=Mana Squeezer +tile.ss.time_machine.name=Time Machine -tile.ss.blue_stone.name=Blue Stone Ore -tile.ss.yellow_stone.name=Yellow Stone Ore -tile.ss.coal_large_ore.name=Coal Large Ore +tile.ss.fan.name=Fan +tile.ss.saw.name=Saw +tile.ss.pump.name=Pump +tile.ss.suction_machine.name=Suction Machine + tile.ss.creeper_chest.name=Creeper Monger Chest tile.ss.shipping_box.name=Shipping Box tile.ss.turnip.name=Turnip Seed tile.ss.cucumber.name=Cucumber Seed +tile.ss.iron_turnip.name=Iron Turnip Seed tile.ss.onion.name=Onion Seed tile.ss.tomato.name=Tomato Seed tile.ss.corn.name=Corn Seed +tile.ss.golden_corn.name=Golden Corn Seed tile.ss.eggplant.name=Eggplant Seed tile.ss.sweet_potato.name=Sweet Potato Seed @@ -48,30 +148,51 @@ tile.ss.green_pepper.name=Green Pepper Seed tile.ss.radish.name=Radish Seed -tile.ss.monitor.name=Monitor -monitor.type=Type -monitor.creeper=Simple Creeper Shop -monitor.robot=Blue Robot Shop +tile.ss.rice.name=Rice Seed -#Item -item.ss.dust_waterlily.name=WaterLily Dust +tile.ss.mushroom_red.name=Red Mushroom Seed +tile.ss.shiitake.name=Shiitake Seed -item.ss.stone_dust.name=Stone Dust -item.ss.dust_blue_stone.name=Blue Stone Dust -item.ss.dust_yellow_stone.name=Yellow Stone Dust +tile.ss.sandpit.name=Sandpit -item.ss.coal_dust.name=Coal Dust +tile.ss.boarding_buoy.name=Boarding Buoy +tile.ss.powered_buoy.name=Powered Buoy +tile.ss.detector_buoy.name=Detector Buoy + +tile.ss.monitor.name=Monitor +monitor.type=Type +monitor.creeper=Simple Creeper Shop +monitor.robot=Blue Robot Shop -item.ss.blue_stone_slime_ball.name=Blue Stone Slime Ball +tile.ss.electric_motor.name=Electric Motor +tile.ss.tofu_motor.name=Tofu Motor +tile.ss.gf_dynamo.name=GF Dynamo +#Item item.ss.unit.name=Unit item.ss.wood_gear.name=Wood Gear +item.ss.stone_gear.name=Stone Gear +item.ss.steel_gear.name=Steel Gear +item.ss.ninja_gear.name=Ninja Gear +item.ss.orichalcum_gear.name=Orichalcum Gear + item.ss.wood_unit_gear.name=Wood Unit Gear +item.ss.stone_unit_gear.name=Stone Unit Gear +item.ss.steel_unit_gear.name=Steel Unit Gear +item.ss.ninja_unit_gear.name=Ninja Unit Gear +item.ss.orichalcum_unit_gear.name=Orichalcum Unit Gear + +item.ss.wood_gf_storage.name=Wood GF Storage +item.ss.stone_gf_storage.name=Stone GF Storage +item.ss.steel_gf_storage.name=Steel GF Storage +item.ss.ninja_gf_storage.name=Ninja GF Storage +item.ss.orichalcum_gf_storage.name=Orichalcum GF Storage item.ss.hammer.name=Hammer -item.ss.calendar.name=Calendar +item.ss.iron_spanner.name=Iron Spanner +item.ss.color_spray.name=Color Spray item.ss.calendar.name=Calendar item.ss.season_stone.name=Season Stone @@ -80,9 +201,93 @@ item.ss.season_stone_summer.name=Season Stone -Summer- item.ss.season_stone_autumn.name=Season Stone -Autumn- item.ss.season_stone_winter.name=Season Stone -Winter- -item.ss.wood_gf_storage.name=Wood GF Storage +item.ss.leaf_bed.name=Leaf Bed + + +item.ss.leaf.name=Leaf + +item.ss.dust_waterlily.name=WaterLily Dust + +item.ss.stone_dust.name=Stone Dust + +item.ss.dust_blue_stone.name=Blue Stone Dust +item.ss.dust_yellow_stone.name=Yellow Stone Dust + +item.ss.coal_dust.name=Coal Dust +item.ss.iron_dust.name=Iron Dust +item.ss.gold_dust.name=Gold Dust +item.ss.diamond_dust.name=Diamond Dust + +item.ss.copper_dust.name=Copper Dust +item.ss.zinc_dust.name=Zinc Dust +item.ss.silver_dust.name=Silver Dust + +item.ss.mithril_dust.name=Mithril Dust + + +item.ss.iron_nugget.name=Iron Nugget +item.ss.copper_nugget.name=Copper Nugget +item.ss.zinc_nugget.name=Zinc Nugget +item.ss.silver_nugget.name=Silver Nugget + +item.ss.steel_nugget.name=Steel Nugget +item.ss.ninja_nugget.name=Ninja Nugget + +item.ss.obsidian_nugget.name=Obsidian Nugget + + +item.ss.steel_ingot.name=Steel Ingot +item.ss.brass_ingot.name=Brass Ingot + +item.ss.bluestone_ingot.name=Blue Stone Ingot +item.ss.yellowstone_ingot.name=Yellow Stone Ingot + +item.ss.copper_ingot.name=Copper Ingot +item.ss.zinc_ingot.name=Zinc Ingot +item.ss.silver_ingot.name=Silver Ingot + +item.ss.mithril_ingot.name=Mithril Ingot +item.ss.orichalcum_gem.name=Orichalcum + +item.ss.ninja_ingot.name=Ninja Ingot -item.ss.drinking_water_small_bottle.name=Drinking Water Small Bottle +item.ss.red_gel.name=Red Stone Gel +item.ss.blue_gel.name=Blue Stone Gel +item.ss.yellow_gel.name=Yellow Stone Gel + + +item.ss.craft_reactor.name=Craft Reactor +item.ss.energy_reactor.name=Energy Reactor +item.ss.object_reactor.name=Object Reactor + + + +item.ss.empty_bottle.name=Empty Bottle +item.ss.water_bottle.name=Water Bottle +item.ss.lava_bottle.name=Lava Bottle +item.ss.sap_bottle.name=Sap Bottle + +item.ss.steam_bucket.name=Steam Bucket +item.ss.iron_fluid_bucket.name=Iron Fluid Bucket +item.ss.gold_fluid_bucket.name=Gold Fluid Bucket + +item.ss.magic_dust.name=Magic Dust + + +item.ss.silk_bobbin.name=Silk Bobbin +item.ss.silk_cloth.name=Silk Cloth +item.ss.small_cloth.name=Small Cloth +item.ss.canvas.name=Canvas +item.ss.drying_flesh.name=Drying Flesh +item.ss.flesh_bobbin.name=Flesh Bobbin +item.ss.string_mass.name=String Mass +item.ss.strong_string.name=Strong String +item.ss.strong_string_bobbin.name=Strong String Bobbin +item.ss.strong_cloth.name=Strong Cloth +item.ss.strong_canvas.name=Strong Canvas + + +item.ss.figure_box.name=Figure Box item.ss.wood_scoop.name=Wood Scoop @@ -91,8 +296,58 @@ item.ss.iron_scoop.name=Iron Scoop item.ss.gold_scoop.name=Gold Scoop item.ss.diamond_scoop.name=Diamond Scoop +item.ss.brass_scoop.name=Brass Scoop + + + +item.ss.wood_knife.name=Wood Knife +item.ss.stone_knife.name=Stone Knife +item.ss.iron_knife.name=Iron Knife +item.ss.gold_knife.name=Gold Knife +item.ss.diamond_knife.name=Diamond Knife + +item.ss.brass_knife.name=Brass Knife + + +item.ss.copper_shovel.name=Copper Shovel +item.ss.copper_pickaxe.name=Copper Pickaxe +item.ss.copper_axe.name=Copper Axe +item.ss.copper_sword.name=Copper Sword +item.ss.copper_hoe.name=Copper Hoe + +item.ss.brass_shovel.name=Brass Shovel +item.ss.brass_pickaxe.name=Brass Pickaxe +item.ss.brass_axe.name=Brass Axe +item.ss.brass_sword.name=Brass Sword +item.ss.brass_hoe.name=Brass Hoe + +item.ss.ninja_shovel.name=Ninja Shovel +item.ss.ninja_pickaxe.name=Ninja Pickaxe +item.ss.ninja_axe.name=Ninja Axe +item.ss.ninja_sword.name=Ninja Sword +item.ss.ninja_hoe.name=Ninja Hoe + + +item.ss.copper_helmet.name=Copper Helmet +item.ss.copper_chestplate.name=Copper Chestplate +item.ss.copper_leggings.name=Copper Leggings +item.ss.copper_boots.name=Copper Boots + +item.ss.ninja_helmet.name=Ninja Helmet +item.ss.ninja_chestplate.name=Ninja Chestplate +item.ss.ninja_leggings.name=Ninja Leggings +item.ss.ninja_boots.name=Ninja Boots + item.ss.wood_watering_can.name=Wood Watering Can +item.ss.brass_shears.name=Brass Shears + +item.ss.mineboat_chest.name=Mineboat Chest +item.ss.mineboat_tank.name=Mineboat Tank + +item.ss.laver.name=Laver + + item.ss.crop.big=Big item.ss.turnip.name=Turnip @@ -110,26 +365,150 @@ item.ss.eggplant.name=Eggplant item.ss.sweet_potato.name=Sweet Potato item.ss.green_pepper.name=Green Pepper +item.ss.blue_potato.name=Blue Potato + item.ss.radish.name=Radish +item.ss.rice.name=Rice + +item.ss.shiitake.name=Shiitake + + +item.ss.squid_sashimi.name=Squid Sashimi + +item.ss.white_rice.name=White Rice + +item.ss.salt.name=Salt +item.ss.curry_powder.name=Curry Powder + +item.ss.laver_roasted.name=Laver Roasted + +item.ss.chicken_smoked.name=Smoked Chicken +item.ss.porkchop_smoked.name=Smoked Porkchop +item.ss.beef_smoked.name=Smoked Beef + +item.ss.rice_ball.name=Rice Ball +item.ss.curry_rice.name=Curry Rice + +item.ss.carrot_soup.name=Carrot Soup +item.ss.corn_soup.name=Corn Soup +item.ss.egg_soup.name=Egg Soup +item.ss.mushroom_stew.name=Mushroom Stew +item.ss.onion_soup.name=Onion Soup +item.ss.ender_soup.name=Ender Soup +item.ss.tomato_soup.name=Tomato Soup + +item.ss.chocolate.name=Chocolate + +item.ss.drinking_water_bottle.name=Drinking Water Bottle +item.ss.takumi_tea_bottle.name=TAKUMI Tea Bottle + + + item.ss.shift_hat.name=Shift's Hat +item.ss.rucksack.name=Rucksack +item.ss.oxygen_tank.name=Oxygen Tank +item.ss.gf_contact_lenses.name=GF Contact Lenses +item.ss.water_contact_lenses.name=Water Contact Lenses + +item.ss.craft_unit.name=Craft Unit +item.ss.attack_unit.name=Attack Unit +item.ss.defense_unit.name=Defense Unit +item.ss.attack_rust_unit.name=Attack Rust Unit +item.ss.defense_rust_unit.name=Defense Rust Unit +item.ss.jump_unit.name=Jump Unit +item.ss.bed_monster_unit.name=Bed Monster Unit +item.ss.pickaxe_unit.name=Pickaxe Unit + +item.ss.debug_unit.name=Debug Unit + + +item.ss.iron_ring.name=Iron Ring +item.ss.creeper_ring.name=Creeper Shop Ring +item.ss.mp_ring.name=MP Ring +item.ss.xp_ring.name=XP Ring + + + +item.ss.magic_contact_lenses.name=Magic Contact Lenses + +#Fluid +fluid.ss.takumi_tea=TAKUMI Tea +fluid.ss.drinking_water=Drinking Water +fluid.ss.spring_water=Spring Water +fluid.ss.hot_springs=Hot Springs +fluid.ss.steam=Steam +fluid.ss.mana=Mana +fluid.ss.oxygen=Oxygen +fluid.ss.sap=Sap + +fluid.ss.iron=Iron Fluid +fluid.ss.gold=Gold Fluid + +fluid.ss.black=Black +fluid.ss.red=Red +fluid.ss.green=Green +fluid.ss.brown=Brown +fluid.ss.blue=Blue +fluid.ss.purple=Purple +fluid.ss.cyan=Cyan +fluid.ss.lightgray=LightGray +fluid.ss.gray=Gray +fluid.ss.pink=Pink +fluid.ss.lime=Lime +fluid.ss.yellow=Yellow +fluid.ss.lightblue=LightBlue +fluid.ss.magenta=Magenta +fluid.ss.orange=Orange +fluid.ss.white=White + +#Potion +ss.potion.burn=Burn +ss.potion.hot_springs=Hot Springs #GUI container.large_furnace=Large Furnace container.sub.inventory=Buffer +container.mineboat_chest=Mineboat Chest + +gui.ss.fluid_furnace=Fluid Furnace +gui.ss.food_smokers=Food Smokers +gui.ss.magic_furnace=Magic Furnace +gui.ss.freezer=Freezer +gui.ss.funnel=Fluid Funnel + +gui.ss.shipping_box=Shipping Box + + +gui.ss.rucksack=Rucksack + +gui.ss.steam_motor=Steam Motor + gui.ss.millstone=Millstone gui.ss.loom=Loom +gui.ss.sawmill=Sawmill +gui.ss.spinning_machine=Spinning Machine +gui.ss.extractor=Extractor +gui.ss.pulverizer=Pulverizer +gui.ss.rolling_machine=Rolling Machine +gui.ss.mana_squeezer=Mana Squeezer +gui.ss.time_machine=Time Machine gui.ss.gf_tank_1=Wood GF Tank gui.ss.gf_tank_2=Stone GF Tank +gui.ss.gf_tank_3=Steel GF Tank +gui.ss.gf_tank_4=Ninja GF Tank +gui.ss.gf_tank_5=Orichalcum GF Tank +#Shop shop.ss.creeper=Simple Creeper Shop -shop.ss.robot=Blue Robot Shop +shop.ss.robot=Red Robot Shop #ToolTip tooltip.season.pm=PM tooltip.season.am=AM +tooltip.season.day=Day tooltip.season=Season tooltip.season.seed=Season @@ -138,32 +517,299 @@ tooltip.season.summer=Summer tooltip.season.autumn=Autumn tooltip.season.winter=Winter +tooltip.name=Name +tooltip.edition=Edition + +#Edition +edition.creative=CreativeTab +edition.achievement=Achievement +edition.figure_beginner=Figure Beginner +edition.ore_festival=Ore Festival + +edition.schr0_cleaver=Schr0 Cleaver + #Tab itemGroup.ss.core=SextiarySector -Core- -itemGroup.ss.machine=SextiarySector -Machine- +itemGroup.ss.fluid=SextiarySector -Fluid- +itemGroup.ss.player=SextiarySector -Player- itemGroup.ss.agriculture=SextiarySector -Agriculture- +itemGroup.ss.fishery=SextiarySector -Fishery- +itemGroup.ss.mining=SextiarySector -Mining- +itemGroup.ss.industry=SextiarySector -Industry- +itemGroup.ss.cooking=SextiarySector -Cooking- +itemGroup.ss.transport=SextiarySector -Transport- itemGroup.ss.economy=SextiarySector -Economy- +itemGroup.ss.magic=SextiarySector -Magic- + +#Player Tab +player.tab.vanilla=Vanilla +player.tab.equipment=Equipment +player.tab.item.ss.craft_unit=Craft + +player.tab.item.ss.rucksack=Rucksack + +player.tab.item.ss.creeper_ring=Creeper Shop #Achievement stat.sell=Sell -achievement.ss.economy=SextiarySector -Economy- +achievement.ss.core=SS2 -Core- + +achievement.ss.moisture=Moisture +achievement.ss.moisture.desc=Let the hydration +achievement.ss.moisture.desc2=Slippery skin + +achievement.ss.bottle=Bottle +achievement.ss.bottle.desc=Craft a bottle +achievement.ss.bottle.desc2=Strengthening bottle + +achievement.ss.drinking_water=Drinking Water +achievement.ss.drinking_water.desc=Smelting a water bottle +achievement.ss.drinking_water.desc2=Delicious ! + +achievement.ss.craft_furnace=Craft Furnace +achievement.ss.craft_furnace.desc=Craft a large furnace +achievement.ss.craft_furnace.desc2=Complex craft + +achievement.ss.hammer=Hammer ! +achievement.ss.hammer.desc=Craft a large hammer +achievement.ss.hammer.desc2=invincible ? + +achievement.ss.fluid_furnace=Melted +achievement.ss.fluid_furnace.desc=Craft a fluid furnace +achievement.ss.fluid_furnace.desc2=It melts in touch + +achievement.ss.freezer=Latest refrigerator +achievement.ss.freezer.desc=Craft a freezer +achievement.ss.freezer.desc2=It's ... + + +achievement.ss.agriculture=SS2 -Agriculture- + +achievement.ss.data=Crop Data + +achievement.ss.seed=First Seed +achievement.ss.seed.desc=Buy a seed +achievement.ss.seed.desc2=Increase + +achievement.ss.scoop=Scoop +achievement.ss.scoop.desc=Craft a scoop +achievement.ss.scoop.desc2=Friendly touch + +achievement.ss.farmland=Farmland +achievement.ss.farmland.desc=Use a scoop to vanilla farmland +achievement.ss.farmland.desc2=Strong ! + +achievement.ss.watering_can=Watering Can +achievement.ss.watering_can.desc=Craft a watering can +achievement.ss.watering_can.desc2=The spear fun water + +achievement.ss.hole=Hole +achievement.ss.hole.desc=Use a scoop to dirt +achievement.ss.hole.desc2=The Who is a hole here ? + +achievement.ss.paddy=Paddy +achievement.ss.paddy.desc=Use a water bucket to hole +achievement.ss.paddy.desc2=Grow rice ! + +## +achievement.ss.turnip=Turnip +achievement.ss.turnip.desc=Pickup a turnip + +achievement.ss.iron_turnip=Iron Turnip +achievement.ss.iron_turnip.desc=Pickup a iron turnip + +achievement.ss.cucumber=Cucumber +achievement.ss.cucumber.desc=Pickup a cucumber + + +achievement.ss.onion=Onion +achievement.ss.onion.desc=Pickup a onion -achievement.creeper_firework=Creeper Monger -achievement.creeper_firework.desc=The attempt to communicate with fireworks ! +achievement.ss.tomato=Tomato +achievement.ss.tomato.desc=Pickup a tomato -achievement.creeper_chest=Creeper Chest -achievement.creeper_chest.desc=Santa Creeper ? +achievement.ss.corn=Corn +achievement.ss.corn.desc=Pickup a corn -achievement.shipping=Shipping Block -achievement.shipping.desc=Trying to shipment +achievement.ss.golden_corn=Golden Corn +achievement.ss.golden_corn.desc=Pickup a golden corn + + +achievement.ss.eggplant=Eggplant +achievement.ss.eggplant.desc=Pickup a eggplant + +achievement.ss.sweet_potato=Sweet Potato +achievement.ss.sweet_potato.desc=Pickup a sweet potato + +achievement.ss.green_pepper=Green Pepper +achievement.ss.green_pepper.desc=Pickup a green pepper + + +achievement.ss.radish=Radish +achievement.ss.radish.desc=Pickup a radish + + +achievement.ss.rice=Rice +achievement.ss.rice.desc=Pickup a rice + +achievement.ss.shiitake=Shiitake +achievement.ss.shiitake.desc=Pickup a shiitake + +achievement.ss.mining=SS2 -Mining- + +achievement.ss.bluestone_dust=Color is different ! +achievement.ss.bluestone_dust.desc=Pickup a bluestone dust +achievement.ss.bluestone_dust.desc2=Beautiful ! + +achievement.ss.copper_ore=New ore +achievement.ss.copper_ore.desc=Pickup a copper ore +achievement.ss.copper_ore.desc2=Three + +achievement.ss.silver_ore=Assassination prevention +achievement.ss.silver_ore.desc=Pickup a silver ore +achievement.ss.silver_ore.desc2=Photo ? + +achievement.ss.mithril_ore=Beginning of the magic +achievement.ss.mithril_ore.desc=Pickup a mithril ore +achievement.ss.mithril_ore.desc2=Ring ? + +achievement.ss.industry=SS2 -Industry- + +achievement.ss.blue_gel=Mysterious gel +achievement.ss.blue_gel.desc=Craft a blue gel +achievement.ss.blue_gel.desc2=How nice + + +achievement.ss.wood_gear=New power +achievement.ss.wood_gear.desc=Craft a wood gear +achievement.ss.wood_gear.desc2=Its name GF ! + +achievement.ss.small_windmill=Force of the wind +achievement.ss.small_windmill.desc=Craft a small windmill +achievement.ss.small_windmill.desc2=It's a good wind + +achievement.ss.millstone=The machine +achievement.ss.millstone.desc=Craft a millstone +achievement.ss.millstone.desc2=Flour I ish + +achievement.ss.loom=Cloth ! +achievement.ss.loom.desc=Craft a loom +achievement.ss.loom.desc2=It is rid from naked! + + +achievement.ss.stone_gear=Power ups +achievement.ss.stone_gear.desc=Craft a stone gear +achievement.ss.stone_gear.desc2=Even stone ? + +achievement.ss.windmill=Updraft +achievement.ss.windmill.desc=Craft a windmill +achievement.ss.windmill.desc2=Crying wind + +achievement.ss.small_waterwheel=The power of water +achievement.ss.small_waterwheel.desc=Craft a small waterwheel +achievement.ss.small_waterwheel.desc2=Do not close the lava ! + +achievement.ss.sawmill=Blade ? +achievement.ss.sawmill.desc=Craft a sawmill +achievement.ss.sawmill.desc2=Let dismantling together ! + +achievement.ss.spinning_machine=Small industrial +achievement.ss.spinning_machine.desc=Craft a spinning machine +achievement.ss.spinning_machine.desc2=Let the String Figure + + +achievement.ss.steel_gear=The power of steel +achievement.ss.steel_gear.desc=Craft a steel gear +achievement.ss.steel_gear.desc2=Coal shortage ? + +achievement.ss.steam_motor=The power of steam +achievement.ss.steam_motor.desc=Craft a small steam motor +achievement.ss.steam_motor.desc2=Industrial revolution + +achievement.ss.large_windmill=Large windmill Small 窶ヲ +achievement.ss.large_windmill.desc=Craft a small large windmill +achievement.ss.large_windmill.desc2=Large force + +achievement.ss.pulverizer=Industrial era +achievement.ss.pulverizer.desc=Craft a pulverizer +achievement.ss.pulverizer.desc2=Double it ! + +achievement.ss.extractor=Near future +achievement.ss.extractor.desc=Craft a extractor +achievement.ss.extractor.desc2=Purification equipment ? + +achievement.ss.fan=Oh ~ ~ ~ +achievement.ss.fan.desc=Craft a fan +achievement.ss.fan.desc2=Blue flame ? + +achievement.ss.saw=Block Breaker +achievement.ss.saw.desc=Craft a saw +achievement.ss.saw.desc2=Just destroy + +achievement.ss.ninja_gear=The power of mystery ? +achievement.ss.ninja_gear.desc=Craft a ninja gear +achievement.ss.ninja_gear.desc2=Japan ! + +achievement.ss.rolling_machine=Cutting board +achievement.ss.rolling_machine.desc=Craft a rolling machine +achievement.ss.rolling_machine.desc2=Pretty it's cutting board ! + +achievement.ss.mana_squeezer=Blessing of the earth +achievement.ss.mana_squeezer.desc=Craft a mana squeezer +achievement.ss.mana_squeezer.desc2=Automation of agriculture ? + +achievement.ss.orichalcum_gear=The power of mystery ! +achievement.ss.orichalcum_gear.desc=Craft a orichalcum gear +achievement.ss.orichalcum_gear.desc2=End content + +achievement.ss.time_machine=Time Machine +achievement.ss.time_machine.desc=Craft a time machine +achievement.ss.time_machine.desc2=World line is different ! + +achievement.ss.economy=SS2 -Economy- + +achievement.ss.creeper_firework=Creeper Monger +achievement.ss.creeper_firework.desc=The attempt to communicate with fireworks +achievement.ss.creeper_firework.desc2=Explosion ! + +achievement.ss.creeper_chest=Creeper Chest +achievement.ss.creeper_chest.desc=Let's go to bed in a separate +achievement.ss.creeper_chest.desc2=Santa Creeper ? + +achievement.ss.shipping=Shipping Block +achievement.ss.shipping.desc=Trying to shipment +achievement.ss.shipping.desc2=I'm millionaire ! + +#Dep +dep.ss.error1= was unable to download required library +dep.ss.error2= . +dep.ss.error3=Check your internet connection and try restarting or download it manually from +dep.ss.error4= and put it in your mods folder #NEI nei.recipe=Recipes nei.ss.furnace.shaped=Furnace Shaped nei.ss.furnace.shapeless=Furnace Shapeless +nei.ss.fluid_furnace=Fluid Furnace Recipe +nei.ss.food_smokers=Food Smokers Recipe + +nei.ss.magic_furnace=Magic Furnace Recipe +nei.ss.magic_fuel=Magic Fuel + +nei.ss.freezer=Freezer Recipe +nei.ss.ice=fuel=Ice Fuel + nei.ss.millstone=Millstone Recipe nei.ss.loom=Loom Recipe - -nei.ss.fertilizer=Mutation Recipe +nei.ss.sawmill=Sawmill Recipe +nei.ss.spinning_machine=Spinning Machine Recipe +nei.ss.extractor=Extractor Recipe +nei.ss.pulverizer=Pulverizer Recipe +nei.ss.rolling_machine=Rolling Machine Recipe +nei.ss.mana_squeezer=Mana Squeezer Recipe +nei.ss.time_machine=Time Machine Recipe + +nei.ss.fertilizer_farmland=Farmland Mutation Recipe +nei.ss.fertilizer_paddy=Paddy Mutation Recipe diff --git a/src/main/resources/assets/sextiarysector/lang/fr_FR.lang b/src/main/resources/assets/sextiarysector/lang/fr_FR.lang new file mode 100644 index 0000000..485977c --- /dev/null +++ b/src/main/resources/assets/sextiarysector/lang/fr_FR.lang @@ -0,0 +1,287 @@ +#French fr_FR + +#Block +tile.ss.large_furnace.name=Grand four +tile.ss.fluid_furnace.name=Four テ fluide + +tile.ss.food_smokers.name=Fumoire + +tile.ss.magic_furnace.name=Four magique + +tile.ss.wood_grate.name=Grille en bois + +tile.ss.wood_plate.name=Assiette en bois + +tile.ss.hole.name=Trou +tile.ss.farmland.name=Terre agricole + +tile.ss.bottle.name=Bouteille de fluide +tile.ss.fluid_crafter.name=Etabli de fluide + +tile.ss.wood_hopper.name=Trテゥmie en bois + +tile.ss.chunk_loader.name=Chargeur de temps + + +tile.ss.small_windmill.name=Petite テゥolienne +tile.ss.windmill.name=テ頴lienne +tile.ss.small_waterwheel.name=Petite noria + +tile.ss.wood_shaft.name=Puits en bois +tile.ss.stone_shaft.name=Puits en pierre +tile.ss.steel_shaft.name=Puits en acier + +tile.ss.wood_gear_box.name=Boテョte de mテゥcanisme en bois +tile.ss.stone_gear_box.name=Boテョte de mテゥcanisme en pierre +tile.ss.steel_gear_box.name=Boテョte de mテゥcanisme en acier + +tile.ss.wood_gf_tank.name=Rテゥservoir GF en bois +tile.ss.stone_gf_tank.name=Rテゥservoir GF en pierre +tile.ss.steel_gf_tank.name=Rテゥservoir GF en acier + +tile.ss.wood_stone_gear_shaft.name=Puits mテゥcanique en pierre et en bois + +tile.ss.millstone.name=Meule +tile.ss.loom.name=Mテゥtier テ tisser +tile.ss.sawmill.name=Scierie +tile.ss.pulverizer.name=Pulvテゥriseur + +tile.ss.fan.name=Ventilateur + +tile.ss.blue_stone.name=Minerai de pierre bleue +tile.ss.yellow_stone.name=Minerai de pierre jaune + +tile.ss.mithril_ore.name=Minerai de mithril +tile.ss.orichalcum_ore.name=Minerai d'orichalcum + +tile.ss.coal_large_ore.name=Grand minerai de charbon +tile.ss.iron_large_ore.name=Grand minerai de fer +tile.ss.gold_large_ore.name=Grand minerai d'or + +tile.ss.creeper_chest.name=Coffre de marchand de pousse +tile.ss.shipping_box.name=Boテョte d'expテゥdition + +tile.ss.turnip.name=Graine de navet +tile.ss.cucumber.name=Graine de concombre + +tile.ss.onion.name=Graine d'oignon +tile.ss.tomato.name=Graine de tomate +tile.ss.corn.name=Graine de maテッs + +tile.ss.eggplant.name=Graine d'aubergine +tile.ss.sweet_potato.name=Graine de patate douce +tile.ss.green_pepper.name=Graine de poivron vert + +tile.ss.radish.name=Graine de radis + +tile.ss.monitor.name=Moniteur +monitor.type=Type +monitor.creeper=Magasin de pousse simple +monitor.robot=Magasin du robot bleu + +tile.ss.electric_motor.name=Moteur テゥlectrique +tile.ss.tofu_motor.name=Moteur de tofu + +#Item +item.ss.dust_waterlily.name=Poussiティre de nテゥnuphar + +item.ss.stone_dust.name=Poussiティre de pierre + +item.ss.dust_blue_stone.name=Poussiティre de pierre bleue +item.ss.dust_yellow_stone.name=Poussiティre de pierre jaune + +item.ss.coal_dust.name=Poussiティre de charbon +item.ss.iron_dust.name=Poussiティre de fer +item.ss.gold_dust.name=Poussiティre d'or +item.ss.diamond_dust.name=Poussiティre de diamant + +item.ss.mithril_dust.name=Poussiティre de mithril + + +item.ss.steel_ingot.name=Lingot d'acier +item.ss.brass_ingot.name=Lingot de laiton + +item.ss.bluestone_ingot.name=Lingot de pierre bleue +item.ss.yellowstone_ingot.name=Lingot de pierre jaune + +item.ss.mithril_ingot.name=Lingot de mithril +item.ss.orichalcum_gem.name=Orichalcum + +item.ss.ninja_ingot.name=Lingot de ninja + +item.ss.blue_stone_slime_ball.name=Boule de pituite en pierre bleue + + +item.ss.energy_reactor.name=Rテゥacteur d'テゥnergie +item.ss.object_reactor.name=Rテゥacteur d'objet + + +item.ss.craft_unit.name=Unitテゥ artisanale + +item.ss.iron_ring.name=Anneau de fer +item.ss.creeper_ring.name=Anneau de magasin de pousse + + +item.ss.magic_dust.name=Poussiティre magique + +item.ss.unit.name=Unitテゥ + +item.ss.wood_gear.name=Mテゥcanisme en bois +item.ss.stone_gear.name=Mテゥcanisme en pierre +item.ss.steel_gear.name=Mテゥcanisme en acier + +item.ss.wood_unit_gear.name=Mテゥcanisme d'unitテゥ en bois +item.ss.stone_unit_gear.name=Mテゥcanisme d'unitテゥ en pierre +item.ss.steel_unit_gear.name=Mテゥcanisme d'unitテゥ en acier + +item.ss.hammer.name=Marteau +item.ss.calendar.name=Calendrier + +item.ss.calendar.name=Calendrier +item.ss.season_stone.name=Pierre de saison +item.ss.season_stone_spring.name=Pierre de saison -Printemps- +item.ss.season_stone_summer.name=Pierre de saison -テ液テゥ- +item.ss.season_stone_autumn.name=Pierre de saison -Automne- +item.ss.season_stone_winter.name=Pierre de saison -Hiver- + +item.ss.wood_gf_storage.name=Stockage GF en bois +item.ss.stone_gf_storage.name=Stockage GF en pierre +item.ss.steel_gf_storage.name=Stockage GF en acier + +item.ss.string_bobbin.name=Bobine de fils +item.ss.cloth.name=Tissu +item.ss.canvas.name=Toile + +item.ss.drinking_water_small_bottle.name=Petite bouteille d'eau potable + + +item.ss.wood_scoop.name=テ営ope en bois +item.ss.stone_scoop.name=テ営ope en pierre +item.ss.iron_scoop.name=テ営ope en fer +item.ss.gold_scoop.name=テ営ope en or +item.ss.diamond_scoop.name=テ営ope en diamant + +item.ss.wood_knife.name=Couteau en bois +item.ss.stone_knife.name=Couteau en pierre +item.ss.iron_knife.name=Couteau en fer +item.ss.gold_knife.name=Couteau en or +item.ss.diamond_knife.name=Couteau en diamant + +item.ss.wood_watering_can.name=Arrosoir en bois + +item.ss.crop.big=Gros + +item.ss.turnip.name=Navet +item.ss.cucumber.name=Concombre + +item.ss.iron_turnip.name=Navet de fer + +item.ss.onion.name=Oignon +item.ss.tomato.name=Tomate +item.ss.corn.name=Maテッs + +item.ss.golden_corn.name=Maテッs dorテゥ + +item.ss.eggplant.name=Aubergine +item.ss.sweet_potato.name=patate douce +item.ss.green_pepper.name=Poivron vert + +item.ss.radish.name=Radis + + +item.ss.salt.name=Sel + +item.ss.chicken_smoked.name=Poulet fumテゥ +item.ss.porkchop_smoked.name=Cotelette de porc fumテゥ +item.ss.beef_smoked.name=Boeuf fumテゥ + + +item.ss.shift_hat.name=Chapeau d'テゥlテゥvation +item.ss.gf_contact_lenses.name=Lentilles de contact GF + +#Fluid +fluid.ss.takumi_tea=Thテゥ TAKUMI +fluid.ss.drinking_water=Eau potable + +fluid.ss.steam=Vapeur + +#GUI +container.large_furnace=Grand four +container.sub.inventory=Tampon + +gui.ss.fluid_furnace=Four テ fluide +gui.ss.food_smokers=Fumoir +gui.ss.magic_furnace=Four magique + +gui.ss.millstone=Meule +gui.ss.loom=Mテゥtier テ tisser +gui.ss.sawmill=Scirie +gui.ss.pulverizer=Pulvテゥriseur + +gui.ss.gf_tank_1=Rテゥservoir GF en bois +gui.ss.gf_tank_2=Rテゥservoir GF en pierre +gui.ss.gf_tank_3=Rテゥservoir GF d'acier + +shop.ss.creeper=Magasin de pousse simple +shop.ss.robot=Magasin du robot bleu + +#ToolTip +tooltip.season.pm=PM +tooltip.season.am=AM + +tooltip.season=Saison +tooltip.season.seed=Saison +tooltip.season.spring=Printemps +tooltip.season.summer=テ液テゥ +tooltip.season.autumn=Automne +tooltip.season.winter=Hiver + +#Tab +itemGroup.ss.core=SextiarySector -Coeur- +itemGroup.ss.fluid=SextiarySector -Fluide- +itemGroup.ss.machine=SextiarySector -Machine- +itemGroup.ss.player=SextiarySector -Joueur- +itemGroup.ss.agriculture=SextiarySector -Agriculture- +itemGroup.ss.mining=SextiarySector -Minage- +itemGroup.ss.cooking=SextiarySector -Cuisine- +itemGroup.ss.economy=SextiarySector -テ営onomie- +itemGroup.ss.magic=SextiarySector -Magie- + +#Player Tab +player.tab.vanilla=Vanilla +player.tab.equipment=テ衛uipement +player.tab.item.ss.craft_unit=Artisanat + +player.tab.item.ss.creeper_ring=Magasin de pousse + +#Achievement +stat.sell=Vendre + +achievement.ss.economy=SextiarySector -テ営onomie- + +achievement.creeper_firework=Creeper Monger +achievement.creeper_firework.desc=The attempt to communicate with fireworks ! + +achievement.creeper_chest=Coffre de pousse +achievement.creeper_chest.desc=Santa Creeper ? + +achievement.shipping=Boテョte d'expテゥdition +achievement.shipping.desc=Trying to shipment + +#NEI +nei.recipe=Recette +nei.ss.furnace.shaped=Four formテゥ +nei.ss.furnace.shapeless=Four sans forme + +nei.ss.fluid_furnace=Recette du four テ fluide +nei.ss.food_smokers=Recette du fumoir + +nei.ss.magic_furnace=Recette du four magique +nei.ss.magic_fuel=Carburant magique + +nei.ss.millstone=Recette de la meule +nei.ss.loom=Recette du mテゥtier テ tisser +nei.ss.sawmill=Recette de la scierie +nei.ss.pulverizer=Recette du pulvテゥriseur + +nei.ss.fertilizer=Recette de mutation diff --git a/src/main/resources/assets/sextiarysector/lang/ja_JP.lang b/src/main/resources/assets/sextiarysector/lang/ja_JP.lang new file mode 100644 index 0000000..3c75bd4 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/lang/ja_JP.lang @@ -0,0 +1,825 @@ +#譌・譛ャ隱 ja_JP + +#繝悶Ο繝繧ッ +tile.ss.large_furnace.name=螟ァ蝙九°縺セ縺ゥ +tile.ss.fluid_furnace.name=豬∽ス薙°縺セ縺ゥ + +tile.ss.food_smokers.name=辯サ陬ス蝎ィ + +tile.ss.magic_furnace.name=鬲疲ウ輔°縺セ縺ゥ +tile.ss.freezer.name=繝輔Μ繝シ繧カ繝シ + +tile.ss.wood_grate.name=譛ィ縺ョ譬シ蟄 + +tile.ss.oak_wood_plate.name=讓ォ縺ョ譛ィ譚ソ +tile.ss.birch_wood_plate.name=逋ス讓コ縺ョ譛ィ迚 +tile.ss.spruce_wood_plate.name=譚セ縺ョ譛ィ迚 +tile.ss.jungle_wood_plate.name=繧ク繝」繝ウ繧ー繝ォ縺ョ譛ィ迚 +tile.ss.acacia_wood_plate.name=繧「繧ォ繧キ繧「縺ョ譛ィ譚ソ +tile.ss.big_oak_wood_plate.name=繝繝シ繧ッ繧ェ繝シ繧ッ縺ョ譛ィ迚 + +tile.ss.iron_plate.name=驩繝励Ξ繝シ繝 +tile.ss.gold_plate.name=驥代励Ξ繝シ繝 + +tile.ss.copper_plate.name=驫繝励Ξ繝シ繝 +tile.ss.zinc_plate.name=莠憺央繝励Ξ繝シ繝 +tile.ss.silver_plate.name=驫繝励Ξ繝シ繝 + +tile.ss.hole.name=遨エ +tile.ss.farmland.name=霎イ蝨ー +tile.ss.paddy.name=豌エ逕ー +tile.ss.wood.name=蜴滓惠 + +tile.ss.bottle.name=豸イ菴薙懊ヨ繝ォ +tile.ss.fluid_crafter.name=豬∽ス薙け繝ゥ繝輔ち繝シ +tile.ss.square.name=譫。 + +tile.ss.tank.name=繧ソ繝ウ繧ッ +tile.ss.funnel.name=繝輔ぃ繝ウ繝阪Ν +tile.ss.copper_pipe.name=驫繝代う繝 + + +tile.ss.wood_hopper.name=譛ィ縺ョ繝帙ャ繝代シ + +tile.ss.chunk_loader.name=繧ソ繧、繝繝ュ繝シ繝繝シ + +tile.ss.figure.name=繝輔ぅ繧ョ繝・繧「 + + + +tile.ss.leaf_block.name=闡峨▲縺ア繝悶Ο繝繧ッ + +tile.ss.trap.name=繝医Λ繝繝 + +tile.ss.leaf_bed.name=闡峨▲縺ア縺ョ繝吶ャ繝 + +tile.ss.drinking_water.name=鬟イ譁呎ーエ +tile.ss.hot_springs.name=貂ゥ豕画ーエ + + +tile.ss.blue_stone.name=繝悶Ν繝シ繧ケ繝医シ繝ウ驩ア遏ウ +tile.ss.yellow_stone.name=繧、繧ィ繝ュ繝シ繧ケ繝医シ繝ウ驩ア遏ウ + +tile.ss.copper_ore.name=驫驩ア遏ウ +tile.ss.zinc_ore.name=莠憺央驩ア遏ウ +tile.ss.silver_ore.name=驫驩ア遏ウ + +tile.ss.mithril_ore.name=繝溘せ繝ェ繝ォ驩ア遏ウ +tile.ss.orichalcum_ore.name=繧ェ繝ェ繝上Ν繧ウ繝ウ驩ア遏ウ + +tile.ss.coal_large_ore.name=螟ァ縺阪↑遏ウ轤ュ驩ア遏ウ +tile.ss.iron_large_ore.name=螟ァ縺阪↑驩驩ア遏ウ +tile.ss.gold_large_ore.name=螟ァ縺阪↑驥鷹桶遏ウ + +tile.ss.silver_large_ore.name=螟ァ縺阪↑驫驩ア遏ウ + +tile.ss.copper_block.name=驫繝悶Ο繝繧ッ +tile.ss.zinc_block.name=莠憺央繝悶Ο繝繧ッ +tile.ss.silver_block.name=驫繝悶Ο繝繧ッ +tile.ss.steel_block.name=驪シ驩繝悶Ο繝繧ッ +tile.ss.brass_block.name=逵滄紺繝悶Ο繝繧ッ +tile.ss.ninja_block.name=繝九Φ繧ク繝」繝悶Ο繝繧ッ +tile.ss.mithril_block.name=繝溘せ繝ェ繝ォ繝悶Ο繝繧ッ +tile.ss.orichalcum_block.name=繧ェ繝ェ繝上Ν繧ウ繝ウ繝悶Ο繝繧ッ + + +tile.ss.small_windmill.name=蟆上&縺鬚ィ霆 +tile.ss.windmill.name=鬚ィ霆 +tile.ss.large_windmill.name=螟ァ縺阪>鬚ィ霆 +tile.ss.small_waterwheel.name=蟆上&縺豌エ霆 +tile.ss.steam_motor.name=闥ク豌励Δ繝シ繧ソ繝シ + +tile.ss.wood_shaft.name=譛ィ縺ョ繧キ繝」繝輔ヨ +tile.ss.stone_shaft.name=遏ウ縺ョ繧キ繝」繝輔ヨ +tile.ss.steel_shaft.name=驪シ驩縺ョ繧キ繝」繝輔ヨ +tile.ss.ninja_shaft.name=繝九Φ繧ク繝」縺ョ繧キ繝」繝輔ヨ +tile.ss.orichalcum_shaft.name=繧ェ繝ェ繝上Ν繧ウ繝ウ縺ョ繧キ繝」繝輔ヨ + +tile.ss.wood_gear_box.name=譛ィ縺ョ繧ョ繧「繝懊ャ繧ッ繧ケ +tile.ss.stone_gear_box.name=遏ウ縺ョ繧ョ繧「繝懊ャ繧ッ繧ケ +tile.ss.steel_gear_box.name=驪シ驩縺ョ繧ョ繧「繝懊ャ繧ッ繧ケ +tile.ss.ninja_gear_box.name=繝九Φ繧ク繝」縺ョ繧ョ繧「繝懊ャ繧ッ繧ケ +tile.ss.orichalcum_gear_box.name=繧ェ繝ェ繝上Ν繧ウ繝ウ縺ョ繧ョ繧「繝懊ャ繧ッ繧ケ + +tile.ss.wood_gf_tank.name=譛ィ縺ョGF繧ソ繝ウ繧ッ +tile.ss.stone_gf_tank.name=遏ウ縺ョGF繧ソ繝ウ繧ッ +tile.ss.steel_gf_tank.name=驪シ驩縺ョGF繧ソ繝ウ繧ッ +tile.ss.ninja_gf_tank.name=繝九Φ繧ク繝」縺ョGF繧ソ繝ウ繧ッ +tile.ss.orichalcum_gf_tank.name=繧ェ繝ェ繝上Ν繧ウ繝ウ縺ョGF繧ソ繝ウ繧ッ + +tile.ss.wood_stone_gear_shaft.name=譛ィ縺ィ遏ウ縺ョ繧ョ繧「繧キ繝」繝輔ヨ +tile.ss.stone_steel_gear_shaft.name=遏ウ縺ィ驪シ驩縺ョ繧ョ繧「繧キ繝」繝輔ヨ +tile.ss.steel_ninja_gear_shaft.name=驪シ驩縺ィ繝九Φ繧ク繝」縺ョ繧ョ繧「繧キ繝」繝輔ヨ +tile.ss.ninja_orichalcum_gear_shaft.name=繝九Φ繧ク繝」縺ィ繧ェ繝ェ繝上Ν繧ウ繝ウ縺ョ繧ョ繧「繧キ繝」繝輔ヨ + +tile.ss.machine_frame.name=讖滓「ー遲蝉ス +tile.ss.millstone.name=遏ウ閾シ +tile.ss.loom.name=郢疲ゥ +tile.ss.sawmill.name=陬ス譚先ゥ +tile.ss.spinning_machine.name=邏。邵セ讖 +tile.ss.pulverizer.name=邊臥墓ゥ +tile.ss.extractor.name=謚ス蜃コ讖 +tile.ss.rolling_machine.name=蝨ァ蟒カ讖 +tile.ss.mana_squeezer.name=繝槭リ謚ス蜃コ讖 +tile.ss.time_machine.name=繧ソ繧、繝繝槭す繝ウ + + +tile.ss.fan.name=繝輔ぃ繝ウ +tile.ss.saw.name=繝弱さ +tile.ss.pump.name=繝昴Φ繝 +tile.ss.suction_machine.name=蜷ク蠑墓ゥ + + +tile.ss.creeper_chest.name=繧ッ繝ェ繝シ繝代シ繝√ぉ繧ケ繝 +tile.ss.shipping_box.name=蜃コ闕キ邂ア + +tile.ss.turnip.name=繧ォ繝悶ョ遞ョ +tile.ss.cucumber.name=繧ュ繝・繧ヲ繝ェ縺ョ遞ョ +tile.ss.iron_turnip.name=驩繧ォ繝悶ョ遞ョ + +tile.ss.onion.name=繧ソ繝槭ロ繧ョ縺ョ遞ョ +tile.ss.tomato.name=繝医槭ヨ縺ョ遞ョ +tile.ss.corn.name=繝医え繝「繝ュ繧ウ繧キ縺ョ遞ョ +tile.ss.golden_corn.name=驥代ヨ繧ヲ繝「繝ュ繧ウ繧キ縺ョ遞ョ + +tile.ss.eggplant.name=繝翫せ縺ョ遞ョ +tile.ss.sweet_potato.name=繧オ繝繝槭う繝「縺ョ遞ョ +tile.ss.green_pepper.name=繝斐シ繝槭Φ縺ョ遞ョ + +tile.ss.radish.name=螟ァ譬ケ縺ョ遞ョ + +tile.ss.rice.name=遞ョ邀セ + +tile.ss.mushroom_red.name=襍、繧ュ繝弱さ縺ョ閭槫ュ +tile.ss.shiitake.name=繧キ繧、繧ソ繧ア縺ョ閭槫ュ + + +tile.ss.sandpit.name=遐ょエ + +tile.ss.boarding_buoy.name=荵鈴剄逕ィ繝悶う +tile.ss.powered_buoy.name=繝代Ρ繝シ繝峨ヶ繧、 +tile.ss.detector_buoy.name=繝繧」繝繧ッ繧ソ繝シ繝悶う + +tile.ss.monitor.name=繝「繝九ち繝シ +monitor.type=蠎礼ィョ +monitor.creeper=繧ッ繝ェ繝シ繝代シ繧キ繝ァ繝繝 +monitor.robot=繝ュ繝懊&繧薙す繝ァ繝繝 + +tile.ss.electric_motor.name=髮サ豌励Δ繝シ繧ソ繝シ +tile.ss.tofu_motor.name=雎閻舌Δ繝シ繧ソ繝シ +tile.ss.gf_dynamo.name=GF繝繧、繝翫Δ + +#繧「繧、繝繝 +item.ss.unit.name=繝ヲ繝九ャ繝 + +item.ss.wood_gear.name=譛ィ縺ョ豁ッ霆 +item.ss.stone_gear.name=遏ウ縺ョ豁ッ霆 +item.ss.steel_gear.name=驪シ驩縺ョ豁ッ霆 +item.ss.ninja_gear.name=繝九Φ繧ク繝」縺ョ豁ッ霆 +item.ss.orichalcum_gear.name=繧ェ繝ェ繝上Ν繧ウ繝ウ縺ョ繧ョ繧「 + +item.ss.wood_unit_gear.name=譛ィ縺ョ繧ョ繧「繝ヲ繝九ャ繝 +item.ss.stone_unit_gear.name=遏ウ縺ョ繧ョ繧「繝ヲ繝九ャ繝 +item.ss.steel_unit_gear.name=驪シ驩縺ョ繧ョ繧「繝ヲ繝九ャ繝 +item.ss.ninja_unit_gear.name=繝九Φ繧ク繝」縺ョ繧ョ繧「繝ヲ繝九ャ繝 +item.ss.orichalcum_unit_gear.name=繧ェ繝ェ繝上Ν繧ウ繝ウ縺ョ繧ョ繧「繝ヲ繝九ャ繝 + +item.ss.wood_gf_storage.name=譛ィ縺ョGF繧ケ繝医Ξ繝シ繧ク +item.ss.stone_gf_storage.name=遏ウ縺ョGF繧ケ繝医Ξ繝シ繧ク +item.ss.steel_gf_storage.name=驪シ驩縺ョGF繧ケ繝医Ξ繝シ繧ク +item.ss.ninja_gf_storage.name=繝九Φ繧ク繝」縺ョGF繧ケ繝医Ξ繝シ繧ク +item.ss.orichalcum_gf_storage.name=繧ェ繝ェ繝上Ν繧ウ繝ウ縺ョGF繧ケ繝医Ξ繝シ繧ク + +item.ss.hammer.name=繝上Φ繝槭シ + +item.ss.calendar.name=繧ォ繝ャ繝ウ繝繝シ +item.ss.season_stone.name=繧キ繝シ繧コ繝ウ繧ケ繝医シ繝ウ +item.ss.season_stone_spring.name=繧キ繝シ繧コ繝ウ繧ケ繝医シ繝ウ-譏・- +item.ss.season_stone_summer.name=繧キ繝シ繧コ繝ウ繧ケ繝医シ繝ウ-螟- +item.ss.season_stone_autumn.name=繧キ繝シ繧コ繝ウ繧ケ繝医シ繝ウ-遘- +item.ss.season_stone_winter.name=繧キ繝シ繧コ繝ウ繧ケ繝医シ繝ウ-蜀ャ- + + + +item.ss.leaf_bed.name=闡峨▲縺ア縺ョ繝吶ャ繝 + + +item.ss.leaf.name=闡峨▲縺ア + +item.ss.dust_waterlily.name=豌エ騾」縺ョ邊 + +item.ss.stone_dust.name=遏ウ縺ョ邊 + +item.ss.dust_blue_stone.name=繝悶Ν繝シ繧ケ繝医シ繝ウ +item.ss.dust_yellow_stone.name=繧、繧ィ繝ュ繝シ繧ケ繝医シ繝ウ + +item.ss.coal_dust.name=遏ウ轤ュ縺ョ邊 +item.ss.iron_dust.name=驩縺ョ邊 +item.ss.gold_dust.name=驥代ョ邊 +item.ss.diamond_dust.name=繝繧、繝、縺ョ邊 + +item.ss.copper_dust.name=驫縺ョ邊 +item.ss.zinc_dust.name=莠憺央縺ョ邊 +item.ss.silver_dust.name=驫縺ョ邊 + +item.ss.mithril_dust.name=繝溘せ繝ェ繝ォ縺ョ邊 + + +item.ss.iron_nugget.name=驩蝪 +item.ss.copper_nugget.name=驫蝪 +item.ss.zinc_nugget.name=莠憺央蝪 +item.ss.silver_nugget.name=驫蝪 + +item.ss.steel_nugget.name=驪シ驩蝪 +item.ss.ninja_nugget.name=繝九Φ繧ク繝」蝪 + +item.ss.obsidian_nugget.name=鮟呈屆遏ウ蝪 + + +item.ss.steel_ingot.name=驪シ驩繧、繝ウ繧エ繝繝 +item.ss.brass_ingot.name=逵滄紺繧、繝ウ繧エ繝繝 + +item.ss.bluestone_ingot.name=繝悶Ν繝シ繧ケ繝医シ繝ウ繧、繝ウ繧エ繝繝 +item.ss.yellowstone_ingot.name=繧、繧ィ繝ュ繝シ繧ケ繝医シ繝ウ繧、繝ウ繧エ繝繝 + +item.ss.copper_ingot.name=驫繧、繝ウ繧エ繝繝 +item.ss.zinc_ingot.name=莠憺央繧、繝ウ繧エ繝繝 +item.ss.silver_ingot.name=驫繧、繝ウ繧エ繝繝 + +item.ss.mithril_ingot.name=繝溘せ繝ェ繝ォ繧、繝ウ繧エ繝繝 +item.ss.orichalcum_gem.name=繧ェ繝ェ繝上Ν繧ウ繝ウ + +item.ss.ninja_ingot.name=繝九Φ繧ク繝」繧、繝ウ繧エ繝繝 + +item.ss.red_gel.name=繝ャ繝繝峨せ繝医シ繝ウ繧ク繧ァ繝ォ +item.ss.blue_gel.name=繝悶Ν繝シ繧ケ繝医シ繝ウ繧ク繧ァ繝ォ +item.ss.yellow_gel.name=繧、繧ィ繝ュ繝シ繧ケ繝医シ繝ウ繧ク繧ァ繝ォ + + +item.ss.craft_reactor.name=繧ッ繝ゥ繝輔ヨ繝ェ繧「繧ッ繧ソ繝シ +item.ss.energy_reactor.name=繧ィ繝阪Ν繧ョ繝シ繝ェ繧「繧ッ繧ソ繝シ +item.ss.object_reactor.name=繧ェ繝悶ず繧ァ繧ッ繝医Μ繧「繧ッ繧ソ繝シ + + + +item.ss.empty_bottle.name=遨コ縺ョ繝懊ヨ繝ォ +item.ss.water_bottle.name=豌エ蜈・繧翫懊ヨ繝ォ +item.ss.lava_bottle.name=貅カ蟯ゥ蜈・繧翫懊ヨ繝ォ +item.ss.sap_bottle.name=讓ケ豸イ蜈・繧翫懊ヨ繝ォ + +item.ss.steam_bucket.name=闥ク豌怜・繧翫ヰ繧ア繝 +item.ss.iron_fluid_bucket.name=陞阪¢縺滄延蜈・繧翫ヰ繧ア繝 +item.ss.gold_fluid_bucket.name=陞阪¢縺滄大・繧翫ヰ繧ア繝 + +item.ss.magic_dust.name=鬲疲ウ輔ョ邊 + + +item.ss.string_bobbin.name=邉ク縺ョ繝懊ン繝ウ +item.ss.cloth.name=蟶 +item.ss.small_cloth.name=蟆上&縺ェ蟶 +item.ss.canvas.name=邊怜ク +item.ss.drying_flesh.name=荵セ辯・閧 +item.ss.flesh_bobbin.name=閧峨ョ繝懊ン繝ウ +item.ss.string_mass.name=邉ク縺ョ蝪 +item.ss.strong_string.name=荳亥、ォ縺ェ邉ク +item.ss.strong_string_bobbin.name=荳亥、ォ縺ェ邉ク縺ョ繝懊ン繝ウ +item.ss.strong_cloth.name=荳亥、ォ縺ェ蟶 +item.ss.strong_canvas.name=荳亥、ォ縺ェ邊怜ク + + +item.ss.figure_box.name=繝輔ぅ繧ョ繝・繧「繝懊ャ繧ッ繧ケ + + +item.ss.wood_scoop.name=譛ィ縺ョ繧ケ繧ウ繝繝 +item.ss.stone_scoop.name=遏ウ縺ョ繧ケ繧ウ繝繝 +item.ss.iron_scoop.name=驩縺ョ繧ケ繧ウ繝繝 +item.ss.gold_scoop.name=驥代ョ繧ケ繧ウ繝繝 +item.ss.diamond_scoop.name=繝繧、繝、縺ョ繧ケ繧ウ繝繝 + +item.ss.brass_scoop.name=逵滄紺縺ョ繧ケ繧ウ繝繝 + + + +item.ss.wood_knife.name=譛ィ縺ョ繝翫う繝 +item.ss.stone_knife.name=遏ウ縺ョ繝翫う繝 +item.ss.iron_knife.name=驩縺ョ繝翫う繝 +item.ss.gold_knife.name=驥代ョ繝翫う繝 +item.ss.diamond_knife.name=繝繧、繝、縺ョ繝翫う繝 + +item.ss.brass_knife.name=逵滄紺縺ョ繝翫う繝 + + +item.ss.copper_shovel.name=驫縺ョ繧キ繝」繝吶Ν +item.ss.copper_pickaxe.name=驫縺ョ繝繝ォ繝上す +item.ss.copper_axe.name=驫縺ョ譁ァ +item.ss.copper_sword.name=驫縺ョ蜑」 +item.ss.copper_hoe.name=驫縺ョ繧ッ繝ッ + +item.ss.brass_shovel.name=逵滄紺縺ョ繧キ繝」繝吶Ν +item.ss.brass_pickaxe.name=逵滄紺縺ョ繝繝ォ繝上す +item.ss.brass_axe.name=逵滄紺縺ョ譁ァ +item.ss.brass_sword.name=逵滄紺縺ョ蜑」 +item.ss.brass_hoe.name=逵滄紺縺ョ繧ッ繝ッ + +item.ss.ninja_shovel.name=繝九Φ繧ク繝」縺ョ繧キ繝」繝吶Ν +item.ss.ninja_pickaxe.name=繝九Φ繧ク繝」縺ョ繝繝ォ繝上す +item.ss.ninja_axe.name=繝九Φ繧ク繝」縺ョ譁ァ +item.ss.ninja_sword.name=繝九Φ繧ク繝」縺ョ蜑」 +item.ss.ninja_hoe.name=繝九Φ繧ク繝」縺ョ繧ッ繝ッ + + +item.ss.copper_helmet.name=驫縺ョ繝倥Ν繝。繝繝 +item.ss.copper_chestplate.name=閭エ縺ョ繝√ぉ繧ケ繝医励Ξ繝シ繝 +item.ss.copper_leggings.name=驫縺ョ繝ャ繧ョ繝ウ繧ケ +item.ss.copper_boots.name=驫縺ョ繝悶シ繝 + +item.ss.ninja_helmet.name=繝九Φ繧ク繝」縺ョ繝倥Ν繝。繝繝 +item.ss.ninja_chestplate.name=繝九Φ繧ク繝」縺ョ繝√ぉ繧ケ繝医励Ξ繝シ繝 +item.ss.ninja_leggings.name=繝九Φ繧ク繝」縺ョ繝ャ繧ョ繝ウ繧ケ +item.ss.ninja_boots.name=繝九Φ繧ク繝」縺ョ繝悶シ繝 + +item.ss.wood_watering_can.name=譛ィ縺ョ繧ク繝ァ繧ヲ繝ュ + +item.ss.brass_shears.name=逵滄紺縺ョ繝上し繝 + +item.ss.mineboat_chest.name=繝√ぉ繧ケ繝井サ倥″繝懊シ繝 +item.ss.mineboat_tank.name=繧ソ繝ウ繧ッ莉倥″繝懊シ繝 + +item.ss.laver.name=豬キ闍 + + +item.ss.crop.big=螟ァ縺阪> + +item.ss.turnip.name=繧ォ繝 +item.ss.cucumber.name=繧ュ繝・繧ヲ繝ェ + +item.ss.iron_turnip.name=驩繧ォ繝 + +item.ss.onion.name=繧ソ繝槭ロ繧ョ +item.ss.tomato.name=繝医槭ヨ +item.ss.corn.name=繝医え繝「繝ュ繧ウ繧キ + +item.ss.golden_corn.name=驥代ヨ繧ヲ繝「繝ュ繧ウ繧キ + +item.ss.eggplant.name=繝翫せ +item.ss.sweet_potato.name=繧オ繝繝槭う繝「 +item.ss.green_pepper.name=繝斐シ繝槭Φ + +item.ss.blue_potato.name=髱偵し繝繝槭う繝「 + +item.ss.radish.name=螟ァ譬ケ + +item.ss.rice.name=邀ウ + +item.ss.shiitake.name=讀手減 + + +item.ss.squid_sashimi.name=繧、繧ォ縺ョ蛻コ霄ォ + +item.ss.white_rice.name=逋ス邀ウ + +item.ss.salt.name=蝪ゥ +item.ss.curry_powder.name=繧ォ繝ャ繝シ繝代え繝繝シ + +item.ss.laver_roasted.name=辟シ縺肴オキ闍 + +item.ss.chicken_smoked.name=鮓剰i縺ョ辯サ陬ス +item.ss.porkchop_smoked.name=雎夊i縺ョ辯サ陬ス +item.ss.beef_smoked.name=迚幄i縺ョ辯サ陬ス + +item.ss.rice_ball.name=縺翫↓縺弱j +item.ss.curry_rice.name=繧ォ繝ャ繝シ繝ゥ繧、繧ケ + +item.ss.carrot_soup.name=縺ォ繧薙§繧薙せ繝シ繝 +item.ss.corn_soup.name=繧ウ繝シ繝ウ繧ケ繝シ繝 +item.ss.egg_soup.name=縺溘∪縺斐せ繝シ繝 +item.ss.mushroom_stew.name=縺阪ョ縺薙す繝√Η繝シ +item.ss.onion_soup.name=繧ェ繝九が繝ウ繧ケ繝シ繝 +item.ss.ender_soup.name=繧ィ繝ウ繝繝シ繧ケ繝シ繝 +item.ss.tomato_soup.name=繝医槭ヨ繧ケ繝シ繝 + +item.ss.chocolate.name=繝√Ι繧ウ繝ャ繝シ繝 + +item.ss.drinking_water_bottle.name=鬟イ譁呎ーエ蜈・繧翫懊ヨ繝ォ +item.ss.takumi_tea_bottle.name=蛹闌カ蜈・繧翫懊ヨ繝ォ + + + +item.ss.shift_hat.name=Shift縺ョ蟶ス蟄 +item.ss.rucksack.name=繝ェ繝・繝繧ッ繧オ繝繧ッ +item.ss.quiver.name=遏「遲 +item.ss.oxygen_tank.name=驟ク邏繧ソ繝ウ繧ッ +item.ss.gf_contact_lenses.name=GF繧ウ繝ウ繧ソ繧ッ繝医Ξ繝ウ繧コ +item.ss.water_contact_lenses.name=繧ヲ繧ゥ繝シ繧ソ繝シ繧ウ繝ウ繧ソ繧ッ繝医Ξ繝ウ繧コ + +item.ss.craft_unit.name=繝ヲ繝九ャ繝 ス「繧、繝繝繝「繧ッ繝ゥ繝輔ヨス」 +item.ss.attack_unit.name=繝ヲ繝九ャ繝 ス「繝繝。繝シ繧ク繝励Λ繧ケス」 +item.ss.defense_unit.name=繝ヲ繝九ャ繝 ス「繝懊え繧ョ繝ァ繝励Λ繧ケス」 +item.ss.attack_rust_unit.name=骭縺ウ縺溘Θ繝九ャ繝 ス「繝繝サ繝サ繧ク繝励サ繧ケス」 +item.ss.defense_rust_unit.name=骭縺ウ縺溘Θ繝九ャ繝 ス「繝懊え繝サ繝サ繝サ繝ゥ繝サス」 +item.ss.jump_unit.name=繝ヲ繝九ャ繝 ス「繧ケ繝シ繝代シ繧ク繝」繝ウ繝暦ス」 +item.ss.dash_unit.name=繝ヲ繝九ャ繝 ス「繝繝繧キ繝・繝繝繧キ繝・ス」 +item.ss.slowly_unit.name=繝ヲ繝九ャ繝 ス「繝ヲ繝繧ッ繝ェ繧「繝ォ繝シ繧ッス」 +item.ss.pulling_unit.name=繝ヲ繝九ャ繝 ス「繧ォ繧ウ繝弱お繧、繧ウ繧ヲス」 +item.ss.multi_schott_unit.name=繝ヲ繝九ャ繝 ス「繝槭Ν繝√す繝ァ繝繝茨ス」 +item.ss.bed_monster_unit.name=繝ヲ繝九ャ繝 ス「繧キ繧コ繧ォ繝翫さ繧ウ繝ュス」 +item.ss.pickaxe_unit.name=繝ヲ繝九ャ繝 ス「繝繝ォ繝上す繝代Ρ繝シス」 + +item.ss.debug_unit.name=繝ヲ繝九ャ繝医後ョ繝舌ャ繧ー繧ソ繧、繧サ繝縲 + + +item.ss.iron_ring.name=驩縺ョ繝ェ繝ウ繧ー +item.ss.creeper_ring.name=繧ッ繝ェ繝シ繝代シ繧キ繝ァ繝繝励Μ繝ウ繧ー +item.ss.mp_ring.name=MP繝ェ繝ウ繧ー +item.ss.xp_ring.name=XP繝ェ繝ウ繧ー + + +item.ss.creeper_memory.name=繧ッ繝ェ繝シ繝代シ繝。繝「繝ェ繝シ +item.ss.skeleton_memory.name=繧ケ繧ア繝ォ繝医Φ繝。繝「繝ェ繝シ + +item.ss.magic_contact_lenses.name=鬲疲ウ輔ョ繧ウ繝ウ繧ソ繧ッ繝医Ξ繝ウ繧コ + +#豸イ菴 +fluid.ss.takumi_tea=蛹闌カ +fluid.ss.drinking_water=鬟イ譁呎ーエ +fluid.ss.spring_water=貉ァ豌エ +fluid.ss.hot_springs=貂ゥ豕画ーエ +fluid.ss.steam=闥ク豌 +fluid.ss.mana=繝槭リ +fluid.ss.oxygen=驟ク邏 +fluid.ss.sap=讓ケ豸イ + +fluid.ss.iron=陞阪¢縺滄延 +fluid.ss.gold=陞阪¢縺滄 + +fluid.ss.black=鮟定牡 +fluid.ss.red=襍、濶イ +fluid.ss.green=邱題牡 +fluid.ss.brown=闌カ濶イ +fluid.ss.blue=髱定牡 +fluid.ss.purple=邏ォ濶イ +fluid.ss.cyan=豌エ濶イ +fluid.ss.lightgray=阮轣ー濶イ +fluid.ss.gray=轣ー濶イ +fluid.ss.pink=譯濶イ +fluid.ss.lime=鮟邱題牡 +fluid.ss.yellow=鮟濶イ +fluid.ss.lightblue=遨コ濶イ +fluid.ss.magenta=襍、邏ォ濶イ +fluid.ss.orange=讖呵牡 +fluid.ss.white=逋ス濶イ + +#繝昴シ繧キ繝ァ繝ウ +ss.potion.burn=轣ォ蛯キ +ss.potion.hot_springs=貂ゥ豕 + +#GUI +container.large_furnace=螟ァ蝙九°縺セ縺ゥ +container.sub.inventory=繝舌ャ繝輔ぃ繝シ + +container.mineboat_chest=繝√ぉ繧ケ繝井サ倥″繝懊シ繝 + +gui.ss.fluid_furnace=豬∽ス薙°縺セ縺ゥ +gui.ss.food_smokers=辯サ陬ス蝎ィ +gui.ss.magic_furnace=鬲疲ウ輔°縺セ縺ゥ +gui.ss.freezer=蜀キ蜃肴ゥ +gui.ss.funnel=貍乗沫 + +gui.ss.shipping_box=蜃コ闕キ邂ア + + +gui.ss.rucksack=繝ェ繝・繝繧ッ繧オ繝繧ッ +gui.ss.quiver=遏「遲 + +gui.ss.steam_motor=闥ク豌励Δ繝シ繧ソ繝シ + +gui.ss.millstone=遏ウ閾シ +gui.ss.loom=郢疲ゥ +gui.ss.sawmill=陬ス譚先ゥ +gui.ss.spinning_machine=邏。邵セ讖 +gui.ss.extractor=謚ス蜃コ讖 +gui.ss.pulverizer=邊臥墓ゥ +gui.ss.rolling_machine=蝨ァ蟒カ讖 +gui.ss.mana_squeezer=繝槭リ謚ス蜃コ讖 +gui.ss.time_machine=繧ソ繧、繝繝槭す繝ウ + +gui.ss.gf_tank_1=譛ィ縺ョGF繧ソ繝ウ繧ッ +gui.ss.gf_tank_2=遏ウ縺ョGF繧ソ繝ウ繧ッ +gui.ss.gf_tank_3=驪シ驩縺ョGF繧ソ繝ウ繧ッ +gui.ss.gf_tank_4=繝九Φ繧ク繝」縺ョGF繧ソ繝ウ繧ッ +gui.ss.gf_tank_5=繧ェ繝ェ繝上Ν繧ウ繝ウ縺ョGF繧ソ繝ウ繧ッ + +#Shop +shop.ss.creeper=繧ッ繝ェ繝シ繝代シ繧キ繝ァ繝繝 +shop.ss.skeleton=繧ケ繧ア繝ォ繝医Φ繧キ繝ァ繝繝 +shop.ss.robot=繝ュ繝懊す繝ァ繝繝 + +#繝繝シ繝ォ繝√ャ繝 +tooltip.season.pm=PM +tooltip.season.am=AM +tooltip.season.day=譌・ + +tooltip.season=蟄」遽 +tooltip.season.seed=譬ス蝓ケ譛滄俣 +tooltip.season.spring=譏・ +tooltip.season.summer=螟 +tooltip.season.autumn=遘 +tooltip.season.winter=蜀ャ + +tooltip.name=蜷榊燕 +tooltip.edition=繧ィ繝繧」繧キ繝ァ繝ウ + +#繧ィ繝繧」繧キ繝ァ繝ウ +edition.creative=CreativeTab +edition.achievement=Achievement +edition.figure_beginner=Figure Beginner +edition.ore_festival=Ore Festival + +edition.schr0_cleaver=Schr0 Cleaver + +#繧ソ繝 +itemGroup.ss.core=SextiarySector -繧ウ繧「- +itemGroup.ss.fluid=SextiarySector -豸イ菴- +itemGroup.ss.player=SextiarySector -繝励Ξ繧、繝、繝シ- +itemGroup.ss.agriculture=SextiarySector -霎イ讌ュ- +itemGroup.ss.fishery=SextiarySector -豌エ逕」讌ュ- +itemGroup.ss.mining=SextiarySector -驩ア讌ュ- +itemGroup.ss.industry=SextiarySector -蟾・讌ュ- +itemGroup.ss.cooking=SextiarySector -譁咏炊- +itemGroup.ss.transport=SextiarySector -霈ク騾- +itemGroup.ss.economy=SextiarySector -邨梧ク- +itemGroup.ss.magic=SextiarySector -鬲疲ウ- + +#Player Tab +player.tab.vanilla=繝舌ル繝ゥ +player.tab.equipment=陬蛯 +player.tab.item.ss.craft_unit=繧ッ繝ゥ繝輔ヨ + +player.tab.item.ss.rucksack=繝ェ繝・繝繧ッ繧オ繝繧ッ +player.tab.item.ss.quiver=遏「遲 + +player.tab.item.ss.creeper_ring=繧ッ繝ェ繝シ繝代シ繧キ繝ァ繝繝 + +#螳溽クセ +stat.sell=螢イ蜊エ謨ー + +achievement.ss.core=SS2 -繧ウ繧「- + +achievement.ss.moisture=豌エ蛻繧貞セ励k +achievement.ss.moisture.desc=豌エ蛻陬懃オヲ繧偵☆繧 +achievement.ss.moisture.desc2=縺吶∋縺吶∋縺励◆閧 + +achievement.ss.bottle=繝懊ヨ繝ォ +achievement.ss.bottle.desc=繝懊ヨ繝ォ繧剃ス懊k +achievement.ss.bottle.desc2=蠑キ蛹悶懊ヨ繝ォ + +achievement.ss.drinking_water=鬟イ譁呎ーエ +achievement.ss.drinking_water.desc=豌エ蜈・繧翫懊ヨ繝ォ繧堤イセ骭ャ縺吶k +achievement.ss.drinking_water.desc2=縺翫>縺励>! + +achievement.ss.craft_furnace=縺九∪縺ゥ繧剃ス懊k +achievement.ss.craft_furnace.desc=螟ァ蝙九°縺セ縺ゥ繧剃ス懊k +achievement.ss.craft_furnace.desc2=隍髮代↑繧ッ繝ゥ繝輔ヨ + +achievement.ss.hammer=繝上Φ繝槭シ ! +achievement.ss.hammer.desc=螟ァ蝙九ワ繝ウ繝槭シ繧剃ス懊k +achievement.ss.hammer.desc2=辟。謨オ ? + +achievement.ss.fluid_furnace=繝。繝ォ繝 +achievement.ss.fluid_furnace.desc=豬∽ス薙°縺セ縺ゥ繧剃ス懊k +achievement.ss.fluid_furnace.desc2=隗ヲ繧九→貅カ縺代k + +achievement.ss.freezer=譛譁ー縺ョ蜀キ阡オ蠎ォ +achievement.ss.freezer.desc=繝輔Μ繝シ繧カ繝シ繧剃ス懊k +achievement.ss.freezer.desc2=縺昴l縺ッ縺ュ... + + +achievement.ss.agriculture=SS2 -霎イ讌ュ- + +achievement.ss.data=菴懃黄縺ョ繝繝シ繧ソ + +achievement.ss.seed=譛蛻昴ョ遞ョ +achievement.ss.seed.desc=遞ョ繧定イキ縺 +achievement.ss.seed.desc2=遞ョ繧貞「励d縺昴≧ + +achievement.ss.scoop=繧ケ繧ウ繝繝 +achievement.ss.scoop.desc=繧ケ繧ウ繝繝励r菴懊k +achievement.ss.scoop.desc2=蜆ェ縺励¥隗ヲ繧阪≧ + +achievement.ss.farmland=霎イ蝨ー +achievement.ss.farmland.desc=繝舌ル繝ゥ縺ョ霎イ蝨ー縺ォ繧ケ繧ウ繝繝励r菴ソ縺 +achievement.ss.farmland.desc2=蠑キ縺 ! + +achievement.ss.watering_can=繧ク繝ァ繧ヲ繝ュ +achievement.ss.watering_can.desc=繧ク繝ァ繧ヲ繝ュ繧剃ス懊k +achievement.ss.watering_can.desc2=讌ス縺励>豌エ繧繧 + +achievement.ss.hole=遨エ +achievement.ss.hole.desc=蝨溘↓繧ケ繧ウ繝繝励r菴ソ縺 +achievement.ss.hole.desc2=隱ー縺後%縺薙↓遨エ繧 ? + +achievement.ss.paddy=豌エ逕ー +achievement.ss.paddy.desc=遨エ縺ォ豌エ繝舌こ繝繧剃スソ縺 +achievement.ss.paddy.desc2=邀ウ繧定ご縺ヲ繧医≧ ! + +## +achievement.ss.turnip=繧ォ繝 +achievement.ss.turnip.desc=繧ォ繝悶r蜿守ゥォ縺吶k + +achievement.ss.iron_turnip=驩繧ォ繝 +achievement.ss.iron_turnip.desc=驩繧ォ繝悶r蜿守ゥォ縺吶k + +achievement.ss.cucumber=繧ュ繝・繧ヲ繝ェ +achievement.ss.cucumber.desc=繧ュ繝・繧ヲ繝ェ繧貞庶遨ォ縺吶k + + +achievement.ss.onion=繧ソ繝槭ロ繧ョ +achievement.ss.onion.desc=繧ソ繝槭ロ繧ョ繧貞庶遨ォ縺吶k + +achievement.ss.tomato=繝医槭ヨ +achievement.ss.tomato.desc=繝医槭ヨ繧貞庶遨ォ縺吶k + +achievement.ss.corn=繝医え繝「繝ュ繧ウ繧キ +achievement.ss.corn.desc=繝医え繝「繝ュ繧ウ繧キ繧貞庶遨ォ縺吶k + +achievement.ss.golden_corn=驥代ョ繝医え繝「繝ュ繧ウ繧キ +achievement.ss.golden_corn.desc=驥代ョ繝医え繝「繝ュ繧ウ繧キ繧貞庶遨ォ縺吶k + + +achievement.ss.eggplant=繝翫せ +achievement.ss.eggplant.desc=繝翫せ繧貞庶遨ォ縺吶k + +achievement.ss.sweet_potato=繧オ繝繝槭う繝「 +achievement.ss.sweet_potato.desc=繧オ繝繝槭う繝「繧貞庶遨ォ縺吶k + +achievement.ss.green_pepper=繝斐シ繝槭Φ +achievement.ss.green_pepper.desc=繝斐シ繝槭Φ繧貞庶遨ォ縺吶k + + +achievement.ss.radish=螟ァ譬ケ +achievement.ss.radish.desc=螟ァ譬ケ繧貞庶遨ォ縺吶k + + +achievement.ss.rice=邀ウ +achievement.ss.rice.desc=邀ウ繧貞庶遨ォ縺吶k + +achievement.ss.shiitake=讀手減 +achievement.ss.shiitake.desc=讀手減繧貞庶遨ォ縺吶k + +achievement.ss.mining=SS2 -驩ア讌ュ- + +achievement.ss.bluestone_dust=濶イ縺碁&縺 ! +achievement.ss.bluestone_dust.desc=繝悶Ν繝シ繧ケ繝医シ繝ウ繧呈治謗倥☆繧 +achievement.ss.bluestone_dust.desc2=鄒弱@縺 ! + +achievement.ss.copper_ore=譁ー縺励>驩ア遏ウ +achievement.ss.copper_ore.desc=驫驩ア遏ウ繧呈治謗倥☆繧 +achievement.ss.copper_ore.desc2=3菴 + +achievement.ss.silver_ore=證玲ョコ髦イ豁「 +achievement.ss.silver_ore.desc=驫驩ア遏ウ繧呈治謗倥☆繧 +achievement.ss.silver_ore.desc2=蜀咏悄 ? + +achievement.ss.mithril_ore=鬲疲ウ輔ョ蟋九∪繧 +achievement.ss.mithril_ore.desc=繝溘せ繝ェ繝ォ驩ア遏ウ繧呈治謗倥☆繧 +achievement.ss.mithril_ore.desc2=謖霈ェ ? + +achievement.ss.industry=SS2 -蟾・讌ュ- + +achievement.ss.bluestone_slime_ball=隰弱ョ繧ケ繝ゥ繧、繝 +achievement.ss.bluestone_slime_ball.desc=繝悶Ν繝シ繧ケ繝医シ繝ウ縺ョ繝懊シ繝ォ繧剃ス懊k +achievement.ss.bluestone_slime_ball.desc2=縺縺縺ュ ! + + +achievement.ss.wood_gear=譁ー縺励>蜉 +achievement.ss.wood_gear.desc=譛ィ縺ョ豁ッ霆翫r菴懊k +achievement.ss.wood_gear.desc2=縺昴ョ蜷阪ッGF ! + +achievement.ss.small_windmill=鬚ィ縺ョ蜉 +achievement.ss.small_windmill.desc=蟆上&縺鬚ィ霆翫r菴懊k +achievement.ss.small_windmill.desc2=縺薙l縺ッ縺縺鬚ィ縺 + +achievement.ss.millstone=讖滓「ー +achievement.ss.millstone.desc=遏ウ閾シ繧剃ス懊k +achievement.ss.millstone.desc2=遘√ッ蟆城コヲ邊 ? + +achievement.ss.loom=蟶! +achievement.ss.loom.desc=郢疲ゥ溘r菴懊m縺 +achievement.ss.loom.desc2=陬ク縺九i隗」謾セ縺輔l繧 ! + + +achievement.ss.stone_gear=繝代Ρ繝シ繧「繝繝 +achievement.ss.stone_gear.desc=遏ウ縺ョ豁ッ霆翫r菴懊k +achievement.ss.stone_gear.desc2=縺ァ繧ら浹縺ァ ? + +achievement.ss.windmill=荳頑豌玲オ +achievement.ss.windmill.desc=鬚ィ霆翫r菴懊k +achievement.ss.windmill.desc2=縺ァ繧ゅ%縺ョ鬚ィ縲∝ー代@豕」縺縺ヲ縺縺セ縺 + +achievement.ss.small_waterwheel=豌エ縺ョ繝√き繝ゥ +achievement.ss.small_waterwheel.desc=蟆上&縺ェ豌エ霆翫r菴懊k +achievement.ss.small_waterwheel.desc2=貅カ蟯ゥ縺ォ逹縺帙↑縺縺ァ ! + +achievement.ss.sawmill=蛻迚ゥ? +achievement.ss.sawmill.desc=陬ス譚先ゥ溘r菴懊k +achievement.ss.sawmill.desc2=荳邱偵↓隗」菴薙@繧医≧ ! + +achievement.ss.spinning_machine=蟆上&縺ェ蟾・讌ュ +achievement.ss.spinning_machine.desc=邏。邵セ讖溘r菴懊k +achievement.ss.spinning_machine.desc2=縺ゅd縺ィ繧翫r縺励∪縺励g縺 + + +achievement.ss.steel_gear=驪シ縺ョ繝√き繝ゥ +achievement.ss.steel_gear.desc=驪シ驩縺ョ豁ッ霆翫r菴懊k +achievement.ss.steel_gear.desc2=遏ウ轤ュ荳崎カウ ? + +achievement.ss.steam_motor=闥ク豌励ョ繝√き繝ゥ +achievement.ss.steam_motor.desc=闥ク豌励Δ繝シ繧ソ繝シ繧剃ス懊k +achievement.ss.steam_motor.desc2=逕」讌ュ髱ゥ蜻ス + +achievement.ss.large_windmill=鬚ィ霆雁、ァ蟆鞘ヲ +achievement.ss.large_windmill.desc=螟ァ縺阪>鬚ィ霆翫r菴懊k +achievement.ss.large_windmill.desc2=螟ァ縺阪↑蜉 + +achievement.ss.pulverizer=蟾・讌ュ縺ョ譎ゆサ」 +achievement.ss.pulverizer.desc=邊臥墓ゥ溘r菴懊k +achievement.ss.pulverizer.desc2=縺薙l縺ァ2蛟 ! + +achievement.ss.extractor=霑第悴譚・ +achievement.ss.extractor.desc=謚ス蜃コ蝎ィ繧剃ス懊k +achievement.ss.extractor.desc2=豬蛹冶」鄂ョ ? + +achievement.ss.fan=縺ゅ≠シセ? +achievement.ss.fan.desc=繝輔ぃ繝ウ繧剃ス懊k +achievement.ss.fan.desc2=髱偵>轤 ? + +achievement.ss.saw=繝悶Ο繝繧ッ繝悶Ξ繧、繧ォ繝シ +achievement.ss.saw.desc=繝弱さ繧剃ス懈舌☆繧 +achievement.ss.saw.desc2=縺溘□螢翫☆縺ョ縺ソ + +achievement.ss.ninja_gear=荳肴晁ュー縺ェ蜉 ? +achievement.ss.ninja_gear.desc=繝九Φ繧ク繝」縺ョ豁ッ霆翫r菴懊k +achievement.ss.ninja_gear.desc2=繝九ャ繝昴Φ ! + +achievement.ss.rolling_machine=縺セ縺ェ譚ソ +achievement.ss.rolling_machine.desc=蝨ァ蟒カ讖溘r菴懊k +achievement.ss.rolling_machine.desc2=縺九↑繧翫∪縺ェ譚ソ縺繧医%繧 ! + +achievement.ss.mana_squeezer=蝨ー逅縺ョ諱オ縺ソ +achievement.ss.mana_squeezer.desc=繝槭リ謚ス蜃コ蝎ィ繧剃ス懊k +achievement.ss.mana_squeezer.desc2=霎イ讌ュ縺ョ閾ェ蜍募喧 ? + +achievement.ss.orichalcum_gear=隰弱ョ蜉 ! +achievement.ss.orichalcum_gear.desc=繧ェ繝ェ繝上Ν繧ウ繝ウ縺ョ豁ッ霆翫r菴懊k +achievement.ss.orichalcum_gear.desc2=繧ィ繝ウ繝峨さ繝ウ繝繝ウ繝 + +achievement.ss.time_machine=繧ソ繧、繝繝槭す繝ウ +achievement.ss.time_machine.desc=繧ソ繧、繝繝槭す繝ウ繧剃ス懊k +achievement.ss.time_machine.desc2=荳也阜邱壹′螟峨o縺」縺 ! + +achievement.ss.economy=SS2 -邨梧ク- + +achievement.ss.creeper_firework=繧ッ繝ェ繝シ繝代シ蝠莠コ +achievement.ss.creeper_firework.desc=闃ア轣ォ縺ァ騾壻ソ。縺励※縺ソ繧医≧ +achievement.ss.creeper_firework.desc2=辷逋コ ! + +achievement.ss.creeper_chest=繧ッ繝ェ繝シ繝代シ繝√ぉ繧ケ繝 +achievement.ss.creeper_chest.desc=縺輔=縲√吶ャ繝峨∈陦後%縺縲 +achievement.ss.creeper_chest.desc2=繧ッ繝ェ繝シ繝代シ縺ョ繧オ繝ウ繧ソ ? + +achievement.ss.shipping=蜃コ闕キ邂ア +achievement.ss.shipping.desc=蜃コ闕キ縺励※縺ソ繧医≧ +achievement.ss.shipping.desc=遘√ッ蜆荳髟キ閠 ! + +#Dep +dep.ss.error1=縺ッ蠢隕√↑繝ゥ繧、繝悶Λ繝ェ +dep.ss.error2=繧偵ム繧ヲ繝ウ繝ュ繝シ繝峨☆繧九%縺ィ縺後〒縺阪∪縺帙s縺ァ縺励◆縲 +dep.ss.error2=繧、繝ウ繧ソ繝シ繝阪ャ繝医ョ謗・邯壹r遒コ隱阪@縺ヲ蜀崎オキ蜍輔☆繧九°縲∵焔蜍輔〒 +dep.ss.error3=縺九i繝繧ヲ繝ウ繝ュ繝シ繝峨@縺ヲmods縺ョ繝輔か繝ォ繝縺ォ蜈・繧後※縺上□縺輔>縲 + +#NEI +nei.recipe=繝ャ繧キ繝 +nei.ss.furnace.shaped=螳壼ス「 邊セ骭ャ +nei.ss.furnace.shapeless=荳榊ョ壼ス「 邊セ骭ャ + +nei.ss.fluid_furnace=豬∽ス薙°縺セ縺ゥ +nei.ss.food_smokers=辯サ陬ス蝎ィ + +nei.ss.magic_furnace=鬲疲ウ輔°縺セ縺ゥ +nei.ss.magic_fuel=鬲疲ウ輔ョ辯譁 + +nei.ss.freezer=繝輔Μ繝シ繧カ繝シ +nei.ss.ice=fuel=陬ス豌キ蜑、 + +nei.ss.millstone=遏ウ閾シ +nei.ss.loom=郢疲ゥ +nei.ss.sawmill=陬ス譚先ゥ +nei.ss.spinning_machine=邏。邵セ讖 +nei.ss.extractor=謚ス蜃コ讖 +nei.ss.pulverizer=邊臥墓ゥ +nei.ss.rolling_machine=蝨ァ蟒カ讖 +nei.ss.mana_squeezer=繝槭リ謚ス蜃コ讖 +nei.ss.time_machine=繧ソ繧、繝繝槭す繝ウ + +nei.ss.fertilizer_farmland=霎イ蝨ー 遯∫┯螟臥焚 +nei.ss.fertilizer_paddy=豌エ逕ー 遯∫┯螟臥焚 diff --git a/src/main/resources/assets/sextiarysector/lang/zh_CN.lang b/src/main/resources/assets/sextiarysector/lang/zh_CN.lang new file mode 100644 index 0000000..86c0a8b --- /dev/null +++ b/src/main/resources/assets/sextiarysector/lang/zh_CN.lang @@ -0,0 +1,786 @@ +#邂菴謎クュ譁 zh_CN + +#black +tile.ss.large_furnace.name=螟ァ蝙狗皮i +tile.ss.fluid_furnace.name=豬∽ス鍋皮i + +tile.ss.food_smokers.name=辭丞宛譛コ + +tile.ss.magic_furnace.name=鬲泌鴨辭皮i +tile.ss.freezer.name=蜀キ蜀サ譛コ + +tile.ss.wood_grate.name=譛ィ譬乗揉 + +tile.ss.oak_wood_plate.name=讖。譬第惠譚ソ +tile.ss.birch_wood_plate.name=逋ス譯ヲ譛ィ譚ソ +tile.ss.spruce_wood_plate.name=莠第揄譛ィ譚ソ +tile.ss.jungle_wood_plate.name=荳帶棊譛ィ譚ソ +tile.ss.acacia_wood_plate.name=驥大粋谺「譛ィ譚ソ +tile.ss.big_oak_wood_plate.name=豺ア濶イ讖。譬第惠譚ソ + +tile.ss.iron_plate.name=體∵攸 +tile.ss.gold_plate.name=驥第攸 + +tile.ss.hole.name=蝮醍伐 +tile.ss.farmland.name=蜀懃伐 +tile.ss.paddy.name=遞サ逕ー +tile.ss.wood.name=蜴滓惠 + +tile.ss.bottle.name=豬∽ス鍋童 +tile.ss.fluid_crafter.name=豬∽ス捺ー疲ウ。 +tile.ss.square.name=譛ィ讒ス + +tile.ss.tank.name=蛯ィ鄂 +tile.ss.funnel.name=豬∽ス捺シ乗沫 +tile.ss.copper_pipe.name=體懆エィ邂。驕 + + +tile.ss.wood_hopper.name=譛ィ雍ィ貍乗沫 + +tile.ss.chunk_loader.name=譌カ遨コ霓ス蜈・蝎ィ + +tile.ss.figure.name=謌仙ーア蜿ー + +tile.ss.trap.name=髯キ髦ア + +tile.ss.drinking_water.name=鬣ョ逕ィ豌エ +tile.ss.hot_springs.name=貂ゥ豕画ーエ + + +tile.ss.blue_stone.name=闢晉浹遏ソ遏ウ +tile.ss.yellow_stone.name=鮟遏ウ遏ソ遏ウ + +tile.ss.copper_ore.name=體懃涸遏ウ +tile.ss.zinc_ore.name=髞檎涸遏ウ +tile.ss.silver_ore.name=體カ遏ソ遏ウ + +tile.ss.mithril_ore.name=遘倬童遏ソ遏ウ +tile.ss.orichalcum_ore.name=螻ア體懃涸遏ウ + +tile.ss.coal_large_ore.name=螟ァ蝙狗、遏ソ遏ウ +tile.ss.iron_large_ore.name=螟ァ蝙矩刀遏ソ遏ウ +tile.ss.gold_large_ore.name=螟ァ蝙矩醍涸遏ウ + +tile.ss.copper_block.name=體懈婿蝮 +tile.ss.zinc_block.name=髞梧婿蝮 +tile.ss.silver_block.name=體カ譁ケ蝮 +tile.ss.steel_block.name=髓「譁ケ蝮 +tile.ss.brass_block.name=鮟體懈婿蝮 +tile.ss.ninja_block.name=蠢崎譁ケ蝮 +tile.ss.mithril_block.name=遘倬童譁ケ蝮 +tile.ss.orichalcum_block.name=螻ア體懈婿蝮 + +tile.ss.small_windmill.name=蟆丞梛鬟手スヲ +tile.ss.windmill.name=鬟手スヲ +tile.ss.large_windmill.name=螟ァ蝙矩」手スヲ +tile.ss.small_waterwheel.name=蟆丞梛豌エ霓ヲ +tile.ss.steam_motor.name=闥ク豎ス蠑墓梼 + +tile.ss.wood_shaft.name=譛ィ霓エ +tile.ss.stone_shaft.name=遏ウ霓エ +tile.ss.steel_shaft.name=髓「霓エ +tile.ss.ninja_shaft.name=蠢崎霓エ +tile.ss.orichalcum_shaft.name=螻ア體懆スエ + +tile.ss.wood_gear_box.name=譛ィ雍ィ蜿倬溽ョア +tile.ss.stone_gear_box.name=遏ウ雍ィ蜿倬溽ョア +tile.ss.steel_gear_box.name=髓「雍ィ蜿倬溽ョア +tile.ss.ninja_gear_box.name=蠢崎蜿倬溽ョア +tile.ss.orichalcum_gear_box.name=螻ア體懷序騾溽ョア + +tile.ss.wood_gf_tank.name=譛ィ雍ィGF鄂 +tile.ss.stone_gf_tank.name=遏ウ雍ィGF鄂 +tile.ss.steel_gf_tank.name=髓「雍ィGF鄂 +tile.ss.ninja_gf_tank.name=蠢崎GF鄂 +tile.ss.orichalcum_gf_tank.name=螻ア體廨F鄂 + +tile.ss.wood_stone_gear_shaft.name=譛ィ遏ウ鮨ソ霓ョ霓エ +tile.ss.stone_steel_gear_shaft.name=遏ウ髓「鮨ソ霓ョ霓エ +tile.ss.steel_ninja_gear_shaft.name=蠢埼弔鮨ソ霓ョ霓エ +tile.ss.ninja_orichalcum_gear_shaft.name=蠢埼糖鮨ソ霓ョ霓エ + +tile.ss.machine_frame.name=譛コ譴ー譯譫カ +tile.ss.millstone.name=逎ィ遏ウ +tile.ss.loom.name=扈蟶譛コ +tile.ss.sawmill.name=髞ッ譛ィ譛コ +tile.ss.spinning_machine.name=郤コ郤ア譛コ +tile.ss.pulverizer.name=逎ィ邊画惻 +tile.ss.extractor.name=謠仙叙譛コ +tile.ss.rolling_machine.name=霎雁視譛コ +tile.ss.mana_squeezer.name=鬲泌鴨蜴区ヲィ譛コ +tile.ss.time_machine.name=譌カ蜈画惻 + + +tile.ss.fan.name=鬟取援 +tile.ss.saw.name=髞ッ蟄 +tile.ss.pump.name=豌エ豕オ +tile.ss.suction_machine.name=謚ス蜷ク譛コ + + +tile.ss.creeper_chest.name=辷ャ陦瑚蝠莠コ邂ア蟄 +tile.ss.shipping_box.name=闊ケ闊カ邂ア蟄 + +tile.ss.turnip.name=關晏骨遘榊ュ +tile.ss.cucumber.name=鮟逑懃ァ榊ュ +tile.ss.iron_turnip.name=體∬雀蜊懃ァ榊ュ + +tile.ss.onion.name=豢玖続遘榊ュ +tile.ss.tomato.name=逡ェ闌遘榊ュ +tile.ss.corn.name=邇臥アウ遘榊ュ +tile.ss.golden_corn.name=驥醍脂邀ウ遘榊ュ + +tile.ss.eggplant.name=闌蟄千ァ榊ュ +tile.ss.sweet_potato.name=逡ェ阮ッ遘榊ュ +tile.ss.green_pepper.name=髱呈、堤ァ榊ュ + +tile.ss.radish.name=逋ス關晏骨遘榊ュ + +tile.ss.rice.name=遞サ邀ウ遘榊ュ + +tile.ss.mushroom_red.name=郤「陂題順遘榊ュ +tile.ss.shiitake.name=鬥呵順遘榊ュ + + +tile.ss.sandpit.name=豐吝搗 + +tile.ss.boarding_buoy.name=荳願飴豬ョ譬 +tile.ss.powered_buoy.name=蜈閭ス豬ョ譬 +tile.ss.detector_buoy.name=謗「豬区オョ譬 + +tile.ss.monitor.name=逶題ァ蝎ィ +monitor.type=邀サ蝙 +monitor.creeper=邂蜊慕握陦瑚蝠蠎 +monitor.robot=闢晁牡譛コ蝎ィ莠コ蝠蠎 + +tile.ss.electric_motor.name=逕オ蜉帛シ墓梼 +tile.ss.tofu_motor.name=雎閻仙シ墓梼 +tile.ss.gf_dynamo.name=GF蜿醍鳩譛コ + +#Item +item.ss.unit.name=蜊募 + +item.ss.wood_gear.name=譛ィ雍ィ鮨ソ霓ョ +item.ss.stone_gear.name=遏ウ雍ィ鮨ソ霓ョ +item.ss.steel_gear.name=髓「雍ィ鮨ソ霓ョ +item.ss.ninja_gear.name=蠢崎鮨ソ霓ョ +item.ss.orichalcum_gear.name=螻ア體憺スソ霓ョ + +item.ss.wood_unit_gear.name=譛ィ雍ィ鮨ソ霓ョ蜊募 +item.ss.stone_unit_gear.name=遏ウ雍ィ鮨ソ霓ョ蜊募 +item.ss.steel_unit_gear.name=髓「雍ィ鮨ソ霓ョ蜊募 +item.ss.ninja_unit_gear.name=蠢崎鮨ソ霓ョ蜊募 +item.ss.orichalcum_unit_gear.name=螻ア體憺スソ霓ョ蜊募 + +item.ss.wood_gf_storage.name=譛ィ雍ィGF蟄伜お蝎ィ +item.ss.stone_gf_storage.name=遏ウ雍ィGF蟄伜お蝎ィ +item.ss.steel_gf_storage.name=髓「雍ィGF蟄伜お蝎ィ +item.ss.ninja_gf_storage.name=蠢崎GF蟄伜お蝎ィ +item.ss.orichalcum_gf_storage.name=螻ア體廨F蟄伜お蝎ィ + +item.ss.hammer.name=髞、蟄 + +item.ss.calendar.name=譌・蜴 +item.ss.season_stone.name=蟄」闃ゆケ狗浹 +item.ss.season_stone_spring.name=蟄」闃ゆケ狗浹 -譏・蟄」- +item.ss.season_stone_summer.name=蟄」闃ゆケ狗浹 -螟丞ュ」- +item.ss.season_stone_autumn.name=蟄」闃ゆケ狗浹 -遘句ュ」- +item.ss.season_stone_winter.name=蟄」闃ゆケ狗浹 -蜀ャ蟄」- + + + +item.ss.dust_waterlily.name=逹。闔イ邊画忰 + +item.ss.stone_dust.name=遏ウ螟エ邊 + +item.ss.dust_blue_stone.name=闢晉浹邊 +item.ss.dust_yellow_stone.name=鮟遏ウ邊 + +item.ss.coal_dust.name=辣、邊 +item.ss.iron_dust.name=體∫イ +item.ss.gold_dust.name=驥醍イ +item.ss.diamond_dust.name=髓サ遏ウ邊 + +item.ss.copper_dust.name=體懃イ +item.ss.zinc_dust.name=髞檎イ + +item.ss.mithril_dust.name=遘倬童邊 + +item.ss.steel_ingot.name=髓「髞ュ +item.ss.brass_ingot.name=鮟體憺発 + +item.ss.bluestone_ingot.name=闢晉浹髞ュ +item.ss.yellowstone_ingot.name=鮟遏ウ髞ュ + +item.ss.copper_ingot.name=體憺発 +item.ss.zinc_ingot.name=髞碁発 +item.ss.silver_ingot.name=體カ髞ュ + +item.ss.craft_reactor.name=蜷域仙渚蠎泌勣 +item.ss.mithril_ingot.name=遘倬童髞ュ +item.ss.orichalcum_gem.name=螻ア體憺発 + +item.ss.ninja_ingot.name=蠢崎髞ュ + +item.ss.iron_nugget.name=體∫イ +item.ss.copper_nugget.name=體懃イ +item.ss.zinc_nugget.name=髞檎イ +item.ss.silver_nugget.name=體カ邊 + +item.ss.steel_nugget.name=髓「邊 +item.ss.ninja_nugget.name=蠢崎邊 + +item.ss.obsidian_nugget.name=鮟第屆遏ウ邊 + +item.ss.red_gel.name=郤「遏ウ蜃晁Ω +item.ss.blue_gel.name=闢晉浹蜃晁Ω +item.ss.yellow_gel.name=鮟遏ウ蜃晁Ω + +item.ss.energy_reactor.name=閭ス貅仙渚蠎泌勣 +item.ss.object_reactor.name=逶ョ譬蜿榊コ泌勣 + + + +item.ss.empty_bottle.name=遨コ逑カ +item.ss.water_bottle.name=豌エ逑カ +item.ss.lava_bottle.name=蟯ゥ豬逑カ +item.ss.sap_bottle.name=譬第ア∫童 + +item.ss.steam_bucket.name=闥ク豎ス譯カ +item.ss.iron_fluid_bucket.name=豸イ諤體∵。カ +item.ss.gold_fluid_bucket.name=豸イ諤驥第。カ + +item.ss.magic_dust.name=鬲泌鴨邊 + + +item.ss.silk_bobbin.name=荳晉サク蜊キ +item.ss.cloth.name=蟶蛹ケ +item.ss.small_cloth.name=蟆丞梛蟶蛹ケ +item.ss.canvas.name=蟶蟶 +item.ss.drying_flesh.name=蟷イ辯・閻占i +item.ss.flesh_bobbin.name=霎」譚。 +item.ss.string_mass.name=郤ソ蝗「 +item.ss.strong_string.name=蜴壼ョ樒コソ +item.ss.strong_string_bobbin.name=蜴壼ョ樒コソ遲 +item.ss.strong_cloth.name=蜴壼ョ槫ク蛹ケ +item.ss.strong_canvas.name=蜴壼ョ槫ク蟶 + + +item.ss.figure_box.name=螂門干蜿ー邂ア + + +item.ss.wood_scoop.name=譛ィ體イ +item.ss.stone_scoop.name=遏ウ體イ +item.ss.iron_scoop.name=體體イ +item.ss.gold_scoop.name=驥鷹憧 +item.ss.diamond_scoop.name=髓サ遏ウ體イ +item.ss.brass_scoop.name=鮟體憺憧 + +item.ss.wood_knife.name=譛ィ雍ィ蟆丞 +item.ss.stone_knife.name=遏ウ雍ィ蟆丞 +item.ss.iron_knife.name=體∬エィ蟆丞 +item.ss.gold_knife.name=驥題エィ蟆丞 +item.ss.diamond_knife.name=髓サ遏ウ蟆丞 +item.ss.brass_knife.name=鮟體懷ー丞 + +item.ss.copper_shovel.name=體憺隼 +item.ss.copper_pickaxe.name=體憺武 +item.ss.copper_axe.name=體憺憧 +item.ss.copper_sword.name=體懷苑 +item.ss.copper_hoe.name=體憺売 + +item.ss.brass_shovel.name=鮟體憺隼 +item.ss.brass_pickaxe.name=鮟體憺武 +item.ss.brass_axe.name=鮟體懈密 +item.ss.brass_sword.name=鮟體懷苑 +item.ss.brass_hoe.name=鮟體憺売 + +item.ss.copper_helmet.name=體懷、エ逶 +item.ss.copper_chestplate.name=體懆ク逕イ +item.ss.copper_leggings.name=體懈侃閻ソ +item.ss.copper_boots.name=體憺擽蟄 + +item.ss.ninja_helmet.name=蠢崎螟エ逶 +item.ss.ninja_chestplate.name=蠢崎閭ク逕イ +item.ss.ninja_leggings.name=蠢崎謚、閻ソ +item.ss.ninja_boots.name=蠢崎髱エ蟄 + +item.ss.wood_watering_can.name=譛ィ雍ィ豢呈ーエ螢カ + +item.ss.brass_shears.name=鮟體懷岡蛻 + +item.ss.mineboat_chest.name=邂ア蟄仙ー剰飴 +item.ss.mineboat_tank.name=蛯ィ鄂仙ー剰飴 + +item.ss.laver.name=邏ォ闖 + + +item.ss.crop.big=螟ァ蝙 + +item.ss.turnip.name=關晏骨 +item.ss.cucumber.name=鮟逑 + +item.ss.iron_turnip.name=體∬雀蜊 + +item.ss.onion.name=豢玖続 +item.ss.tomato.name=逡ェ闌 +item.ss.corn.name=邇臥アウ + +item.ss.golden_corn.name=驥醍脂邀ウ + +item.ss.eggplant.name=闌蟄 +item.ss.sweet_potato.name=逕倩民 +item.ss.blue_potato.name=闢晏悄雎 + +item.ss.radish.name=逋ス關晏骨 + +item.ss.rice.name=遞サ邀ウ + +item.ss.shiitake.name=鬥呵順 + + +item.ss.squid_sashimi.name=魍ソ魍シ蛻コ霄ォ + +item.ss.white_rice.name=螟ァ邀ウ + +item.ss.salt.name=逶 +item.ss.curry_powder.name=蜥門務鬣ュ + +item.ss.laver_roasted.name=辜、邏ォ闖 + +item.ss.chicken_smoked.name=辜溽城ク。閧 +item.ss.porkchop_smoked.name=辜溽冗謙謗 +item.ss.beef_smoked.name=辜溽冗央閧 + +item.ss.rice_ball.name=鬣ュ蝗「蟄 +item.ss.curry_rice.name=蜥門務鬣ュ + +item.ss.carrot_soup.name=閭。關晏骨豎、 +item.ss.corn_soup.name=邇臥アウ豎、 +item.ss.egg_soup.name=陋玖干豎、 +item.ss.mushroom_stew.name=陂題順辣イ +item.ss.onion_soup.name=豢玖続豎、 +item.ss.ender_soup.name=譛ォ蠖ア豎、 +item.ss.tomato_soup.name=逡ェ闌豎、 + +item.ss.chocolate.name=蟾ァ蜈句鴨 + +item.ss.drinking_water_bottle.name=鬣ョ逕ィ豌エ逑カ +item.ss.takumi_tea_bottle.name=TAKUMI闌カ逑カ + + + +item.ss.shift_hat.name=Shift逧蟶ス蟄 +item.ss.rucksack.name=蟶蟶蛹 +item.ss.oxygen_tank.name=豌ァ豌泌お鄂 +item.ss.gf_contact_lenses.name=GF髫仙ス「逵シ髟 +item.ss.water_contact_lenses.name=豌エ轣オ髫仙ス「逵シ髟 + +item.ss.craft_unit.name=蜷域仙黒蜈 +item.ss.attack_unit.name=謾サ蜃サ蜊募 +item.ss.defense_unit.name=髦イ蠕。蜊募 +item.ss.attack_rust_unit.name=逕滄蝿謾サ蜃サ蜊募 +item.ss.defense_rust_unit.name=逕滄蝿髦イ蠕。蜊募 +item.ss.jump_unit.name=霍ウ霍蜊募 +item.ss.dash_unit.name=蜀イ蛻コ蜊募 +item.ss.slowly_unit.name=諷「豁・蜊募 +item.ss.pulling_unit.name=蠑コ蠑灘黒蜈 +item.ss.multi_schott_unit.name=螟夐榊ー蜃サ蜊募 +item.ss.bed_monster_unit.name=逹。逵蜊募 +item.ss.pickaxe_unit.name=驥謗伜黒蜈 + +item.ss.magic_contact_lenses.name=鬲疲ウ暮嚼蠖「逵シ髟 + +item.ss.debug_unit.name=隹隸募黒蜈 + +item.ss.quiver.name=邂ュ陲 + +item.ss.iron_ring.name=體∵欠邇ッ +item.ss.creeper_ring.name=辷ャ陦瑚蝠蠎玲欠邇ッ +item.ss.mp_ring.name=髓ア蟶∵欠邇ッ +item.ss.xp_ring.name=扈城ェ梧欠邇ッ + + + +#豸イ菴 +fluid.ss.takumi_tea=TAKUMI 闌カ +fluid.ss.drinking_water=鬣ョ逕ィ豌エ +fluid.ss.spring_water=豕画ーエ +fluid.ss.hot_springs=貂ゥ豕画ーエ +fluid.ss.steam=闥ク豎ス +fluid.ss.mana=鬲泌鴨 +fluid.ss.oxygen=豌ァ豌 +fluid.ss.sap=譬第ア + +fluid.ss.iron=豸イ諤體 +fluid.ss.gold=豸イ諤驥 + +fluid.ss.black=鮟題牡 +fluid.ss.red=郤「濶イ +fluid.ss.green=扈ソ濶イ +fluid.ss.brown=譽戊牡 +fluid.ss.blue=闢晁牡 +fluid.ss.purple=邏ォ濶イ +fluid.ss.cyan=髱定牡 +fluid.ss.lightgray=豺。轣ー濶イ +fluid.ss.gray=轣ー濶イ +fluid.ss.pink=邊芽牡 +fluid.ss.lime=鮟扈ソ濶イ +fluid.ss.yellow=鮟濶イ +fluid.ss.lightblue=豺。闢晁牡 +fluid.ss.magenta=蜩∫コ「濶イ +fluid.ss.orange=讖呵牡 +fluid.ss.white=逋ス濶イ + +#Potion +ss.potion.burn=辯辜ァ +ss.potion.hot_springs=貂ゥ豕 + +#GUI +container.large_furnace=螟ァ蝙狗皮i +container.sub.inventory=郛灘ュ倡ョア + +container.mineboat_chest=邂ア蟄仙ー剰飴 + +gui.ss.fluid_furnace=豬∽ス鍋皮i +gui.ss.food_smokers=辭丞宛譛コ +gui.ss.magic_furnace=鬲泌鴨辭皮i +gui.ss.freezer=蜀キ蜀サ譛コ +gui.ss.funnel=豬∽ス捺シ乗沫 + +gui.ss.shipping_box=闊ケ闊カ邂ア蟄 + +gui.ss.rucksack=蟶蟶蛹 + +gui.ss.steam_motor=闥ク豎ス蠑墓梼 + +gui.ss.millstone=逎ィ遏ウ +gui.ss.loom=扈蟶譛コ +gui.ss.sawmill=髞ッ譛ィ譛コ +gui.ss.spinning_machine=郤コ郤ア譛コ +gui.ss.extractor=謠仙叙譛コ +gui.ss.pulverizer=逎ィ邊画惻 +gui.ss.rolling_machine=霎雁視譛コ +gui.ss.mana_squeezer=鬲泌鴨蜴区ヲィ譛コ +gui.ss.time_machine=譌カ蜈画惻 + +gui.ss.gf_tank_1=譛ィ雍ィGF鄂 +gui.ss.gf_tank_2=遏ウ雍ィGF鄂 +gui.ss.gf_tank_3=髓「雍ィGF鄂 +gui.ss.gf_tank_4=蠢崎GF鄂 +gui.ss.gf_tank_5=螻ア體廨F鄂 + +#Shop +shop.ss.creeper=辷ャ陦瑚蝠蠎 +shop.ss.robot=譛コ蝎ィ莠コ蝠蠎 + +#ToolTip +tooltip.season.pm=荳句壕 +tooltip.season.am=荳雁壕 +tooltip.season.day=螟ゥ謨ー + +tooltip.season=蟄」闃 +tooltip.season.seed=蟄」闃 +tooltip.season.spring=譏・蟄」 +tooltip.season.summer=螟丞ュ」 +tooltip.season.autumn=遘句ュ」 +tooltip.season.winter=蜀ャ蟄」 + +tooltip.name=蜷榊ュ +tooltip.edition=迚域悽 + +#Edition +edition.creative=蛻幃讓。蠑乗 +edition.achievement=謌仙ーア +edition.figure_beginner=蛻晏ュヲ閠 +edition.ore_festival=遏ソ迚ゥ闃よ律 + +edition.schr0_cleaver=Schr0蛻閧牙 + +#Tab +itemGroup.ss.core=SextiarySector -譬ク蠢- +itemGroup.ss.fluid=SextiarySector -豬∽ス- +itemGroup.ss.player=SextiarySector -邇ゥ螳カ- +itemGroup.ss.agriculture=SextiarySector -蜀應ク- +itemGroup.ss.fishery=SextiarySector -貂比ク- +itemGroup.ss.mining=SextiarySector -遏ソ荳- +itemGroup.ss.industry=SextiarySector -蟾・荳- +itemGroup.ss.cooking=SextiarySector -辜ケ鬣ェ- +itemGroup.ss.transport=SextiarySector -莠、騾- +itemGroup.ss.economy=SextiarySector -扈乗オ- +itemGroup.ss.magic=SextiarySector -鬲疲ウ- + +#Player Tab +player.tab.vanilla=蜴溽沿 +player.tab.equipment=隶セ螟 +player.tab.item.ss.craft_unit=蜷域 + +player.tab.item.ss.rucksack=蟶蟶蛹 + +player.tab.item.ss.creeper_ring=辷ャ陦瑚蝠蠎 + +#Achievement +stat.sell=雍ゥ蜊 + +achievement.ss.core=SS2 -譬ク蠢- + +achievement.ss.moisture=貉ソ蠎ヲ +achievement.ss.moisture.desc=隶ゥ謨エ荳ェ荳也阜豌エ蛹門制 +achievement.ss.moisture.desc2=蜈画サ醍噪逧ョ閧、 + +achievement.ss.bottle=逑カ蟄 +achievement.ss.bottle.desc=蜷域蝉ク荳ェ逑カ蟄 +achievement.ss.bottle.desc2=蠑コ蛹也噪逑カ蟄 + +achievement.ss.drinking_water=鬣ョ逕ィ豌エ +achievement.ss.drinking_water.desc=蜀カ轤シ豌エ逑カ +achievement.ss.drinking_water.desc2=鄒主袖! + +achievement.ss.craft_furnace=蜷域千皮i +achievement.ss.craft_furnace.desc=蜷域蝉ク荳ェ螟ァ蝙狗皮i +achievement.ss.craft_furnace.desc2=譖エ螟肴揩逧蜷域 + +achievement.ss.hammer=髞、蟄! +achievement.ss.hammer.desc=蜷域蝉ク荳ェ螟ァ蝙矩筈蟄 +achievement.ss.hammer.desc2=譌謨御コ? + +achievement.ss.fluid_furnace=陞崎ァ」 +achievement.ss.fluid_furnace.desc=蜷域蝉ク荳ェ豬∽ス鍋皮i +achievement.ss.fluid_furnace.desc2=螳閭ス螟滓磁隗ヲ辭疲カイ + +achievement.ss.freezer=譛譁ー逧蜀キ蜀サ譛コ +achievement.ss.freezer.desc=蜷域蝉ク荳ェ蜀キ蜀サ譛コ +achievement.ss.freezer.desc2=螳... + + +achievement.ss.agriculture=SS2 -蜀應ク- + +achievement.ss.data=菴懃黄謨ー謐ョ + +achievement.ss.seed=隨ャ荳鬚礼ァ榊ュ +achievement.ss.seed.desc=雍ュ荵ー荳邊堤ァ榊ュ +achievement.ss.seed.desc2=謠宣ォ + +achievement.ss.scoop=體イ蟄 +achievement.ss.scoop.desc=蜷域蝉ク謚企憧蟄 +achievement.ss.scoop.desc2=蜿句・ス逧謗・隗ヲ + +achievement.ss.farmland=蜀懃伐 +achievement.ss.farmland.desc=蟇ケ蜴溽沿閠募慍菴ソ逕ィ體イ蟄 +achievement.ss.farmland.desc2=蝮壼崋譛牙鴨! + +achievement.ss.watering_can=豢呈ーエ螢カ +achievement.ss.watering_can.desc=蜷域蝉ク荳ェ豢呈ーエ螢カ +achievement.ss.watering_can.desc2=鬟樊コ逧豌エ闃ア + +achievement.ss.hole=蝮醍伐 +achievement.ss.hole.desc=蟇ケ豕・蝨滉スソ逕ィ體イ蟄 +achievement.ss.hole.desc2=譛芽ー∵弍荳荳ェ豢槫? + +achievement.ss.paddy=遞サ逕ー +achievement.ss.paddy.desc=蟇ケ蝮醍伐菴ソ逕ィ豌エ譯カ +achievement.ss.paddy.desc2=遘肴、咲ィサ邀ウ蜷ァ! + +## +achievement.ss.turnip=關晏骨 +achievement.ss.turnip.desc=驥鞫倅ク荳ェ關晏骨 + +achievement.ss.iron_turnip=體∬雀蜊 +achievement.ss.iron_turnip.desc=驥鞫倅ク荳ェ體∬雀蜊 + +achievement.ss.cucumber=鮟逑 +achievement.ss.cucumber.desc=驥鞫倅ク荳ェ鮟逑 + + +achievement.ss.onion=豢玖続 +achievement.ss.onion.desc=驥鞫倅ク荳ェ豢玖続 + +achievement.ss.tomato=逡ェ闌 +achievement.ss.tomato.desc=驥鞫倅ク荳ェ逡ェ闌 + +achievement.ss.corn=邇臥アウ +achievement.ss.corn.desc=驥鞫倅ク荳ェ邇臥アウ + +achievement.ss.golden_corn=驥醍脂邀ウ +achievement.ss.golden_corn.desc=驥鞫倅ク荳ェ驥醍脂邀ウ + + +achievement.ss.eggplant=闌蟄 +achievement.ss.eggplant.desc=驥鞫倅ク荳ェ闌蟄 + +achievement.ss.sweet_potato=逕倩民 +achievement.ss.sweet_potato.desc=驥鞫倅ク荳ェ逕倩民 + +achievement.ss.green_pepper=髱呈、 +achievement.ss.green_pepper.desc=驥鞫倅ク荳ェ髱呈、 + + +achievement.ss.radish=逋ス關晏骨 +achievement.ss.radish.desc=驥鞫倅ク荳ェ逋ス關晏骨 + + +achievement.ss.rice=遞サ邀ウ +achievement.ss.rice.desc=驥鞫倅ク荳ェ遞サ邀ウ + +achievement.ss.shiitake=鬥呵順 +achievement.ss.shiitake.desc=驥鞫倅ク荳ェ鬥呵順 + +achievement.ss.mining=SS2 -遏ソ荳- + +achievement.ss.bluestone_dust=荳榊酔逧鬚懆牡! +achievement.ss.bluestone_dust.desc=驥謗倅ク荳ェ闢晉浹 +achievement.ss.bluestone_dust.desc2=螟夂セ主賦! + +achievement.ss.copper_ore=譁ー蜈エ遏ソ莠ァ +achievement.ss.copper_ore.desc=驥謗倅ク荳ェ體懃涸遏ウ +achievement.ss.copper_ore.desc2=荳我クェ + +achievement.ss.silver_ore=鬚髦イ證玲捩 +achievement.ss.silver_ore.desc=驥謗倅ク荳ェ體カ遏ソ遏ウ +achievement.ss.silver_ore.desc2=譏セ雎。莠? + +achievement.ss.mithril_ore=鬲疲ウ慕噪蠑蟋 +achievement.ss.mithril_ore.desc=驥謗倅ク荳ェ遘倬童遏ソ +achievement.ss.mithril_ore.desc2=謖邇ッ蜻「? + +achievement.ss.industry=SS2 -蟾・荳- + +achievement.ss.bluestone_slime_ball=荳肴晁ョョ蜃晁Ω +achievement.ss.bluestone_slime_ball.desc=蜷域蝉ク荳ェ闢晁牡蜃晁Ω +achievement.ss.bluestone_slime_ball.desc2=螟壻ケ域」貞賦 + + +achievement.ss.wood_gear=譁ー蜈エ閭ス貅 +achievement.ss.wood_gear.desc=蜷域蝉ク荳ェ譛ィ雍ィ鮨ソ霓ョ +achievement.ss.wood_gear.desc2=螳逧蜷榊ュ怜将GF ! + +achievement.ss.small_windmill=譚・閾ェ貂鬟守噪蜉幃 +achievement.ss.small_windmill.desc=蜷域蝉ク荳ェ蟆丞梛鬟手スヲ +achievement.ss.small_windmill.desc2=鬟取弍譫∝・ス逧 + +achievement.ss.millstone=譛コ蝎ィ +achievement.ss.millstone.desc=蜷域蝉ク荳ェ逎ィ遏ウ +achievement.ss.millstone.desc2=逎ィ邊蛾擇邊 + +achievement.ss.loom=蟶蛹ケ! +achievement.ss.loom.desc=蜷域蝉ク荳ェ扈蟶譛コ +achievement.ss.loom.desc2=蜴サ謗芽。ィ髱「! + + +achievement.ss.stone_gear=閭ス貅仙合郤ァ +achievement.ss.stone_gear.desc=蜷域蝉ク荳ェ遏ウ螟エ鮨ソ霓ョ +achievement.ss.stone_gear.desc2=蜥檎浹螟エ逶ク豈? + +achievement.ss.windmill=豌疲オ∽ク雁合 +achievement.ss.windmill.desc=蜷域蝉ク荳ェ鬟手スヲ +achievement.ss.windmill.desc2=蜩ュ豕」逧鬟 + +achievement.ss.small_waterwheel=豌エ逧蜉幃 +achievement.ss.small_waterwheel.desc=蜷域蝉ク荳ェ蟆丞梛豌エ霓ヲ +achievement.ss.small_waterwheel.desc2=隸キ蜍ソ髱霑大イゥ豬! + +achievement.ss.sawmill=蛻髞区伜」ォ? +achievement.ss.sawmill.desc=蜷域蝉ク荳ェ髞ッ蟄 +achievement.ss.sawmill.desc2=隶ゥ謌台サャ荳襍キ邊芽コォ遒朱ェィ! + +achievement.ss.spinning_machine=霓サ驥冗コァ蟾・荳 +achievement.ss.spinning_machine.desc=蜷域蝉ク荳ェ郤コ扈譛コ +achievement.ss.spinning_machine.desc2=隶ゥ謌台サャ譚・邇ゥ鄙サ扈ウ貂ク謌 + + +achievement.ss.steel_gear=髓「逧蜉幃 +achievement.ss.steel_gear.desc=蜷域蝉ク荳ェ髓「雍ィ鮨ソ霓ョ +achievement.ss.steel_gear.desc2=郛コ辣、荳? + +achievement.ss.steam_motor=闥ク豎ス蜉ィ蜉 +achievement.ss.steam_motor.desc=蜷域蝉ク荳ェ闥ク豎ス蠑墓梼 +achievement.ss.steam_motor.desc2=蟾・荳夐擠譁ー + +achievement.ss.large_windmill=螟ァ蝙矩」手スヲ窶ヲ +achievement.ss.large_windmill.desc=蜷域蝉ク荳ェ螟ァ蝙矩」手スヲ +achievement.ss.large_windmill.desc2=蠑コ螟ァ逧蜉幃 + +achievement.ss.pulverizer=蟾・荳夂コェ蜈 +achievement.ss.pulverizer.desc=蜷域蝉ク荳ェ逎ィ邊画惻 +achievement.ss.pulverizer.desc2=閠∵攸譚・荳、莉ス! + +achievement.ss.extractor=譛ェ譚・ +achievement.ss.extractor.desc=蜷域蝉ク荳ェ謠仙叙譛コ +achievement.ss.extractor.desc2=謠千コッ隶セ螟? + +achievement.ss.fan=Oh~~~ +achievement.ss.fan.desc=蜷域蝉ク荳ェ鬟取援 +achievement.ss.fan.desc2=闢晁牡轣ォ辟ー? + +achievement.ss.saw=譁ケ蝮礼エ蝮乗惻 +achievement.ss.saw.desc=蜷域蝉ク荳ェ髞ッ蟄 +achievement.ss.saw.desc2=莉莉遐エ蝮乗脂閠悟キイ + +achievement.ss.ninja_gear=逾樒ァ倅ケ句鴨 ? +achievement.ss.ninja_gear.desc=蜷域蝉ク荳ェ蠢崎鮨ソ霓ョ +achievement.ss.ninja_gear.desc2=譚・閾ェ髴楢匯蝗ス! + +achievement.ss.rolling_machine=蛻譚ソ +achievement.ss.rolling_machine.desc=蜷域蝉ク荳ェ霎雁視譛コ +achievement.ss.rolling_machine.desc2=霑吝庄譏ッ荳荳ェ譫∝・ス逧蛻譚ソ! + +achievement.ss.mana_squeezer=螟ァ蝨ー荵狗・晉ヲ +achievement.ss.mana_squeezer.desc=蜷域蝉ク荳ェ鬲泌鴨蜴区ヲィ譛コ +achievement.ss.mana_squeezer.desc2=蜀應ク夊ェ蜉ィ蛹? + +achievement.ss.orichalcum_gear=逾樒ァ倅ケ句鴨! +achievement.ss.orichalcum_gear.desc=蜷域蝉ク荳ェ螻ア體憺スソ霓ョ +achievement.ss.orichalcum_gear.desc2=譛扈育噪蜀螳ケ + +achievement.ss.time_machine=譌カ蜈画惻 +achievement.ss.time_machine.desc=蜷域蝉ク荳ェ譌カ蜈画惻 +achievement.ss.time_machine.desc2=荳也阜郤ソ驛ス荳堺ク譬キ莠蜻「! + +achievement.ss.economy=SS2 -扈乗オ- + +achievement.ss.creeper_firework=辷ャ陦瑚蝠莠コ +achievement.ss.creeper_firework.desc=莨∝崟騾夊ソ辜溽↓譚・莨霎セ隶ッ蜿キ +achievement.ss.creeper_firework.desc2=辷轤ク! + +achievement.ss.creeper_chest=辷ャ陦瑚邂ア蟄 +achievement.ss.creeper_chest.desc=隶ゥ謌台サャ蜊慕峡蝨ィ蠎贋ク +achievement.ss.creeper_chest.desc2=蝨」隸櫁協蜉帶? + +achievement.ss.shipping=闊ケ闊カ譁ケ蝮 +achievement.ss.shipping.desc=隸戊ッ墓擂陬霓ス雍ァ迚ゥ +achievement.ss.shipping.desc2=謌大庄譏ッ逋セ荳蟇檎ソ! + + + +#Dep +dep.ss.error1=譏ッ髴隕∫噪遞句コ丞コ +dep.ss.error2=荳崎ス荳玖スス縲 +dep.ss.error2=遑ョ隶、莠定#鄂題ソ樊磁シ梧焔蜉ィ驥榊星 +dep.ss.error3=荳玖スス隸キ謾セ蜈・譁莉カ螟ケmods縲 + + +#NEI +nei.recipe=蜷域宣肴婿 +nei.ss.furnace.shaped=辭皮i譛牙コ城肴婿 +nei.ss.furnace.shapeless=辭皮i譌蠎城肴婿 + +nei.ss.fluid_furnace=豬∽ス鍋皮i驟肴婿 +nei.ss.food_smokers=辭丞宛譛コ驟肴婿 + +nei.ss.magic_furnace=鬲泌鴨辭皮i驟肴婿 +nei.ss.magic_fuel=鬲泌鴨辯譁 + +nei.ss.freezer=蜀キ蜀サ譛コ驟肴婿 +nei.ss.ice=fuel=蜀キ蜀サ辯譁 + +nei.ss.millstone=逎ィ遏ウ驟肴婿 +nei.ss.loom=扈蟶譛コ驟肴婿 +nei.ss.sawmill=髞ッ譛ィ譛コ驟肴婿 +nei.ss.spinning_machine=郤コ郤ア譛コ驟肴婿 +nei.ss.extractor=謠仙叙譛コ驟肴婿 +nei.ss.pulverizer=逎ィ邊画惻驟肴婿 +nei.ss.rolling_machine=霎雁視譛コ驟肴婿 +nei.ss.mana_squeezer=鬲泌鴨蜴区ヲィ譛コ驟肴婿 +nei.ss.time_machine=譌カ蜈画惻驟肴婿 + +nei.ss.fertilizer_farmland=蜀懃伐菴懃黄遯∝序 +nei.ss.fertilizer_paddy=遞サ逕ー菴懃黄遯∝序 diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_0.png new file mode 100644 index 0000000..caf5db3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_0.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_0.png.mcmeta new file mode 100644 index 0000000..7644671 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_0.png.mcmeta @@ -0,0 +1,38 @@ +{ + "animation": { + "frames": [ + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15 + ] + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_1.png new file mode 100644 index 0000000..0cb1f0b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_1.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_1.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/blocks/blue_fire_layer_1.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/bluestone_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/bluestone_ore.png deleted file mode 100644 index a819513..0000000 Binary files a/src/main/resources/assets/sextiarysector/textures/blocks/bluestone_ore.png and /dev/null differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/break.png b/src/main/resources/assets/sextiarysector/textures/blocks/break.png new file mode 100644 index 0000000..438b017 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/break.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy.png new file mode 100644 index 0000000..9bada97 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_0.png new file mode 100644 index 0000000..9bada97 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_0_active.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_0_active.png new file mode 100644 index 0000000..e628006 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_0_active.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_1.png new file mode 100644 index 0000000..1bf5519 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_1_active.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_1_active.png new file mode 100644 index 0000000..128a9b3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_1_active.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_2.png new file mode 100644 index 0000000..329dd33 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_2_active.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_2_active.png new file mode 100644 index 0000000..393d6d9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_2_active.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_3.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_3.png new file mode 100644 index 0000000..e95b681 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_3_active.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_3_active.png new file mode 100644 index 0000000..bb6c4b9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_3_active.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_4.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_4.png new file mode 100644 index 0000000..1e47aad Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_4.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_4_active.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_4_active.png new file mode 100644 index 0000000..fa86205 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_4_active.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_5.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_5.png new file mode 100644 index 0000000..44042ec Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_5.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_5_active.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_5_active.png new file mode 100644 index 0000000..1c92290 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_5_active.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_6.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_6.png new file mode 100644 index 0000000..00a16e2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_6.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_6_active.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_6_active.png new file mode 100644 index 0000000..f75e576 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_6_active.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_7.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_7.png new file mode 100644 index 0000000..f4ac378 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_7.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_7_active.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_7_active.png new file mode 100644 index 0000000..bbd92fe Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/boarding_buoy_7_active.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/detector_buoy.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/detector_buoy.png new file mode 100644 index 0000000..66ae39f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/detector_buoy.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/detector_buoy_powered.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/detector_buoy_powered.png new file mode 100644 index 0000000..dad5d15 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/detector_buoy_powered.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy.png new file mode 100644 index 0000000..ece12d4 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_0.png new file mode 100644 index 0000000..7da9b36 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_1.png new file mode 100644 index 0000000..ae0da6d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_2.png new file mode 100644 index 0000000..503fa26 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_3.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_3.png new file mode 100644 index 0000000..d89c072 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_4.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_4.png new file mode 100644 index 0000000..d413b20 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_4.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_5.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_5.png new file mode 100644 index 0000000..f0573fd Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_5.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_6.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_6.png new file mode 100644 index 0000000..539c06c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_6.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_7.png b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_7.png new file mode 100644 index 0000000..baf2690 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/buoy/powered_buoy_7.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_0.png new file mode 100644 index 0000000..c25f298 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_1.png new file mode 100644 index 0000000..fea7702 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_2.png new file mode 100644 index 0000000..ab6ebee Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_3.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_3.png new file mode 100644 index 0000000..759ba67 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/blue_potato_stage_3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_0.png new file mode 100644 index 0000000..e6c5360 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_1.png new file mode 100644 index 0000000..213d31c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_2.png new file mode 100644 index 0000000..28638df Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_3.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_3.png new file mode 100644 index 0000000..6b394b0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/copper_onion_stage_3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_0.png new file mode 100644 index 0000000..45f9cd6 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_1.png new file mode 100644 index 0000000..81af43b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_2.png new file mode 100644 index 0000000..6e51ec7 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_3.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_3.png new file mode 100644 index 0000000..552f245 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_4.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_4.png new file mode 100644 index 0000000..b573219 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/golden_corn_stage_4.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_0.png new file mode 100644 index 0000000..b3e4849 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_1.png new file mode 100644 index 0000000..65e3925 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_2.png new file mode 100644 index 0000000..9e4fce5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_3.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_3.png new file mode 100644 index 0000000..0f15244 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/iron_turnip_stage_3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_0.png new file mode 100644 index 0000000..4f69f11 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_1.png new file mode 100644 index 0000000..02f4f96 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_2.png new file mode 100644 index 0000000..b7afa7d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_3.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_3.png new file mode 100644 index 0000000..2a65a15 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/mushroom_red_stage_3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_0.png new file mode 100644 index 0000000..7d8040b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_1.png new file mode 100644 index 0000000..7491675 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_2.png new file mode 100644 index 0000000..90d387c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_3.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_3.png new file mode 100644 index 0000000..7acafb3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/rice_stage_3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_0.png new file mode 100644 index 0000000..56501cd Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_1.png new file mode 100644 index 0000000..1d208f4 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_2.png new file mode 100644 index 0000000..2d5fd4c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_3.png b/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_3.png new file mode 100644 index 0000000..6fa9848 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/crop/shiitake_stage_3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fertilizer/water_lily.png b/src/main/resources/assets/sextiarysector/textures/blocks/fertilizer/water_lily.png new file mode 100644 index 0000000..eee0b3b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/fertilizer/water_lily.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/figure.png b/src/main/resources/assets/sextiarysector/textures/blocks/figure.png new file mode 100644 index 0000000..8cc9dca Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/figure.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/figure_side.png b/src/main/resources/assets/sextiarysector/textures/blocks/figure_side.png new file mode 100644 index 0000000..67977ce Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/figure_side.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_flow.png b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_flow.png new file mode 100644 index 0000000..7f932ca Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_flow.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_flow.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_flow.png.mcmeta new file mode 100644 index 0000000..8e55e43 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_still.png b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_still.png new file mode 100644 index 0000000..ae41d3e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_still.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_still.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_still.png.mcmeta new file mode 100644 index 0000000..7ceb363 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/lava_still.png.mcmeta @@ -0,0 +1,45 @@ +{ + "animation": { + "frametime": 2, + "frames": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 18, + 17, + 16, + 15, + 14, + 13, + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid/portal.png b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/portal.png new file mode 100644 index 0000000..0400a5e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/portal.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid/portal.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/portal.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/portal.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_flow.png b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_flow.png new file mode 100644 index 0000000..90845f4 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_flow.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_flow.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_flow.png.mcmeta new file mode 100644 index 0000000..4f0718a --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_flow.png.mcmeta @@ -0,0 +1,3 @@ +{ + "animation": {} +} \ No newline at end of file diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_still.png b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_still.png new file mode 100644 index 0000000..f98b432 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_still.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/gear_storage_full.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_still.png.mcmeta similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/gearforce/gear_storage_full.png.mcmeta rename to src/main/resources/assets/sextiarysector/textures/blocks/fluid/water_still.png.mcmeta diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid_furnace_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/fluid_furnace_top.png new file mode 100644 index 0000000..f221818 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/fluid_furnace_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/fluid_furnace_top_on.png b/src/main/resources/assets/sextiarysector/textures/blocks/fluid_furnace_top_on.png new file mode 100644 index 0000000..2bf68b7 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/fluid_furnace_top_on.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_front_off.png b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_front_off.png new file mode 100644 index 0000000..1ee4ee9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_front_off.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_front_on.png b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_front_on.png new file mode 100644 index 0000000..046d2b1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_front_on.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_side.png b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_side.png new file mode 100644 index 0000000..ba6fc36 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_side.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_top.png new file mode 100644 index 0000000..32fefc8 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_top_on.png b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_top_on.png new file mode 100644 index 0000000..fe247d8 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/food_smokers_top_on.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/funnel_inside.png b/src/main/resources/assets/sextiarysector/textures/blocks/funnel_inside.png new file mode 100644 index 0000000..bb41604 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/funnel_inside.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/funnel_outside.png b/src/main/resources/assets/sextiarysector/textures/blocks/funnel_outside.png new file mode 100644 index 0000000..6162822 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/funnel_outside.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/funnel_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/funnel_top.png new file mode 100644 index 0000000..eb952d6 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/funnel_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/gold_block_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/gold_block_top.png new file mode 100644 index 0000000..fadbfbe Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/gold_block_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_front_off.png b/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_front_off.png new file mode 100644 index 0000000..5a4f70e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_front_off.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_front_on.png b/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_front_on.png new file mode 100644 index 0000000..ce0f392 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_front_on.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_side.png b/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_side.png new file mode 100644 index 0000000..115f73d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_side.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_top.png new file mode 100644 index 0000000..a3a5a08 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ice/freezer_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/iron_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/iron_block.png new file mode 100644 index 0000000..7816799 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/iron_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/iron_block_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/iron_block_top.png new file mode 100644 index 0000000..ae17cc9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/iron_block_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/leaf_bed_0.png b/src/main/resources/assets/sextiarysector/textures/blocks/leaf_bed_0.png new file mode 100644 index 0000000..a4f1a03 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/leaf_bed_0.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/leaf_bed_1.png b/src/main/resources/assets/sextiarysector/textures/blocks/leaf_bed_1.png new file mode 100644 index 0000000..2d915d5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/leaf_bed_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/leaf_bed_2.png b/src/main/resources/assets/sextiarysector/textures/blocks/leaf_bed_2.png new file mode 100644 index 0000000..79c8543 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/leaf_bed_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/extractor.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/extractor.png new file mode 100644 index 0000000..ca45e5d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/extractor.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/mana_squeezer.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/mana_squeezer.png new file mode 100644 index 0000000..1657555 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/mana_squeezer.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gear_box.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gear_box.png new file mode 100644 index 0000000..412bb77 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gear_box.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gear_box_in.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gear_box_in.png new file mode 100644 index 0000000..8fa0658 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gear_box_in.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gear_box_out.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gear_box_out.png new file mode 100644 index 0000000..3a0eaeb Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gear_box_out.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gf_tank.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gf_tank.png new file mode 100644 index 0000000..86797f1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gf_tank.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gf_tank_in.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gf_tank_in.png new file mode 100644 index 0000000..1673cb1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gf_tank_in.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gf_tank_out.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gf_tank_out.png new file mode 100644 index 0000000..272a9ce Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/ninja_gf_tank_out.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gear_box.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gear_box.png new file mode 100644 index 0000000..1f3e89c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gear_box.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gear_box_in.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gear_box_in.png new file mode 100644 index 0000000..f3d3026 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gear_box_in.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gear_box_out.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gear_box_out.png new file mode 100644 index 0000000..c477e20 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gear_box_out.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gf_tank.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gf_tank.png new file mode 100644 index 0000000..31e71b8 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gf_tank.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gf_tank_in.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gf_tank_in.png new file mode 100644 index 0000000..640670b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gf_tank_in.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gf_tank_out.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gf_tank_out.png new file mode 100644 index 0000000..1597e08 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/orichalcum_gf_tank_out.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/pulverizer.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pulverizer.png new file mode 100644 index 0000000..91b43b9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pulverizer.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump.png new file mode 100644 index 0000000..b598186 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump_front.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump_front.png new file mode 100644 index 0000000..94ce041 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump_front.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump_top.png new file mode 100644 index 0000000..c4ddbed Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump_up.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump_up.png new file mode 100644 index 0000000..e7f1494 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/pump_up.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/rolling_machine.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/rolling_machine.png new file mode 100644 index 0000000..51df099 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/rolling_machine.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/sawmill.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/sawmill.png new file mode 100644 index 0000000..aac7f17 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/sawmill.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/spinning_machine.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/spinning_machine.png new file mode 100644 index 0000000..ff0c468 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/spinning_machine.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gear_box.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gear_box.png new file mode 100644 index 0000000..fd30503 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gear_box.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gear_box_in.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gear_box_in.png new file mode 100644 index 0000000..4541268 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gear_box_in.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gear_box_out.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gear_box_out.png new file mode 100644 index 0000000..d369e73 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gear_box_out.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gf_tank.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gf_tank.png new file mode 100644 index 0000000..dc10364 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gf_tank.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gf_tank_in.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gf_tank_in.png new file mode 100644 index 0000000..1f3996b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gf_tank_in.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gf_tank_out.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gf_tank_out.png new file mode 100644 index 0000000..0e88db7 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/steel_gf_tank_out.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/machine/time_machine.png b/src/main/resources/assets/sextiarysector/textures/blocks/machine/time_machine.png new file mode 100644 index 0000000..ca38eac Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/machine/time_machine.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_front_off.png b/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_front_off.png new file mode 100644 index 0000000..18ce7f3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_front_off.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_front_on.png b/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_front_on.png new file mode 100644 index 0000000..0dbe80b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_front_on.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_side.png b/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_side.png new file mode 100644 index 0000000..dbe5003 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_side.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_top.png new file mode 100644 index 0000000..89ae0d3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/magic/furnace_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/bluestone_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/bluestone_ore.png new file mode 100644 index 0000000..f06ee8c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/bluestone_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/brass_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/brass_block.png new file mode 100644 index 0000000..5040e91 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/brass_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/coal_large_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/coal_large_ore.png index e30926f..e0f8eae 100644 Binary files a/src/main/resources/assets/sextiarysector/textures/blocks/ore/coal_large_ore.png and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/coal_large_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/copper_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/copper_block.png new file mode 100644 index 0000000..9a680b3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/copper_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/copper_block_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/copper_block_top.png new file mode 100644 index 0000000..b36f76a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/copper_block_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/copper_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/copper_ore.png new file mode 100644 index 0000000..650da44 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/copper_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/diamond_large_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/diamond_large_ore.png index 7660da5..87a817b 100644 Binary files a/src/main/resources/assets/sextiarysector/textures/blocks/ore/diamond_large_ore.png and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/diamond_large_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_block.png new file mode 100644 index 0000000..174002e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_large_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_large_ore.png index 9eb145c..0113d65 100644 Binary files a/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_large_ore.png and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_large_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_ore.png new file mode 100644 index 0000000..15763e6 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/gold_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/iron_block_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/iron_block_top.png new file mode 100644 index 0000000..ae17cc9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/iron_block_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/iron_large_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/iron_large_ore.png index 6a88964..9090655 100644 Binary files a/src/main/resources/assets/sextiarysector/textures/blocks/ore/iron_large_ore.png and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/iron_large_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/mithril_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/mithril_block.png new file mode 100644 index 0000000..d5dcf54 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/mithril_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/mithril_block.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/blocks/ore/mithril_block.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/blocks/ore/mithril_block.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/mithril_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/mithril_ore.png new file mode 100644 index 0000000..752779a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/mithril_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/ninja_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/ninja_block.png new file mode 100644 index 0000000..b2629d6 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/ninja_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/orichalcum_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/orichalcum_block.png new file mode 100644 index 0000000..1a8bfe2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/orichalcum_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/orichalcum_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/orichalcum_ore.png new file mode 100644 index 0000000..2498c1b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/orichalcum_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_block.png new file mode 100644 index 0000000..2b7f6c2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_block_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_block_top.png new file mode 100644 index 0000000..9d2cab4 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_block_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_large_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_large_ore.png new file mode 100644 index 0000000..f894a02 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_large_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_ore.png new file mode 100644 index 0000000..b9800e1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/silver_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/steel_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/steel_block.png new file mode 100644 index 0000000..93955b5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/steel_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/yellowstone_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/yellowstone_ore.png new file mode 100644 index 0000000..2d161bb Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/yellowstone_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/zinc_block.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/zinc_block.png new file mode 100644 index 0000000..e1d1b9f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/zinc_block.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/zinc_block_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/zinc_block_top.png new file mode 100644 index 0000000..f063964 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/zinc_block_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/ore/zinc_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/ore/zinc_ore.png new file mode 100644 index 0000000..6930528 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/ore/zinc_ore.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/trap.png b/src/main/resources/assets/sextiarysector/textures/blocks/trap.png new file mode 100644 index 0000000..d91e706 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/trap.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/wood.png b/src/main/resources/assets/sextiarysector/textures/blocks/wood.png new file mode 100644 index 0000000..860a119 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/wood.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/wood_hopper_inside.png b/src/main/resources/assets/sextiarysector/textures/blocks/wood_hopper_inside.png new file mode 100644 index 0000000..c4ed6f3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/wood_hopper_inside.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/wood_hopper_outside.png b/src/main/resources/assets/sextiarysector/textures/blocks/wood_hopper_outside.png new file mode 100644 index 0000000..c4bfb02 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/wood_hopper_outside.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/wood_hopper_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/wood_hopper_top.png new file mode 100644 index 0000000..28be5d4 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/wood_hopper_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/wood_top.png b/src/main/resources/assets/sextiarysector/textures/blocks/wood_top.png new file mode 100644 index 0000000..da73123 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/wood_top.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/wood_top2.png b/src/main/resources/assets/sextiarysector/textures/blocks/wood_top2.png new file mode 100644 index 0000000..161e791 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/blocks/wood_top2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/blocks/yellowstone_ore.png b/src/main/resources/assets/sextiarysector/textures/blocks/yellowstone_ore.png deleted file mode 100644 index d582d6b..0000000 Binary files a/src/main/resources/assets/sextiarysector/textures/blocks/yellowstone_ore.png and /dev/null differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/craft_furnace.png b/src/main/resources/assets/sextiarysector/textures/guis/craft_furnace.png new file mode 100644 index 0000000..3256c22 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/craft_furnace.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/ender_stele.png b/src/main/resources/assets/sextiarysector/textures/guis/ender_stele.png new file mode 100644 index 0000000..d6f49f6 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/ender_stele.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/fertilizer_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/fertilizer_farmland_nei.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/guis/fertilizer_nei.png rename to src/main/resources/assets/sextiarysector/textures/guis/fertilizer_farmland_nei.png diff --git a/src/main/resources/assets/sextiarysector/textures/guis/fertilizer_paddy_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/fertilizer_paddy_nei.png new file mode 100644 index 0000000..f6ffed4 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/fertilizer_paddy_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/fertilizer_wood_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/fertilizer_wood_nei.png new file mode 100644 index 0000000..1ce005f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/fertilizer_wood_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/fluid_furnace.png b/src/main/resources/assets/sextiarysector/textures/guis/fluid_furnace.png new file mode 100644 index 0000000..50edaf5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/fluid_furnace.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/fluid_furnace_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/fluid_furnace_nei.png new file mode 100644 index 0000000..adc94a2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/fluid_furnace_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/fluid_refinery.png b/src/main/resources/assets/sextiarysector/textures/guis/fluid_refinery.png new file mode 100644 index 0000000..21bb973 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/fluid_refinery.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/freezer.png b/src/main/resources/assets/sextiarysector/textures/guis/freezer.png new file mode 100644 index 0000000..27cbebd Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/freezer.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/funnel.png b/src/main/resources/assets/sextiarysector/textures/guis/funnel.png new file mode 100644 index 0000000..fa70f8e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/funnel.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/hopper.png b/src/main/resources/assets/sextiarysector/textures/guis/hopper.png new file mode 100644 index 0000000..7e7b354 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/hopper.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/icons.png b/src/main/resources/assets/sextiarysector/textures/guis/icons.png index 9e0744c..06c2584 100644 Binary files a/src/main/resources/assets/sextiarysector/textures/guis/icons.png and b/src/main/resources/assets/sextiarysector/textures/guis/icons.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/inventory_next.png b/src/main/resources/assets/sextiarysector/textures/guis/inventory_next.png new file mode 100644 index 0000000..51d2ec1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/inventory_next.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/inventory_ss_potion.png b/src/main/resources/assets/sextiarysector/textures/guis/inventory_ss_potion.png new file mode 100644 index 0000000..cc7b76e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/inventory_ss_potion.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/extractor.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/extractor.png new file mode 100644 index 0000000..e8e1539 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/extractor.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/extractor_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/extractor_nei.png new file mode 100644 index 0000000..c0a0836 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/extractor_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/mana_squeezer.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/mana_squeezer.png new file mode 100644 index 0000000..9936feb Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/mana_squeezer.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/mana_squeezer_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/mana_squeezer_nei.png new file mode 100644 index 0000000..6784937 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/mana_squeezer_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/ninja_gf_tank.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/ninja_gf_tank.png new file mode 100644 index 0000000..29ded61 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/ninja_gf_tank.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/orichalcum_gf_tank.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/orichalcum_gf_tank.png new file mode 100644 index 0000000..69aa03b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/orichalcum_gf_tank.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/press.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/press.png new file mode 100644 index 0000000..cd4eaf1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/press.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/pulverizer.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/pulverizer.png new file mode 100644 index 0000000..51e048a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/pulverizer.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/pulverizer_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/pulverizer_nei.png new file mode 100644 index 0000000..5e0582e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/pulverizer_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/rolling_machine.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/rolling_machine.png new file mode 100644 index 0000000..632006e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/rolling_machine.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/rolling_machine_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/rolling_machine_nei.png new file mode 100644 index 0000000..9490f0f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/rolling_machine_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/sawmill.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/sawmill.png new file mode 100644 index 0000000..6c1560d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/sawmill.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/sawmill_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/sawmill_nei.png new file mode 100644 index 0000000..f71e3d3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/sawmill_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/spinning_machine.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/spinning_machine.png new file mode 100644 index 0000000..fe15612 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/spinning_machine.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/spinning_machine_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/spinning_machine_nei.png new file mode 100644 index 0000000..20fc226 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/spinning_machine_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/steam_motor.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/steam_motor.png new file mode 100644 index 0000000..ce683df Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/steam_motor.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/steel_gf_tank.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/steel_gf_tank.png new file mode 100644 index 0000000..b9e9003 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/steel_gf_tank.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/time_machine.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/time_machine.png new file mode 100644 index 0000000..9541125 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/time_machine.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/machine/time_machine_nei.png b/src/main/resources/assets/sextiarysector/textures/guis/machine/time_machine_nei.png new file mode 100644 index 0000000..9ffb73c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/machine/time_machine_nei.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/magic_furnace.png b/src/main/resources/assets/sextiarysector/textures/guis/magic_furnace.png new file mode 100644 index 0000000..cb2c796 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/magic_furnace.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/potion.png b/src/main/resources/assets/sextiarysector/textures/guis/potion.png new file mode 100644 index 0000000..3c5652c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/potion.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/progress.png b/src/main/resources/assets/sextiarysector/textures/guis/progress.png new file mode 100644 index 0000000..c70d46e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/progress.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/rucksack.png b/src/main/resources/assets/sextiarysector/textures/guis/rucksack.png new file mode 100644 index 0000000..e961ae1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/rucksack.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/guis/shipping_box.png b/src/main/resources/assets/sextiarysector/textures/guis/shipping_box.png new file mode 100644 index 0000000..e961ae1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/guis/shipping_box.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/copper_boots.png b/src/main/resources/assets/sextiarysector/textures/items/armor/copper_boots.png new file mode 100644 index 0000000..1fa8272 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/copper_boots.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/copper_chestplate.png b/src/main/resources/assets/sextiarysector/textures/items/armor/copper_chestplate.png new file mode 100644 index 0000000..a1db597 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/copper_chestplate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/copper_helmet.png b/src/main/resources/assets/sextiarysector/textures/items/armor/copper_helmet.png new file mode 100644 index 0000000..2b2a952 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/copper_helmet.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/copper_leggings.png b/src/main/resources/assets/sextiarysector/textures/items/armor/copper_leggings.png new file mode 100644 index 0000000..7576e55 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/copper_leggings.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/iron_boots.png b/src/main/resources/assets/sextiarysector/textures/items/armor/iron_boots.png new file mode 100644 index 0000000..b69ca05 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/iron_boots.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/iron_chestplate.png b/src/main/resources/assets/sextiarysector/textures/items/armor/iron_chestplate.png new file mode 100644 index 0000000..e7993ce Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/iron_chestplate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/iron_helmet.png b/src/main/resources/assets/sextiarysector/textures/items/armor/iron_helmet.png new file mode 100644 index 0000000..65e64cc Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/iron_helmet.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/iron_leggings.png b/src/main/resources/assets/sextiarysector/textures/items/armor/iron_leggings.png new file mode 100644 index 0000000..ad53673 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/iron_leggings.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_boots.png b/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_boots.png new file mode 100644 index 0000000..9f57de0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_boots.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_chestplate.png b/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_chestplate.png new file mode 100644 index 0000000..a67a128 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_chestplate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_helmet.png b/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_helmet.png new file mode 100644 index 0000000..3bef4f5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_helmet.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_leggings.png b/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_leggings.png new file mode 100644 index 0000000..8bb688b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/armor/ninja_leggings.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/buoy/boarding_buoy.png b/src/main/resources/assets/sextiarysector/textures/items/buoy/boarding_buoy.png new file mode 100644 index 0000000..324646d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/buoy/boarding_buoy.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/buoy/detector_buoy.png b/src/main/resources/assets/sextiarysector/textures/items/buoy/detector_buoy.png new file mode 100644 index 0000000..ac1edd2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/buoy/detector_buoy.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/buoy/powered_buoy.png b/src/main/resources/assets/sextiarysector/textures/items/buoy/powered_buoy.png new file mode 100644 index 0000000..4c4c461 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/buoy/powered_buoy.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/golden_corn.png b/src/main/resources/assets/sextiarysector/textures/items/crop/golden_corn.png deleted file mode 100644 index e0c9870..0000000 Binary files a/src/main/resources/assets/sextiarysector/textures/items/crop/golden_corn.png and /dev/null differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/iron_turnip.png b/src/main/resources/assets/sextiarysector/textures/items/crop/iron_turnip.png deleted file mode 100644 index 73b5ffb..0000000 Binary files a/src/main/resources/assets/sextiarysector/textures/items/crop/iron_turnip.png and /dev/null differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/dust/copper_dust.png b/src/main/resources/assets/sextiarysector/textures/items/dust/copper_dust.png new file mode 100644 index 0000000..a00ab9b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/dust/copper_dust.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/dust/diamond_dust.png b/src/main/resources/assets/sextiarysector/textures/items/dust/diamond_dust.png new file mode 100644 index 0000000..4101350 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/dust/diamond_dust.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/dust/gold_dust.png b/src/main/resources/assets/sextiarysector/textures/items/dust/gold_dust.png new file mode 100644 index 0000000..fc2038c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/dust/gold_dust.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/dust/iron_dust.png b/src/main/resources/assets/sextiarysector/textures/items/dust/iron_dust.png new file mode 100644 index 0000000..75a9da5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/dust/iron_dust.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/dust/magic_dust.png b/src/main/resources/assets/sextiarysector/textures/items/dust/magic_dust.png new file mode 100644 index 0000000..4a0cb9e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/dust/magic_dust.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/dust/mana_dust.png b/src/main/resources/assets/sextiarysector/textures/items/dust/mana_dust.png new file mode 100644 index 0000000..4ee3752 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/dust/mana_dust.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/dust/mithril_dust.png b/src/main/resources/assets/sextiarysector/textures/items/dust/mithril_dust.png new file mode 100644 index 0000000..f78fe68 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/dust/mithril_dust.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/dust/silver_dust.png b/src/main/resources/assets/sextiarysector/textures/items/dust/silver_dust.png new file mode 100644 index 0000000..4f93228 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/dust/silver_dust.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/dust/zinc_dust.png b/src/main/resources/assets/sextiarysector/textures/items/dust/zinc_dust.png new file mode 100644 index 0000000..9fce632 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/dust/zinc_dust.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/face/gf_contact_lenses.png b/src/main/resources/assets/sextiarysector/textures/items/face/gf_contact_lenses.png new file mode 100644 index 0000000..4a20e8b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/face/gf_contact_lenses.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/face/magic_contact_lenses.png b/src/main/resources/assets/sextiarysector/textures/items/face/magic_contact_lenses.png new file mode 100644 index 0000000..5ae5553 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/face/magic_contact_lenses.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/face/water_contact_lenses.png b/src/main/resources/assets/sextiarysector/textures/items/face/water_contact_lenses.png new file mode 100644 index 0000000..304ea90 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/face/water_contact_lenses.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/figure.png b/src/main/resources/assets/sextiarysector/textures/items/figure.png new file mode 100644 index 0000000..268c2ee Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/figure.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/figure_box.png b/src/main/resources/assets/sextiarysector/textures/items/figure_box.png new file mode 100644 index 0000000..bbc803d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/figure_box.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/bucket_water.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/bucket_water.png new file mode 100644 index 0000000..2f36acc Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/bucket_water.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/color_spray.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/color_spray.png new file mode 100644 index 0000000..82907bf Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/color_spray.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/drink/drinking_water_small_bottle.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/drinking_water_bottle.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/drink/drinking_water_small_bottle.png rename to src/main/resources/assets/sextiarysector/textures/items/fluid/drinking_water_bottle.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/drinking_water_bottle2.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/drinking_water_bottle2.png new file mode 100644 index 0000000..47c21c3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/drinking_water_bottle2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/drinking_water_bucket.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/drinking_water_bucket.png new file mode 100644 index 0000000..62bbb7d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/drinking_water_bucket.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/empty_bottle.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/empty_bottle.png new file mode 100644 index 0000000..9ea7761 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/empty_bottle.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/gold_fluid_bucket.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/gold_fluid_bucket.png new file mode 100644 index 0000000..f8a05ce Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/gold_fluid_bucket.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/iron_fluid_bucket.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/iron_fluid_bucket.png new file mode 100644 index 0000000..3c1cccd Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/iron_fluid_bucket.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/lava_bottle.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/lava_bottle.png new file mode 100644 index 0000000..d1cf4c4 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/lava_bottle.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/milk_bottle.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/milk_bottle.png new file mode 100644 index 0000000..f3052f5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/milk_bottle.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/sap_bottle.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/sap_bottle.png new file mode 100644 index 0000000..9c316ad Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/sap_bottle.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/steam_bucket.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/steam_bucket.png new file mode 100644 index 0000000..c8102a6 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/steam_bucket.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/takumi_tea_bottle.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/takumi_tea_bottle.png new file mode 100644 index 0000000..fe02cd1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/takumi_tea_bottle.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/fluid/water_bottle.png b/src/main/resources/assets/sextiarysector/textures/items/fluid/water_bottle.png new file mode 100644 index 0000000..44e307a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/fluid/water_bottle.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/condiment/curry_powder.png b/src/main/resources/assets/sextiarysector/textures/items/food/condiment/curry_powder.png new file mode 100644 index 0000000..8c704ce Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/condiment/curry_powder.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/condiment/salt.png b/src/main/resources/assets/sextiarysector/textures/items/food/condiment/salt.png new file mode 100644 index 0000000..0864df9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/condiment/salt.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/dessert/chocolate.png b/src/main/resources/assets/sextiarysector/textures/items/food/dessert/chocolate.png new file mode 100644 index 0000000..23c303e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/dessert/chocolate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/fish/laver.png b/src/main/resources/assets/sextiarysector/textures/items/food/fish/laver.png new file mode 100644 index 0000000..516dee5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/fish/laver.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/fish/laver_roasted.png b/src/main/resources/assets/sextiarysector/textures/items/food/fish/laver_roasted.png new file mode 100644 index 0000000..ef611d0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/fish/laver_roasted.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/fish/squid_sashimi.png b/src/main/resources/assets/sextiarysector/textures/items/food/fish/squid_sashimi.png new file mode 100644 index 0000000..182bebd Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/fish/squid_sashimi.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/grain/rice.png b/src/main/resources/assets/sextiarysector/textures/items/food/grain/rice.png new file mode 100644 index 0000000..bbd2fd9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/grain/rice.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/grain/white_rice.png b/src/main/resources/assets/sextiarysector/textures/items/food/grain/white_rice.png new file mode 100644 index 0000000..f4d4542 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/grain/white_rice.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/meat/beef_smoked.png b/src/main/resources/assets/sextiarysector/textures/items/food/meat/beef_smoked.png new file mode 100644 index 0000000..4aa402b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/meat/beef_smoked.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/meat/chicken_smoked.png b/src/main/resources/assets/sextiarysector/textures/items/food/meat/chicken_smoked.png new file mode 100644 index 0000000..5ff12a3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/meat/chicken_smoked.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/meat/porkchop_smoked.png b/src/main/resources/assets/sextiarysector/textures/items/food/meat/porkchop_smoked.png new file mode 100644 index 0000000..f5b0473 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/meat/porkchop_smoked.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/mushroom/shiitake.png b/src/main/resources/assets/sextiarysector/textures/items/food/mushroom/shiitake.png new file mode 100644 index 0000000..2df9ce2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/mushroom/shiitake.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/rice/curry_rice.png b/src/main/resources/assets/sextiarysector/textures/items/food/rice/curry_rice.png new file mode 100644 index 0000000..75123fd Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/rice/curry_rice.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/rice/rice_ball.png b/src/main/resources/assets/sextiarysector/textures/items/food/rice/rice_ball.png new file mode 100644 index 0000000..d9080fc Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/rice/rice_ball.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/rice/tuna_sushi.png b/src/main/resources/assets/sextiarysector/textures/items/food/rice/tuna_sushi.png new file mode 100644 index 0000000..8965173 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/rice/tuna_sushi.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/soup/carrot_soup.png b/src/main/resources/assets/sextiarysector/textures/items/food/soup/carrot_soup.png new file mode 100644 index 0000000..e33b445 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/soup/carrot_soup.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/soup/corn_soup.png b/src/main/resources/assets/sextiarysector/textures/items/food/soup/corn_soup.png new file mode 100644 index 0000000..fd5f777 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/soup/corn_soup.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/soup/egg_soup.png b/src/main/resources/assets/sextiarysector/textures/items/food/soup/egg_soup.png new file mode 100644 index 0000000..255a40d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/soup/egg_soup.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/soup/ender_soup.png b/src/main/resources/assets/sextiarysector/textures/items/food/soup/ender_soup.png new file mode 100644 index 0000000..0b71ccb Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/soup/ender_soup.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/soup/onion_soup.png b/src/main/resources/assets/sextiarysector/textures/items/food/soup/onion_soup.png new file mode 100644 index 0000000..e7fc6f2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/soup/onion_soup.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/soup/tomato_soup.png b/src/main/resources/assets/sextiarysector/textures/items/food/soup/tomato_soup.png new file mode 100644 index 0000000..77a079a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/soup/tomato_soup.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/blue_potato.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/blue_potato.png new file mode 100644 index 0000000..b142b45 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/blue_potato.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/corn.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/corn.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/crop/corn.png rename to src/main/resources/assets/sextiarysector/textures/items/food/vegetable/corn.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/cucumber.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/cucumber.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/crop/cucumber.png rename to src/main/resources/assets/sextiarysector/textures/items/food/vegetable/cucumber.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/eggplant.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/eggplant.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/crop/eggplant.png rename to src/main/resources/assets/sextiarysector/textures/items/food/vegetable/eggplant.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/golden_corn.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/golden_corn.png new file mode 100644 index 0000000..1e4ea57 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/golden_corn.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/green_pepper.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/green_pepper.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/crop/green_pepper.png rename to src/main/resources/assets/sextiarysector/textures/items/food/vegetable/green_pepper.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/iron_turnip.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/iron_turnip.png new file mode 100644 index 0000000..2ba260c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/iron_turnip.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/onion.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/onion.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/crop/onion.png rename to src/main/resources/assets/sextiarysector/textures/items/food/vegetable/onion.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/radish.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/radish.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/crop/radish.png rename to src/main/resources/assets/sextiarysector/textures/items/food/vegetable/radish.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/sweet_potato.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/sweet_potato.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/crop/sweet_potato.png rename to src/main/resources/assets/sextiarysector/textures/items/food/vegetable/sweet_potato.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/tomato.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/tomato.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/crop/tomato.png rename to src/main/resources/assets/sextiarysector/textures/items/food/vegetable/tomato.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/crop/turnip.png b/src/main/resources/assets/sextiarysector/textures/items/food/vegetable/turnip.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/crop/turnip.png rename to src/main/resources/assets/sextiarysector/textures/items/food/vegetable/turnip.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/funnel.png b/src/main/resources/assets/sextiarysector/textures/items/funnel.png new file mode 100644 index 0000000..1ab4a9b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/funnel.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/gf_hammer.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/gf_hammer.png new file mode 100644 index 0000000..9629ba6 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/gf_hammer.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/hammer.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/hammer.png new file mode 100644 index 0000000..d0e9c55 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/hammer.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/iron_spanner.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/iron_spanner.png new file mode 100644 index 0000000..d34f1f1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/iron_spanner.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/ninja_gear_storage.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/ninja_gear_storage.png new file mode 100644 index 0000000..21e9776 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/ninja_gear_storage.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/ninja_gear_storage_full.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/ninja_gear_storage_full.png new file mode 100644 index 0000000..95993ea Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/ninja_gear_storage_full.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/ninja_gear_storage_full.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/items/gearforce/ninja_gear_storage_full.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/items/gearforce/ninja_gear_storage_full.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/orichalcum_gear_storage.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/orichalcum_gear_storage.png new file mode 100644 index 0000000..fa5951a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/orichalcum_gear_storage.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/orichalcum_gear_storage_full.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/orichalcum_gear_storage_full.png new file mode 100644 index 0000000..f133c99 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/orichalcum_gear_storage_full.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/orichalcum_gear_storage_full.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/items/gearforce/orichalcum_gear_storage_full.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/items/gearforce/orichalcum_gear_storage_full.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/steel_gear_storage.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/steel_gear_storage.png new file mode 100644 index 0000000..4cc608d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/steel_gear_storage.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/steel_gear_storage_full.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/steel_gear_storage_full.png new file mode 100644 index 0000000..ff434f6 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/steel_gear_storage_full.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/steel_gear_storage_full.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/items/gearforce/steel_gear_storage_full.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/items/gearforce/steel_gear_storage_full.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/stone_gear_storage.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/stone_gear_storage.png new file mode 100644 index 0000000..119bd4b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/stone_gear_storage.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/stone_gear_storage_full.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/stone_gear_storage_full.png new file mode 100644 index 0000000..733cab5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gearforce/stone_gear_storage_full.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/stone_gear_storage_full.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/items/gearforce/stone_gear_storage_full.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/items/gearforce/stone_gear_storage_full.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/gear_storage.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/wood_gear_storage.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/gearforce/gear_storage.png rename to src/main/resources/assets/sextiarysector/textures/items/gearforce/wood_gear_storage.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/gear_storage_full.png b/src/main/resources/assets/sextiarysector/textures/items/gearforce/wood_gear_storage_full.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/gearforce/gear_storage_full.png rename to src/main/resources/assets/sextiarysector/textures/items/gearforce/wood_gear_storage_full.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/gearforce/wood_gear_storage_full.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/items/gearforce/wood_gear_storage_full.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/items/gearforce/wood_gear_storage_full.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/items/gel/blue_gel.png b/src/main/resources/assets/sextiarysector/textures/items/gel/blue_gel.png new file mode 100644 index 0000000..2f780ce Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gel/blue_gel.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/slimeball/bluestone_slimeball.png b/src/main/resources/assets/sextiarysector/textures/items/gel/bluestone_slimeball.png similarity index 100% rename from src/main/resources/assets/sextiarysector/textures/items/slimeball/bluestone_slimeball.png rename to src/main/resources/assets/sextiarysector/textures/items/gel/bluestone_slimeball.png diff --git a/src/main/resources/assets/sextiarysector/textures/items/gel/red_gel.png b/src/main/resources/assets/sextiarysector/textures/items/gel/red_gel.png new file mode 100644 index 0000000..d7c6ffa Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gel/red_gel.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gel/yellow_gel.png b/src/main/resources/assets/sextiarysector/textures/items/gel/yellow_gel.png new file mode 100644 index 0000000..1f8fbb4 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gel/yellow_gel.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gem/orichalcum_gem.png b/src/main/resources/assets/sextiarysector/textures/items/gem/orichalcum_gem.png new file mode 100644 index 0000000..4dd9175 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gem/orichalcum_gem.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_bag.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_bag.png new file mode 100644 index 0000000..581a1be Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_bag.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_belt.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_belt.png new file mode 100644 index 0000000..2171768 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_belt.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_boots.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_boots.png new file mode 100644 index 0000000..fd7e05f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_boots.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_helmet.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_helmet.png new file mode 100644 index 0000000..3a455f3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_helmet.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_legs.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_legs.png new file mode 100644 index 0000000..28b2c49 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_legs.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_plate.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_plate.png new file mode 100644 index 0000000..6e632b9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_decoration_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_face.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_face.png new file mode 100644 index 0000000..106bce5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_face.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_fluid.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_fluid.png new file mode 100644 index 0000000..82b2ab5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_fluid.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_hand.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_hand.png new file mode 100644 index 0000000..7ed0aff Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_hand.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_necklace.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_necklace.png new file mode 100644 index 0000000..4debade Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_necklace.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_other.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_other.png new file mode 100644 index 0000000..9af29c7 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_other.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_ring.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_ring.png new file mode 100644 index 0000000..ba07dfa Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_ring.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/gui/slot_unit.png b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_unit.png new file mode 100644 index 0000000..be37e81 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/gui/slot_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/bluestone_ingot.png b/src/main/resources/assets/sextiarysector/textures/items/ingot/bluestone_ingot.png new file mode 100644 index 0000000..f619abd Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ingot/bluestone_ingot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/brass_ingot.png b/src/main/resources/assets/sextiarysector/textures/items/ingot/brass_ingot.png new file mode 100644 index 0000000..2dddad8 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ingot/brass_ingot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/copper_ingot.png b/src/main/resources/assets/sextiarysector/textures/items/ingot/copper_ingot.png new file mode 100644 index 0000000..b5b9771 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ingot/copper_ingot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/mithril_ingot.png b/src/main/resources/assets/sextiarysector/textures/items/ingot/mithril_ingot.png new file mode 100644 index 0000000..97528d9 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ingot/mithril_ingot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/mithril_ingot.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/items/ingot/mithril_ingot.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/items/ingot/mithril_ingot.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/ninja_ingot.png b/src/main/resources/assets/sextiarysector/textures/items/ingot/ninja_ingot.png new file mode 100644 index 0000000..1022970 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ingot/ninja_ingot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/silver_ingot.png b/src/main/resources/assets/sextiarysector/textures/items/ingot/silver_ingot.png new file mode 100644 index 0000000..b44eda5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ingot/silver_ingot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/steel_ingot.png b/src/main/resources/assets/sextiarysector/textures/items/ingot/steel_ingot.png new file mode 100644 index 0000000..c83a9ba Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ingot/steel_ingot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/yellowstone_ingot.png b/src/main/resources/assets/sextiarysector/textures/items/ingot/yellowstone_ingot.png new file mode 100644 index 0000000..4c1f040 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ingot/yellowstone_ingot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ingot/zinc_ingot.png b/src/main/resources/assets/sextiarysector/textures/items/ingot/zinc_ingot.png new file mode 100644 index 0000000..63ea1a1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ingot/zinc_ingot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/leaf.png b/src/main/resources/assets/sextiarysector/textures/items/leaf.png new file mode 100644 index 0000000..a171f8f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/leaf.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/leaf_bed.png b/src/main/resources/assets/sextiarysector/textures/items/leaf_bed.png new file mode 100644 index 0000000..0bd0aa3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/leaf_bed.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/canvas.png b/src/main/resources/assets/sextiarysector/textures/items/loom/canvas.png new file mode 100644 index 0000000..63dc239 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/canvas.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/cloth.png b/src/main/resources/assets/sextiarysector/textures/items/loom/cloth.png new file mode 100644 index 0000000..b2679cb Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/cloth.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/drying_flesh.png b/src/main/resources/assets/sextiarysector/textures/items/loom/drying_flesh.png new file mode 100644 index 0000000..e8d0882 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/drying_flesh.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/flesh_bobbin.png b/src/main/resources/assets/sextiarysector/textures/items/loom/flesh_bobbin.png new file mode 100644 index 0000000..8646c86 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/flesh_bobbin.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/paper.png b/src/main/resources/assets/sextiarysector/textures/items/loom/paper.png new file mode 100644 index 0000000..a1d9c7e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/paper.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/silk_bobbin.png b/src/main/resources/assets/sextiarysector/textures/items/loom/silk_bobbin.png new file mode 100644 index 0000000..5edba70 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/silk_bobbin.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/silk_cloth.png b/src/main/resources/assets/sextiarysector/textures/items/loom/silk_cloth.png new file mode 100644 index 0000000..0c8d33f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/silk_cloth.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/small_cloth.png b/src/main/resources/assets/sextiarysector/textures/items/loom/small_cloth.png new file mode 100644 index 0000000..db5fdb2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/small_cloth.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/stick.png b/src/main/resources/assets/sextiarysector/textures/items/loom/stick.png new file mode 100644 index 0000000..6f8ce13 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/stick.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/string.png b/src/main/resources/assets/sextiarysector/textures/items/loom/string.png new file mode 100644 index 0000000..0b04ddb Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/string.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/string_bobbin.png b/src/main/resources/assets/sextiarysector/textures/items/loom/string_bobbin.png new file mode 100644 index 0000000..3a57364 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/string_bobbin.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/string_mass.png b/src/main/resources/assets/sextiarysector/textures/items/loom/string_mass.png new file mode 100644 index 0000000..4d792ee Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/string_mass.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/strong_canvas.png b/src/main/resources/assets/sextiarysector/textures/items/loom/strong_canvas.png new file mode 100644 index 0000000..da6988c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/strong_canvas.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/strong_cloth.png b/src/main/resources/assets/sextiarysector/textures/items/loom/strong_cloth.png new file mode 100644 index 0000000..73cb1bb Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/strong_cloth.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/strong_string.png b/src/main/resources/assets/sextiarysector/textures/items/loom/strong_string.png new file mode 100644 index 0000000..216bdaf Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/strong_string.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/loom/strong_string_bobbin.png b/src/main/resources/assets/sextiarysector/textures/items/loom/strong_string_bobbin.png new file mode 100644 index 0000000..1516b60 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/loom/strong_string_bobbin.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/machine/ninja_gear.png b/src/main/resources/assets/sextiarysector/textures/items/machine/ninja_gear.png new file mode 100644 index 0000000..0a7a740 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/machine/ninja_gear.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/machine/ninja_unit_gear.png b/src/main/resources/assets/sextiarysector/textures/items/machine/ninja_unit_gear.png new file mode 100644 index 0000000..7631b88 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/machine/ninja_unit_gear.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/machine/orichalcum_gear.png b/src/main/resources/assets/sextiarysector/textures/items/machine/orichalcum_gear.png new file mode 100644 index 0000000..cea8236 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/machine/orichalcum_gear.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/machine/orichalcum_unit_gear.png b/src/main/resources/assets/sextiarysector/textures/items/machine/orichalcum_unit_gear.png new file mode 100644 index 0000000..2c3d9ad Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/machine/orichalcum_unit_gear.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/machine/steel_gear.png b/src/main/resources/assets/sextiarysector/textures/items/machine/steel_gear.png new file mode 100644 index 0000000..d0ac591 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/machine/steel_gear.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/machine/steel_unit_gear.png b/src/main/resources/assets/sextiarysector/textures/items/machine/steel_unit_gear.png new file mode 100644 index 0000000..86eddd5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/machine/steel_unit_gear.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/machine/stone_gear.png b/src/main/resources/assets/sextiarysector/textures/items/machine/stone_gear.png new file mode 100644 index 0000000..ac623d0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/machine/stone_gear.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/machine/stone_unit_gear.png b/src/main/resources/assets/sextiarysector/textures/items/machine/stone_unit_gear.png new file mode 100644 index 0000000..8912663 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/machine/stone_unit_gear.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/memory/mp_memory.png b/src/main/resources/assets/sextiarysector/textures/items/memory/mp_memory.png new file mode 100644 index 0000000..36c8496 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/memory/mp_memory.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/memory/xp_memory.png b/src/main/resources/assets/sextiarysector/textures/items/memory/xp_memory.png new file mode 100644 index 0000000..52c1f97 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/memory/xp_memory.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/mineboat_chest.png b/src/main/resources/assets/sextiarysector/textures/items/mineboat_chest.png new file mode 100644 index 0000000..a89330f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/mineboat_chest.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/mineboat_tank.png b/src/main/resources/assets/sextiarysector/textures/items/mineboat_tank.png new file mode 100644 index 0000000..d02d6f8 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/mineboat_tank.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/nugget/copper_nugget.png b/src/main/resources/assets/sextiarysector/textures/items/nugget/copper_nugget.png new file mode 100644 index 0000000..ab50a1d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/nugget/copper_nugget.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/nugget/gold_nugget.png b/src/main/resources/assets/sextiarysector/textures/items/nugget/gold_nugget.png new file mode 100644 index 0000000..3a9a2fe Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/nugget/gold_nugget.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/nugget/iron_nugget.png b/src/main/resources/assets/sextiarysector/textures/items/nugget/iron_nugget.png new file mode 100644 index 0000000..bf58b73 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/nugget/iron_nugget.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/nugget/ninja_nugget.png b/src/main/resources/assets/sextiarysector/textures/items/nugget/ninja_nugget.png new file mode 100644 index 0000000..4db9d06 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/nugget/ninja_nugget.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/nugget/obsidian_nugget.png b/src/main/resources/assets/sextiarysector/textures/items/nugget/obsidian_nugget.png new file mode 100644 index 0000000..6d1d409 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/nugget/obsidian_nugget.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/nugget/silver_nugget.png b/src/main/resources/assets/sextiarysector/textures/items/nugget/silver_nugget.png new file mode 100644 index 0000000..65e25b8 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/nugget/silver_nugget.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/nugget/steel_nugget.png b/src/main/resources/assets/sextiarysector/textures/items/nugget/steel_nugget.png new file mode 100644 index 0000000..3ccf41e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/nugget/steel_nugget.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/nugget/zinc_nugget.png b/src/main/resources/assets/sextiarysector/textures/items/nugget/zinc_nugget.png new file mode 100644 index 0000000..b67c767 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/nugget/zinc_nugget.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/oxygen_tank.png b/src/main/resources/assets/sextiarysector/textures/items/oxygen_tank.png new file mode 100644 index 0000000..a90173a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/oxygen_tank.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/copper_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/copper_plate.png new file mode 100644 index 0000000..f4efea7 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/copper_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/gold_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/gold_plate.png new file mode 100644 index 0000000..f72d313 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/gold_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/iron_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/iron_plate.png new file mode 100644 index 0000000..9fee175 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/iron_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/silver_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/silver_plate.png new file mode 100644 index 0000000..a16a500 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/silver_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/wood_acacia_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_acacia_plate.png new file mode 100644 index 0000000..667c66c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_acacia_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/wood_big_oak_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_big_oak_plate.png new file mode 100644 index 0000000..88aeed7 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_big_oak_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/wood_birch_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_birch_plate.png new file mode 100644 index 0000000..6e266c0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_birch_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/wood_jungle_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_jungle_plate.png new file mode 100644 index 0000000..bc3e373 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_jungle_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/wood_oak_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_oak_plate.png new file mode 100644 index 0000000..0793dae Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_oak_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/wood_spruce_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_spruce_plate.png new file mode 100644 index 0000000..bd72fd8 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/wood_spruce_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/plate/zinc_plate.png b/src/main/resources/assets/sextiarysector/textures/items/plate/zinc_plate.png new file mode 100644 index 0000000..37572e0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/plate/zinc_plate.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/reactor/craft_reactor.png b/src/main/resources/assets/sextiarysector/textures/items/reactor/craft_reactor.png new file mode 100644 index 0000000..70b65b5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/reactor/craft_reactor.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/reactor/craft_reactor.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/items/reactor/craft_reactor.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/items/reactor/craft_reactor.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/items/reactor/energy_reactor.png b/src/main/resources/assets/sextiarysector/textures/items/reactor/energy_reactor.png new file mode 100644 index 0000000..e2d87a2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/reactor/energy_reactor.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/reactor/energy_reactor.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/items/reactor/energy_reactor.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/items/reactor/energy_reactor.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/items/reactor/object_reactor.png b/src/main/resources/assets/sextiarysector/textures/items/reactor/object_reactor.png new file mode 100644 index 0000000..aa175fd Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/reactor/object_reactor.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/reactor/object_reactor.png.mcmeta b/src/main/resources/assets/sextiarysector/textures/items/reactor/object_reactor.png.mcmeta new file mode 100644 index 0000000..0645f48 --- /dev/null +++ b/src/main/resources/assets/sextiarysector/textures/items/reactor/object_reactor.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/sextiarysector/textures/items/ring/creeper_ring.png b/src/main/resources/assets/sextiarysector/textures/items/ring/creeper_ring.png new file mode 100644 index 0000000..be5fa83 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ring/creeper_ring.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ring/iron_ring.png b/src/main/resources/assets/sextiarysector/textures/items/ring/iron_ring.png new file mode 100644 index 0000000..27559ac Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ring/iron_ring.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ring/iron_ring3.png b/src/main/resources/assets/sextiarysector/textures/items/ring/iron_ring3.png new file mode 100644 index 0000000..7c8cf4e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ring/iron_ring3.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ring/iron_ring4.png b/src/main/resources/assets/sextiarysector/textures/items/ring/iron_ring4.png new file mode 100644 index 0000000..b14ea48 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ring/iron_ring4.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ring/mp_ring.png b/src/main/resources/assets/sextiarysector/textures/items/ring/mp_ring.png new file mode 100644 index 0000000..14d1f75 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ring/mp_ring.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ring/slot_ring.png b/src/main/resources/assets/sextiarysector/textures/items/ring/slot_ring.png new file mode 100644 index 0000000..9e4e070 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ring/slot_ring.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/ring/xp_ring.png b/src/main/resources/assets/sextiarysector/textures/items/ring/xp_ring.png new file mode 100644 index 0000000..7718d1e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/ring/xp_ring.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/rucksack.png b/src/main/resources/assets/sextiarysector/textures/items/rucksack.png new file mode 100644 index 0000000..e7d6f2f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/rucksack.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/seed/blue_potato_seed.png b/src/main/resources/assets/sextiarysector/textures/items/seed/blue_potato_seed.png new file mode 100644 index 0000000..414bc00 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/seed/blue_potato_seed.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/seed/golden_corn_seed.png b/src/main/resources/assets/sextiarysector/textures/items/seed/golden_corn_seed.png new file mode 100644 index 0000000..412958c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/seed/golden_corn_seed.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/seed/iron_turnip_seed.png b/src/main/resources/assets/sextiarysector/textures/items/seed/iron_turnip_seed.png new file mode 100644 index 0000000..99155d3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/seed/iron_turnip_seed.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/seed/mushroom_red_seed.png b/src/main/resources/assets/sextiarysector/textures/items/seed/mushroom_red_seed.png new file mode 100644 index 0000000..1b68ebf Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/seed/mushroom_red_seed.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/seed/shiitake_seed.png b/src/main/resources/assets/sextiarysector/textures/items/seed/shiitake_seed.png new file mode 100644 index 0000000..42c949e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/seed/shiitake_seed.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/brass_axe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_axe.png new file mode 100644 index 0000000..a7ee888 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_axe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/brass_hoe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_hoe.png new file mode 100644 index 0000000..8f0b1d2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_hoe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/brass_knife.png b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_knife.png new file mode 100644 index 0000000..1b29cb6 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_knife.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/brass_pickaxe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_pickaxe.png new file mode 100644 index 0000000..17b1f2d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_pickaxe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/brass_scoop.png b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_scoop.png new file mode 100644 index 0000000..2b807e8 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_scoop.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/brass_shears.png b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_shears.png new file mode 100644 index 0000000..16b3482 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_shears.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/brass_shovel.png b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_shovel.png new file mode 100644 index 0000000..0a5bfcb Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_shovel.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/brass_sword.png b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_sword.png new file mode 100644 index 0000000..de1bf68 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/brass_sword.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/copper_axe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_axe.png new file mode 100644 index 0000000..61e2180 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_axe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/copper_hoe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_hoe.png new file mode 100644 index 0000000..5a61724 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_hoe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/copper_pickaxe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_pickaxe.png new file mode 100644 index 0000000..f06c962 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_pickaxe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/copper_shovel.png b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_shovel.png new file mode 100644 index 0000000..ac5d536 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_shovel.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/copper_sword.png b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_sword.png new file mode 100644 index 0000000..557c8de Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/copper_sword.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/diamond_axe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/diamond_axe.png new file mode 100644 index 0000000..7627f87 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/diamond_axe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/diamond_knife.png b/src/main/resources/assets/sextiarysector/textures/items/tool/diamond_knife.png new file mode 100644 index 0000000..ae523c2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/diamond_knife.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/gold_knife.png b/src/main/resources/assets/sextiarysector/textures/items/tool/gold_knife.png new file mode 100644 index 0000000..29714dc Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/gold_knife.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/iron_knife.png b/src/main/resources/assets/sextiarysector/textures/items/tool/iron_knife.png new file mode 100644 index 0000000..d067c00 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/iron_knife.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_axe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_axe.png new file mode 100644 index 0000000..c8efbfa Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_axe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_hoe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_hoe.png new file mode 100644 index 0000000..db4e1d0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_hoe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_pickaxe.png b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_pickaxe.png new file mode 100644 index 0000000..8a3c97d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_pickaxe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_shovel.png b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_shovel.png new file mode 100644 index 0000000..debc0f1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_shovel.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_sword.png b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_sword.png new file mode 100644 index 0000000..897f966 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/ninja_sword.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/shears.png b/src/main/resources/assets/sextiarysector/textures/items/tool/shears.png new file mode 100644 index 0000000..f9c6de1 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/shears.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/stone_knife.png b/src/main/resources/assets/sextiarysector/textures/items/tool/stone_knife.png new file mode 100644 index 0000000..24638b4 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/stone_knife.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/tool/wood_knife.png b/src/main/resources/assets/sextiarysector/textures/items/tool/wood_knife.png new file mode 100644 index 0000000..b36c49c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/tool/wood_knife.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/attack_rust_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/attack_rust_unit.png new file mode 100644 index 0000000..198bfde Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/attack_rust_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/attack_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/attack_unit.png new file mode 100644 index 0000000..3a4033a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/attack_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/attack_unit2.png b/src/main/resources/assets/sextiarysector/textures/items/unit/attack_unit2.png new file mode 100644 index 0000000..19eaada Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/attack_unit2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/bed_day_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/bed_day_unit.png new file mode 100644 index 0000000..25c5c5b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/bed_day_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/bed_monster_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/bed_monster_unit.png new file mode 100644 index 0000000..b5a283d Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/bed_monster_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/copper_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/copper_unit.png new file mode 100644 index 0000000..7761cf0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/copper_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/craft_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/craft_unit.png new file mode 100644 index 0000000..49d1def Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/craft_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/debug_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/debug_unit.png new file mode 100644 index 0000000..a973013 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/debug_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/defense_rust_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/defense_rust_unit.png new file mode 100644 index 0000000..4faabae Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/defense_rust_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/defense_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/defense_unit.png new file mode 100644 index 0000000..d0de360 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/defense_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/gold_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/gold_unit.png new file mode 100644 index 0000000..6f9e19a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/gold_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/jump_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/jump_unit.png new file mode 100644 index 0000000..a70264b Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/jump_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/pickaxe_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/pickaxe_unit.png new file mode 100644 index 0000000..b5f6bc2 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/pickaxe_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/rust_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/rust_unit.png new file mode 100644 index 0000000..452c8ed Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/rust_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/silver_unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/silver_unit.png new file mode 100644 index 0000000..c62d05f Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/silver_unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/unit/unit.png b/src/main/resources/assets/sextiarysector/textures/items/unit/unit.png new file mode 100644 index 0000000..1ff8d6e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/unit/unit.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/items/wood_hopper.png b/src/main/resources/assets/sextiarysector/textures/items/wood_hopper.png new file mode 100644 index 0000000..1897a89 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/items/wood_hopper.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/armor/copper_layer_1.png b/src/main/resources/assets/sextiarysector/textures/models/armor/copper_layer_1.png new file mode 100644 index 0000000..4e58178 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/armor/copper_layer_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/armor/copper_layer_2.png b/src/main/resources/assets/sextiarysector/textures/models/armor/copper_layer_2.png new file mode 100644 index 0000000..6aa4570 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/armor/copper_layer_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/armor/iron_layer_1.png b/src/main/resources/assets/sextiarysector/textures/models/armor/iron_layer_1.png new file mode 100644 index 0000000..6da6e84 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/armor/iron_layer_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/armor/iron_layer_2.png b/src/main/resources/assets/sextiarysector/textures/models/armor/iron_layer_2.png new file mode 100644 index 0000000..fab422a Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/armor/iron_layer_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/armor/ninja_layer_1.png b/src/main/resources/assets/sextiarysector/textures/models/armor/ninja_layer_1.png new file mode 100644 index 0000000..bf074d5 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/armor/ninja_layer_1.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/armor/ninja_layer_2.png b/src/main/resources/assets/sextiarysector/textures/models/armor/ninja_layer_2.png new file mode 100644 index 0000000..bf84acb Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/armor/ninja_layer_2.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/block_bottle.png b/src/main/resources/assets/sextiarysector/textures/models/block_bottle.png new file mode 100644 index 0000000..a8fd362 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/block_bottle.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/copper_pipe.png b/src/main/resources/assets/sextiarysector/textures/models/copper_pipe.png new file mode 100644 index 0000000..6b5e5c0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/copper_pipe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/copper_pipe_color.png b/src/main/resources/assets/sextiarysector/textures/models/copper_pipe_color.png new file mode 100644 index 0000000..938ee80 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/copper_pipe_color.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/craft_furnace.png b/src/main/resources/assets/sextiarysector/textures/models/craft_furnace.png new file mode 100644 index 0000000..4bb2c73 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/craft_furnace.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/electric_motor.png b/src/main/resources/assets/sextiarysector/textures/models/electric_motor.png new file mode 100644 index 0000000..5bf48c3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/electric_motor.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/fan.png b/src/main/resources/assets/sextiarysector/textures/models/fan.png new file mode 100644 index 0000000..211b388 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/fan.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/fluid_crafter.png b/src/main/resources/assets/sextiarysector/textures/models/fluid_crafter.png new file mode 100644 index 0000000..5184065 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/fluid_crafter.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/gear_shaft.png b/src/main/resources/assets/sextiarysector/textures/models/gear_shaft.png new file mode 100644 index 0000000..93d2eaa Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/gear_shaft.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/gf_dynamo.png b/src/main/resources/assets/sextiarysector/textures/models/gf_dynamo.png new file mode 100644 index 0000000..0def9cc Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/gf_dynamo.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/iron_pipe.png b/src/main/resources/assets/sextiarysector/textures/models/iron_pipe.png new file mode 100644 index 0000000..c7ef49c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/iron_pipe.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/large_windmill.png b/src/main/resources/assets/sextiarysector/textures/models/large_windmill.png new file mode 100644 index 0000000..8668c46 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/large_windmill.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/monitor_robot.png b/src/main/resources/assets/sextiarysector/textures/models/monitor_robot.png index 26ed134..4d2e478 100644 Binary files a/src/main/resources/assets/sextiarysector/textures/models/monitor_robot.png and b/src/main/resources/assets/sextiarysector/textures/models/monitor_robot.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/ninja_gear_shaft.png b/src/main/resources/assets/sextiarysector/textures/models/ninja_gear_shaft.png new file mode 100644 index 0000000..13ea949 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/ninja_gear_shaft.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/ninja_shaft.png b/src/main/resources/assets/sextiarysector/textures/models/ninja_shaft.png new file mode 100644 index 0000000..4ea5688 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/ninja_shaft.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/orichalcum_shaft.png b/src/main/resources/assets/sextiarysector/textures/models/orichalcum_shaft.png new file mode 100644 index 0000000..78febe3 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/orichalcum_shaft.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/saw.png b/src/main/resources/assets/sextiarysector/textures/models/saw.png new file mode 100644 index 0000000..0c8162c Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/saw.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/small_waterwheel.png b/src/main/resources/assets/sextiarysector/textures/models/small_waterwheel.png new file mode 100644 index 0000000..8d42198 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/small_waterwheel.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/square.png b/src/main/resources/assets/sextiarysector/textures/models/square.png new file mode 100644 index 0000000..b6b2400 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/square.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/square_under.png b/src/main/resources/assets/sextiarysector/textures/models/square_under.png new file mode 100644 index 0000000..b772910 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/square_under.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/steam_motor.png b/src/main/resources/assets/sextiarysector/textures/models/steam_motor.png new file mode 100644 index 0000000..e26e543 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/steam_motor.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/steel_gear_shaft.png b/src/main/resources/assets/sextiarysector/textures/models/steel_gear_shaft.png new file mode 100644 index 0000000..6e4eac0 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/steel_gear_shaft.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/steel_shaft.png b/src/main/resources/assets/sextiarysector/textures/models/steel_shaft.png new file mode 100644 index 0000000..8473b06 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/steel_shaft.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/stone_gear_shaft.png b/src/main/resources/assets/sextiarysector/textures/models/stone_gear_shaft.png new file mode 100644 index 0000000..001584e Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/stone_gear_shaft.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/tank.png b/src/main/resources/assets/sextiarysector/textures/models/tank.png new file mode 100644 index 0000000..f5dab94 Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/tank.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/tofu_motor.png b/src/main/resources/assets/sextiarysector/textures/models/tofu_motor.png new file mode 100644 index 0000000..dbc4cce Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/tofu_motor.png differ diff --git a/src/main/resources/assets/sextiarysector/textures/models/wood_gear_shaft.png b/src/main/resources/assets/sextiarysector/textures/models/wood_gear_shaft.png new file mode 100644 index 0000000..2f887ff Binary files /dev/null and b/src/main/resources/assets/sextiarysector/textures/models/wood_gear_shaft.png differ diff --git a/src/main/resources/ss_dependencies.info b/src/main/resources/ss_dependencies.info new file mode 100644 index 0000000..efe60c9 --- /dev/null +++ b/src/main/resources/ss_dependencies.info @@ -0,0 +1,7 @@ +{ +"repo": "https://dl.dropboxusercontent.com/s/3m5bsoo6wyziexa/", +"file": "PotionExtension-1.7.10-1.1.0.jar", +"dev": "PotionExtension-1.7.10-1.1.0.jar", +"class": "ak.potionextension.PotionExtensionCorePlugin", +"coreLib": "true" +} \ No newline at end of file