Everything posted by Z@Nka
-
[1.7.2]Custom Furnace
They should but i got the code form the normal furnace, so could you point out exactly where my problem is?
-
[1.7.2]NetworkRegistry
I'm sorry to ask but could you just tell me the code behind this, I am having a really hard time coding because i can't test anything.
- [1.7.2]NetworkRegistry
-
[1.7.2]NetworkRegistry
Crash report: ---- Minecraft Crash Report ---- // Surprise! Haha. Well, this is awkward. Time: 07.03.14 22:01 Description: Initializing game java.lang.RuntimeException: Invalid attempt to create a GUI during mod construction. Use an EventHandler instead at cpw.mods.fml.common.network.NetworkRegistry.registerGuiHandler(NetworkRegistry.java:218) at bulkyzanka.electro.mod.Electrocuted.<init>(Electrocuted.java:143) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at cpw.mods.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:173) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:509) 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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188) 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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at cpw.mods.fml.common.Loader.loadMods(Loader.java:484) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:201) at net.minecraft.client.Minecraft.startGame(Minecraft.java:564) at net.minecraft.client.Minecraft.run(Minecraft.java:934) at net.minecraft.client.main.Main.main(Main.java:112) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at cpw.mods.fml.common.network.NetworkRegistry.registerGuiHandler(NetworkRegistry.java:218) at bulkyzanka.electro.mod.Electrocuted.<init>(Electrocuted.java:143) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at cpw.mods.fml.common.ILanguageAdapter$JavaAdapter.getNewInstance(ILanguageAdapter.java:173) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:509) 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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188) 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 com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at cpw.mods.fml.common.Loader.loadMods(Loader.java:484) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:201) at net.minecraft.client.Minecraft.startGame(Minecraft.java:564) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:934) at net.minecraft.client.main.Main.main(Main.java:112) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details: Minecraft Version: 1.7.2 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_21, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 197018256 bytes (187 MB) / 378011648 bytes (360 MB) up to 1905197056 bytes (1816 MB) JVM Flags: 0 total; AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.01-pre FML v7.2.125.1031 Minecraft Forge 10.12.0.1031 5 mods loaded, 5 mods active mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML{7.2.125.1031} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1031.jar) Unloaded->Constructed Forge{10.12.0.1031} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1031.jar) Unloaded->Constructed examplemod{1.0} [Example Mod] (bin) Unloaded->Constructed electro{1.0A} [Electrocuted] (bin) Unloaded->Errored Launched Version: 1.6 LWJGL: 2.9.0 OpenGL: AMD Radeon HD 6800 Series GL version 4.2.12422 Compatibility Profile Context 13.152.0.0, ATI Technologies Inc. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: ~~ERROR~~ NullPointerException: null Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null Anisotropic Filtering: Off (1) Main class: package bulkyzanka.electro.mod; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.util.EnumHelper; import bulkyzanka.electro.mod.blocks.BlockCompressionFurnace; import bulkyzanka.electro.mod.blocks.Test; import bulkyzanka.electro.mod.creativetabs.ElectrocutedTab; import bulkyzanka.electro.mod.gui.GuiHandler; import bulkyzanka.electro.mod.items.BoneIngot; import bulkyzanka.electro.mod.items.BonePlate; import bulkyzanka.electro.mod.items.CoalMotor; import bulkyzanka.electro.mod.items.ElectricMotor; import bulkyzanka.electro.mod.items.Generator; import bulkyzanka.electro.mod.items.armor.BoneArmor; import bulkyzanka.electro.mod.items.tools.BoneAxe; import bulkyzanka.electro.mod.items.tools.BoneHoe; import bulkyzanka.electro.mod.items.tools.BonePickaxe; import bulkyzanka.electro.mod.items.tools.BoneSpade; import bulkyzanka.electro.mod.items.tools.BoneSword; import bulkyzanka.electro.mod.lib.Referance; import bulkyzanka.electro.mod.proxy.ProxyCommon; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid = Referance.MODID, version = Referance.VERSION) public class Electrocuted { //Instance @Instance(Referance.MODID) public static Electrocuted instance; //Proxy Stuff @SidedProxy(clientSide = "electro.proxy.ProxyClient" , serverSide = "electro.proxy.ProxyCommon") public static ProxyCommon proxy; //GuiIDs public static final int guiIdCompressionFurnace = 1; //CreativeTabs public static CreativeTabs ElectrocutedTab = new ElectrocutedTab(CreativeTabs.getNextID(), "ElectrocutedTab"); //Material //ToolMaterial public static ToolMaterial Bone = EnumHelper.addToolMaterial("Bone", 2, 175, 6.0F, 2.5F, 19); //ArmorMaterial public static ArmorMaterial BoneArmor = EnumHelper.addArmorMaterial("BONEARMOR", 7, new int[]{3, 7, 6, 3}, 20); //Items public static Item BonePlate = new BonePlate().setUnlocalizedName("BonePlate").setTextureName("electrocuted:BonePlate"); public static Item BoneIngot = new BoneIngot().setUnlocalizedName("BoneIngot").setTextureName("electrocuted:BoneIngot"); public static Item CoalMotor = new CoalMotor().setUnlocalizedName("CoalMotor").setTextureName("electrocted:CoalMotor"); public static Item ElectricMotor = new ElectricMotor().setUnlocalizedName("ElectricMotor").setTextureName("electrocted:ElectricMotor"); public static Item Generator = new Generator().setUnlocalizedName("Generator").setTextureName("electrocted:Generator"); //Blocks public static Block CompressionFurnaceIdle = new BlockCompressionFurnace(false).setBlockName("CompressionFurnaceIdle").setBlockTextureName("electrocuted:CompressionFurnace_Idle_front"); public static Block CompressionFurnaceActive = new BlockCompressionFurnace(true).setBlockName("CompressionFurnaceActive").setBlockTextureName("electrocuted:CompressionFurnace_Idle_front"); //Tools public static Item BoneSword = new BoneSword(Bone).setUnlocalizedName("BoneSword").setTextureName("electrocuted:BoneSword"); public static Item BoneSpade = new BoneSpade(Bone).setUnlocalizedName("BoneSpade").setTextureName("electrocuted:BoneSpade"); public static Item BonePickaxe = new BonePickaxe(Bone).setUnlocalizedName("BonePickaxe").setTextureName("electrocuted:BonePickaxe"); public static Item BoneAxe = new BoneAxe(Bone).setUnlocalizedName("BoneAxe").setTextureName("electrocuted:BoneAxe"); public static Item BoneHoe = new BoneHoe(Bone).setUnlocalizedName("BoneHoe").setTextureName("electrocuted:BoneHoe"); //Armor public static Item BoneHelmet = new BoneArmor(BoneArmor, 0).setUnlocalizedName("BoneHelmet").setTextureName("electrocuted:BoneHelmet"); public static Item BoneChestPlate = new BoneArmor(BoneArmor, 1).setUnlocalizedName("BoneChestPlate").setTextureName("electrocuted:BoneChestPlate"); public static Item BoneLeggings = new BoneArmor(BoneArmor, 2).setUnlocalizedName("BoneLeggings").setTextureName("electrocuted:BoneLeggings"); public static Item BoneBoots = new BoneArmor(BoneArmor, 3).setUnlocalizedName("BoneBoots").setTextureName("electrocuted:BoneBoots"); //EventHandler //PreInit @EventHandler public void preinit(FMLPreInitializationEvent event) { //Config Configuration config = new Configuration( event.getSuggestedConfigurationFile()); config.load(); config.save(); } //Init @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRenderInformation(); proxy.registerTileEntities(); } //PostInit @EventHandler public void postinit(FMLPostInitializationEvent event) { } public Electrocuted() { //Registry GameRegistry.registerItem(BonePlate, "BonePlate"); GameRegistry.registerItem(BoneIngot, "BoneIngot"); GameRegistry.registerItem(CoalMotor, "CoalMotor"); GameRegistry.registerItem(ElectricMotor, "ElectricMotor"); GameRegistry.registerItem(Generator, "Generator"); GameRegistry.registerBlock(CompressionFurnaceIdle, "CompressionFurnaceIdle"); GameRegistry.registerBlock(CompressionFurnaceActive, "CompressionFurnaceActive"); GameRegistry.registerItem(BoneSword, "BoneSword"); GameRegistry.registerItem(BoneSpade, "BoneSpade"); GameRegistry.registerItem(BonePickaxe, "BonePickaxe"); GameRegistry.registerItem(BoneAxe, "BoneAxe"); GameRegistry.registerItem(BoneHoe, "BoneHoe"); GameRegistry.registerItem(BoneHelmet, "BoneHelmet"); GameRegistry.registerItem(BoneChestPlate, "BoneChestPlate"); GameRegistry.registerItem(BoneLeggings, "BoneLeggings"); GameRegistry.registerItem(BoneBoots, "BoneBoots"); GuiHandler GuiHandler = new GuiHandler(); LanguageRegistry.instance().addStringLocalization("container.CompressionFurnace", "Compression Furnace"); NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); //Recipe //Items GameRegistry.addRecipe(new ItemStack(BonePlate, 2), new Object [] { "XX ", "XX ", 'X', Items.bone }); GameRegistry.addRecipe(new ItemStack(BoneIngot, 3), new Object [] { "XXX", "XYX", "XXX", 'X', Items.bone, 'Y', Items.iron_ingot }); //Tools GameRegistry.addRecipe(new ItemStack(BoneSword, 1), new Object [] { " X ", " X ", " Y ", 'X', BoneIngot, 'Y', Items.stick }); GameRegistry.addRecipe(new ItemStack(BoneSpade, 1), new Object [] { " X ", " Y ", " Y ", 'X', BoneIngot, 'Y', Items.stick }); GameRegistry.addRecipe(new ItemStack(BonePickaxe, 1), new Object [] { "XXX", " Y ", " Y ", 'X', BoneIngot, 'Y', Items.stick }); GameRegistry.addRecipe(new ItemStack(BoneAxe, 1), new Object [] { "XX ", "XY ", " Y ", 'X', BoneIngot, 'Y', Items.stick }); GameRegistry.addRecipe(new ItemStack(BoneHoe, 1), new Object [] { " XX", " Y ", " Y ", 'X', BoneIngot, 'Y', Items.stick }); //Armor GameRegistry.addRecipe(new ItemStack(BoneHelmet, 1), new Object [] { "XXX", "X X", 'X', BonePlate }); GameRegistry.addRecipe(new ItemStack(BoneChestPlate, 1), new Object [] { "X X", "XXX", "XXX", 'X', BonePlate }); GameRegistry.addRecipe(new ItemStack(BoneLeggings, 1), new Object [] { "XXX", "X X", "X X", 'X', BonePlate }); GameRegistry.addRecipe(new ItemStack(BoneBoots, 1), new Object [] { "X X", "X X", 'X', BonePlate }); } }
-
[1.7.2]NetworkRegistry
Nvm, I'm still crashing when I run it. It still giving me an error in the same place. :'(
-
[1.7.2]NetworkRegistry
Ohh thanks. I tried to run the INSTANCE as a method. -.-
-
[1.7.2]Custom Furnace
Thats the series i watched... But, I still don't understand where i'm steeing the metadata again... Ohh ok. I looked at the code from the normal furnace and thats what i got. OnBlockPlacedBy() and setDefaultDirection() are both setting the metadata for the block. One function sets direction based on furnace surroundings (so it doesn't face a block). The other bases it on the facing of the player (like a door or stairs). They should agree?
-
[1.7.2]NetworkRegistry
Yeah, but Eclipse doesn't recognise .instance() as a method. It says its undefined.
-
[1.7.2]NetworkRegistry
I have this problem where I cant register my "GuiHandler". I am not sure if its just something i missed or what but i cant test by new code because the game cant start. The code i am using is: NetworkRegistry.instance().registerGuiHandler(instance, new GuiHandler()); I have tried putting it into Init/Load and i did put it in normally. None of it worked. :'(
-
[1.7.2]Custom Furnace
Thats the series i watched... But, I still don't understand where i'm steeing the metadata again...
-
[1.7.2]Custom Furnace
Hi, My custom furnace is not working the way i would like it to still, I made a post yesterday about it and fixed it but now i have another problem. :'( The furnace is not facing the way i want it to. Instead of acting like a normal furnace where the side your looking at will be the front, it is the block you click on. For example, i click on the west side of a block and the front is towards the west, even though i was standing north. Block class package electro.blocks; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import electro.lib.Referance; import electro.mod.Electrocuted; import electro.tileentity.TileEntityCompressionFurnace; public class BlockCompressionFurnace extends BlockContainer { private final boolean isActive; @SideOnly(Side.CLIENT) private IIcon iconFront; @SideOnly(Side.CLIENT) private IIcon iconTop; public BlockCompressionFurnace(boolean isActive) { super(Material.rock); this.setCreativeTab(Electrocuted.ElectrocutedTab); this.isActive = isActive; } public Item idDropped(int par1, Random random, int par3) { return Item.getItemFromBlock(Electrocuted.CompressionFurnaceIdle); } public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); this.setDefaultDirection(world, x, y, z); } private void setDefaultDirection(World world, int x, int y, int z) { if (!world.isRemote) { Block block = world.getBlock(x, y, z - 1); Block block1 = world.getBlock(x, y, z + 1); Block block2 = world.getBlock(x - 1, y, z); Block block3 = world.getBlock(x + 1, y, z); byte b0 = 3; if (block.func_149730_j() && !block1.func_149730_j()) { b0 = 3; } if (block1.func_149730_j() && !block.func_149730_j()) { b0 = 2; } if (block2.func_149730_j() && !block3.func_149730_j()) { b0 = 5; } if (block3.func_149730_j() && !block2.func_149730_j()) { b0 = 4; } world.setBlockMetadataWithNotify(x, y, z, b0, 2); } } @SideOnly(Side.CLIENT) public IIcon getIcon(int p_149691_1_, int p_149691_2_) { return p_149691_1_ == 1 ? this.iconTop : (p_149691_1_ == 0 ? this.iconTop : (p_149691_1_ != p_149691_2_ ? this.blockIcon : this.iconFront)); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon("electrocuted:CompressionFurnace_side"); this.iconFront = iconRegister.registerIcon(this.isActive ? "electrocuted:CompressionFurnace_Active_front" : "electrocuted:CompressionFurnace_Idle_Front"); this.iconTop = iconRegister.registerIcon("electrocuted:CompressionFurnace_top"); } public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { if(world.isRemote) { FMLNetworkHandler.openGui(player, Electrocuted.instance, Electrocuted.guiIdCompressionFurnace, world, x, y, z); } return true; } public TileEntity createNewTileEntity(World world, int var1) { return new TileEntityCompressionFurnace(); } public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLivingBase, ItemStack itemstack) { int l = MathHelper.floor_double((double)(entityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if (l == 0) { world.setBlockMetadataWithNotify(x, y, z, 2, 2); } if (l == 1) { world.setBlockMetadataWithNotify(x, y, z, 5, 2); } if (l == 2) { world.setBlockMetadataWithNotify(x, y, z, 3, 2); } if (l == 3) { world.setBlockMetadataWithNotify(x, y, z, 4, 2); } if (itemstack.hasDisplayName()) { ((TileEntityCompressionFurnace)world.getTileEntity(x, y, z)).setGuiDisplayName(itemstack.getDisplayName()); } } } TileEntity class (not done) package electro.tileentity; import net.minecraft.tileentity.TileEntity; public class TileEntityCompressionFurnace extends TileEntity { private String localizedName; public void setGuiDisplayName(String displayName) { this.localizedName = displayName; } }
- Custom Furnace
-
Custom Furnace
OK so, I am having a few errors with the "setDefaultDirection" in my furnace class... I looked at a bunch of tutorials and found nothing. If its something very basic that i didn't spot, then I'm sorry... package electro.blocks; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import electro.lib.Referance; import electro.mod.Electrocuted; public class CompressionFurnace extends BlockContainer { private final boolean isActive; @SideOnly(Side.CLIENT) private IIcon iconFront; public CompressionFurnace(boolean isActive) { super(Material.rock); this.setCreativeTab(Electrocuted.ElectrocutedTab); this.isActive = isActive; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon(Referance.MODID + ":" + "CompressionFurnace_side"); this.iconFront = iconRegister.registerIcon(Referance.MODID + ":" + (this.isActive ? "CompressionFurnace_Active_front" : "CompressionFurnace_Idle_front")); } @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int metadata) { return side == metadata ? this.iconFront : this.blockIcon; } public int idDropped(int par1, int par3) { return getIdFromBlock(Electrocuted.CompressionFurnaceIdle); } public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); this.setDefaultDirection(world, x, y, z); } private void setDefaultDirection(World world, int x, int y, int z) { if(!world.isRemote) { int l1; int l2; int l3; int l4; byte b1 = 3; world.setBlockMetadataWithNotify(x, y, z, B1, 2); } } } The problem is that there is no world.getBlockID or Block.opaqueCubeLookup[] method. I don't know is it the new forge or am i doing something wrong. Any help would be great!
-
Tile entities and some problems...
"The source attachmet does not contain the source for the file BlockCauldron.class." Is there a way of opening it a diffrent way?
-
Tile entities and some problems...
Ok, I'll check it out!
-
Tile entities and some problems...
Lol I know. I have other things planned for. If I know how to do this then I will be able to do the rest myself.
-
Tile entities and some problems...
Yo guys! I just made a new topic a few hours ago, but since i am pretty new to this i have more problems. :'( In my mod, I have planned to make buckets be a tile entity. I want them to be placeable in the world. Since i don't have a clue how to do that i read all the block and tile entity wiki post, I also watched tons of videos. All the tutorials said to make an tile entity you need a block, but then the bucket was possible to get in creative. I don't want that because I want it to be just a bucket that when right clicked on a block places it. I tried to do it with my knowledge but then I wouldn't be able to make it a tile entity. I also want it to be interactable (right clicked with a water bucket fill it up with water etc.).
-
Eclipse doesn't handle imports?
Never mind guys I figured everything out! Thanks for all the help!
-
Eclipse doesn't handle imports?
Ok, first of all, sorry for posting here again and annoying you guys again. If this is a very simple fix or I'm just blind then I'm sorry..... Again. I'm having random errors (red lines) show up under my code... @EventHandler public void postInit(FMLPostInitializationEvent event) {} This is one of them. (There is many more) There is a red line under the p in "public".
-
Eclipse doesn't handle imports?
Hmmm, thats what i forgot. -.- Thanks for the help, I'm sorry for any hassle.
-
Eclipse doesn't handle imports?
I linked the libraries and it doesn't want to work. ;(
-
Eclipse doesn't handle imports?
Ohh fail, I heard it in a video that forge does all the imports. -.- Anyway is there a way to fix it?
-
Eclipse doesn't handle imports?
I figured that forge does it, then i tried importing FML init thing. It didn't work so i tried doing it myself but as i said i think i did it wrong or something.
-
Eclipse doesn't handle imports?
OK, so I'm kind of new to forge (I'm a noob ) and my Eclipse doesn't want to import anything. I press ctrl + shift and o, but it doesn't work. @EventHandler public void preInit(FMLPreInitializationEvent event) {} @EventHandler public void init(FMLInitializationEvent event) {} @EventHandler public void postInit(FMLPostInitializationEvent event) {} I did the usual but The option i had was to do this: public class bsurvival<FMLInitializationEvent, FMLPreInitializationEvent, FMLPostInitializationEvent> Make a .class or add a parameter to the thing( '' ). I think it might be because i still haven't played with 1.7.2 and I didn't add the libraries correctly. I would appreciate any help from others.
-
Soo Im New.
OK. I'll do something easier. Thanks to everybody who helped, i really appreciate it.
IPS spam blocked by CleanTalk.