-
Posts
99 -
Joined
-
Last visited
-
Days Won
1
Everything posted by KingOfMiners
-
In the ItemArmor class there is no method that says getArmorTexture.
-
I'm working on a port for my mod to 1.9 and with porting comes with some problems, I am having trouble with the how the armor layout texture works it used to be something this: @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type){ if(this.armorType == 2){ return "legging texture"; } return "other texture"; } How do you do this now in 1.9?
-
Thank you, I discovered that one of the methods was updated to have a name so I changed the old method and it works.
-
I updated the version of 1.8.9 Forge to a more updated MDK version and when I tried to play a world I kept getting this crash: [16:30:07] [server thread/ERROR]: Encountered an unexpected exception java.lang.NoClassDefFoundError: com/moreoresmod/main/dimensions/Otherlyworld/OtherlyworldChunkProvider at com.moreoresmod.main.dimensions.Otherlyworld.OtherlyWorldProvider.createChunkGenerator(OtherlyWorldProvider.java:73) ~[OtherlyWorldProvider.class:?] at net.minecraft.world.WorldServer.createChunkProvider(WorldServer.java:743) ~[WorldServer.class:?] at net.minecraft.world.WorldServer.<init>(WorldServer.java:121) ~[WorldServer.class:?] at net.minecraft.world.WorldServerMulti.<init>(WorldServerMulti.java:18) ~[WorldServerMulti.class:?] at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:94) ~[integratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:127) ~[integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:508) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_66] Caused by: java.lang.ClassNotFoundException: com.moreoresmod.main.dimensions.Otherlyworld.OtherlyworldChunkProvider at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_66] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_66] ... 8 more Caused by: java.lang.ClassFormatError: Duplicate method name&signature in class file com/moreoresmod/main/dimensions/Otherlyworld/OtherlyworldChunkProvider at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_66] at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:1.8.0_66] at java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:1.8.0_66] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ~[launchwrapper-1.12.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_66] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_66] ... 8 more [16:30:07] [server thread/ERROR]: This crash report has been saved to: C:\Users\Tyler\Documents\Coding\Minecraft\forge-1.8.9-11.15.0.1693-mdk\run\.\crash-reports\crash-2016-01-29_16.30.07-server.txt [16:30:08] [server thread/INFO] [FML]: Applying holder lookups [16:30:08] [server thread/INFO] [FML]: Holder lookups applied [16:30:08] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STARTING and forced into state SERVER_STOPPED. Errors may have been discarded. [16:30:08] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id [16:30:10] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:612]: ---- Minecraft Crash Report ---- // Hey, that tickles! Hehehe! Time: 1/29/16 4:30 PM Description: Exception in server tick loop java.lang.NoClassDefFoundError: com/moreoresmod/main/dimensions/Otherlyworld/OtherlyworldChunkProvider at com.moreoresmod.main.dimensions.Otherlyworld.OtherlyWorldProvider.createChunkGenerator(OtherlyWorldProvider.java:73) at net.minecraft.world.WorldServer.createChunkProvider(WorldServer.java:743) at net.minecraft.world.WorldServer.<init>(WorldServer.java:121) at net.minecraft.world.WorldServerMulti.<init>(WorldServerMulti.java:18) at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:94) at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:127) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:508) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.moreoresmod.main.dimensions.Otherlyworld.OtherlyworldChunkProvider at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 8 more Caused by: java.lang.ClassFormatError: Duplicate method name&signature in class file com/moreoresmod/main/dimensions/Otherlyworld/OtherlyworldChunkProvider at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ... 10 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.8.9 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_66, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 784848112 bytes (748 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.19 Powered by Forge 11.15.1.1722 4 mods loaded, 4 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAA mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UCHIJAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1722.jar) UCHIJAA Forge{11.15.1.1722} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1722.jar) UCHIJAA MoreOresMod{0.0} [The More Ores Mod] (bin) Loaded coremods (and transformers): GL info: ~~ERROR~~ RuntimeException: No OpenGL context found in the current thread. Profiler Position: N/A (disabled) Player Count: 0 / 8; [] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge' [16:30:10] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:612]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2016-01-29_16.30.07-server.txt AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release WorldProvider: package com.moreoresmod.main.dimensions.Otherlyworld; import com.moreoresmod.main.init.MoreOresModBiomes; import net.minecraft.util.Vec3; import net.minecraft.world.WorldProvider; import net.minecraft.world.biome.WorldChunkManager; import net.minecraft.world.biome.WorldChunkManagerHell; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.ChunkProviderFlat; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class OtherlyWorldProvider extends WorldProvider { public void registerWorldChunkManager(){ this.worldChunkMgr = new WorldChunkManagerHell(MoreOresModBiomes.otherlyworldBiome, 1.2F); } @Override public String getDimensionName() { return "The Otherly World"; } @Override public String getInternalNameSuffix() { return "otherly"; } @Override public double getMovementFactor(){ return 8.0; } @Override public boolean getHasNoSky() { return false; } @SideOnly(Side.CLIENT) public float getStarBrightness(float par1) { return 0.0F; } @Override public long getWorldTime() { return 18000; } @SideOnly(Side.CLIENT) public float getSunBrightness(float par1) { return 0.0F; } public boolean canRespawnHere() { return false; } @SideOnly(Side.CLIENT) public Vec3 getFogColor(float p_76562_1_, float p_76562_2_){ return new Vec3(0,0,0); } @Override public IChunkProvider createChunkGenerator(){ return new OtherlyworldChunkProvider(this.worldObj, this.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getWorldInfo().getGeneratorOptions()); } } ChunkProvider: package com.moreoresmod.main.dimensions.Otherlyworld; import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE; import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.MINESHAFT; import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.RAVINE; import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.SCATTERED_FEATURE; import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.STRONGHOLD; import static net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE; import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ANIMALS; import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON; import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE; import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE; import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA; import java.util.List; import java.util.Random; import com.moreoresmod.main.init.MoreOresModBiomes; import com.moreoresmod.main.init.MoreOresModBlocks; import net.minecraft.block.Block; import net.minecraft.block.BlockFalling; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.util.IProgressUpdate; import net.minecraft.util.MathHelper; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.SpawnerAnimals; import net.minecraft.world.World; import net.minecraft.world.WorldType; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase.SpawnListEntry; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.ChunkPrimer; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.ChunkProviderSettings; import net.minecraft.world.gen.MapGenBase; import net.minecraft.world.gen.MapGenCaves; import net.minecraft.world.gen.MapGenRavine; import net.minecraft.world.gen.NoiseGenerator; import net.minecraft.world.gen.NoiseGeneratorOctaves; import net.minecraft.world.gen.NoiseGeneratorPerlin; import net.minecraft.world.gen.feature.WorldGenDungeons; import net.minecraft.world.gen.feature.WorldGenLakes; import net.minecraft.world.gen.structure.MapGenMineshaft; import net.minecraft.world.gen.structure.MapGenScatteredFeature; import net.minecraft.world.gen.structure.MapGenStronghold; import net.minecraft.world.gen.structure.MapGenVillage; import net.minecraft.world.gen.structure.StructureOceanMonument; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.ChunkProviderEvent; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.TerrainGen; import net.minecraftforge.fml.common.eventhandler.Event.Result; public class OtherlyworldChunkProvider implements IChunkProvider { private Random rand; private NoiseGeneratorOctaves field_147431_j; private NoiseGeneratorOctaves field_147432_k; private NoiseGeneratorOctaves field_147429_l; private NoiseGeneratorPerlin field_147430_m; public NoiseGeneratorOctaves noiseGen5; public NoiseGeneratorOctaves noiseGen6; public NoiseGeneratorOctaves mobSpawnerNoise; private World worldObj; private final boolean mapFeaturesEnabled; private WorldType field_177475_o; private final double[] field_147434_q; private final float[] parabolicField; private ChunkProviderSettings settings; private Block field_177476_s; private double[] stoneNoise; private MapGenBase caveGenerator; private MapGenStronghold strongholdGenerator; private MapGenVillage villageGenerator; private MapGenMineshaft mineshaftGenerator; private MapGenScatteredFeature scatteredFeatureGenerator; private MapGenBase ravineGenerator; private StructureOceanMonument oceanMonumentGenerator; private BiomeGenBase[] biomesForGeneration; double[] field_147427_d; double[] field_147428_e; double[] field_147425_f; double[] field_147426_g; private static final String __OBFID = "CL_00000396"; { caveGenerator = TerrainGen.getModdedMapGen(caveGenerator, CAVE); strongholdGenerator = (MapGenStronghold) TerrainGen.getModdedMapGen(strongholdGenerator, STRONGHOLD); villageGenerator = (MapGenVillage) TerrainGen.getModdedMapGen(villageGenerator, VILLAGE); mineshaftGenerator = (MapGenMineshaft) TerrainGen.getModdedMapGen(mineshaftGenerator, MINESHAFT); scatteredFeatureGenerator = (MapGenScatteredFeature) TerrainGen.getModdedMapGen(scatteredFeatureGenerator, SCATTERED_FEATURE); ravineGenerator = TerrainGen.getModdedMapGen(ravineGenerator, RAVINE); } public OtherlyworldChunkProvider(World worldIn, long seed, boolean mapFeatures, String generatorOptions) { this.field_177476_s = Blocks.ice /*Water*/; this.stoneNoise = new double[256]; this.caveGenerator = new MapGenCaves(); this.strongholdGenerator = new MapGenStronghold(); this.villageGenerator = new MapGenVillage(); this.mineshaftGenerator = new MapGenMineshaft(); this.scatteredFeatureGenerator = new MapGenScatteredFeature(); this.ravineGenerator = new MapGenRavine(); this.oceanMonumentGenerator = new StructureOceanMonument(); this.worldObj = worldIn; this.mapFeaturesEnabled = mapFeatures; this.field_177475_o = worldIn.getWorldInfo().getTerrainType(); this.rand = new Random(seed); this.field_147431_j = new NoiseGeneratorOctaves(this.rand, 16); this.field_147432_k = new NoiseGeneratorOctaves(this.rand, 16); this.field_147429_l = new NoiseGeneratorOctaves(this.rand, ; this.field_147430_m = new NoiseGeneratorPerlin(this.rand, 4); this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, ; this.field_147434_q = new double[825]; this.parabolicField = new float[25]; for (int j = -2; j <= 2; ++j) { for (int k = -2; k <= 2; ++k) { float f = 10.0F / MathHelper.sqrt_float((float)(j * j + k * k) + 0.2F); this.parabolicField[j + 2 + (k + 2) * 5] = f; } } if (generatorOptions != null) { this.settings = ChunkProviderSettings.Factory.jsonToFactory(generatorOptions).func_177864_b(); this.field_177476_s = this.settings.useLavaOceans ? Blocks.air /*Lava*/ : Blocks.ice; /* Water*/ } NoiseGenerator[] noiseGens = {field_147431_j, field_147432_k, field_147429_l, field_147430_m, noiseGen5, noiseGen6, mobSpawnerNoise}; noiseGens = TerrainGen.getModdedNoiseGenerators(worldIn, this.rand, noiseGens); this.field_147431_j = (NoiseGeneratorOctaves)noiseGens[0]; this.field_147432_k = (NoiseGeneratorOctaves)noiseGens[1]; this.field_147429_l = (NoiseGeneratorOctaves)noiseGens[2]; this.field_147430_m = (NoiseGeneratorPerlin)noiseGens[3]; this.noiseGen5 = (NoiseGeneratorOctaves)noiseGens[4]; this.noiseGen6 = (NoiseGeneratorOctaves)noiseGens[5]; this.mobSpawnerNoise = (NoiseGeneratorOctaves)noiseGens[6]; } public void setBlocksInChunk(int p_180518_1_, int p_180518_2_, ChunkPrimer p_180518_3_) { this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, p_180518_1_ * 4 - 2, p_180518_2_ * 4 - 2, 10, 10); this.func_147423_a(p_180518_1_ * 4, 0, p_180518_2_ * 4); for (int k = 0; k < 4; ++k) { int l = k * 5; int i1 = (k + 1) * 5; for (int j1 = 0; j1 < 4; ++j1) { int k1 = (l + j1) * 33; int l1 = (l + j1 + 1) * 33; int i2 = (i1 + j1) * 33; int j2 = (i1 + j1 + 1) * 33; for (int k2 = 0; k2 < 32; ++k2) { double d0 = 0.125D; double d1 = this.field_147434_q[k1 + k2]; double d2 = this.field_147434_q[l1 + k2]; double d3 = this.field_147434_q[i2 + k2]; double d4 = this.field_147434_q[j2 + k2]; double d5 = (this.field_147434_q[k1 + k2 + 1] - d1) * d0; double d6 = (this.field_147434_q[l1 + k2 + 1] - d2) * d0; double d7 = (this.field_147434_q[i2 + k2 + 1] - d3) * d0; double d8 = (this.field_147434_q[j2 + k2 + 1] - d4) * d0; for (int l2 = 0; l2 < 8; ++l2) { double d9 = 0.25D; double d10 = d1; double d11 = d2; double d12 = (d3 - d1) * d9; double d13 = (d4 - d2) * d9; for (int i3 = 0; i3 < 4; ++i3) { double d14 = 0.25D; double d16 = (d11 - d10) * d14; double d15 = d10 - d16; for (int j3 = 0; j3 < 4; ++j3) { if ((d15 += d16) > 0.0D) { p_180518_3_.setBlockState(k * 4 + i3, k2 * 8 + l2, j1 * 4 + j3, MoreOresModBlocks.otherlyworld_stone.getDefaultState()/*Stone*/); } else if (k2 * 8 + l2 < this.settings.seaLevel) { p_180518_3_.setBlockState(k * 4 + i3, k2 * 8 + l2, j1 * 4 + j3, this.field_177476_s.getDefaultState()); } } d10 += d12; d11 += d13; } d1 += d5; d2 += d6; d3 += d7; d4 += d8; } } } } } public void placeBiomeBlocks(int p_180517_1_, int p_180517_2_, ChunkPrimer p_180517_3_, BiomeGenBase[] p_180517_4_) { ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, p_180517_1_, p_180517_2_, p_180517_3_, this.worldObj); MinecraftForge.EVENT_BUS.post(event); if (event.getResult() == Result.DENY) return; double d0 = 0.03125D; this.stoneNoise = this.field_147430_m.func_151599_a(this.stoneNoise, (double)(p_180517_1_ * 16), (double)(p_180517_2_ * 16), 16, 16, d0 * 2.0D, d0 * 2.0D, 1.0D); for (int k = 0; k < 16; ++k) { for (int l = 0; l < 16; ++l) { BiomeGenBase biomegenbase = MoreOresModBiomes.otherlyworldBiome; biomegenbase.genTerrainBlocks(this.worldObj, this.rand, p_180517_3_, p_180517_1_ * 16 + k, p_180517_2_ * 16 + l, this.stoneNoise[l + k * 16]); } } } public Chunk provideChunk(int x, int z) { this.rand.setSeed((long)x * 341873128712L + (long)z * 132897987541L); ChunkPrimer chunkprimer = new ChunkPrimer(); this.setBlocksInChunk(x, z, chunkprimer); this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, x * 16, z * 16, 16, 16); this.placeBiomeBlocks(x, z, chunkprimer, this.biomesForGeneration); if (this.settings.useCaves) { //this.caveGenerator.func_175792_a(this, this.worldObj, x, z, chunkprimer); } if (this.settings.useRavines) { //this.ravineGenerator.func_175792_a(this, this.worldObj, x, z, chunkprimer); } if (this.settings.useMineShafts && this.mapFeaturesEnabled) { //this.mineshaftGenerator.func_175792_a(this, this.worldObj, x, z, chunkprimer); } if (this.settings.useVillages && this.mapFeaturesEnabled) { //this.villageGenerator.func_175792_a(this, this.worldObj, x, z, chunkprimer); } if (this.settings.useStrongholds && this.mapFeaturesEnabled) { //this.strongholdGenerator.func_175792_a(this, this.worldObj, x, z, chunkprimer); } if (this.settings.useTemples && this.mapFeaturesEnabled) { //this.scatteredFeatureGenerator.func_175792_a(this, this.worldObj, x, z, chunkprimer); } if (this.settings.useMonuments && this.mapFeaturesEnabled) { //this.oceanMonumentGenerator.func_175792_a(this, this.worldObj, x, z, chunkprimer); } Chunk chunk = new Chunk(this.worldObj, chunkprimer, x, z); byte[] abyte = chunk.getBiomeArray(); for (int k = 0; k < abyte.length; ++k) { abyte[k] = (byte)this.biomesForGeneration[k].biomeID; } chunk.generateSkylightMap(); return chunk; } private void func_147423_a(int p_147423_1_, int p_147423_2_, int p_147423_3_) { this.field_147426_g = this.noiseGen6.generateNoiseOctaves(this.field_147426_g, p_147423_1_, p_147423_3_, 5, 5, (double)this.settings.depthNoiseScaleX, (double)this.settings.depthNoiseScaleZ, (double)this.settings.depthNoiseScaleExponent); float f = this.settings.coordinateScale; float f1 = this.settings.heightScale; this.field_147427_d = this.field_147429_l.generateNoiseOctaves(this.field_147427_d, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, (double)(f / this.settings.mainNoiseScaleX), (double)(f1 / this.settings.mainNoiseScaleY), (double)(f / this.settings.mainNoiseScaleZ)); this.field_147428_e = this.field_147431_j.generateNoiseOctaves(this.field_147428_e, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, (double)f, (double)f1, (double)f); this.field_147425_f = this.field_147432_k.generateNoiseOctaves(this.field_147425_f, p_147423_1_, p_147423_2_, p_147423_3_, 5, 33, 5, (double)f, (double)f1, (double)f); boolean flag1 = false; boolean flag = false; int l = 0; int i1 = 0; for (int j1 = 0; j1 < 5; ++j1) { for (int k1 = 0; k1 < 5; ++k1) { float f2 = 0.0F; float f3 = 0.0F; float f4 = 0.0F; byte b0 = 2; BiomeGenBase biomegenbase = MoreOresModBiomes.otherlyworldBiome;//this.biomesForGeneration[j1 + 2 + (k1 + 2) * 10]; for (int l1 = -b0; l1 <= b0; ++l1) { for (int i2 = -b0; i2 <= b0; ++i2) { BiomeGenBase biomegenbase1 = MoreOresModBiomes.otherlyworldBiome;//this.biomesForGeneration[j1 + l1 + 2 + (k1 + i2 + 2) * 10]; float f5 = this.settings.biomeDepthOffSet + biomegenbase1.minHeight * this.settings.biomeDepthWeight; float f6 = this.settings.biomeScaleOffset + biomegenbase1.maxHeight * this.settings.biomeScaleWeight; if (this.field_177475_o == WorldType.AMPLIFIED && f5 > 0.0F) { f5 = 1.0F + f5 * 2.0F; f6 = 1.0F + f6 * 4.0F; } float f7 = this.parabolicField[l1 + 2 + (i2 + 2) * 5] / (f5 + 2.0F); if (biomegenbase1.minHeight > biomegenbase.minHeight) { f7 /= 2.0F; } f2 += f6 * f7; f3 += f5 * f7; f4 += f7; } } f2 /= f4; f3 /= f4; f2 = f2 * 0.9F + 0.1F; f3 = (f3 * 4.0F - 1.0F) / 8.0F; double d7 = this.field_147426_g[i1] / 8000.0D; if (d7 < 0.0D) { d7 = -d7 * 0.3D; } d7 = d7 * 3.0D - 2.0D; if (d7 < 0.0D) { d7 /= 2.0D; if (d7 < -1.0D) { d7 = -1.0D; } d7 /= 1.4D; d7 /= 2.0D; } else { if (d7 > 1.0D) { d7 = 1.0D; } d7 /= 8.0D; } ++i1; double d8 = (double)f3; double d9 = (double)f2; d8 += d7 * 0.2D; d8 = d8 * (double)this.settings.baseSize / 8.0D; double d0 = (double)this.settings.baseSize + d8 * 4.0D; for (int j2 = 0; j2 < 33; ++j2) { double d1 = ((double)j2 - d0) * (double)this.settings.stretchY * 128.0D / 256.0D / d9; if (d1 < 0.0D) { d1 *= 4.0D; } double d2 = this.field_147428_e[l] / (double)this.settings.lowerLimitScale; double d3 = this.field_147425_f[l] / (double)this.settings.upperLimitScale; double d4 = (this.field_147427_d[l] / 10.0D + 1.0D) / 2.0D; double d5 = MathHelper.denormalizeClamp(d2, d3, d4) - d1; if (j2 > 29) { double d6 = (double)((float)(j2 - 29) / 3.0F); d5 = d5 * (1.0D - d6) + -10.0D * d6; } this.field_147434_q[l] = d5; ++l; } } } } public boolean chunkExists(int x, int z) { return true; } public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { BlockFalling.fallInstantly = true; int k = p_73153_2_ * 16; int l = p_73153_3_ * 16; BlockPos blockpos = new BlockPos(k, 0, l); BiomeGenBase biomegenbase = MoreOresModBiomes.otherlyworldBiome;//this.worldObj.getBiomeGenForCoords(blockpos.add(16, 0, 16)); this.rand.setSeed(this.worldObj.getSeed()); long i1 = this.rand.nextLong() / 2L * 2L + 1L; long j1 = this.rand.nextLong() / 2L * 2L + 1L; this.rand.setSeed((long)p_73153_2_ * i1 + (long)p_73153_3_ * j1 ^ this.worldObj.getSeed()); boolean flag = false; ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(p_73153_2_, p_73153_3_); MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); if (this.settings.useMineShafts && this.mapFeaturesEnabled) { this.mineshaftGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); } if (this.settings.useVillages && this.mapFeaturesEnabled) { flag = this.villageGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); } if (this.settings.useStrongholds && this.mapFeaturesEnabled) { this.strongholdGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); } if (this.settings.useTemples && this.mapFeaturesEnabled) { this.scatteredFeatureGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); } if (this.settings.useMonuments && this.mapFeaturesEnabled) { this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, chunkcoordintpair); } int k1; int l1; int i2; if (biomegenbase != BiomeGenBase.desert && biomegenbase != BiomeGenBase.desertHills && this.settings.useWaterLakes && !flag && this.rand.nextInt(this.settings.waterLakeChance) == 0 && TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, LAKE)) { k1 = this.rand.nextInt(16) + 8; l1 = this.rand.nextInt(256); i2 = this.rand.nextInt(16) + 8; (new WorldGenLakes(Blocks.ice/*Water*/)).generate(this.worldObj, this.rand, blockpos.add(k1, l1, i2)); } if (TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, LAVA) && !flag && this.rand.nextInt(this.settings.lavaLakeChance / 10) == 0 && this.settings.useLavaLakes) { k1 = this.rand.nextInt(16) + 8; l1 = this.rand.nextInt(this.rand.nextInt(248) + ; i2 = this.rand.nextInt(16) + 8; if (l1 < 63 || this.rand.nextInt(this.settings.lavaLakeChance / == 0) { (new WorldGenLakes(Blocks.air/*Lava*/)).generate(this.worldObj, this.rand, blockpos.add(k1, l1, i2)); } } if (this.settings.useDungeons) { boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, DUNGEON); for (k1 = 0; doGen && k1 < this.settings.dungeonChance; ++k1) { l1 = this.rand.nextInt(16) + 8; i2 = this.rand.nextInt(256); int j2 = this.rand.nextInt(16) + 8; (new WorldGenDungeons()).generate(this.worldObj, this.rand, blockpos.add(l1, i2, j2)); } } biomegenbase.decorate(this.worldObj, this.rand, new BlockPos(k, 0, l)); if (TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, ANIMALS)) { SpawnerAnimals.performWorldGenSpawning(this.worldObj, biomegenbase, k + 8, l + 8, 16, 16, this.rand); } blockpos = blockpos.add(8, 0, ; boolean doGen = TerrainGen.populate(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag, ICE); for (k1 = 0; doGen && k1 < 16; ++k1) { for (l1 = 0; l1 < 16; ++l1) { BlockPos blockpos1 = this.worldObj.getPrecipitationHeight(blockpos.add(k1, 0, l1)); BlockPos blockpos2 = blockpos1.down(); if (this.worldObj.canBlockFreezeWater(blockpos2)) { this.worldObj.setBlockState(blockpos2, Blocks.ice.getDefaultState(), 2); } if (this.worldObj.canSnowAt(blockpos1, true)) { this.worldObj.setBlockState(blockpos1, Blocks.snow_layer.getDefaultState(), 2); } } } MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(p_73153_1_, worldObj, rand, p_73153_2_, p_73153_3_, flag)); BlockFalling.fallInstantly = false; } public boolean func_177460_a(IChunkProvider p_177460_1_, Chunk p_177460_2_, int p_177460_3_, int p_177460_4_) { boolean flag = false; if (this.settings.useMonuments && this.mapFeaturesEnabled && p_177460_2_.getInhabitedTime() < 3600L) { flag |= this.oceanMonumentGenerator.generateStructure(this.worldObj, this.rand, new ChunkCoordIntPair(p_177460_3_, p_177460_4_)); } return flag; } public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_) { return true; } public void saveExtraData() {} public boolean unloadQueuedChunks() { return false; } public boolean canSave() { return true; } public String makeString() { return "RandomLevelSource"; } public List func_177458_a(EnumCreatureType p_177458_1_, BlockPos p_177458_2_) { BiomeGenBase biomegenbase = MoreOresModBiomes.otherlyworldBiome; if (this.mapFeaturesEnabled) { if (p_177458_1_ == EnumCreatureType.MONSTER && this.scatteredFeatureGenerator.func_175798_a(p_177458_2_)) { return this.scatteredFeatureGenerator.getScatteredFeatureSpawnList(); } if (p_177458_1_ == EnumCreatureType.MONSTER && this.settings.useMonuments && this.oceanMonumentGenerator.func_175796_a(this.worldObj, p_177458_2_)) { return this.oceanMonumentGenerator.func_175799_b(); } } return biomegenbase.getSpawnableList(p_177458_1_); } public BlockPos getStrongholdGen(World worldIn, String p_180513_2_, BlockPos p_180513_3_) { return "Stronghold".equals(p_180513_2_) && this.strongholdGenerator != null ? this.strongholdGenerator.getClosestStrongholdPos(worldIn, p_180513_3_) : null; } public int getLoadedChunkCount() { return 0; } public void recreateStructures(Chunk p_180514_1_, int p_180514_2_, int p_180514_3_) { if (this.settings.useMineShafts && this.mapFeaturesEnabled) { this.mineshaftGenerator.generate(this, this.worldObj, p_180514_2_, p_180514_3_, (ChunkPrimer)null); } if (this.settings.useVillages && this.mapFeaturesEnabled) { this.villageGenerator.generate(this, this.worldObj, p_180514_2_, p_180514_3_, (ChunkPrimer)null); } if (this.settings.useStrongholds && this.mapFeaturesEnabled) { this.strongholdGenerator.generate(this, this.worldObj, p_180514_2_, p_180514_3_, (ChunkPrimer)null); } if (this.settings.useTemples && this.mapFeaturesEnabled) { this.scatteredFeatureGenerator.generate(this, this.worldObj, p_180514_2_, p_180514_3_, (ChunkPrimer)null); } if (this.settings.useMonuments && this.mapFeaturesEnabled) { this.oceanMonumentGenerator.generate(this, this.worldObj, p_180514_2_, p_180514_3_, (ChunkPrimer)null); } } public Chunk provideChunk(BlockPos blockPosIn) { return this.provideChunk(blockPosIn.getX() >> 4, blockPosIn.getZ() >> 4); } @Override public List<SpawnListEntry> getPossibleCreatures( EnumCreatureType creatureType, BlockPos pos) { // TODO Auto-generated method stub return null; } }
-
How to you add Liquids into Forge 1.8.9?
KingOfMiners replied to KingOfMiners's topic in Modder Support
No answer, as expected. -
I have looked it up several times but Liquids are just something that I can't find out how to add them into minecraft, if anyone knows a good source or knows how to can you help?
-
[1.8.8] Structure generation generating in wrong Y coordenet
KingOfMiners replied to KingOfMiners's topic in Modder Support
It appears in 1.8.8 forge they removed world.getHeightValue Is there another way? -
I'm working on making a structure but it keeps generating at the world height and not at the ground level, I have tried a lot of times but they just don't generate right. package com.moreoresmod.main.worldgeneration.structure; import java.util.List; import java.util.Random; import com.google.common.collect.Lists; import com.moreoresmod.main.entitys.EntityDungonProtector; import com.moreoresmod.main.init.MoreOresModBiomes; import com.moreoresmod.main.init.MoreOresModBlocks; import com.moreoresmod.main.init.MoreOresModItems; import net.minecraft.block.BlockChest; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.tileentity.TileEntityMobSpawner; import net.minecraft.util.BlockPos; import net.minecraft.util.WeightedRandomChestContent; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.fml.common.IWorldGenerator; public class Structures implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if(world.provider.getDimensionId() == 0){ if(world.getBiomeGenForCoords(new BlockPos(chunkX*16, 64, chunkZ*16)).equals(MoreOresModBiomes.otherlyworldBiome)){ //generateTeleporterStructure(random,chunkX,chunkZ,world); } }else if(world.provider.getDimensionId() == 2){ generateOtherlyworldDungen(random, chunkX, chunkZ, world); } } private void generateTeleporterStructure(Random random, int chunkX, int chunkZ, World world){ int startX = chunkX * 16 + random.nextInt(16); int startY = world.getActualHeight() - 256 + random.nextInt(50); int startZ = chunkZ * 16 + random.nextInt(16); BlockPos pos = new BlockPos(startX,startY,startZ); world.setBlockState(pos, Blocks.bedrock.getDefaultState()); int width = random.nextInt(5) *2 + 10; int length = width*2; int height = 7; for (int x=0; x<width; x++) { for (int z=0; z<length; z++) { for (int y=0; y<height; y++) { BlockPos bpos = pos.add(x, y, z); if (x==0 || x==width-1 || y==0 || y== height-1 || z==0 || z== length-1) world.setBlockState(bpos, Blocks.bedrock.getDefaultState()); else world.setBlockState(bpos, Blocks.air.getDefaultState()); } } } int doorX = width /2; int chestZ = length-2; //door world.setBlockState(pos.add(doorX-1,1,0), Blocks.air.getDefaultState()); world.setBlockState(pos.add(doorX-1,2,0), Blocks.air.getDefaultState()); world.setBlockState(pos.add(doorX,1,0), Blocks.air.getDefaultState()); world.setBlockState(pos.add(doorX,2,0), Blocks.air.getDefaultState()); //chest world.setBlockState(pos.add(doorX, 1, chestZ), Blocks.chest.getDefaultState()); world.setBlockState(pos.add(doorX-1, 1, chestZ), Blocks.chest.getDefaultState()); } private void generateOtherlyworldDungen(Random rand, int chunkX, int chunkZ,World world){ int startX = chunkX * 16 + rand.nextInt(50); int startY = world.getActualHeight() - 1; int startZ = chunkZ * 16 + rand.nextInt(50); while(world.getBlockState(new BlockPos(startX,startY,startZ)) == Blocks.air){ startY--; } if(world.getBlockState(new BlockPos(startX,startY,startZ)) != Blocks.air){ BlockPos pos = new BlockPos(startX, startY, startZ); for(int x = pos.getX() - 5; x == pos.getX() + 5; x++){ for(int z = pos.getZ() - 5; z == pos.getX() + 5; z++){ int y = pos.getY(); world.setBlockState(new BlockPos(x, y, z), MoreOresModBlocks.otherlyworld_brick.getDefaultState()); } } BlockPos spawner1 = pos.add(-3, 0, -3); world.setBlockState(spawner1, Blocks.mob_spawner.getDefaultState(), 2); TileEntity tileentity1 = world.getTileEntity(spawner1); if (tileentity1 instanceof TileEntityMobSpawner) { ((TileEntityMobSpawner)tileentity1).getSpawnerBaseLogic().setEntityName("Darkness"); } BlockPos spawner2 = pos.add(3, 0, -3); world.setBlockState(spawner2, Blocks.mob_spawner.getDefaultState(), 2); TileEntity tileentity2 = world.getTileEntity(spawner2); if (tileentity2 instanceof TileEntityMobSpawner) { ((TileEntityMobSpawner)tileentity2).getSpawnerBaseLogic().setEntityName("Darkness"); } BlockPos spawner3 = pos.add(-3, 0, 3); world.setBlockState(spawner3, Blocks.mob_spawner.getDefaultState(), 2); TileEntity tileentity3 = world.getTileEntity(spawner3); if (tileentity3 instanceof TileEntityMobSpawner) { ((TileEntityMobSpawner)tileentity3).getSpawnerBaseLogic().setEntityName("Darkness"); } BlockPos spawner4 = pos.add(3, 0, 3); world.setBlockState(spawner4, Blocks.mob_spawner.getDefaultState(), 2); TileEntity tileentity4 = world.getTileEntity(spawner4); if (tileentity4 instanceof TileEntityMobSpawner) { ((TileEntityMobSpawner)tileentity4).getSpawnerBaseLogic().setEntityName("Darkness"); } } } } [\code]
-
I Deleted the code on this post because i don't want anyone to steal my code.
-
I want to make it so if you right click the block it turns into another block but I have that, I want it to give you an item if you right click it and it has a cherry it gives you a cherry. I did this in 1.6 but i dont remember and i lost the files public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ, ItemStack stack){ int i = pos.getX(); int j = pos.getY(); int k = pos.getZ(); BlockPos bpos = new BlockPos(i, j, k); if(this.hasCharry == true){ worldIn.setBlockState(bpos, MoreOresModBlocks.charry_leaves_empty.getDefaultState(), 0); } return true; }
-
Will It Work Now: public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) { super.updateTick(world, pos, state, rand); if(this.hasCharry == false && rand.nextInt(500) < 1){ int i = pos.getX(); int j = pos.getY(); int k = pos.getZ(); BlockPos bpos = new BlockPos(i, j, k); world.setBlockState(bpos, MoreOresModBlocks.charry_leaves_full.getDefaultState(), 0); } }
-
okay, thanks if i need anything I'll come back to this forum.
-
I'm making a cherry leaf block and i want it so it has a small chance to change into a leaf that has cherries on it and i would be able to do it but i don't know how to use setBlockState[move]*Fail*[/move] but i need help if(this.hasCharry == false && rand.nextInt(500) < 1){ int i = pos.getX(); int j = pos.getY(); int k = pos.getZ(); BlockPos bpos = new BlockPos(i, j, k); worldIn.setBlockState(bpos, state); } oh and yes i googled it.
-
I don't understand this playerIn.openGui(mod, modGuiId, world, x, y, z); what do i put for mod, modGuiId, world, x, y, z?
-
It helped but it won't render the GUI and the console says this now: [09:27:44] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:710) [FMLCommonHandler.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1011) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:345) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?] at GradleStart.main(GradleStart.java:45) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_31] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_31] at net.minecraft.inventory.Container.getSlot(Container.java:114) ~[Container.class:?] at net.minecraft.inventory.Container.putStacksInSlots(Container.java:527) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleWindowItems(NetHandlerPlayClient.java:1082) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.S30PacketWindowItems.func_180732_a(S30PacketWindowItems.java:61) ~[s30PacketWindowItems.class:?] at net.minecraft.network.play.server.S30PacketWindowItems.processPacket(S30PacketWindowItems.java:72) ~[s30PacketWindowItems.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:18) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:709) ~[FMLCommonHandler.class:?] ... 11 more [09:27:44] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:710) [FMLCommonHandler.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1011) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:345) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?] at GradleStart.main(GradleStart.java:45) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_31] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_31] at net.minecraft.inventory.Container.getSlot(Container.java:114) ~[Container.class:?] at net.minecraft.inventory.Container.putStackInSlot(Container.java:519) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1045) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:30) ~[s2FPacketSetSlot.class:?] at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:55) ~[s2FPacketSetSlot.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:18) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:709) ~[FMLCommonHandler.class:?] ... 11 more [09:27:44] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 37, Size: 36 java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 37, Size: 36 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:710) [FMLCommonHandler.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1011) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:345) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?] at GradleStart.main(GradleStart.java:45) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 37, Size: 36 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_31] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_31] at net.minecraft.inventory.Container.getSlot(Container.java:114) ~[Container.class:?] at net.minecraft.inventory.Container.putStackInSlot(Container.java:519) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleSetSlot(NetHandlerPlayClient.java:1045) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:30) ~[s2FPacketSetSlot.class:?] at net.minecraft.network.play.server.S2FPacketSetSlot.processPacket(S2FPacketSetSlot.java:55) ~[s2FPacketSetSlot.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:18) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:709) ~[FMLCommonHandler.class:?] ... 11 more
-
i cant get my melter as i'm calling to show anything but Melter and the inventory below it This is the block's class: package com.moreoresmod.main.block; import java.util.Random; import com.moreoresmod.main.init.MoreOresModBlocks; import com.moreoresmod.main.tileentity.TileEntityMelter; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class Melter extends BlockContainer { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); private final boolean isBurning; private static boolean keepInventory; private static final String __OBFID = "CL_00000248"; public Melter(boolean isBurning) { super(Material.rock); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); this.isBurning = isBurning; } public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(MoreOresModBlocks.melter); } public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { this.setDefaultFacing(worldIn, pos, state); } private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { Block block = worldIn.getBlockState(pos.north()).getBlock(); Block block1 = worldIn.getBlockState(pos.south()).getBlock(); Block block2 = worldIn.getBlockState(pos.west()).getBlock(); Block block3 = worldIn.getBlockState(pos.east()).getBlock(); EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } } @SideOnly(Side.CLIENT) public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { if (this.isBurning) { EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); double d0 = (double)pos.getX() + 0.5D; double d1 = (double)pos.getY() + rand.nextDouble() * 6.0D / 16.0D; double d2 = (double)pos.getZ() + 0.5D; double d3 = 0.52D; double d4 = rand.nextDouble() * 0.6D - 0.3D; switch (Melter.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()]) { case 1: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); break; case 2: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); break; case 3: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); break; case 4: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); } } } public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote) { return true; } else { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityMelter) { playerIn.displayGUIChest((TileEntityMelter)tileentity); } return true; } } public static void setState(boolean active, World worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); TileEntity tileentity = worldIn.getTileEntity(pos); keepInventory = true; if (active) { worldIn.setBlockState(pos, MoreOresModBlocks.melter.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); worldIn.setBlockState(pos, MoreOresModBlocks.melter.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); } else { worldIn.setBlockState(pos, MoreOresModBlocks.melter.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); worldIn.setBlockState(pos, MoreOresModBlocks.melter.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); } keepInventory = false; if (tileentity != null) { tileentity.validate(); worldIn.setTileEntity(pos, tileentity); } } public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityMelter(); } public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); } public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2); if (stack.hasDisplayName()) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityMelter) { ((TileEntityMelter)tileentity).setCustomInventoryName(stack.getDisplayName()); } } } public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityMelter) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityMelter)tileentity); worldIn.updateComparatorOutputLevel(pos, this); } } super.breakBlock(worldIn, pos, state); } public boolean hasComparatorInputOverride() { return true; } public int getComparatorInputOverride(World worldIn, BlockPos pos) { return Container.calcRedstone(worldIn.getTileEntity(pos)); } @SideOnly(Side.CLIENT) public Item getItem(World worldIn, BlockPos pos) { return Item.getItemFromBlock(Blocks.furnace); } public int getRenderType() { return 3; } @SideOnly(Side.CLIENT) public IBlockState getStateForEntityRender(IBlockState state) { return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); } public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(FACING, enumfacing); } public int getMetaFromState(IBlockState state) { return ((EnumFacing)state.getValue(FACING)).getIndex(); } protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {FACING}); } @SideOnly(Side.CLIENT) static final class SwitchEnumFacing { static final int[] FACING_LOOKUP = new int[EnumFacing.values().length]; private static final String __OBFID = "CL_00002111"; static { try { FACING_LOOKUP[EnumFacing.WEST.ordinal()] = 1; } catch (NoSuchFieldError var4) { ; } try { FACING_LOOKUP[EnumFacing.EAST.ordinal()] = 2; } catch (NoSuchFieldError var3) { ; } try { FACING_LOOKUP[EnumFacing.NORTH.ordinal()] = 3; } catch (NoSuchFieldError var2) { ; } try { FACING_LOOKUP[EnumFacing.SOUTH.ordinal()] = 4; } catch (NoSuchFieldError var1) { ; } } } } This is my TileEntity Class: package com.moreoresmod.main.tileentity; import com.moreoresmod.main.container.ContainerMelter; import com.moreoresmod.main.tileentity.Recipes.MelterRecipes; import com.moreoresmod.main.tileentity.slots.SlotMelterFuel; import net.minecraft.block.Block; import net.minecraft.block.BlockFurnace; import net.minecraft.block.material.Material; 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.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemHoe; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.item.ItemTool; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntityLockable; import net.minecraft.util.EnumFacing; import net.minecraft.util.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class TileEntityMelter extends TileEntityLockable implements IUpdatePlayerListBox, ISidedInventory { private static final int[] slotsTop = new int[] {0}; private static final int[] slotsBottom = new int[] {2, 1}; private static final int[] slotsSides = new int[] {1}; private ItemStack[] melterItemStacks = new ItemStack[3]; private int melterMeltTime; private int currentItemMeltTime; private int meltTime; private int totalMeltTime; private String melterCustomName; private static final String __OBFID = "CL_00000357"; public int getSizeInventory() { return this.melterItemStacks.length; } public ItemStack getStackInSlot(int index) { return this.melterItemStacks[index]; } public ItemStack decrStackSize(int index, int count) { if (this.melterItemStacks[index] != null) { ItemStack itemstack; if (this.melterItemStacks[index].stackSize <= count) { itemstack = this.melterItemStacks[index]; this.melterItemStacks[index] = null; return itemstack; } else { itemstack = this.melterItemStacks[index].splitStack(count); if (this.melterItemStacks[index].stackSize == 0) { this.melterItemStacks[index] = null; } return itemstack; } } else { return null; } } public ItemStack getStackInSlotOnClosing(int index) { if (this.melterItemStacks[index] != null) { ItemStack itemstack = this.melterItemStacks[index]; this.melterItemStacks[index] = null; return itemstack; } else { return null; } } public void setInventorySlotContents(int index, ItemStack stack) { boolean flag = stack != null && stack.isItemEqual(this.melterItemStacks[index]) && ItemStack.areItemStackTagsEqual(stack, this.melterItemStacks[index]); this.melterItemStacks[index] = stack; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) { stack.stackSize = this.getInventoryStackLimit(); } if (index == 0 && !flag) { this.totalMeltTime = this.func_174904_a(stack); this.meltTime = 0; this.markDirty(); } } public String getName() { return this.hasCustomName() ? this.melterCustomName : "container.melter"; } public boolean hasCustomName() { return this.melterCustomName != null && this.melterCustomName.length() > 0; } public void setCustomInventoryName(String p_145951_1_) { this.melterCustomName = p_145951_1_; } public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); NBTTagList nbttaglist = compound.getTagList("Items", 10); this.melterItemStacks = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); byte b0 = nbttagcompound1.getByte("Slot"); if (b0 >= 0 && b0 < this.melterItemStacks.length) { this.melterItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } this.melterMeltTime = compound.getShort("MeltTime"); this.meltTime = compound.getShort("meltTime"); this.totalMeltTime = compound.getShort("meltTimeTotal"); this.currentItemMeltTime = getItemMeltTime(this.melterItemStacks[1]); if (compound.hasKey("CustomName", ) { this.melterCustomName = compound.getString("CustomName"); } } public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setShort("MeltTime", (short)this.melterMeltTime); compound.setShort("meltTime", (short)this.meltTime); compound.setShort("meltTimeTotal", (short)this.totalMeltTime); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.melterItemStacks.length; ++i) { if (this.melterItemStacks[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte)i); this.melterItemStacks[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } compound.setTag("Items", nbttaglist); if (this.hasCustomName()) { compound.setString("CustomName", this.melterCustomName); } } public int getInventoryStackLimit() { return 64; } public boolean isMelting() { return this.melterMeltTime > 0; } @SideOnly(Side.CLIENT) public static boolean isMelting(IInventory p_174903_0_) { return p_174903_0_.getField(0) > 0; } public void update() { boolean flag = this.isMelting(); boolean flag1 = false; if (this.isMelting()) { --this.melterMeltTime; } if (!this.worldObj.isRemote) { if (!this.isMelting() && (this.melterItemStacks[1] == null || this.melterItemStacks[0] == null)) { if (!this.isMelting() && this.meltTime > 0) { this.meltTime = MathHelper.clamp_int(this.meltTime - 2, 0, this.totalMeltTime); } } else { if (!this.isMelting() && this.canSmelt()) { this.currentItemMeltTime = this.melterMeltTime = getItemMeltTime(this.melterItemStacks[1]); if (this.isMelting()) { flag1 = true; if (this.melterItemStacks[1] != null) { --this.melterItemStacks[1].stackSize; if (this.melterItemStacks[1].stackSize == 0) { this.melterItemStacks[1] = melterItemStacks[1].getItem().getContainerItem(melterItemStacks[1]); } } } } if (this.isMelting() && this.canSmelt()) { ++this.meltTime; if (this.meltTime == this.totalMeltTime) { this.meltTime = 0; this.totalMeltTime = this.func_174904_a(this.melterItemStacks[0]); this.smeltItem(); flag1 = true; } } else { this.meltTime = 0; } } if (flag != this.isMelting()) { flag1 = true; BlockFurnace.setState(this.isMelting(), this.worldObj, this.pos); } } if (flag1) { this.markDirty(); } } public int func_174904_a(ItemStack p_174904_1_) { return 200; } private boolean canSmelt() { if (this.melterItemStacks[0] == null) { return false; } else { ItemStack itemstack = MelterRecipes.instance().getMeltingResult(this.melterItemStacks[0]); if (itemstack == null) return false; if (this.melterItemStacks[2] == null) return true; if (!this.melterItemStacks[2].isItemEqual(itemstack)) return false; int result = melterItemStacks[2].stackSize + itemstack.stackSize; return result <= getInventoryStackLimit() && result <= this.melterItemStacks[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly. } } public void smeltItem() { if (this.canSmelt()) { ItemStack itemstack = MelterRecipes.instance().getMeltingResult(this.melterItemStacks[0]); if (this.melterItemStacks[2] == null) { this.melterItemStacks[2] = itemstack.copy(); } else if (this.melterItemStacks[2].getItem() == itemstack.getItem()) { this.melterItemStacks[2].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items } if (this.melterItemStacks[0].getItem() == Item.getItemFromBlock(Blocks.sponge) && this.melterItemStacks[0].getMetadata() == 1 && this.melterItemStacks[1] != null && this.melterItemStacks[1].getItem() == Items.bucket) { this.melterItemStacks[1] = new ItemStack(Items.water_bucket); } --this.melterItemStacks[0].stackSize; if (this.melterItemStacks[0].stackSize <= 0) { this.melterItemStacks[0] = null; } } } public static int getItemMeltTime(ItemStack p_145952_0_) { if (p_145952_0_ == null) { return 0; } else { Item item = p_145952_0_.getItem(); /*if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) { Block block = Block.getBlockFromItem(item); if (block == Blocks.wooden_slab) { return 150; } if (block.getMaterial() == Material.wood) { return 300; } if (block == Blocks.coal_block) { return 16000; } }*/ if (item == Items.lava_bucket) return 20000; return net.minecraftforge.fml.common.registry.GameRegistry.getFuelValue(p_145952_0_); } } public static boolean isItemFuel(ItemStack p_145954_0_) { return getItemMeltTime(p_145954_0_) > 0; } public boolean isUseableByPlayer(EntityPlayer player) { return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; } public void openInventory(EntityPlayer player) {} public void closeInventory(EntityPlayer player) {} public boolean isItemValidForSlot(int index, ItemStack stack) { return index == 2 ? false : (index != 1 ? true : isItemFuel(stack) || SlotMelterFuel.isBucket(stack)); } public int[] getSlotsForFace(EnumFacing side) { return side == EnumFacing.DOWN ? slotsBottom : (side == EnumFacing.UP ? slotsTop : slotsSides); } public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) { return this.isItemValidForSlot(index, itemStackIn); } public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) { if (direction == EnumFacing.DOWN && index == 1) { Item item = stack.getItem(); if (item != Items.water_bucket && item != Items.bucket) { return false; } } return true; } public String getGuiID() { return "moreoresmod:melter"; } public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerMelter(playerInventory, this); } public int getField(int id) { switch (id) { case 0: return this.melterMeltTime; case 1: return this.currentItemMeltTime; case 2: return this.meltTime; case 3: return this.totalMeltTime; default: return 0; } } public void setField(int id, int value) { switch (id) { case 0: this.melterMeltTime = value; break; case 1: this.currentItemMeltTime = value; break; case 2: this.meltTime = value; break; case 3: this.totalMeltTime = value; } } public int getFieldCount() { return 4; } public void clear() { for (int i = 0; i < this.melterItemStacks.length; ++i) { this.melterItemStacks[i] = null; } } } this is my Container Class: package com.moreoresmod.main.container; import com.moreoresmod.main.tileentity.TileEntityMelter; import com.moreoresmod.main.tileentity.Recipes.MelterRecipes; import com.moreoresmod.main.tileentity.slots.SlotMelterFuel; import com.moreoresmod.main.tileentity.slots.SlotMelterOutput; 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.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ContainerMelter extends Container { private final IInventory tileMelter; private int field_178152_f; private int field_178153_g; private int field_178154_h; private int field_178155_i; private static final String __OBFID = "CL_00001748"; public ContainerMelter(InventoryPlayer p_i45794_1_, IInventory furnaceInventory) { this.tileMelter = furnaceInventory; this.addSlotToContainer(new Slot(furnaceInventory, 0, 56, 17)); this.addSlotToContainer(new SlotMelterFuel(furnaceInventory, 1, 56, 53)); this.addSlotToContainer(new SlotMelterOutput(p_i45794_1_.player, furnaceInventory, 2, 116, 35)); int i; for (i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(p_i45794_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(p_i45794_1_, i, 8 + i * 18, 142)); } } public void addCraftingToCrafters(ICrafting listener) { super.addCraftingToCrafters(listener); listener.func_175173_a(this, this.tileMelter); } public void detectAndSendChanges() { super.detectAndSendChanges(); for (int i = 0; i < this.crafters.size(); ++i) { ICrafting icrafting = (ICrafting)this.crafters.get(i); if (this.field_178152_f != this.tileMelter.getField(2)) { icrafting.sendProgressBarUpdate(this, 2, this.tileMelter.getField(2)); } if (this.field_178154_h != this.tileMelter.getField(0)) { icrafting.sendProgressBarUpdate(this, 0, this.tileMelter.getField(0)); } if (this.field_178155_i != this.tileMelter.getField(1)) { icrafting.sendProgressBarUpdate(this, 1, this.tileMelter.getField(1)); } if (this.field_178153_g != this.tileMelter.getField(3)) { icrafting.sendProgressBarUpdate(this, 3, this.tileMelter.getField(3)); } } this.field_178152_f = this.tileMelter.getField(2); this.field_178154_h = this.tileMelter.getField(0); this.field_178155_i = this.tileMelter.getField(1); this.field_178153_g = this.tileMelter.getField(3); } @SideOnly(Side.CLIENT) public void updateProgressBar(int id, int data) { this.tileMelter.setField(id, data); } public boolean canInteractWith(EntityPlayer playerIn) { return this.tileMelter.isUseableByPlayer(playerIn); } public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; Slot slot = (Slot)this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (index == 2) { if (!this.mergeItemStack(itemstack1, 3, 39, true)) { return null; } slot.onSlotChange(itemstack1, itemstack); } else if (index != 1 && index != 0) { if (MelterRecipes.instance().getMeltingResult(itemstack1) != null) { if (!this.mergeItemStack(itemstack1, 0, 1, false)) { return null; } } else if (TileEntityMelter.isItemFuel(itemstack1)) { if (!this.mergeItemStack(itemstack1, 1, 2, false)) { return null; } } else if (index >= 3 && index < 30) { if (!this.mergeItemStack(itemstack1, 30, 39, false)) { return null; } } else if (index >= 30 && index < 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(playerIn, itemstack1); } return itemstack; } } And The Eclipse console said: [06:44:41] [Client thread/FATAL] [FML]: Exception caught executing FutureTask: java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 java.util.concurrent.ExecutionException: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:710) [FMLCommonHandler.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1011) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:345) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_31] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_31] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_31] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:85) [start/:?] at GradleStart.main(GradleStart.java:45) [start/:?] Caused by: java.lang.IndexOutOfBoundsException: Index: 36, Size: 36 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_31] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_31] at net.minecraft.inventory.Container.getSlot(Container.java:114) ~[Container.class:?] at net.minecraft.inventory.Container.putStacksInSlots(Container.java:527) ~[Container.class:?] at net.minecraft.client.network.NetHandlerPlayClient.handleWindowItems(NetHandlerPlayClient.java:1082) ~[NetHandlerPlayClient.class:?] at net.minecraft.network.play.server.S30PacketWindowItems.func_180732_a(S30PacketWindowItems.java:61) ~[s30PacketWindowItems.class:?] at net.minecraft.network.play.server.S30PacketWindowItems.processPacket(S30PacketWindowItems.java:72) ~[s30PacketWindowItems.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:18) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_31] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_31] at net.minecraftforge.fml.common.FMLCommonHandler.callFuture(FMLCommonHandler.java:709) ~[FMLCommonHandler.class:?] ... 11 more [06:44:41] [server thread/ERROR] [FML]: A TileEntity type com.moreoresmod.main.tileentity.TileEntityMelter has throw an exception trying to write state. It will not persist. Report this to the mod author java.lang.RuntimeException: class com.moreoresmod.main.tileentity.TileEntityMelter is missing a mapping! This is a bug! at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:77) ~[TileEntity.class:?] at net.minecraft.tileentity.TileEntityLockable.writeToNBT(TileEntityLockable.java:29) ~[TileEntityLockable.class:?] at com.moreoresmod.main.tileentity.TileEntityMelter.writeToNBT(TileEntityMelter.java:393) ~[TileEntityMelter.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:382) [AnvilChunkLoader.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:183) [AnvilChunkLoader.class:?] at net.minecraft.world.gen.ChunkProviderServer.saveChunkData(ChunkProviderServer.java:246) [ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:305) [ChunkProviderServer.class:?] at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:938) [WorldServer.class:?] at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:363) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:620) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:164) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_31] [06:44:42] [server thread/INFO]: Saving and pausing game... [06:44:42] [server thread/INFO]: Saving chunks for level 'Copy of SuperTnt'/Overworld [06:44:42] [server thread/ERROR] [FML]: A TileEntity type com.moreoresmod.main.tileentity.TileEntityMelter has throw an exception trying to write state. It will not persist. Report this to the mod author java.lang.RuntimeException: class com.moreoresmod.main.tileentity.TileEntityMelter is missing a mapping! This is a bug! at net.minecraft.tileentity.TileEntity.writeToNBT(TileEntity.java:77) ~[TileEntity.class:?] at net.minecraft.tileentity.TileEntityLockable.writeToNBT(TileEntityLockable.java:29) ~[TileEntityLockable.class:?] at com.moreoresmod.main.tileentity.TileEntityMelter.writeToNBT(TileEntityMelter.java:393) ~[TileEntityMelter.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:382) [AnvilChunkLoader.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:183) [AnvilChunkLoader.class:?] at net.minecraft.world.gen.ChunkProviderServer.saveChunkData(ChunkProviderServer.java:246) [ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:305) [ChunkProviderServer.class:?] at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:938) [WorldServer.class:?] at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:363) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:140) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:478) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_31] [06:44:42] [server thread/INFO]: Saving chunks for level 'Copy of SuperTnt'/Nether [06:44:42] [server thread/INFO]: Saving chunks for level 'Copy of SuperTnt'/The End
-
i cant get my melter as i'm calling to show anything but Melter and the inventory below it This is the block's class: package com.moreoresmod.main.block; import java.util.Random; import com.moreoresmod.main.init.MoreOresModBlocks; import com.moreoresmod.main.tileentity.TileEntityMelter; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class Melter extends BlockContainer { public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); private final boolean isBurning; private static boolean keepInventory; private static final String __OBFID = "CL_00000248"; public Melter(boolean isBurning) { super(Material.rock); this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); this.isBurning = isBurning; } public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(MoreOresModBlocks.melter); } public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { this.setDefaultFacing(worldIn, pos, state); } private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { Block block = worldIn.getBlockState(pos.north()).getBlock(); Block block1 = worldIn.getBlockState(pos.south()).getBlock(); Block block2 = worldIn.getBlockState(pos.west()).getBlock(); Block block3 = worldIn.getBlockState(pos.east()).getBlock(); EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2); } } @SideOnly(Side.CLIENT) public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { if (this.isBurning) { EnumFacing enumfacing = (EnumFacing)state.getValue(FACING); double d0 = (double)pos.getX() + 0.5D; double d1 = (double)pos.getY() + rand.nextDouble() * 6.0D / 16.0D; double d2 = (double)pos.getZ() + 0.5D; double d3 = 0.52D; double d4 = rand.nextDouble() * 0.6D - 0.3D; switch (Melter.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()]) { case 1: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); break; case 2: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]); break; case 3: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D, new int[0]); break; case 4: worldIn.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); worldIn.spawnParticle(EnumParticleTypes.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D, new int[0]); } } } public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (worldIn.isRemote) { return true; } else { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityMelter) { playerIn.displayGUIChest((TileEntityMelter)tileentity); } return true; } } public static void setState(boolean active, World worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); TileEntity tileentity = worldIn.getTileEntity(pos); keepInventory = true; if (active) { worldIn.setBlockState(pos, MoreOresModBlocks.melter.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); worldIn.setBlockState(pos, MoreOresModBlocks.melter.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); } else { worldIn.setBlockState(pos, MoreOresModBlocks.melter.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); worldIn.setBlockState(pos, MoreOresModBlocks.melter.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3); } keepInventory = false; if (tileentity != null) { tileentity.validate(); worldIn.setTileEntity(pos, tileentity); } } public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileEntityMelter(); } public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); } public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { worldIn.setBlockState(pos, state.withProperty(FACING, placer.getHorizontalFacing().getOpposite()), 2); if (stack.hasDisplayName()) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityMelter) { ((TileEntityMelter)tileentity).setCustomInventoryName(stack.getDisplayName()); } } } public void breakBlock(World worldIn, BlockPos pos, IBlockState state) { if (!keepInventory) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TileEntityMelter) { InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityMelter)tileentity); worldIn.updateComparatorOutputLevel(pos, this); } } super.breakBlock(worldIn, pos, state); } public boolean hasComparatorInputOverride() { return true; } public int getComparatorInputOverride(World worldIn, BlockPos pos) { return Container.calcRedstone(worldIn.getTileEntity(pos)); } @SideOnly(Side.CLIENT) public Item getItem(World worldIn, BlockPos pos) { return Item.getItemFromBlock(Blocks.furnace); } public int getRenderType() { return 3; } @SideOnly(Side.CLIENT) public IBlockState getStateForEntityRender(IBlockState state) { return this.getDefaultState().withProperty(FACING, EnumFacing.SOUTH); } public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(FACING, enumfacing); } public int getMetaFromState(IBlockState state) { return ((EnumFacing)state.getValue(FACING)).getIndex(); } protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {FACING}); } @SideOnly(Side.CLIENT) static final class SwitchEnumFacing { static final int[] FACING_LOOKUP = new int[EnumFacing.values().length]; private static final String __OBFID = "CL_00002111"; static { try { FACING_LOOKUP[EnumFacing.WEST.ordinal()] = 1; } catch (NoSuchFieldError var4) { ; } try { FACING_LOOKUP[EnumFacing.EAST.ordinal()] = 2; } catch (NoSuchFieldError var3) { ; } try { FACING_LOOKUP[EnumFacing.NORTH.ordinal()] = 3; } catch (NoSuchFieldError var2) { ; } try { FACING_LOOKUP[EnumFacing.SOUTH.ordinal()] = 4; } catch (NoSuchFieldError var1) { ; } } } } This is my TileEntity Class: package com.moreoresmod.main.tileentity; import com.moreoresmod.main.container.ContainerMelter; import com.moreoresmod.main.tileentity.Recipes.MelterRecipes; import com.moreoresmod.main.tileentity.slots.SlotMelterFuel; import net.minecraft.block.Block; import net.minecraft.block.BlockFurnace; import net.minecraft.block.material.Material; 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.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemHoe; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.item.ItemTool; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.server.gui.IUpdatePlayerListBox; import net.minecraft.tileentity.TileEntityLockable; import net.minecraft.util.EnumFacing; import net.minecraft.util.MathHelper; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class TileEntityMelter extends TileEntityLockable implements IUpdatePlayerListBox, ISidedInventory { private static final int[] slotsTop = new int[] {0}; private static final int[] slotsBottom = new int[] {2, 1}; private static final int[] slotsSides = new int[] {1}; private ItemStack[] melterItemStacks = new ItemStack[3]; private int melterMeltTime; private int currentItemMeltTime; private int meltTime; private int totalMeltTime; private String melterCustomName; private static final String __OBFID = "CL_00000357"; public int getSizeInventory() { return this.melterItemStacks.length; } public ItemStack getStackInSlot(int index) { return this.melterItemStacks[index]; } public ItemStack decrStackSize(int index, int count) { if (this.melterItemStacks[index] != null) { ItemStack itemstack; if (this.melterItemStacks[index].stackSize <= count) { itemstack = this.melterItemStacks[index]; this.melterItemStacks[index] = null; return itemstack; } else { itemstack = this.melterItemStacks[index].splitStack(count); if (this.melterItemStacks[index].stackSize == 0) { this.melterItemStacks[index] = null; } return itemstack; } } else { return null; } } public ItemStack getStackInSlotOnClosing(int index) { if (this.melterItemStacks[index] != null) { ItemStack itemstack = this.melterItemStacks[index]; this.melterItemStacks[index] = null; return itemstack; } else { return null; } } public void setInventorySlotContents(int index, ItemStack stack) { boolean flag = stack != null && stack.isItemEqual(this.melterItemStacks[index]) && ItemStack.areItemStackTagsEqual(stack, this.melterItemStacks[index]); this.melterItemStacks[index] = stack; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) { stack.stackSize = this.getInventoryStackLimit(); } if (index == 0 && !flag) { this.totalMeltTime = this.func_174904_a(stack); this.meltTime = 0; this.markDirty(); } } public String getName() { return this.hasCustomName() ? this.melterCustomName : "container.melter"; } public boolean hasCustomName() { return this.melterCustomName != null && this.melterCustomName.length() > 0; } public void setCustomInventoryName(String p_145951_1_) { this.melterCustomName = p_145951_1_; } public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); NBTTagList nbttaglist = compound.getTagList("Items", 10); this.melterItemStacks = new ItemStack[this.getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); ++i) { NBTTagCompound nbttagcompound1 = nbttaglist.getCompoundTagAt(i); byte b0 = nbttagcompound1.getByte("Slot"); if (b0 >= 0 && b0 < this.melterItemStacks.length) { this.melterItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } this.melterMeltTime = compound.getShort("MeltTime"); this.meltTime = compound.getShort("meltTime"); this.totalMeltTime = compound.getShort("meltTimeTotal"); this.currentItemMeltTime = getItemMeltTime(this.melterItemStacks[1]); if (compound.hasKey("CustomName", ) { this.melterCustomName = compound.getString("CustomName"); } } public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setShort("MeltTime", (short)this.melterMeltTime); compound.setShort("meltTime", (short)this.meltTime); compound.setShort("meltTimeTotal", (short)this.totalMeltTime); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.melterItemStacks.length; ++i) { if (this.melterItemStacks[i] != null) { NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte)i); this.melterItemStacks[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } compound.setTag("Items", nbttaglist); if (this.hasCustomName()) { compound.setString("CustomName", this.melterCustomName); } } public int getInventoryStackLimit() { return 64; } public boolean isMelting() { return this.melterMeltTime > 0; } @SideOnly(Side.CLIENT) public static boolean isMelting(IInventory p_174903_0_) { return p_174903_0_.getField(0) > 0; } public void update() { boolean flag = this.isMelting(); boolean flag1 = false; if (this.isMelting()) { --this.melterMeltTime; } if (!this.worldObj.isRemote) { if (!this.isMelting() && (this.melterItemStacks[1] == null || this.melterItemStacks[0] == null)) { if (!this.isMelting() && this.meltTime > 0) { this.meltTime = MathHelper.clamp_int(this.meltTime - 2, 0, this.totalMeltTime); } } else { if (!this.isMelting() && this.canSmelt()) { this.currentItemMeltTime = this.melterMeltTime = getItemMeltTime(this.melterItemStacks[1]); if (this.isMelting()) { flag1 = true; if (this.melterItemStacks[1] != null) { --this.melterItemStacks[1].stackSize; if (this.melterItemStacks[1].stackSize == 0) { this.melterItemStacks[1] = melterItemStacks[1].getItem().getContainerItem(melterItemStacks[1]); } } } } if (this.isMelting() && this.canSmelt()) { ++this.meltTime; if (this.meltTime == this.totalMeltTime) { this.meltTime = 0; this.totalMeltTime = this.func_174904_a(this.melterItemStacks[0]); this.smeltItem(); flag1 = true; } } else { this.meltTime = 0; } } if (flag != this.isMelting()) { flag1 = true; BlockFurnace.setState(this.isMelting(), this.worldObj, this.pos); } } if (flag1) { this.markDirty(); } } public int func_174904_a(ItemStack p_174904_1_) { return 200; } private boolean canSmelt() { if (this.melterItemStacks[0] == null) { return false; } else { ItemStack itemstack = MelterRecipes.instance().getMeltingResult(this.melterItemStacks[0]); if (itemstack == null) return false; if (this.melterItemStacks[2] == null) return true; if (!this.melterItemStacks[2].isItemEqual(itemstack)) return false; int result = melterItemStacks[2].stackSize + itemstack.stackSize; return result <= getInventoryStackLimit() && result <= this.melterItemStacks[2].getMaxStackSize(); //Forge BugFix: Make it respect stack sizes properly. } } public void smeltItem() { if (this.canSmelt()) { ItemStack itemstack = MelterRecipes.instance().getMeltingResult(this.melterItemStacks[0]); if (this.melterItemStacks[2] == null) { this.melterItemStacks[2] = itemstack.copy(); } else if (this.melterItemStacks[2].getItem() == itemstack.getItem()) { this.melterItemStacks[2].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items } if (this.melterItemStacks[0].getItem() == Item.getItemFromBlock(Blocks.sponge) && this.melterItemStacks[0].getMetadata() == 1 && this.melterItemStacks[1] != null && this.melterItemStacks[1].getItem() == Items.bucket) { this.melterItemStacks[1] = new ItemStack(Items.water_bucket); } --this.melterItemStacks[0].stackSize; if (this.melterItemStacks[0].stackSize <= 0) { this.melterItemStacks[0] = null; } } } public static int getItemMeltTime(ItemStack p_145952_0_) { if (p_145952_0_ == null) { return 0; } else { Item item = p_145952_0_.getItem(); /*if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) { Block block = Block.getBlockFromItem(item); if (block == Blocks.wooden_slab) { return 150; } if (block.getMaterial() == Material.wood) { return 300; } if (block == Blocks.coal_block) { return 16000; } }*/ if (item == Items.lava_bucket) return 20000; return net.minecraftforge.fml.common.registry.GameRegistry.getFuelValue(p_145952_0_); } } public static boolean isItemFuel(ItemStack p_145954_0_) { return getItemMeltTime(p_145954_0_) > 0; } public boolean isUseableByPlayer(EntityPlayer player) { return this.worldObj.getTileEntity(this.pos) != this ? false : player.getDistanceSq((double)this.pos.getX() + 0.5D, (double)this.pos.getY() + 0.5D, (double)this.pos.getZ() + 0.5D) <= 64.0D; } public void openInventory(EntityPlayer player) {} public void closeInventory(EntityPlayer player) {} public boolean isItemValidForSlot(int index, ItemStack stack) { return index == 2 ? false : (index != 1 ? true : isItemFuel(stack) || SlotMelterFuel.isBucket(stack)); } public int[] getSlotsForFace(EnumFacing side) { return side == EnumFacing.DOWN ? slotsBottom : (side == EnumFacing.UP ? slotsTop : slotsSides); } public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) { return this.isItemValidForSlot(index, itemStackIn); } public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) { if (direction == EnumFacing.DOWN && index == 1) { Item item = stack.getItem(); if (item != Items.water_bucket && item != Items.bucket) { return false; } } return true; } public String getGuiID() { return "moreoresmod:melter"; } public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerMelter(playerInventory, this); } public int getField(int id) { switch (id) { case 0: return this.melterMeltTime; case 1: return this.currentItemMeltTime; case 2: return this.meltTime; case 3: return this.totalMeltTime; default: return 0; } } public void setField(int id, int value) { switch (id) { case 0: this.melterMeltTime = value; break; case 1: this.currentItemMeltTime = value; break; case 2: this.meltTime = value; break; case 3: this.totalMeltTime = value; } } public int getFieldCount() { return 4; } public void clear() { for (int i = 0; i < this.melterItemStacks.length; ++i) { this.melterItemStacks[i] = null; } } } this is my Container Class: package com.moreoresmod.main.container; import com.moreoresmod.main.tileentity.TileEntityMelter; import com.moreoresmod.main.tileentity.Recipes.MelterRecipes; import com.moreoresmod.main.tileentity.slots.SlotMelterFuel; import com.moreoresmod.main.tileentity.slots.SlotMelterOutput; 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.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class ContainerMelter extends Container { private final IInventory tileMelter; private int field_178152_f; private int field_178153_g; private int field_178154_h; private int field_178155_i; private static final String __OBFID = "CL_00001748"; public ContainerMelter(InventoryPlayer p_i45794_1_, IInventory furnaceInventory) { this.tileMelter = furnaceInventory; this.addSlotToContainer(new Slot(furnaceInventory, 0, 56, 17)); this.addSlotToContainer(new SlotMelterFuel(furnaceInventory, 1, 56, 53)); this.addSlotToContainer(new SlotMelterOutput(p_i45794_1_.player, furnaceInventory, 2, 116, 35)); int i; for (i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { this.addSlotToContainer(new Slot(p_i45794_1_, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot(p_i45794_1_, i, 8 + i * 18, 142)); } } public void addCraftingToCrafters(ICrafting listener) { super.addCraftingToCrafters(listener); listener.func_175173_a(this, this.tileMelter); } public void detectAndSendChanges() { super.detectAndSendChanges(); for (int i = 0; i < this.crafters.size(); ++i) { ICrafting icrafting = (ICrafting)this.crafters.get(i); if (this.field_178152_f != this.tileMelter.getField(2)) { icrafting.sendProgressBarUpdate(this, 2, this.tileMelter.getField(2)); } if (this.field_178154_h != this.tileMelter.getField(0)) { icrafting.sendProgressBarUpdate(this, 0, this.tileMelter.getField(0)); } if (this.field_178155_i != this.tileMelter.getField(1)) { icrafting.sendProgressBarUpdate(this, 1, this.tileMelter.getField(1)); } if (this.field_178153_g != this.tileMelter.getField(3)) { icrafting.sendProgressBarUpdate(this, 3, this.tileMelter.getField(3)); } } this.field_178152_f = this.tileMelter.getField(2); this.field_178154_h = this.tileMelter.getField(0); this.field_178155_i = this.tileMelter.getField(1); this.field_178153_g = this.tileMelter.getField(3); } @SideOnly(Side.CLIENT) public void updateProgressBar(int id, int data) { this.tileMelter.setField(id, data); } public boolean canInteractWith(EntityPlayer playerIn) { return this.tileMelter.isUseableByPlayer(playerIn); } public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; Slot slot = (Slot)this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (index == 2) { if (!this.mergeItemStack(itemstack1, 3, 39, true)) { return null; } slot.onSlotChange(itemstack1, itemstack); } else if (index != 1 && index != 0) { if (MelterRecipes.instance().getMeltingResult(itemstack1) != null) { if (!this.mergeItemStack(itemstack1, 0, 1, false)) { return null; } } else if (TileEntityMelter.isItemFuel(itemstack1)) { if (!this.mergeItemStack(itemstack1, 1, 2, false)) { return null; } } else if (index >= 3 && index < 30) { if (!this.mergeItemStack(itemstack1, 30, 39, false)) { return null; } } else if (index >= 30 && index < 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(playerIn, itemstack1); } return itemstack; } }
-
[1.8][Solved]Ore Will not Generate in the nether
KingOfMiners replied to KingOfMiners's topic in Modder Support
never mind the good part is it is fixed -
[1.8][Solved]Ore Will not Generate in the nether
KingOfMiners replied to KingOfMiners's topic in Modder Support
it works now but you could have said in the constructor WorldGenMinable you put BlockHelper.forBlock(Blocks.netherrack); -
[1.8][Solved]Ore Will not Generate in the nether
KingOfMiners replied to KingOfMiners's topic in Modder Support
i do know basic java but i sometimes have a hard time understanding somethings -
[1.8][Solved]Ore Will not Generate in the nether
KingOfMiners replied to KingOfMiners's topic in Modder Support
Will It Work Now? package com.moreoresmod.main.worldgeneration; import java.util.Random; import akka.japi.Predicate; import com.moreoresmod.main.init.MoreOresModBlocks; import net.minecraft.block.Block; import net.minecraft.block.state.pattern.BlockHelper; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class NetherDiamondGeneration implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { BlockHelper.forBlock(Blocks.netherrack); switch(world.provider.getDimensionId()){ case 1: generateEnd(world, random, chunkX, chunkZ); break; case 0: generateOverworld(world, random, chunkX, chunkZ); break; case -1: generateNether(world, random, chunkX, chunkZ); break; } } public void generateEnd(World world, Random random, int x, int z){ } public void generateOverworld(World world, Random random, int x, int z){ } public void generateNether(World world, Random random, int x, int z){ generateOre(MoreOresModBlocks.nether_diamond, world, random, x, z, 2, 8, 50, 2, 256, Blocks.netherrack); } public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance , int minY, int maxY, Block generateIn){ int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize); int hightRange = maxY - minY; WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize); for(int i = 0; i < chance; i++){ int xRand = chunkX * 16 + random.nextInt(16); int yRand = random.nextInt(hightRange) + minY; int zRand = chunkZ * 16 + random.nextInt(16); gen.generate(world, random,new BlockPos(xRand, yRand, zRand)); } } } -
[1.8][Solved]Ore Will not Generate in the nether
KingOfMiners replied to KingOfMiners's topic in Modder Support
i know but where exactly and how would i put it -
[1.8][Solved]Ore Will not Generate in the nether
KingOfMiners replied to KingOfMiners's topic in Modder Support
where do i put Predicate and how -
I Can't get my ore to generate in the nether i Have the same coding as my ruby ore generation but i cant seem to get the ore to generate in the nether: package com.moreoresmod.main.worldgeneration; import java.util.Random; import com.moreoresmod.main.init.MoreOresModBlocks; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.fml.common.IWorldGenerator; public class NetherDiamondGeneration implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.getDimensionId()){ case 1: generateEnd(world, random, chunkX, chunkZ); break; case 0: generateOverworld(world, random, chunkX, chunkZ); break; case -1: generateNether(world, random, chunkX, chunkZ); break; } } public void generateEnd(World world, Random random, int x, int z){ } public void generateOverworld(World world, Random random, int x, int z){ } public void generateNether(World world, Random random, int x, int z){ generateOre(MoreOresModBlocks.nether_diamond, world, random, x, z, 2, 8, 50, 2, 256, Blocks.netherrack); } public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance , int minY, int maxY, Block generateIn){ int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize); int hightRange = maxY - minY; WorldGenMinable gen = new WorldGenMinable(block.getDefaultState(), vienSize); for(int i = 0; i < chance; i++){ int xRand = chunkX * 16 + random.nextInt(16); int yRand = random.nextInt(hightRange) + minY; int zRand = chunkZ * 16 + random.nextInt(16); gen.generate(world, random,new BlockPos(xRand, yRand, zRand)); } } }