
mardiff
Members-
Posts
158 -
Joined
-
Last visited
Everything posted by mardiff
-
As I have no experiences thus far with config files, I tried to make one, yet failed. Here is the complete set of code for the ConfigHandler: package mardiff.quartz.lib; import java.io.File; import net.minecraftforge.common.Configuration; public class ConfigHandler { public static void init(File configFile) { Configuration config = new Configuration(configFile); config.load(); //Blocks BlockIds.QUARTZ_CRYSTAL_BLOCK = config.getBlock("Quartz Crystal Block", BlockIds.QUARTZ_CRYSTAL_BLOCK_DEFAULT).getInt(); //BlockIds.QUARTZ_ORE = config.getBlock(Quartz Block, BlockIds.QUARTZ_ORE_DEFAULT).getInt(); //Items ItemIds.QUARTZ_SWORD = config.getItem("Quartz Sword", ItemIds.QUARTZ_SWORD_DEFAULT).getInt() - 256; ItemIds.QUARTZ_SHOVEL = config.getItem("Quartz Shovel", ItemIds.QUARTZ_SHOVEL_DEFAULT).getInt() - 256; ItemIds.QUARTZ_PICK = config.getItem("Quartz Pickaxe", ItemIds.QUARTZ_PICK_DEFAULT).getInt() - 256; ItemIds.QUARTZ_AXE = config.getItem("Quartz Axe", ItemIds.QUARTZ_AXE_DEFAULT).getInt() - 256; ItemIds.QUARTZ_HOE = config.getItem("Quartz Hoe", ItemIds.QUARTZ_HOE_DEFAULT).getInt() - 256; ItemIds.QUARTZ_HELM = config.getItem("Quartz Helm", ItemIds.QUARTZ_HELM_DEFAULT).getInt() - 256; ItemIds.QUARTZ_CHEST = config.getItem("Quartz Chest", ItemIds.QUARTZ_CHEST_DEFAULT).getInt() - 256; ItemIds.QUARTZ_LEGS = config.getItem("Quartz Legs", ItemIds.QUARTZ_LEGS_DEFAULT).getInt() - 256; ItemIds.QUARTZ_BOOTS = config.getItem("Quartz Boots", ItemIds.QUARTZ_BOOTS_DEFAULT).getInt() - 256; ItemIds.QUARTZ_CHISEL = config.getItem("Diamond Chisel", ItemIds.QUARTZ_CHISEL_DEFAULT).getInt() - 256; ItemIds.QUARTZ_CARVED_QUARTZ = config.getItem("Quartz Crystal", ItemIds.QUARTZ_CARVED_QUARTZ_DEFAULT).getInt() - 256; config.save(); } } Addtionally, this line is in the PreInit of my main class: ConfigHandler.init(event.getSuggestedConfigurationFile()); The problem is that when I try to open an existing world or make a new one, instead of giving me an error, the game simply kicks the game out to the title screen, and only then when you open the world again does it freeze the console. The console doesn't give any errors, so that doesn't help, and the config file itself looks just like it should. Any help would be appreciated. Thanks, Mardiff
-
Here's my armor class: @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, int layer) { if(itemID == ModItems.quartzHelm.itemID || itemID == ModItems.quartzChest.itemID || itemID == ModItems.quartzBoots.itemID) { return "quartz:textures/models/armor/quartz_layer_1.png"; } if(itemID == ModItems.quartzLegs.itemID) { return "quartz:textures/models/armor/quartz_layer_2.png"; } return null; } Make sure your armor is in textures/models/armor/[armorname]_layer_1/2.png. Also, check in the console to see where your client is looking for textures.
-
Hey Everyone, I am looking to test my fluid to see if it shows up in tanks correctly. It would be greatly appreciated if someone could lend me a mod with a working Fluid Tank using lemming's new fluid system? You don't have to give away source code, as it can either be compiled or decompiled. Any help will be appreciated, mardiff
-
Override the hitEntity function in ItemSword, and make it play your sound.
-
I'm not sure what I did wrong, but the texture on the liquid in game doesn't work. All I know is that the error is unhappy with the this.getFluid().setIcons(this.theIcon[0], this.theIcon[1]); Here's the whole class: package mardiff.ethanol.fluids; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockStationary; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.util.DamageSource; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fluids.BlockFluidClassic; public class BlockEthanolLiquid extends BlockFluidClassic { protected Icon[] theIcon; public BlockEthanolLiquid(int i) { super(i, ModFluids.ethanol, Material.water); this.setCreativeTab(CreativeTabs.tabMisc); ModFluids.ethanol.setBlockID(this); this.getFluid().setIcons(this.theIcon[0], this.theIcon[1]); } @Override @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { this.theIcon = new Icon[]{iconRegister.registerIcon("ethanol:ethanol_still"), iconRegister.registerIcon("ethanol:ethanol_flow")}; } @Override @SideOnly(Side.CLIENT) public Icon getIcon(int side, int meta) { if ( side <= 1 ) { return this.theIcon[0]; } else { return this.theIcon[1]; } } } Edit: *facepalm* It wasn't the code, it was that I was using my 1.5 textures.... Everything works fine!
-
Thanks! How would I then do custom textures? I get kind of confused around the arrays and I'm not sure which method actually registers it, considering I can't find a registerIcons function.
-
Does anyone know how to make a new liquid with King Lemming's new BlockFluid class? I've been messing around a little and I can only manage to do this by making my own BlockFluid class, and even then textures don't work... any ideas?
-
Just use the same thing as the .png.mcmeta. They probably changed how animations work.
-
[1.6.1] onBlockActivated doesn't work anymore!
mardiff replied to KeeganDeathman's topic in Modder Support
Did you fix it yet? Because if so please lock this topic so people stop yelling at each other... -
I have the same problem, it seems to be looking in the default minecraft texture area for textures.
-
Can you post your main mod class for us?
-
[1.6.1] onBlockActivated doesn't work anymore!
mardiff replied to KeeganDeathman's topic in Modder Support
Im pretty sure it changed to: public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) -
Nevermind, I got it to work! Thanks Everyone!
-
And how does one implement that?
-
Main Class: package redstone; import net.minecraft.block.Block; import net.minecraft.block.BlockFurnace; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.src.ModLoader; import net.minecraftforge.common.EnumHelper; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="redstoneModv1.0.0", name="Redstone Tools & Armor", version="1.0.0") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class RedstoneBase { //Blocks public static final Block grinderIdle = (new BlockGrinder(2624, false)).setHardness(3.5F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("grinder").setCreativeTab(CreativeTabs.tabDecorations); public static final Block grinderBurning = (new BlockGrinder(2625, true)).setHardness(3.5F).setStepSound(Block.soundStoneFootstep).setLightValue(0.875F).setUnlocalizedName("grinder"); @Init public void load(FMLInitializationEvent event) { LanguageRegistry.addName(grinderIdle, "Grinder"); GameRegistry.registerBlock(grinderIdle); GameRegistry.addRecipe(new ItemStack(grinderIdle), "xxx", "xyx", "xxx", 'x', Block.stone, 'y', Item.wheat); GameRegistry.registerTileEntity(TileEntityGrinder.class, "TileEntityGrinder"); NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler()); } } GuiHandler: package redstone; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; public class GuiHandler implements IGuiHandler { @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile_entity = world.getBlockTileEntity(x, y, z); if(tile_entity instanceof TileEntityGrinder){ return new ContainerGrinder(player.inventory, (TileEntityGrinder) tile_entity); } return null; } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile_entity = world.getBlockTileEntity(x, y, z); if(tile_entity instanceof TileEntityGrinder){ return new GuiGrinder(player.inventory, (TileEntityGrinder) tile_entity); } return null; } }
-
Now it says my mod has to be a network mod. I have the @NetworkMod annotain my my main class and I have a packet handler, but it still gives me the error. Any ideas?
-
Okay, thank you everyone, my furnace doesn't freeze anymore, but when I right click on it now, nothing happens.... Just a question, do I need packet handlers? And if I do, do I need both server and client side?
-
Hello Everyone, I've been working on making a custom furnace and so far I have tried to copy the vanilla furnace code. Everything has worked fine except for when I to right click on the block. The error I get says that TileEntityFurnace cannot be cast to TileEntityGrinder (which is my tile entity) in onBlockActivated in BlockGrinder. Here's the code for that: /* * A replacement for the displayGUIFurnace in EntityPlayer. */ public void displayGUIGrinder(TileEntityGrinder par1TileEntityGrinder) {} public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (par1World.isRemote) { return true; } else { TileEntityGrinder tileentitygrinder = (TileEntityGrinder)par1World.getBlockTileEntity(par2, par3, par4); if (tileentitygrinder != null) { this.displayGUIGrinder(tileentitygrinder); } return true; } } Any suggestions? All help will be appreciated. Thanks, mardiff
-
Show us some code please?
-
Put the declarations in preInit instead of Init.
-
Textures and LanguageRegistry in preInit instead of Init
mardiff replied to sorash67's topic in Modder Support
Buggy forge. Wait for the recommended release and it should be fixed. -
There is a function called onBlockDestroyed which isn't exactly what you are looking for since it activates when the block is destroyed, but doesn't check if it isn't.
-
Textures and LanguageRegistry in preInit instead of Init
mardiff replied to sorash67's topic in Modder Support
I'm positive. I made a 3x3 hole that was 4 deep, put down 9 spikes, jumped in, and nothing happened. And no, I wasn't in creative. I guess that players are no longer instances of living entities, or something like that. -
Textures and LanguageRegistry in preInit instead of Init
mardiff replied to sorash67's topic in Modder Support
1) I am using version 758 of forge. 2) I am testing this inside of Eclipse. 3) When I put the spikes on the ground, it appears that the model is working but not the texture, unless the texture is pure black with purple flashes 4) I am very impressed by the spikes with mobs, but it doesn't appear to be dealing damage to me in survival. Not sure if this is intended or not. -
Textures and LanguageRegistry in preInit instead of Init
mardiff replied to sorash67's topic in Modder Support
Well I don't know, because I can't fix something that doesn't appear to be broken. [/img]