Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi Post the crash log and your updated IBSRH? Pls use https://gist.github.com/ for your code so we can see the line numbers... -TGG
  2. Hi I think the problem is that you've copied bits of Dragonisser's code without really understanding what it's doing? This bit for example.. if (par1ItemStack.getItemDamage() > 0) { entityplayer.fallDistance = 0.0F; } The key bit from Dragonisser's code is that he is using the ItemDamage as a counter. The rest is irrelevant to you. So to troubleshoot the cooldown problems you're having, I think the best way is to add a diagnostic to your code, you can see Dragonisser already had one there which for sure will help a lot So for example if (par1ItemStack.getItemDamage() < par1ItemStack.getMaxDamage()) { par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - 1); System.out.println(par1ItemStack.getItemDamage()); // uncomment this line } and if (player.capabilities.isCreativeMode || player.inventory.hasItem(Items.arrow)) { System.out.println("Attempt to fire stack " + stack + " with getItemDamage() == " + stack.getItemDamage()); // add this in if (stack.getItemDamage() == 0){ player.inventory.consumeInventoryItem(Items.arrow); //stack.attemptDamageItem(damageItem, itemRand); Then look in the console for the diagnostic information and see what happens when you try to use the wand. -TGG
  3. Hi Which line is ChunkProviderPuplet:244? -TGG
  4. How exactly do I do this? There you go ^^ -TGG
  5. no worries, you're welcome, glad to help a fellow pilgrim on the road to Minecraft enlightenment -TGG
  6. Hi Well I've wrestled with it a bit with no luck. It just seems to disappear into the void and never pop out the other side. I tried tracing through to see why but it will take a more powerful brain than mine to understand what's going on in all those channels and listeners and contexts. It does appear to have something to do with the fact you're sending it from a GUI . When I move the send command to a client-side event eg @SubscribeEvent public void onKey(InputEvent.KeyInputEvent event) { Main.snw.sendToServer(new Request("test")); } then it works fine. I'm at the limits of my knowledge here, sorry. Perhaps folks who have used GUI before might be more help... -TGG
  7. Hi Instead of onImpact, you could try overriding onUpdate (don't forget super.onUpdate() as the first line) to check if the entity position is in a water block. getBlock should work fine there. -TGG
  8. Hi Your code doesn't seem to have anything in it to open your PerkGUI for testing, how were you testing it? -TGG
  9. Could be; although packets work fine for me on 1230 Post your project code somewhere, I can give it a try over the next day? -TGG
  10. I'm with dieSieben, can't see anything wrong. Time for a couple of breakpoints in the forge code I think. Been there myself trying to debug network code and it was moderately painful. You might try first putting a breakpoint in FMLProxyPacket.processPacket, or NetworkManager.processReceivedPackets to see if your packet arrives but just isn't handled correctly . A lot of packets go through there so I'd suggest you add a precondition to it, i.e. put a second breakpoint in your command send method and then "Disabled until selected breakpoint is hit" (IntelliJ) for your FMLProxyPacket breakpoint. Hopefully yours won't be too far down the queue then. -TGG
  11. Hi Assuming you're using IDEA, it looks to me like you have set your resources folder as a 'source root' rather than a 'resources root'. So when you build it, it may not be copying the resources across to the compiled mod folder. Try changing it to resources root (do you know how to do that?) -TGG
  12. int z = this.yCoord + dirs.offsetZ; aiieee!!! look very carefully -TGG
  13. Hi If you for some reason just want the TileEntities in a given chunk, you can use Chunk.chunkTileEntityMap which contains all TileEntities in the chunk, hashed by their ChunkPosition. -TGG
  14. /** * Performs a ray trace for the distance specified and using the partial tick time. Args: distance, partialTickTime */ @SideOnly(Side.CLIENT) public MovingObjectPosition rayTrace(double p_70614_1_, float p_70614_3_) It is not valid to call rayTrace on the server, and will probably cause random crashes. I'd suggest you copy the code to your own class, it's not complicated. Use Entity.eyeHeight() to compensate for the eye height difference on the client and server -TGG
  15. Hi Could you explain your algorithm a bit? I'm not clear what it's supposed to do (and how it's supposed to do it) By the way, did you know that the player y position on the server corresponds to player feet, but the player y position on the client corresponds to the player eyes? There is a Entity method called eyeHeight or something similar which helps you correct for that. -TGG
  16. Hi THat message isn't actually a memory leak error. It tells you that you are receiving a message but don't have a handler registered for it on that side. If you search the Forge code for that error message string, and put a breakpoint there, you can inspect the packet (IMessage) it's currently processing to find out which IMessage has the missing handler. -TGG
  17. Mods. To be honest I don't think most people will really care much -TGG
  18. Yeah that's right. where does registerTESR() get called from? -TGG
  19. Hi Try putting System.out.println("render called"); into your renderTileEntityAt. That will show you whether your rendering code has a problem or whether you just haven't registered the TileEntity & Renderer properly. -TGG
  20. Hi Are you sure your .thirdPersonView code in onFoodEaten or onEaten is being called? I have a suspicion that onEaten might not be called on the client. You could test that by putting System.out.println("Side: " + (world.isRemote ? "client" : "server")); at the top of onEaten. -TGG
  21. ? I dont have no code, thats why i am asking I think he means >I already have a texture and its working in the inventory but looks super weird when the player is holding it You're saying it looks fine in the inventory (transparent?) but not when the player is holding it. So you obviously have some code already and perhaps some screenshots? I'm not sure whether you want an item like glass (which is either fully opaque or fully transparent) or whether you want something like the ice block (which is partially transparent and uses alpha blending). Both fully transparent and partially transparent use alpha channels. This link might help understand item rendering http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-items.html This link for transparency (with blocks) http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html You can achieve what you want using an IItemRenderer with the following code in it GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // render here GL11.glPopAttrib(); Useful background info here http://www.glprogramming.com/red/chapter06.html -TGG
  22. Hi >Oh, okay. I went is far as the EntityRegistry.addSpawn, then started looking in SpawnListEntry instead. You were close just needed to search for SpawnListEntry "new instance creation". And actually, if you do that, it will bring up a stack of other places too that I didn't mention, for other non-default biomes where the spawning rates are different. eg BiomeGenForest, BiomeGenJungle, etc > Thanks for you help. No worries! -TGG
  23. Hi FYI how I found this info: 1) EntityRegistry.addSpawn: public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes) { for (BiomeGenBase biome : biomes) { @SuppressWarnings("unchecked") List<SpawnListEntry> spawns = biome.getSpawnableList(typeOfCreature); for (SpawnListEntry entry : spawns) { //Adjusting an existing spawn entry if (entry.entityClass == entityClass) { entry.itemWeight = weightedProb; entry.minGroupCount = min; entry.maxGroupCount = max; break; } } spawns.add(new SpawnListEntry(entityClass, weightedProb, min, max)); } } So my new spawns are being added to biome.getSpawnableList(), which is /** * Returns the correspondent list of the EnumCreatureType informed. */ public List getSpawnableList(EnumCreatureType p_76747_1_) { return p_76747_1_ == EnumCreatureType.monster ? this.spawnableMonsterList : (p_76747_1_ == EnumCreatureType.creature ? this.spawnableCreatureList : (p_76747_1_ == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (p_76747_1_ == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null))); } which shows me I'm looking for spawnableMonsterList, spawnableCreatureList, etc depending on the water type. Go to usage of spawnableMonsterList gives me BiomeGenBase constructor --> this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4)); this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4)); this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4)); this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4)); this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4)); this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4)); this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4)); this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4)); this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4)); this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4)); this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1)); this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4)); this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, ); Jackpot! -TGG
  24. Hi Leaves are unusual because vanilla changes their colour depending on the biome (see vanilla code below). BlockLeaves:: /** * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called * when first determining what to render. */ @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_, int p_149720_3_, int p_149720_4_) { int l = 0; int i1 = 0; int j1 = 0; for (int k1 = -1; k1 <= 1; ++k1) { for (int l1 = -1; l1 <= 1; ++l1) { int i2 = p_149720_1_.getBiomeGenForCoords(p_149720_2_ + l1, p_149720_4_ + k1).getBiomeFoliageColor(p_149720_2_ + l1, p_149720_3_, p_149720_4_ + k1); l += (i2 & 16711680) >> 16; i1 += (i2 & 65280) >> 8; j1 += i2 & 255; } } return (l / 9 & 255) << 16 | (i1 / 9 & 255) << 8 | j1 / 9 & 255; } If you want to stop it, either don't inherit from BlockLeaves, or @override colorMultiplier (eg to return 0xffffff;) Although, come to think of it, a blue texture should never look green regardless of what multiplier you return. Give it a try anyhow, it might help... -TGG
  25. Ha welcome to the world of Minecraft modding, happens to me regularly too > The Icon is name particleIcon and is inside the BlockPosion.class so wouldn't it be setParticleIcon(BlockPoison.particleIcon); Maybe BlockPosion.particleIcon is still null at the point you copy it, if the BlockPoison hasn't been set up yet. A breakpoint will show you.. Alternatively a breakpoint in your particle renderer will let you look at the IIcon and see what's wrong with it -TGG
×
×
  • Create New...

Important Information

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