-
Posts
1689 -
Joined
-
Last visited
-
Days Won
1
Everything posted by SanAndreaP
-
Yes, and this method "setGraphicsLevel" calls the same-named method in the BlockLeaves class, which sets the variable graphicsLevel. So no need to hook into it!
-
FML override leather armor torso texture
SanAndreaP replied to vherkin's topic in Support & Bug Reports
Yes, I know that issue. It happens on MC 1.4.2 with Forge 6.0.1.355 and this mod: http://www.minecraftforum.net/topic/942445-142-craftable-mob-eggs-sspsmp-pending/ I don't know about 1.4.4/1.4.5 as this mod isn't updated yet. -
That is not needed. All you need is the graphicsLevel boolean variable from an instance of the BlockLeaves class. It will be set to true automatically when the graphic level is fancy, false if it's fast. I would suggest to extend BlockLeaves. You can also get an instance of a leave block and then get the boolean variable from there, like this: boolean fancy = ((BlockLeaves)Block.blocksList[18]).graphicsLevel Then you can use that boolean in your getTextureFromSideAndMetadata method of your block to determine the fast/fancy texture. Also in isOpaqueCube and in shouldSideBeRendered for correct rendering. Just look at the vanilla leaves code for this.
-
.minecraft/lib
-
Which method in your block class do you use to get the texture index? Im not entirely sure what you mean by that but here is the block class: package thedecopack.medieval.blocks; import net.minecraft.src.*; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import java.util.List; import java.util.Random; import thedecopack.medieval.DecoMedieval; public class BlockMedievalCedarLog extends Block { protected BlockMedievalCedarLog(int par1) { super(par1, Material.wood); this.setCreativeTab(DecoMedieval.medievalTab); } /** * Returns the quantity of items to drop on block destruction. */ public int quantityDropped(Random par1Random) { return 1; } /** * Returns the ID of the items to drop on destruction. */ public int idDropped(int par1, Random par2Random, int par3) { return this.blockID; } /** * ejects contained items into the world, and notifies neighbours of an update, as appropriate */ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { byte var7 = 4; int var8 = var7 + 1; if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { for (int var9 = -var7; var9 <= var7; ++var9) { for (int var10 = -var7; var10 <= var7; ++var10) { for (int var11 = -var7; var11 <= var7; ++var11) { int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11); if (Block.blocksList[var12] != null) { Block.blocksList[var12].beginLeavesDecay(par1World, par2 + var9, par3 + var10, par4 + var11); } } } } } } /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public int getBlockTextureFromSide(int i) { if(i == 1 || i == 0) { return 17; } else { return 16; } } @Override public boolean canSustainLeaves(World world, int x, int y, int z) { return true; } @Override public boolean isWood(World world, int x, int y, int z) { return true; } public String getTextureFile() { return DecoMedieval.instance.blockTextureFile(); } } I meant your leaves.
-
Which method in your block class do you use to get the texture index?
-
I see the problem now. Replace cropblock.blockID in your seed initialization with the actual Block ID 231 If you grab the IDs from a config file in the future, grab the actual number and put it there.
-
So you said you moved the line like I told you. Could you provide the changed code?
-
Okay then, maybe this works: Remove all "Main." references from your variables, like in this one: "Main.cropseed.shiftedIndex"
-
Simply look at the code for the TileEntity, especially look for the methods "onDataPacket" (also available in TileEntitySign) and "getDescriptionPacket". Make sure you send a packet of type Packet132TileEntityData in "onDataPacket". And "FYI" means "For your information"
-
Tha errort has nothing to do with Forge modding, it's a simple syntax error you made. Put this line: cropblock = new BlockCrop(231, 0, Main.cropseed.shiftedIndex, Main.cropseed, Main.itemFlax.shiftedIndex, Block.grass.blockID, 0).setStepSound(Block.soundGrassFootstep).setHardness(0.0F).setBlockName("cropblock"); below this line: itemFlax = new ItemFlax(556).setIconIndex(1).setItemName("Flaxfood"); Just to explain that to you: the cropblock constructor gives you an NPE, because the variables cropseed and itemFlax are null when you call them. You try to initialize them after initializing cropblock and because cropblock needs these two variables, it simply doesn't work.
-
Instead of t = config.get("main", "texture", "bla bla text").toString(); You have to use t = config.get("main", "texture", "bla bla text").value; Took me 2 minutes of searching in the code.
-
there IS a TileEntity on the client, always. Your problem is just that the TE from the client doesn't update its data from the server TE. You have to handle with packets to do this. FYI The TE has its own methods for dealing with packets. There's no need to do this with your Packet Handler.
-
Looks like you didn't initialize "Main.cropseed" and/or "Main.itemFlax" before you call that constructor.
-
what icon will this new tab have? I forgot to mention that you have to make a new class which extend CreativeTabs and override this method: public ItemStack getIconItemStack() { return new ItemStack(Item.eyeOfEnder); } So this tab would have the Eye Of Ender item as icon. And instead of initializate with the standard CreativeTabs class, you should do this: public static CreativeTabs yourTab = new MyCustomTab("yourTab");
-
Here: http://www.minecraftforge.net/forum/index.php/topic,1976.0.html Read it. EXACTLY.
-
Make a tick handler and put the constant-rain code in there. It should be called server-side.
-
I don't know what you want to do, but you could just use the @PostInit method in your main class. It is fired after all mods are loaded into the classpath.
-
6.0.1.341 but the snowing workings now all the downfall is snow just changing the temp did the trick but how do i let i snow constantly You would have to make it rain constantly which, of course, applies for all biomes then.
-
read instructions -.-
-
Which Forge do you use? The method is public for me (on Forge 6.3.0.372)
-
Unusual Forge Errors; Please Help!
SanAndreaP replied to TheNuclearDuck's topic in General Discussion
whoops, forgot to check if it's null: ItemStack stack = tileentity.getStackInSlot(SLOT_ID); if(stack != null && stack.isItemEqual(new ItemStack(Item.redstone))) { tileentity.decrStackSize(SLOT_ID, 1); } -
Unusual Forge Errors; Please Help!
SanAndreaP replied to TheNuclearDuck's topic in General Discussion
You should put that in your TileEntity in your updateEntity method, because when placed in the GUI, it won't edit anything on the server and will be reset again. -
Unusual Forge Errors; Please Help!
SanAndreaP replied to TheNuclearDuck's topic in General Discussion
Check out my edit above.