Everything posted by DARKHAWX
-
[1.8] [Solved] Gui not being rendered properly (texture.png > 256x256)
So I'm creating a new book GUI that is basically a tutorial book like those seen in Thaumcraft/Botania/TConstruct/etc. However when I added buttons and a few GUI elements to my image it seems to just bug out and place the textures in weird positions / not even show them. -snip- The first set of coordinates is the location of the top left corner of my book texture in minecraft's window. The next 3 sets of coordinates are for each of the nextpage/prevpage/etc buttons being drawn (not the chapterButtons). The pairs of coordinates mean, respectively, the top left corner of the buttons texture, the bottom right corner of the buttons texture (both of these are in respect to the texture.png file. They make a box that contains the texture of the button), and the third pair of coordinates refers to the location of the button within minecraft's window. Now I'm pretty certain that, by default minecraft's window's size is 640x480 so surely all these buttons should be properly rendered within the window. I know this is probably a bit messy and hard to read, but can anyone check if my math is off or if I am just doing some stuff completely wrong that would be great, as I've been at this for the last couple hours and can't seem to fix it... (Also, as a side note, whenever I click a button it makes the sound numerous times... which I'm going to put down to not doing something right with buttonList. And finally, there are a few things here that are empty or incomplete, such as renderScreen(), that's just because I haven't gotten around to finishing it because of this stupid problem.
-
Rectangular Hitbox
Whoops... completely misread that. Should really get more sleep.
-
Rectangular Hitbox
Use this.setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ); in your blocks constructor to change the blocks hitbox.
-
[1.8] [EDIT] Updating crafting matrix upon changing item in a slot
EDIT: Read my third post. Hi there, I want to look into creating a method of crafting some items for my mod. However I'm having a hard time understanding how to create and implement this. If anyone can give me a brief explanation or point me to a tutorial that would be amazing.
-
[1.8] [Solved] Changing the bounding/collision(?) box of a block
Hi there, So recently I just started creating custom models for my blocks and want to know if it is possible to change the bounding/collision box of the block so that it doesn't take up the whole block, but just the model. Current block model: My block model is a bit complex, so it might not be feasible to create a collision box that is exactly the block model. If it's not feasible then how can I just make the box smaller... EDIT: Think I might have found something... should I be using setBlockBounds() to change it? EDIT2: After a bunch of digging it looks like it would be exceptionally tedious to create a block bouding that fit exactly around my model. However I have fixed my problem. Simply put the following in your constructor for your block setBlockBounds(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
-
[1.8] Allow only certain items in specific slots
Yeah, probably should. Still trying to get the whole crafting system working though, one step at a time.
-
[1.8] Allow only certain items in specific slots
Thanks, changing that worked. When I was coding it I absolutely knew that when I was creating the list it was probably done incorrectly.
-
[1.8] Allow only certain items in specific slots
I'm pretty sure this is working, because once I added it I was unable to place items in said slot... I think my problem lies in checking whether the item being added is a valid item. I don't think my code in isItemValid is incorrect.
-
[1.8] Allow only certain items in specific slots
Hi there, I'm currently trying to code a new crafting table that has 2 additional slots for specific items. So I'm trying to prevent players from adding any item, other than the correct ones, to that slot. To do this I have created a new SlotSolvent class that overrides the "isItemValid" check and will only return true if the itemstack being added is the same as one of the allowable items. However this does not seem to be working. Can someone point out where I am going wrong? SlotSolvent public class SlotSolvent extends Slot { public SlotSolvent(IInventory inventory, int id, int xPos, int yPos) { super(inventory, id, xPos, yPos); } @Override public boolean isItemValid(ItemStack itemstack) { List<ItemStack> solvents = new ArrayList<>(); // List of allowed solvents solvents.add(new ItemStack(ModItems.conicalFlask)); for(ItemStack item: solvents) { if(item.getUnlocalizedName() == itemstack.getUnlocalizedName()) return true; } return false; } } This is what I have in my container class this.addSlotToContainer(new SlotSolvent(te, 1, 19, 17)); (te is just my tile entity)
-
Dimension Customization
Hey guys I've been making a new dimension for my mod and I was wondering if someone could point me to a tutorial that shows some of the things that you can customize in your dimension. I used Wuppy29's tutorials for the dimension code and it works fine, he just doesn't have customization for the dimension. I mainly want one that tells me how to use multiple customized biomes in my dimension. Also in Wuppy29's tutorials he states that the lighting of the portal doesn't exaclty work, e.g. lighting with fire doesn't make the portal. Does anyone know of a fix for that? Also in the tutorial the code makes the player get teleported about 3 blocks away from the portal, anyone know a fix? Also to make the portal have a time until you can enter again and to make it not insta-tp you there (have to stand in it for a sec or two)? I mainly want the customized biome tutorial, don't worry about the rest if you don't know of any. Thanks to the future people that will help.
- Configuration File
-
How can I make animated Textures
How did you fix it? My textures don't exactly work and I'd like to know what you did for it to work.
-
Animated Blocks???
I found another mod with explanations on the FX, so I've got that worked except it gives me this error: (I can still play just the block is messed up) [WARNING] [fml.TextureManager] Detected a texture FX sizing discrepancy in TextureElementalBrickFX (4, 52) So its telling me that my image size is wrong, but I've looked at other peoples images and they are just the same, each individual frame on top of each other. But it doesn't work (mine is a little longer than others), is there a certain variable that you have to change to set how many frames i need? This is the code I've got for the FX file: package mod.ElementalWorld; import java.io.IOException; import net.minecraft.client.renderer.RenderEngine; import net.minecraft.src.ModTextureAnimation; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.TextureFXManager; public class TextureElementalBrickFX extends ModTextureAnimation { public TextureElementalBrickFX(String texture, int index) throws IOException { super(index, 1, texture, TextureFXManager.instance().loadImageFromTexturePack(FMLClientHandler.instance().getClient().renderEngine, texture), 1); } public void bindImage(RenderEngine renderengine) { //Binds texture with GL11 to use specific icon index. GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, renderengine.getTexture("/textures/ElementalWorld/Elemental Brick.png")); } }
-
Animated Blocks???
This doesn't help me much, I still don't know what to do with the file and what each part of it means, can you help me point it out or could you link me a tutorial on this as I have never delved into animated textures and would like to know what to do.
-
Tree Trouble
I wanted to make a new tree that is only a big tree. So I went with DARKHAX's tutorials on trees and that worked, but it was for normal trees. So then I decided to copy the code from WorldGenHugeTrees and just rename the blocks. But this doesn't work. Each time I try to bonemeal my sapling it comes up this error: java.lang.Error: Unresolved compilation problem: The constructor WorldGenTwistedOak(boolean) is undefined at mod.ElementalWorld.BlockTwistedOakSapling.growTree(BlockTwistedOakSapling.java:52) at mod.ElementalWorld.ElementalWorldBoneMealEvent.bonemealUsed(ElementalWorldBoneMealEvent.java:14) at net.minecraftforge.event.ASMEventHandler_4_ElementalWorldBoneMealEvent_bonemealUsed_BonemealEvent.invoke(.dynamic) at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:35) at net.minecraftforge.event.EventBus.post(EventBus.java:103) at net.minecraft.item.ItemDye.onItemUse(ItemDye.java:78) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:135) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:389) at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1327) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1810) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:846) at net.minecraft.client.Minecraft.run(Minecraft.java:771) at java.lang.Thread.run(Unknown Source) Now I do realise that the reason the boolean is not defined is because it is different, but I have no idea what to set it to. If anyone knows of a tutorial for generating large trees, link it please, or if you know of a fix, post it. But looking into the code for the vanilla sapling and tree, it has so many variable and my heads gets lost inside of them all. So I would really appreciate it if someone could help with this. Thanks. Also I was wondering of way to make leaves to have a 50/50 chance of actually spawning when the tree is created. I tried using a random function that returns either null or the blockID but that didn't work. It just gave me this error: java.lang.NullPointerException at mod.ElementalWorld.WorldGenTwistedOak.randLeaves(WorldGenTwistedOak.java:37) at mod.ElementalWorld.WorldGenTwistedOak.generate(WorldGenTwistedOak.java:107) at mod.ElementalWorld.BlockTwistedOakSapling.growTree(BlockTwistedOakSapling.java:53) at mod.ElementalWorld.ElementalWorldBoneMealEvent.bonemealUsed(ElementalWorldBoneMealEvent.java:14) at net.minecraftforge.event.ASMEventHandler_4_ElementalWorldBoneMealEvent_bonemealUsed_BonemealEvent.invoke(.dynamic) at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:35) at net.minecraftforge.event.EventBus.post(EventBus.java:103) at net.minecraft.item.ItemDye.onItemUse(ItemDye.java:78) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:135) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:389) at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1327) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1810) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:846) at net.minecraft.client.Minecraft.run(Minecraft.java:771) at java.lang.Thread.run(Unknown Source) So hopefully one of you smart people can help me with this. EDIT: Well I fixed the problem with the WorldGenHugeTrees, but found out that those are the jungle trees, so I changed that to WorldGenBigTrees which I hope is for the big forest trees. But now I get a different error after I replace the blocks: java.lang.ArrayIndexOutOfBoundsException: -9 at net.minecraft.world.chunk.storage.ExtendedBlockStorage.setExtBlockID(ExtendedBlockStorage.java:106) at net.minecraft.world.chunk.Chunk.setBlockIDWithMetadata(Chunk.java:715) at net.minecraft.world.World.setBlockAndMetadataWithUpdate(World.java:554) at net.minecraft.world.World.setBlockAndMetadata(World.java:532) at net.minecraft.world.World.setBlockAndMetadataWithNotify(World.java:716) at net.minecraft.world.gen.feature.WorldGenerator.setBlockAndMetadata(WorldGenerator.java:47) at mod.ElementalWorld.WorldGenTwistedOak.placeBlockLine(WorldGenTwistedOak.java:296) at mod.ElementalWorld.WorldGenTwistedOak.generateLeafNodeBases(WorldGenTwistedOak.java:370) at mod.ElementalWorld.WorldGenTwistedOak.generate(WorldGenTwistedOak.java:510) at mod.ElementalWorld.BlockTwistedOakSapling.growTree(BlockTwistedOakSapling.java:55) at mod.ElementalWorld.ElementalWorldBoneMealEvent.bonemealUsed(ElementalWorldBoneMealEvent.java:14) at net.minecraftforge.event.ASMEventHandler_4_ElementalWorldBoneMealEvent_bonemealUsed_BonemealEvent.invoke(.dynamic) at net.minecraftforge.event.ASMEventHandler.invoke(ASMEventHandler.java:35) at net.minecraftforge.event.EventBus.post(EventBus.java:103) at net.minecraft.item.ItemDye.onItemUse(ItemDye.java:78) at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:135) at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:389) at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1327) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1810) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:846) at net.minecraft.client.Minecraft.run(Minecraft.java:771) at java.lang.Thread.run(Unknown Source) So its telling me that one of my numbers is out of bounds and that number is -9, but I've Crtl+F and looked for -9 but I can't find it, I've also looking in all of the sapling and tree file but haven't found anything, can one of you see the problem in this code: package mod.ElementalWorld; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; public class WorldGenTwistedOak extends WorldGenerator { /** * Contains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0 * and 2 for 1, and 0 and 1 for 2. */ static final byte[] otherCoordPairs = new byte[] {(byte)2, (byte)0, (byte)0, (byte)1, (byte)2, (byte)1}; /** random seed for GenBigTree */ Random rand = new Random(); /** Reference to the World object. */ World worldObj; int[] basePos = new int[] {0, 0, 0}; int heightLimit = 0; int height; double heightAttenuation = 0.618D; double branchDensity = 1.0D; double branchSlope = 0.381D; double scaleWidth = 1.0D; double leafDensity = 1.0D; /** * Currently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees. */ int trunkSize = 1; /** * Sets the limit of the random value used to initialize the height limit. */ int heightLimitLimit = 12; /** * Sets the distance limit for how far away the generator will populate leaves from the base leaf node. */ int leafDistanceLimit = 4; /** Contains a list of a points at which to generate groups of leaves. */ int[][] leafNodes; public WorldGenTwistedOak(boolean par1) { super(par1); } /** * Generates a list of leaf nodes for the tree, to be populated by generateLeaves. */ void generateLeafNodeList() { this.height = (int)((double)this.heightLimit * this.heightAttenuation); if (this.height >= this.heightLimit) { this.height = this.heightLimit - 1; } int var1 = (int)(1.382D + Math.pow(this.leafDensity * (double)this.heightLimit / 13.0D, 2.0D)); if (var1 < 1) { var1 = 1; } int[][] var2 = new int[var1 * this.heightLimit][4]; int var3 = this.basePos[1] + this.heightLimit - this.leafDistanceLimit; int var4 = 1; int var5 = this.basePos[1] + this.height; int var6 = var3 - this.basePos[1]; var2[0][0] = this.basePos[0]; var2[0][1] = var3; var2[0][2] = this.basePos[2]; var2[0][3] = var5; --var3; while (var6 >= 0) { int var7 = 0; float var8 = this.layerSize(var6); if (var8 < 0.0F) { --var3; --var6; } else { for (double var9 = 0.5D; var7 < var1; ++var7) { double var11 = this.scaleWidth * (double)var8 * ((double)this.rand.nextFloat() + 0.328D); double var13 = (double)this.rand.nextFloat() * 2.0D * Math.PI; int var15 = MathHelper.floor_double(var11 * Math.sin(var13) + (double)this.basePos[0] + var9); int var16 = MathHelper.floor_double(var11 * Math.cos(var13) + (double)this.basePos[2] + var9); int[] var17 = new int[] {var15, var3, var16}; int[] var18 = new int[] {var15, var3 + this.leafDistanceLimit, var16}; if (this.checkBlockLine(var17, var18) == -1) { int[] var19 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; double var20 = Math.sqrt(Math.pow((double)Math.abs(this.basePos[0] - var17[0]), 2.0D) + Math.pow((double)Math.abs(this.basePos[2] - var17[2]), 2.0D)); double var22 = var20 * this.branchSlope; if ((double)var17[1] - var22 > (double)var5) { var19[1] = var5; } else { var19[1] = (int)((double)var17[1] - var22); } if (this.checkBlockLine(var19, var17) == -1) { var2[var4][0] = var15; var2[var4][1] = var3; var2[var4][2] = var16; var2[var4][3] = var19[1]; ++var4; } } } --var3; --var6; } } this.leafNodes = new int[var4][4]; System.arraycopy(var2, 0, this.leafNodes, 0, var4); } void genTreeLayer(int par1, int par2, int par3, float par4, byte par5, int par6) { int var7 = (int)((double)par4 + 0.618D); byte var8 = otherCoordPairs[par5]; byte var9 = otherCoordPairs[par5 + 3]; int[] var10 = new int[] {par1, par2, par3}; int[] var11 = new int[] {0, 0, 0}; int var12 = -var7; int var13 = -var7; for (var11[par5] = var10[par5]; var12 <= var7; ++var12) { var11[var8] = var10[var8] + var12; var13 = -var7; while (var13 <= var7) { double var15 = Math.pow((double)Math.abs(var12) + 0.5D, 2.0D) + Math.pow((double)Math.abs(var13) + 0.5D, 2.0D); if (var15 > (double)(par4 * par4)) { ++var13; } else { var11[var9] = var10[var9] + var13; int var14 = this.worldObj.getBlockId(var11[0], var11[1], var11[2]); if (var14 != 0 && var14 != ElementalWorld.twistedOakLeaves.blockID) { ++var13; } else { this.setBlockAndMetadata(this.worldObj, var11[0], var11[1], var11[2], par6, 0); ++var13; } } } } } /** * Gets the rough size of a layer of the tree. */ float layerSize(int par1) { if ((double)par1 < (double)((float)this.heightLimit) * 0.3D) { return -1.618F; } else { float var2 = (float)this.heightLimit / 2.0F; float var3 = (float)this.heightLimit / 2.0F - (float)par1; float var4; if (var3 == 0.0F) { var4 = var2; } else if (Math.abs(var3) >= var2) { var4 = 0.0F; } else { var4 = (float)Math.sqrt(Math.pow((double)Math.abs(var2), 2.0D) - Math.pow((double)Math.abs(var3), 2.0D)); } var4 *= 0.5F; return var4; } } float leafSize(int par1) { return par1 >= 0 && par1 < this.leafDistanceLimit ? (par1 != 0 && par1 != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; } /** * Generates the leaves surrounding an individual entry in the leafNodes list. */ void generateLeafNode(int par1, int par2, int par3) { int var4 = par2; for (int var5 = par2 + this.leafDistanceLimit; var4 < var5; ++var4) { float var6 = this.leafSize(var4 - par2); this.genTreeLayer(par1, var4, par3, var6, (byte)1, ElementalWorld.twistedOakLeaves.blockID); } } /** * Places a line of the specified block ID into the world from the first coordinate triplet to the second. */ void placeBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger, int par3) { int[] var4 = new int[] {0, 0, 0}; byte var5 = 0; byte var6; for (var6 = 0; var5 < 3; ++var5) { var4[var5] = par2ArrayOfInteger[var5] - par1ArrayOfInteger[var5]; if (Math.abs(var4[var5]) > Math.abs(var4[var6])) { var6 = var5; } } if (var4[var6] != 0) { byte var7 = otherCoordPairs[var6]; byte var8 = otherCoordPairs[var6 + 3]; byte var9; if (var4[var6] > 0) { var9 = 1; } else { var9 = -1; } double var10 = (double)var4[var7] / (double)var4[var6]; double var12 = (double)var4[var8] / (double)var4[var6]; int[] var14 = new int[] {0, 0, 0}; int var15 = 0; for (int var16 = var4[var6] + var9; var15 != var16; var15 += var9) { var14[var6] = MathHelper.floor_double((double)(par1ArrayOfInteger[var6] + var15) + 0.5D); var14[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var15 * var10 + 0.5D); var14[var8] = MathHelper.floor_double((double)par1ArrayOfInteger[var8] + (double)var15 * var12 + 0.5D); byte var17 = 0; int var18 = Math.abs(var14[0] - par1ArrayOfInteger[0]); int var19 = Math.abs(var14[2] - par1ArrayOfInteger[2]); int var20 = Math.max(var18, var19); if (var20 > 0) { if (var18 == var20) { var17 = 4; } else if (var19 == var20) { var17 = 8; } } this.setBlockAndMetadata(this.worldObj, var14[0], var14[1], var14[2], par3, var17); } } } /** * Generates the leaf portion of the tree as specified by the leafNodes list. */ void generateLeaves() { int var1 = 0; for (int var2 = this.leafNodes.length; var1 < var2; ++var1) { int var3 = this.leafNodes[var1][0]; int var4 = this.leafNodes[var1][1]; int var5 = this.leafNodes[var1][2]; this.generateLeafNode(var3, var4, var5); } } /** * Indicates whether or not a leaf node requires additional wood to be added to preserve integrity. */ boolean leafNodeNeedsBase(int par1) { return (double)par1 >= (double)this.heightLimit * 0.2D; } /** * Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a * field that is always 1 to 2. */ void generateTrunk() { int var1 = this.basePos[0]; int var2 = this.basePos[1]; int var3 = this.basePos[1] + this.height; int var4 = this.basePos[2]; int[] var5 = new int[] {var1, var2, var4}; int[] var6 = new int[] {var1, var3, var4}; this.placeBlockLine(var5, var6, ElementalWorld.twistedOakLog.blockID); if (this.trunkSize == 2) { ++var5[0]; ++var6[0]; this.placeBlockLine(var5, var6, ElementalWorld.twistedOakLog.blockID); ++var5[2]; ++var6[2]; this.placeBlockLine(var5, var6, ElementalWorld.twistedOakLog.blockID); var5[0] += -1; var6[0] += -1; this.placeBlockLine(var5, var6, ElementalWorld.twistedOakLog.blockID); } } /** * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. */ void generateLeafNodeBases() { int var1 = 0; int var2 = this.leafNodes.length; for (int[] var3 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; var1 < var2; ++var1) { int[] var4 = this.leafNodes[var1]; int[] var5 = new int[] {var4[0], var4[1], var4[2]}; var3[1] = var4[3]; int var6 = var3[1] - this.basePos[1]; if (this.leafNodeNeedsBase(var6)) { this.placeBlockLine(var3, var5, (byte)ElementalWorld.twistedOakLog.blockID); } } } /** * Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance * (in blocks) before a non-air, non-leaf block is encountered and/or the end is encountered. */ int checkBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger) { int[] var3 = new int[] {0, 0, 0}; byte var4 = 0; byte var5; for (var5 = 0; var4 < 3; ++var4) { var3[var4] = par2ArrayOfInteger[var4] - par1ArrayOfInteger[var4]; if (Math.abs(var3[var4]) > Math.abs(var3[var5])) { var5 = var4; } } if (var3[var5] == 0) { return -1; } else { byte var6 = otherCoordPairs[var5]; byte var7 = otherCoordPairs[var5 + 3]; byte var8; if (var3[var5] > 0) { var8 = 1; } else { var8 = -1; } double var9 = (double)var3[var6] / (double)var3[var5]; double var11 = (double)var3[var7] / (double)var3[var5]; int[] var13 = new int[] {0, 0, 0}; int var14 = 0; int var15; for (var15 = var3[var5] + var8; var14 != var15; var14 += var8) { var13[var5] = par1ArrayOfInteger[var5] + var14; var13[var6] = MathHelper.floor_double((double)par1ArrayOfInteger[var6] + (double)var14 * var9); var13[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var14 * var11); int var16 = this.worldObj.getBlockId(var13[0], var13[1], var13[2]); if (var16 != 0 && var16 != ElementalWorld.twistedOakLeaves.blockID) { break; } } return var14 == var15 ? -1 : Math.abs(var14); } } /** * Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height * limit, is valid. */ boolean validTreeLocation() { int[] var1 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; int[] var2 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; int var3 = this.worldObj.getBlockId(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); if (var3 != 2 && var3 != 3) { return false; } else { int var4 = this.checkBlockLine(var1, var2); if (var4 == -1) { return true; } else if (var4 < 6) { return false; } else { this.heightLimit = var4; return true; } } } /** * Rescales the generator settings, only used in WorldGenBigTree */ public void setScale(double par1, double par3, double par5) { this.heightLimitLimit = (int)(par1 * 12.0D); if (par1 > 0.5D) { this.leafDistanceLimit = 5; } this.scaleWidth = par3; this.leafDensity = par5; } public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { this.worldObj = par1World; long var6 = par2Random.nextLong(); this.rand.setSeed(var6); this.basePos[0] = par3; this.basePos[1] = par4; this.basePos[2] = par5; if (this.heightLimit == 0) { this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); } if (!this.validTreeLocation()) { return false; } else { this.generateLeafNodeList(); this.generateLeaves(); this.generateTrunk(); this.generateLeafNodeBases(); return true; } } }
-
Configuration File
Just wondering, but how much information can you put on the configuration file?
- Animated Blocks???
-
Animated Blocks???
So does anyone know what to use for animated block? Or can anyone show me a tutorial on this?
-
Achievement not Working
Wow. I feel so stupid. Sorry everyone. I figured out the problem. I had the code addAchievementLocalizations() instead of this.addAchievementLocalizations(). So I'm all sorry for your inconvenience. I shall be going now. If anybody knows much about adding a mob, could you check out my topic about it here: http://www.minecraftforge.net/forum/index.php/topic,5558.0.html (My mob won't pickup items and this time its not a typo (hopefully))
-
Achievement not Working
Each one prints out 10240, which is what I set the ID to.
-
Achievement not Working
I've deleted it because it doesn't work. I even copied madriff's code but it still doesn't work even when I rename the things. import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import cpw.mods.fml.common.IPickupNotifier; public class AchievementPickupManager implements IPickupNotifier { @Override public void notifyPickup(EntityItem item, EntityPlayer player) { if(item.getEntityItem().itemID == ElementalWorld.magicEco.itemID) { player.addStat(ElementalWorld.MagicAchieve, 1); } } } EDIT: Forgot to say that I've added System.out.println("Test"); to test whether it works and everything works besides notifyPickup. So the class is working. But for somereason the item.getEntityItem().itemID is returning a different itemID than the magicEco.itemID even when I pickup the item.
-
Achievement not Working
No I am not. I knew that existed. I ahve tried that. But FOR SOME REASON IT DOESN"T WORK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I'm going to give up now. Goodbye.
-
MOB HOLDING ITEMS AND MOB SPAWNING WITH ITEMS.
Okay I tried that, still didn't fix it. It added more issues. My mobs act like zombies (on fire in sun, converting villagers). Then I decided to override those in my Entity file. But that just screwed everything up and still didn't fix it. So... You might have to look at the code, because I can't figure it out.
-
Achievement not Working
Guys Here is what my EntityItem.java is: http://pastebin.com/wVH1GbPc Could you compare to yours (The ones of you that have func_92014_d()) and tell me what it's been renamed too.
-
Achievement not Working
Here is the code: /** * Gets the username of the entity. */ public String getEntityName() { return StatCollector.translateToLocal("item." + this.getEntityItem().getItemName()); } I tried earlier today to use event.item.getEntityName(). I used system.out.println to print the name of the item and got this: item.item.magicEco. So then i decided to use this code to check for the right item: if(event.item.getEntityName() == "item.item.magicEco") and then added a println to check if it worked, but it never worked, even though the name was the same each time. P.S. like I said before could you look at the updated PasteBin link I put in the topic about the Mob Holding Item issue.
IPS spam blocked by CleanTalk.