
ColdFox
Members-
Posts
52 -
Joined
-
Last visited
Everything posted by ColdFox
-
I've a custom item that I use as a input of a smelting recipe, but I would like to change the time that it takes to smelt. Anyone knows how can I do that?
-
Already fixed it. I searched in the EntityPlayer class and found a solution. player.inventory.damageArmor(int ammount);
-
So I've this code if (player.isBurning()) { itemstack0.damageItem(3, player); itemstack1.damageItem(4, player); itemstack2.damageItem(5, player); itemstack3.damageItem(5, player); } in the onArmorTickUpdate of my helmet. It works fine until the damage reaches to 0, then a new item appears and continues to damage. When I remove the new item, and them try to shift-click, it doesn't go automatically for the armor slot. Can any one tell me why aren't the items being broke?
-
Control blocks that can be place in a custom dimension
ColdFox replied to ColdFox's topic in Modder Support
there's is one but only for the interaction with a block, I don't think that it works for the placement -
Control blocks that can be place in a custom dimension
ColdFox replied to ColdFox's topic in Modder Support
To do that I think that I've to change the Block.java -
Control blocks that can be place in a custom dimension
ColdFox replied to ColdFox's topic in Modder Support
That's sounds like a solution but I don't think that's the best one. But thanks anyway, I'm gonna try that out. Btw,aren't those xCoord and zCoord always the same? That way it would only check the blocks above and below. And do a layer of only the blocks with this tile entity would be kinda stupid -
Control blocks that can be place in a custom dimension
ColdFox replied to ColdFox's topic in Modder Support
All blocks. If it was with my blocks it would be easy -
There's anyways to control what happens to a block when is placed by the player in a custom dimension without, of course, having to change the Block.java file?
-
I fixed it today with that, and only saw your reply when I was closing this thread, thanks anyway
-
Packets are generally a good idea to sync the server and client. Which seems to be the case here. If there is a "ghost entity" that would be (I think) the server thinking there is an entity there, but the actual client is making the entity without letting the server know the entity is made... Just a plain ole me rambling on This may or may not be the case... Thanks, I'll try that latter
-
Already tried that. It happens the same, except the ghost goes into the ground and some time after killing the real entity the server crashes.
-
When I spawn a entity, in this case a Blaze, it also appears another Blaze but I can't do anything to it. It only disappears when I reenter in the world. Any help? public boolean onBlockActivated(World par1World, int x, int y, int z,EntityPlayer par5EntityPlayer, int par6, float par7, float par8,float par9) { EntityBlaze blaze1 = new EntityBlaze(par1World); blaze1.setPosition(x, y+3, z); blaze1.spawnExplosionParticle(); par1World.spawnEntityInWorld(blaze1); return true; }
-
So, as far as I know and I can see in the original files, helmet is type 0 of armor, chestplate type 1, leggins type2 and boots type 3. But I've a method to check if the player has a full set of armor and to work properly I had to invert those indexes. Here's the code... public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { if ( player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null ) { ItemStack itemstack0 = player.inventory.armorItemInSlot(3); ItemStack itemstack1 = player.inventory.armorItemInSlot(2); ItemStack itemstack2 = player.inventory.armorItemInSlot(1); ItemStack itemstack3 = player.inventory.armorItemInSlot(0); if ( itemstack0.itemID == SunSonMod.fireProtectedHelmet.itemID && itemstack1.itemID == SunSonMod.fireProtectedPlate.itemID && itemstack2.itemID == SunSonMod.fireProtectedLegs.itemID && itemstack3.itemID == SunSonMod.fireProtectedBoots.itemID ) { player.addPotionEffect(new PotionEffect(Potion.fireResistance.id,10,10)); } } } Is this normal or I did something wrong? It's working but I'm afraid that it may causes problems in the future.
-
I tried and still the same. When I'm in lava I don't lose hp but when I jump out I start taking damage
-
I'm trying to do a set of armor that when the player is full equipped he will be fireproof (no damage when in lava or in touch with fire). For now it work well when I'm in lava but when I jump out I still burning and start to lose hp. Any help? I tried this way and the commented way: public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { EntityPlayer player = (EntityPlayer) par3Entity; if ( player.inventory.armorItemInSlot(0) != null && player.inventory.armorItemInSlot(1) != null && player.inventory.armorItemInSlot(2) != null && player.inventory.armorItemInSlot(3) != null ) { ItemStack itemstack0 = player.inventory.armorItemInSlot(0); ItemStack itemstack1 = player.inventory.armorItemInSlot(1); ItemStack itemstack2 = player.inventory.armorItemInSlot(2); ItemStack itemstack3 = player.inventory.armorItemInSlot(3); if ( itemstack0.itemID == SunSonMod.fireProtectedHelmet.itemID && itemstack1.itemID == SunSonMod.fireProtectedPlate.itemID && itemstack2.itemID == SunSonMod.fireProtectedLegs.itemID && itemstack3.itemID == SunSonMod.fireProtectedBoots.itemID ) { /*if(player.isBurning()){ player.extinguish(); }*/ if(!itemstack0.isItemEnchanted() && !itemstack1.isItemEnchanted() && !itemstack2.isItemEnchanted() && !itemstack3.isItemEnchanted()){ itemstack0.addEnchantment(Enchantment.fireProtection, 1000); itemstack1.addEnchantment(Enchantment.fireProtection, 1000); itemstack2.addEnchantment(Enchantment.fireProtection, 1000); itemstack3.addEnchantment(Enchantment.fireProtection, 1000); } } } }
-
try this worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, (float)this.explosionRadius, true, true);
-
FIXED: I just limited the size of the ArrayList to a low number.
-
I tried to replace the blocks on the server, but I think that I need something to control the replacement speed because it's crashing the game.
-
It would not. Read my code. I did exactly that in a very old mod of mine, it works just fine. Link: http://www.minecraftforum.net/topic/1246526-132-betterpressureplates-pressure-plates-that-adapt-to-the-block-below-beta/ That's for 1.3.2, it may not work now. But someone try it and let us know
-
Read above. E.g.: he places the first mine on top of dirt. The mine would have the dirt texture. He places the second mine on top of stone, both mines would change to stone.
-
Won't work. All instances of the block would share textures. As soon as you placed a second one that was on top of a different block, the first one would change. (Tip: block classes are not instanced for each block in the world, there is only a single instance of every block class) I forgot about that. Well... he could create a different block for each texture (the most common), or just use a transparent texture
-
I have a ArrayList that stores info about blocks that are changed and a method to restore them. But only two types of block are stored, waterMoving and waterStill. The ArrayList stores a object with ID, x, y and z values of each block. When the method is called, the blocks are replaced but, in game, if I jump to one I get stuck and if I place a block on top the water, it turns into the old block. Here's the code of restoreBlocks method. Can anyone tell me what's wrong/missing? public void restoreBlocks(World par1World){ if(!blocksChanged.isEmpty()){ for(int i=0;i<blocksChanged.size();i++){ par1World.setBlockToAir(blocksChanged.get(i).getX(), blocksChanged.get(i).getY(), blocksChanged.get(i).getZ()); par1World.setBlock(blocksChanged.get(i).getX(), blocksChanged.get(i).getY(), blocksChanged.get(i).getZ(), blocksChanged.get(i).getID()); } blocksChanged.clear(); } }
-
Try something like this int blockID = par1World.getBlockID(blockX, blockY, blockZ); Block b0 = Block.blockList[blockID]; b0.getIcon(side, metadata);
-
That did the trick
-
I would assume that the block get's unloaded since the player is far away and the whole chunk get's unloaded? The chunk doesn't unload, because I only get like 30 or 40 blocks away from the block. But it may unload if I go farther, that way what can I do?