Jump to content

LePheel

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by LePheel

  1. Take a look at how MrCrayFish did it in his Furniture Mod, I used that as a launching point for my own exploration
  2. I updated to the bleeding edge and re-ran all my Decomp stuff, but I'm still getting this error: ---- Minecraft Crash Report ---- // Shall we play a game? Time: 12/15/15 5:07 PM Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraft.crash.CrashReportCategory.firstTwoElementsOfStackTraceMatch(Unknown Source) at net.minecraft.crash.CrashReport.makeCategoryDepth(Unknown Source) at net.minecraft.crash.CrashReport.makeCategory(Unknown Source) at net.minecraft.client.Minecraft.runTick(Unknown Source) at net.minecraft.client.Minecraft.runGameLoop(Unknown Source) at net.minecraft.client.Minecraft.run(Unknown Source) at net.minecraft.client.main.Main.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.crash.CrashReportCategory.firstTwoElementsOfStackTraceMatch(Unknown Source) at net.minecraft.crash.CrashReport.makeCategoryDepth(Unknown Source) at net.minecraft.crash.CrashReport.makeCategory(Unknown Source) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player833'/200, l='MpServer', x=-245.51, y=72.00, z=175.18]] Chunk stats: MultiplayerChunkCache: 169, 169 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: -232.00,64.00,188.00 - World: (-232,64,188), Chunk: (at 8,4,12 in -15,11; contains blocks -240,0,176 to -225,255,191), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) Level time: 4666 game time, 4666 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 75 total; [EntityChicken['Chicken'/128, l='MpServer', x=-236.69, y=67.00, z=193.63], EntityChicken['Chicken'/129, l='MpServer', x=-238.63, y=62.53, z=214.22], EntityChicken['Chicken'/139, l='MpServer', x=-217.50, y=73.00, z=95.50], EntityChicken['Chicken'/142, l='MpServer', x=-212.50, y=74.00, z=109.28], EntityChicken['Chicken'/143, l='MpServer', x=-215.50, y=69.00, z=123.50], EntityChicken['Chicken'/144, l='MpServer', x=-212.66, y=67.00, z=136.41], EntityChicken['Chicken'/145, l='MpServer', x=-219.66, y=66.00, z=146.66], EntityChicken['Chicken'/146, l='MpServer', x=-213.50, y=65.00, z=157.50], EntityChicken['Chicken'/147, l='MpServer', x=-214.44, y=64.00, z=165.28], EntityChicken['Chicken'/148, l='MpServer', x=-211.34, y=62.64, z=179.06], EntityCreeper['Creeper'/149, l='MpServer', x=-214.31, y=48.00, z=179.69], EntityCreeper['Creeper'/151, l='MpServer', x=-214.31, y=48.00, z=178.22], EntityChicken['Chicken'/158, l='MpServer', x=-199.16, y=68.00, z=99.41], EntityChicken['Chicken'/159, l='MpServer', x=-199.50, y=67.00, z=97.50], EntitySpider['Spider'/31, l='MpServer', x=-301.47, y=20.00, z=102.03], EntityChicken['Chicken'/160, l='MpServer', x=-193.63, y=64.00, z=123.41], EntityChicken['Chicken'/32, l='MpServer', x=-315.69, y=70.00, z=101.44], EntityZombie['Zombie'/161, l='MpServer', x=-207.13, y=28.00, z=165.75], EntityCreeper['Creeper'/1570, l='MpServer', x=-197.50, y=39.00, z=231.50], EntityChicken['Chicken'/35, l='MpServer', x=-321.53, y=70.00, z=104.81], EntityZombie['Zombie'/164, l='MpServer', x=-200.66, y=29.00, z=167.91], EntitySkeleton['Skeleton'/1188, l='MpServer', x=-231.50, y=39.00, z=124.50], EntitySquid['Squid'/167, l='MpServer', x=-202.69, y=60.31, z=189.25], EntitySkeleton['Skeleton'/39, l='MpServer', x=-321.50, y=17.00, z=223.50], EntitySkeleton['Skeleton'/1066, l='MpServer', x=-323.50, y=25.00, z=235.50], EntityBat['Bat'/1836, l='MpServer', x=-308.07, y=51.98, z=222.47], EntityBat['Bat'/1837, l='MpServer', x=-308.39, y=49.59, z=236.18], EntityChicken['Chicken'/174, l='MpServer', x=-186.41, y=63.63, z=109.25], EntityBat['Bat'/1838, l='MpServer', x=-307.71, y=51.10, z=228.86], EntityZombie['Zombie'/175, l='MpServer', x=-190.13, y=16.00, z=135.47], EntityZombie['Zombie'/177, l='MpServer', x=-189.88, y=27.00, z=179.19], EntityBat['Bat'/179, l='MpServer', x=-181.32, y=52.04, z=142.47], EntityZombie['Zombie'/54, l='MpServer', x=-306.50, y=19.00, z=107.50], EntitySkeleton['Skeleton'/184, l='MpServer', x=-171.50, y=49.00, z=150.50], EntityBat['Bat'/1465, l='MpServer', x=-173.97, y=34.41, z=127.13], EntityBat['Bat'/1466, l='MpServer', x=-179.94, y=33.91, z=114.19], EntityPlayerSP['Player833'/200, l='MpServer', x=-245.51, y=72.00, z=175.18], EntityZombie['Zombie'/74, l='MpServer', x=-300.50, y=36.00, z=143.50], EntityChicken['Chicken'/75, l='MpServer', x=-285.66, y=71.00, z=153.56], EntityChicken['Chicken'/76, l='MpServer', x=-291.91, y=72.00, z=148.13], EntityChicken['Chicken'/77, l='MpServer', x=-297.66, y=69.00, z=158.53], EntityChicken['Chicken'/78, l='MpServer', x=-293.41, y=72.00, z=148.38], EntityCreeper['Creeper'/79, l='MpServer', x=-291.56, y=35.00, z=169.94], EntityCreeper['Creeper'/1231, l='MpServer', x=-247.53, y=26.00, z=130.03], EntitySkeleton['Skeleton'/94, l='MpServer', x=-274.22, y=30.00, z=115.19], EntityChicken['Chicken'/96, l='MpServer', x=-276.66, y=71.00, z=157.38], EntityZombie['Zombie'/1120, l='MpServer', x=-201.50, y=32.00, z=164.50], EntityZombie['Zombie'/1632, l='MpServer', x=-279.43, y=36.00, z=150.42], EntityChicken['Chicken'/97, l='MpServer', x=-289.34, y=71.00, z=158.34], EntityZombie['Zombie'/1633, l='MpServer', x=-290.50, y=34.00, z=155.50], EntityChicken['Chicken'/98, l='MpServer', x=-284.63, y=72.00, z=149.59], EntityZombie['Zombie'/1634, l='MpServer', x=-295.16, y=34.00, z=154.22], EntityChicken['Chicken'/99, l='MpServer', x=-284.50, y=72.00, z=152.50], EntitySkeleton['Skeleton'/1123, l='MpServer', x=-187.50, y=30.00, z=123.50], EntityZombie['Zombie'/1635, l='MpServer', x=-288.50, y=34.00, z=155.50], EntityBat['Bat'/1763, l='MpServer', x=-298.22, y=25.00, z=206.44], EntityBat['Bat'/101, l='MpServer', x=-279.49, y=35.80, z=250.44], EntityCreeper['Creeper'/1639, l='MpServer', x=-315.50, y=62.00, z=113.50], EntityChicken['Chicken'/110, l='MpServer', x=-256.75, y=62.68, z=191.25], EntityItem['item.item.cabbage_seed'/111, l='MpServer', x=-264.81, y=63.00, z=202.97], EntitySpider['Spider'/1905, l='MpServer', x=-182.50, y=26.00, z=171.50], EntityChicken['Chicken'/114, l='MpServer', x=-236.51, y=68.11, z=181.80], EntitySpider['Spider'/1906, l='MpServer', x=-180.50, y=26.00, z=170.50], EntityChicken['Chicken'/115, l='MpServer', x=-246.53, y=70.00, z=185.85], EntityZombie['Zombie'/627, l='MpServer', x=-181.50, y=25.00, z=161.50], EntityChicken['Chicken'/116, l='MpServer', x=-253.38, y=69.00, z=190.47], EntityHorse['Horse'/117, l='MpServer', x=-250.78, y=63.00, z=210.00], EntityZombie['Zombie'/119, l='MpServer', x=-242.50, y=51.00, z=252.50], EntityChicken['Chicken'/123, l='MpServer', x=-224.53, y=71.00, z=126.59], EntityChicken['Chicken'/124, l='MpServer', x=-216.69, y=67.00, z=140.44], EntityChicken['Chicken'/125, l='MpServer', x=-237.00, y=63.00, z=205.47], EntityChicken['Chicken'/126, l='MpServer', x=-224.50, y=62.59, z=197.91], EntityHorse['Horse'/127, l='MpServer', x=-236.15, y=66.00, z=200.49], EntityBat['Bat'/639, l='MpServer', x=-211.49, y=53.36, z=178.51], EntityBat['Bat'/767, l='MpServer', x=-188.28, y=25.21, z=170.63]] Retry entities: 0 total; [] Server brand: fml,forge Server type: Integrated singleplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(Unknown Source) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Unknown Source) at net.minecraft.client.Minecraft.run(Unknown Source) at net.minecraft.client.main.Main.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_60, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 551891424 bytes (526 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 1, tcache: 1, allocated: 12, tallocated: 94 FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.4.1563 5 mods loaded, 5 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UCHIJAAAA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) UCHIJAAAA FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8-11.14.4.1563.jar) UCHIJAAAA Forge{11.14.4.1563} [Minecraft Forge] (forgeSrc-1.8-11.14.4.1563.jar) UCHIJAAAA alamor{1.0.0} [Alamor Mod] (bin) UCHIJAAAA itemtransformhelper{1.2} [item Transform Helper] (ItemTransformHelper1-3-Minecraft1-8-deobfuscated.zip) Loaded coremods (and transformers): GL info: ' Vendor: 'Intel' Version: '4.0.0 - Build 10.18.10.4276' Renderer: 'Intel(R) HD Graphics 4000' Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: Intel(R) HD Graphics 4000 GL version 4.0.0 - Build 10.18.10.4276, Intel GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: No Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Does that mean I've done something wrong in my update process? Is Gradle 2.0-Snapshot not actually the right build?
  3. When I try to place items that can be smelted into my custom furnace, I get a crash to desktop, but I am getting a bit of a strange error log: [13:27:15] [Client thread/FATAL]: Unreported exception thrown! java.lang.NullPointerException at net.minecraft.crash.CrashReportCategory.firstTwoElementsOfStackTraceMatch(Unknown Source) ~[CrashReportCategory.class:?] at net.minecraft.crash.CrashReport.makeCategoryDepth(Unknown Source) ~[CrashReport.class:?] at net.minecraft.crash.CrashReport.makeCategory(Unknown Source) ~[CrashReport.class:?] at net.minecraft.client.Minecraft.runTick(Unknown Source) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Unknown Source) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Unknown Source) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Unknown Source) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_60] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_60] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_60] at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?] at GradleStart.main(Unknown Source) [start/:?] Here are what I think are the relevant code files public class ItemModFood extends ItemFood implements IItemSmeltable, ISubtypeFromStackPovider, ISizedItem { String internalname; public ItemModFood(int amount, boolean isWolfFood) { super(amount, isWolfFood); setCreativeTab(Alamor.tabCustomFood); } public ItemModFood(int amount, float saturation, boolean isWolfFood) { super(amount, saturation, isWolfFood); setCreativeTab(Alamor.tabCustomFood); } public Item register(String internalname) { setUnlocalizedName(internalname); this.internalname = internalname; return this; } @Override public ItemStack getSmelted(ItemStack raw) { if (internalname.equals("raw_beef")) { return new ItemStack(ModItems.itemCookedBeef); } if (internalname.equals("raw_chicken")) { return new ItemStack(ModItems.itemCookedChicken); } if (internalname.equals("raw_corn")) { return new ItemStack(ModItems.itemCookedCorn); } if (internalname.equals("raw_fish")) { return new ItemStack(ModItems.itemCookedFish); } if (internalname.equals("raw_lambchop")) { return new ItemStack(ModItems.itemCookedLamb); } if (internalname.equals("raw_porkchop")) { return new ItemStack(ModItems.itemCookedPork); } if (internalname.equals("potato_item")) { return new ItemStack(ModItems.itemCookedPotato); }/* if (internalname.equals("raw_")) { return new ItemStack(ModItems.cooked_); } if (internalname.equals("raw_")) { return new ItemStack(ModItems.cooked_); }*/ return null; } public class TileEntityHeatSource extends TileEntityLockable implements IUpdatePlayerListBox, IPitchAndVolumProvider { boolean initialized = false; 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}; // 0 = stuff to smelt // 1 = fuel // 2 = output slot private ItemStack[] furnaceItemStacks = new ItemStack[3]; private String furnaceCustomName; // What kind of furnace are we? public EnumStrongHeatSource furnace; // Current temperature of the furnace public int furnaceTemperature = 20; // Current temperature of the ore (Degree Celsius * deg public int oreTemperature = 20; // Maximum temperature that can be reached with the currently used fuel public int maxTemperature; // For how long the ore has been cooking public float oreCookingTime; // How much of the current fuel is consumed public int fuelBurnTime; // How much fuel is available public int maxFuelBurnTime; // How much smoke the current fuel burns? public int smokeLevel; int counter; // Update once in counterMax() ticks public int counterMax() { return 12; } // Resting temperature public int enviromentTemperature() { return 20; } // seconds it requires to melt the ore once beyond melting point public int maxCookingTime() { return 30; } public TileEntityHeatSource() { this (EnumStrongHeatSource.STOVE); } public TileEntityHeatSource(EnumStrongHeatSource furnace) { this.furnace = furnace; } public boolean tryPutItemStack(ItemStack itemstack) { if (itemstack.getItem() instanceof IItemSmeltable && ((IItemSmeltable)itemstack.getItem()).getSmelted(itemstack) != null) { if (furnaceItemStacks[0] == null) { furnaceItemStacks[0] = itemstack.splitStack(1); return true; } if (ItemStack.areItemStackTagsEqual(itemstack, furnaceItemStacks[0]) && itemstack.isItemEqual(furnaceItemStacks[0])) { furnaceItemStacks[0].stackSize++; itemstack.stackSize--; return true; } } if (itemstack.getItem() instanceof IItemFuel && ((IItemFuel)itemstack.getItem()).getBurningHeat(itemstack) > 0) { if (furnaceItemStacks[1] == null) { furnaceItemStacks[1] = itemstack.splitStack(1); return true; } if (ItemStack.areItemStackTagsEqual(itemstack, furnaceItemStacks[1]) && itemstack.isItemEqual(furnaceItemStacks[1])) { furnaceItemStacks[1].stackSize++; itemstack.stackSize--; return true; } } return false; } public int getSizeInventory() { return this.furnaceItemStacks.length; } public ItemStack getStackInSlot(int index) { return this.furnaceItemStacks[index]; } public ItemStack decrStackSize(int index, int count) { if (this.furnaceItemStacks[index] != null) { ItemStack itemstack; if (this.furnaceItemStacks[index].stackSize <= count) { itemstack = this.furnaceItemStacks[index]; this.furnaceItemStacks[index] = null; return itemstack; } else { itemstack = this.furnaceItemStacks[index].splitStack(count); if (this.furnaceItemStacks[index].stackSize == 0) { this.furnaceItemStacks[index] = null; } return itemstack; } } else { return null; } } public ItemStack getStackInSlotOnClosing(int index) { if (this.furnaceItemStacks[index] != null) { ItemStack itemstack = this.furnaceItemStacks[index]; this.furnaceItemStacks[index] = null; return itemstack; } else { return null; } } public void setInventorySlotContents(int index, ItemStack stack) { boolean flag = stack != null && stack.isItemEqual(this.furnaceItemStacks[index]) && ItemStack.areItemStackTagsEqual(stack, this.furnaceItemStacks[index]); this.furnaceItemStacks[index] = stack; if (stack != null && stack.stackSize > this.getInventoryStackLimit()) { stack.stackSize = this.getInventoryStackLimit(); } if (index == 0 && !flag) { oreTemperature = enviromentTemperature(); oreCookingTime = 0; this.markDirty(); } } public String getName() { return this.hasCustomName() ? this.furnaceCustomName : (furnace == EnumStrongHeatSource.STOVE ? "container.stove" : "container.firepit"); } public boolean hasCustomName() { return this.furnaceCustomName != null && this.furnaceCustomName.length() > 0; } public void setCustomInventoryName(String p_145951_1_) { this.furnaceCustomName = p_145951_1_; } public int getInventoryStackLimit() { return 64; } public boolean isBurning() { return this.fuelBurnTime > 0; } @SideOnly(Side.CLIENT) public static boolean isBurning(IInventory inventory) { return inventory.getField(5) > 0; } @Override public void update() { if (worldObj.isRemote && !initialized && isBurning()) { Alamor.proxy.playLoopingSound("alamor:fireplace", this); initialized = true; } if (worldObj.isRemote) return; counter = ++counter % counterMax(); int tick = counter / (counterMax()-1); if (tick == 0) return; // Use up fuel if (fuelBurnTime > 0) { fuelBurnTime -= tick; if (fuelBurnTime == 0) { maxFuelBurnTime = 0; setStoveBurning(false); } } // Furnace is burning: Heat furnace if (isBurning()) { furnaceTemperature = changeTemperature(furnaceTemperature, maxTemperature, tick); } // Ore follows furnace temperature if (canSmeltItem()) { heatOre(); } // Finished smelting? Turn to smelted item if (oreCookingTime > maxCookingTime()) { smeltItem(); } // Furnace is not burning and can burn: Ignite the fuel if (!isBurning() && canSmelt()) { igniteFuel(); } // Furnace is not burning: Cool down furnace and ore also turn of fire if (!isBurning()) { furnaceTemperature = changeTemperature(furnaceTemperature, enviromentTemperature(), tick); } } public int changeTemperature(int fromTemp, int toTemp, int speed) { return changeTemperature(fromTemp, toTemp, speed, true); } public int changeTemperature(int fromTemp, int toTemp, int speed, boolean condition) { if (!condition) return fromTemp; int diff = Math.abs(fromTemp - toTemp); speed = speed + speed * (diff/50); if (diff < speed) { return toTemp; } if (fromTemp > toTemp) { speed = -speed; } if (fromTemp == toTemp) { speed = 0; } return fromTemp + speed; } public ItemStack fuelSlot() { return furnaceItemStacks[1]; } public ItemStack oreSlot() { return furnaceItemStacks[0]; } public ItemStack smeltedSlot() { return furnaceItemStacks[2]; } ItemStack oreItemSmelted() { if (oreSlot() != null && oreSlot().getItem() instanceof IItemSmeltable) { IItemSmeltable smeltable = (IItemSmeltable)oreSlot().getItem(); return smeltable.getSmelted(oreSlot()); } return null; } int oreItemSmeltedRatio() { if (oreSlot() != null && oreSlot().getItem() instanceof IItemSmeltable) { IItemSmeltable smeltable = (IItemSmeltable)oreSlot().getItem(); return smeltable.getRaw2SmeltedRatio(oreSlot()); } return 0; } int oreItemSmeltedMeltingPoint() { if (oreSlot()!= null && oreSlot().getItem() instanceof IItemSmeltable) { IItemSmeltable smeltable = (IItemSmeltable)oreSlot().getItem(); return smeltable.getMeltingPoint(oreSlot()); } return 0; } float oreItemSmeltingDurationModifier() { if (oreSlot()!= null && oreSlot().getItem() instanceof IItemSmeltable) { IItemSmeltable smeltable = (IItemSmeltable)oreSlot().getItem(); return smeltable.getSmeltingSpeedModifier(oreSlot()); } return 1f; } private boolean canSmelt() { boolean smeltableOre = // Require smeltable ore oreSlot() != null && oreItemSmelted() != null // Require enough ore && oreSlot().stackSize >= oreItemSmeltedRatio(); // Fire pits always burn up their fuel if (furnace == EnumStrongHeatSource.FIREPIT) { smeltableOre = smeltableOre || oreSlot() == null; } return smeltableOre // Require fuel && furnace.getProducedHeat(fuelSlot()) != 0 // Require enough fuel && fuelSlot().stackSize >= furnace.fueluse // Require empty output slot or stackable smelted && placeableInOutputSlot(oreItemSmelted()) ; } public boolean placeableInOutputSlot(ItemStack stack) { return smeltedSlot() == null || ( smeltedSlot().isItemEqual(stack) && ItemStack.areItemStackTagsEqual(stack, smeltedSlot()) && smeltedSlot().stackSize + stack.stackSize <= smeltedSlot().getMaxStackSize() ) ; } public void heatOre() { // Adjust temperature of ore if (oreItemSmeltedMeltingPoint() > 0) { oreTemperature = changeTemperature(oreTemperature, furnaceTemperature, 2); } else { oreTemperature = enviromentTemperature(); } // Begin smelting when hot enough if (oreItemSmeltedMeltingPoint() > 0 && oreTemperature >= oreItemSmeltedMeltingPoint()) { float diff = (1f * oreTemperature / oreItemSmeltedMeltingPoint()); oreCookingTime += MathHelper.clamp_int((int) (diff), 1, 30) * oreItemSmeltingDurationModifier(); } else { if (oreCookingTime > 0) oreCookingTime--; } } public void igniteFuel() { igniteWithFuel(fuelSlot(), 1); fuelSlot().stackSize -= furnace.fueluse; if (fuelSlot().stackSize <= 0) { furnaceItemStacks[1] = null; } } public void igniteWithFuel(ItemStack stack, int durationMultiplier) { maxFuelBurnTime = fuelBurnTime = furnace.getHeatDuration(stack) * durationMultiplier; maxTemperature = furnace.getProducedHeat(stack); smokeLevel = ((IItemFuel)stack.getItem()).smokeLevel(stack); setStoveBurning(true); } public void setStoveBurning(boolean burning) { IStrongHeatSource block = (IStrongHeatSource) worldObj.getBlockState(pos).getBlock(); if (block.isBurning() != burning) { block.setState(burning, worldObj, pos); } worldObj.markBlockForUpdate(pos); } public boolean canSmeltItem() { return oreSlot() != null && oreItemSmelted() != null && oreSlot().stackSize >= oreItemSmeltedRatio() && placeableInOutputSlot(oreItemSmelted()) ; } public void smeltItem() { if (canSmeltItem()) { ItemStack itemstack = oreItemSmelted(); if (smeltedSlot() == null) { this.furnaceItemStacks[2] = itemstack.copy(); } else { smeltedSlot().stackSize += itemstack.stackSize; } oreSlot().stackSize -= oreItemSmeltedRatio(); if (oreSlot().stackSize <= 0) { this.furnaceItemStacks[0] = null; } oreTemperature = enviromentTemperature(); oreCookingTime = 0; } worldObj.markBlockForUpdate(pos); markDirty(); } public int getItemBurnTime(ItemStack itemstack) { return furnace.getHeatDuration(itemstack); } public boolean isItemFuel(ItemStack itemstack) { return getItemBurnTime(itemstack) > 0; } public boolean isUseableByPlayer(EntityPlayer player) { return 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)); } public String getGuiID() { return "minecraft:furnace"; } public Container createContainer(InventoryPlayer playerInventory, EntityPlayer playerIn) { return new ContainerStove(playerInventory, this); } public int getField(int id) { switch (id) { case 0: return furnace.id; case 1: return furnaceTemperature; case 2: return oreTemperature; case 3: return maxTemperature; case 4: return (int) oreCookingTime; case 5: return fuelBurnTime; case 6: return maxFuelBurnTime; case 7: return smokeLevel; default: return 0; } } public void setField(int id, int value) { switch (id) { case 0: furnace = EnumStrongHeatSource.byId(value); break; case 1: furnaceTemperature = value; break; case 2: oreTemperature = value; break; case 3: maxTemperature = value; break; case 4: oreCookingTime = value; break; case 5: fuelBurnTime = value; break; case 6: maxFuelBurnTime = value; break; case 7: smokeLevel = value; break; default: break; } } public int getFieldCount() { return 8; } public void clear() { for (int i = 0; i < this.furnaceItemStacks.length; ++i) { this.furnaceItemStacks[i] = null; } } public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); NBTTagList nbttaglist = compound.getTagList("Items", 10); this.furnaceItemStacks = 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.furnaceItemStacks.length) { this.furnaceItemStacks[b0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } furnace = EnumStrongHeatSource.byId(compound.getShort("furnace")); furnaceTemperature = compound.getShort("furnaceTemperature"); oreTemperature = compound.getShort("oreTemperature"); maxTemperature = compound.getShort("maxTemperature"); oreCookingTime = compound.getShort("oreCookingTime"); fuelBurnTime = compound.getShort("fuelBurnTime"); smokeLevel = compound.getShort("smokeLevel"); if (compound.hasKey("CustomName", ) { this.furnaceCustomName = compound.getString("CustomName"); } } public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); compound.setShort("furnace", (short)this.furnace.id); compound.setShort("furnaceTemperature", (short)this.furnaceTemperature); compound.setShort("oreTemperature", (short)this.oreTemperature); compound.setShort("maxTemperature", (short)this.maxTemperature); compound.setShort("oreCookingTime", (short)this.oreCookingTime); compound.setShort("fuelBurnTime", (short)this.fuelBurnTime); compound.setShort("smokeLevel", (short)smokeLevel); NBTTagList nbttaglist = new NBTTagList(); for (int i = 0; i < this.furnaceItemStacks.length; ++i) { if (this.furnaceItemStacks[i] != null){ NBTTagCompound nbttagcompound1 = new NBTTagCompound(); nbttagcompound1.setByte("Slot", (byte)i); this.furnaceItemStacks[i].writeToNBT(nbttagcompound1); nbttaglist.appendTag(nbttagcompound1); } } compound.setTag("Items", nbttaglist); if (this.hasCustomName()) { compound.setString("CustomName", this.furnaceCustomName); } } @Override public float getPitch() { return 1f; } @Override public float getVolumne() { if (!isBurning()) return 0f; // The fire pit burns louder return (furnace == EnumStrongHeatSource.STOVE) ? 0.4f : 0.8f; } @Override public BlockPos getPosition() { return pos; } @Override public boolean isDonePlaying(IPitchAndVolumProvider self) { return !(worldObj.getTileEntity(pos) instanceof TileEntityHeatSource) || self != worldObj.getTileEntity(pos); } @Override public Packet getDescriptionPacket() { NBTTagCompound nbt = new NBTTagCompound(); writeToNBT(nbt); return new S35PacketUpdateTileEntity(pos, 1, nbt); } @Override public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { readFromNBT(pkt.getNbtCompound()); worldObj.markBlockForUpdate(pos); } }
  4. My apartment was recently burglarized and my laptop was stolen. I have been working on a mod for a while and it hadn't occurred to me to back it up yet. I know, foolish, but I didn't. I will next time. I have published the mod several times after building it with gradel and have copies of the published mod (published in 1.7.10). I was wondering if there was an effective way to deobfuscate and decompile my code so that I could continue working on my mod. Thanks in advance.
  5. Fair enough, I had not realize that MCPatcher's changes had created the incompatibility not the changes to Forge
  6. I'm aware that it is currently possible to create connected textures for blocks, but we miss out on a lot of the features that MCPatcher adds. Interestingly, back when we still had IDs it was easy to create properties files for forge blocks based on IDs and get them to work to display connected textures. I'm not sure what exactly has changed for 1.7 and the removal of the ID system, but it doesn't seem possible to texture forge blocks using MCPatcher's CTM anymore. If it is possible to get back it would be a huge benefit to resource pack creators and modders that want to use all of the potential in CTM.
  7. I'm trying to code a custom wall based off the cobblestone walls. I can't seem to get Fence Gates to interact properly with it, however. The gates seem to be unchanged, as if connecting to a fence post. The wall responds to the presence of the gate, but the gate doesn't "lower" like it does with cobble walls. Wall Code: package com.lepheel.alamor.blocks; import java.util.List; import net.minecraft.block.BlockWall; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; public class BlockLogPostBlock extends BlockWall{ public BlockLogPostBlock(){ super(Blocks.log); setCreativeTab(CreativeTabs.tabBlock); } @SuppressWarnings({ "unchecked", "rawtypes" }) public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(par1, 1, 0)); } @Override public IIcon getIcon(int par1, int par2) { return Blocks.log.getBlockTextureFromSide(par1); } public void registerBlockIcons(IIconRegister par1IconRegister){ this.blockIcon = par1IconRegister.registerIcon("Alamor:" + getUnlocalizedName().substring(5)); } } Any suggestions?
  8. Perhaps I had placed it in the wrong spot in my code. I'll take a look at it again knowing that it should be working as intended. Thank you for the response!
  9. I was just wondering if there was a simple way to modify the properties of vanilla blocks such as hardness or resistances. I was trying to use code like Block.obsidian.setHardness(25); but it didn't seem to work on any of the blocks. Does anyone know a simple method? I don't want to have to create custom blocks to replace each block that I'm trying to modify.
  10. As part of my mod, I disabled all Vanilla recipes and replace them with my own. Is there an easy way for me to import back in Map Cloning and extension from the source?
  11. Thank you guys for the help. Needed the de-obfuscator. Much appreciated.
  12. Ah, that's seriously a bummer. If I had exported them at some point, could I easily de-compile them and import them back into Eclipse?
  13. I accidentally ran the "clean" bat on my Forge source folder before I had a chance to back up my mod that I had been working on in Eclipse. Is there any way that I can recover everything that I had?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.