Jump to content

fritterdonut

Members
  • Posts

    5
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Location
    Canada

fritterdonut's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. In 1.6.2 fluids had a setGaseous(boolean) method. It defaults to false. Try that?
  2. Unfortunately it's kind of hard to gauge how much is 'enough'. Ideally, you'd have an understanding of: Classes Methods Primitive types (boolean, int, short, long, float, char, as well as String) Inheritance (extending classes and also using interfaces) Basic data structures (Arrays, Lists, etc) Using Public/Private/Final/etc modifiers for methods and variables when appropriate If, For, Else, While, Do, Switch statements - How they work and when to use them Recursive methods (which can save you a lot of coding) Basic logic (!= not equal, && and, || or, == equal, etc) Some understanding of packets, hopefully I've probably missed a bunch here, but that's what springs to mind. A lot of it you can learn on the way while poking through vanilla Minecraft classes. Once you wrap your head around certain Minecraft-specific things (Blocks have an associated TileEntity, that TileEntity can implement a Container, that Container can implement Slots, and the whole shebang can be looked at with a GUI activated by the block), things tend to make more sense. I first dealt with Java while doing Minecraft modding, now I've come back after taking University classes on the subject. A lot of what we covered in the introductory courses I had already learned just from playing around with Forge for a week. And remember, Google is your friend. There are plenty of good online tutorials for learning the basics of Java.
  3. So I have some blocks you could call custom furnaces. They have only 2 slots: one input, one output. Input is slot 0 in the container class, Output is slot 1 in the container class. I changed this in my TileEntity class to adjust for it only having 2 slots (code is based on original BlockFurnace code): private static final int[] slotsTop = new int[] {0}; private static final int[] slotsBottom = new int[] {1}; private static final int[] slotsSides = new int[] {0}; So now I can place items in the input slot (slot 0) through hoppers via the top or sides of the block and it works correctly. However, I can't output from slot 1 through the bottom. Items stay in the furnace without moving. Any ideas how I could rectify this? Edit: Me, being completely blind, managed to miss this method: public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { return par3 == 0 || par1 != 1 || par2ItemStack.getItem() == Items.bucket; } Being from the Furnace TileEntity class, it by default disabled slot 1 (represented by int par1) from being withdrawn from. Changing it to: public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { return par1 != 0 || par2ItemStack.getItem() == Items.bucket; } Has made it so items can be withdrawn from my blocks.
  4. Yup, mod is still listed in the mods menu and the console shows that when reloading the new world client and server successfully load 4 mods (FML, MC Forge, MCP, and my own mod).
  5. Hi, I previously worked with Forge but am only recently looking into it again. I seem to have run into a bit of an issue, and I honestly have no idea what is wrong. I can add a new block, test run it, create a world, find the block in the creative menu and place said block. However, after saving/quiting the world and then loading it again, the block is MIA from the creative menu, gone from your inventory, and has disappeared from world itself, leaving only lighting errors where the blocks previously were. I'm using Forge build 1024 for MC 1.7.2. It also prints out this lovely stacktrace in Eclipse: java.lang.RuntimeException: Mod IDs are missing at cpw.mods.fml.common.Loader.fireMissingMappingEvent(Loader.java:865) at cpw.mods.fml.common.registry.GameData.injectWorldIDMap(GameData.java:272) at cpw.mods.fml.common.FMLContainer.readData(FMLContainer.java:191) at cpw.mods.fml.common.FMLCommonHandler.handleWorldDataLoad(FMLCommonHandler.java:382) at net.minecraft.world.storage.SaveHandler.loadWorldInfo(SaveHandler.java:148) at net.minecraft.world.World.<init>(World.java:293) at net.minecraft.world.WorldServer.<init>(WorldServer.java:111) at net.minecraft.server.integrated.IntegratedServer.loadAllWorlds(IntegratedServer.java:65) at net.minecraft.server.integrated.IntegratedServer.startServer(IntegratedServer.java:98) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:488) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) There are only 2 classes currently in existence: SimpleIndustry: package simpleIndustry; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = SimpleIndustry.MODID, version = SimpleIndustry.VERSION) public class SimpleIndustry { public static final String MODID = "SimpleIndustry"; public static final String VERSION = "1.0"; private static final Block TestBlock = new TestBlock(); @EventHandler public void load(FMLInitializationEvent event) { GameRegistry.registerBlock(TestBlock, MODID + ":" + TestBlock.getUnlocalizedName().substring(5)); } } And TestBlock: package simpleIndustry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import simpleIndustry.SimpleIndustry; public class TestBlock extends Block { public TestBlock() { super(Material.rock); this.setHardness(25.0F); this.setResistance(1000F); this.setCreativeTab(CreativeTabs.tabBlock); this.setBlockName("TestBlock"); this.setBlockTextureName(SimpleIndustry.MODID + ":tile.TestTexture"); this.setHarvestLevel("pickaxe", 3); } } I've spent the last couple hours googling, reading/watching tutorials, and searching the forums for a reason as to why this happens, but I haven't found anything that solves the issue. Any assistance would be very much appreciated. I feel I'm being an idiot and it's probably something really simple, but I just can't figure out what. Thanks. Edit: Problem is solved. Needed to use FMLPreInitializationEvent in the main class, instead of FMLInitializationEvent.
×
×
  • Create New...

Important Information

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