Jump to content

ColdFox

Members
  • Posts

    52
  • Joined

  • Last visited

Everything posted by ColdFox

  1. Animated textures load as an animation time strip. If you want to keep the animation, the use the size of just the frame and allow it to tick. Either way, use the single frame size, not the strip size. I managed to force the size to 14x14 but the thing is that I only want that when the texture is animated. Is there any way to get the resource pack path?
  2. I've several custom blocks that use the textures from the game. So if you load a resource pack, they also use those textures. The problem that I'm facing now is when they try to use a animated texture. The renderer resizes the texture and applies it to the block, like so:
  3. In the 1.6.4 version my blocks were rendered like this: public class ItemRendererInventoryColumn implements IItemRenderer{ private ModelColumnBlock model; public ItemRendererInventoryColumn(){ model = new ModelColumnBlock(); } public boolean handleRenderType(ItemStack item, ItemRenderType type) { return true; } public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,ItemRendererHelper helper) { return true; } public void renderItem(ItemRenderType type, ItemStack item, Object... data) { TileEntityRenderer.instance.renderTileEntityAt(new ColumnTileEntity().setBlockTypeAndMeta(mod_MoreBlocksMod.columnBlock.get(item.itemID-mod_MoreBlocksMod.columnBlockIDFinal),0), 0.0D, 0.0D, 0.0D, 0.0F); } but now there's no TileEntityRenderer class. I searched for a "renderTileEntityAt" and found the TileEntitySpecialRenderer class, however I can't use that method because is static. Does anyone knows what can I do?
  4. The way I was imagining it would create the recipes dynamically according with the number of mods. In this case, I've a basic block with a custom model and its texture depends of the block that you use to craft it. What he suggested was a recipe that you could do with a any block, including blocks from mods. But I'm not worried about this, thanks anw
  5. A player suggested me to create crafting recipes in my mod with blocks from other mods, but is it possible? I think that it can't be done because when I register the crafting recipes the Registry has to have the blocks registered.
  6. I forgot to override the method renderAsNormalBlock() so the tile entity had a normal block "size". Thanks anyway
  7. So I tried like this: @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { int l = par1World.getBlockMetadata(par2, par3, par4); switch(l){ case 0: return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.5, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 1, (double)par4 + 1); case 1: return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.0, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 0.5, (double)par4 + 1); case 2: return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.0, (double)par4 + 0.5, (double)par2 + 1, (double)par3 + 1, (double)par4 + 1); case 3: return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.0, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 1, (double)par4 + 0.5); case 4: return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.5, (double)par3+0.0, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 1, (double)par4 + 1); case 5: return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.5, (double)par4 + 0.0, (double)par2 + 0.5, (double)par3 + 1, (double)par4 + 1); default: System.err.println("Something went wrong. Invalid metadata."); return AxisAlignedBB.getAABBPool().getAABB((double)par2 + 0.0, (double)par3+0.5, (double)par4 + 0.0, (double)par2 + 1, (double)par3 + 1, (double)par4 + 1); } } and it's the same I also tried with different values but or it's the same, or it's almost like a normal block. EDIT: Fixed, I forgot the method /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ public boolean renderAsNormalBlock() { return false; } :facepalm:
  8. thanks for saving me again, gonna try it later
  9. I've a block with a tile entity for use a custom model and I've set the block bounds. The problem is that when the player's head gets into the "normal" block area, the player gets pushed away from it as it would happen when the player collides with a entity. Am I missing something? SlabBlock SlabTileEntity
  10. can you give me an example of what to do? =/ like how do I save the subtype into the TileEntity and how to do so the "block" knows what subtype drop
  11. Seriously? That doesn't "reset" the values for your tile entity. That creates a new tile entity with its OWN values. When you're seeing the values as 0, THAT'S THE ONE IN YOUR INVENTORY. Ok... my bad I was handling the wrong tile entities, the problem is fixed. I still need a little help but it's not related with this thread. I need to have more than 16 subtypes of a block, the problem is that I can't use metadata, otherwise it would be done. Right now I'm using metadata, as you can see in the class above. It works fine except when I break a block with a subID >15. What can I do to make it work, so that when the block breaks it will drop the correct block?
  12. I also have this class, that I found that it's "reseting" the values of the tile entity When I don't use it, the values are ok. So now the problem is how to render the custom block model in the inventory.
  13. I've it on the load method GameRegistry.registerTileEntity(mods.MoreBlocksMod.BaseDownTileEntity.class, "baseDownTileEntity");
  14. Ok... the code; BaseDownBlock BaseDownTileEntity
  15. My tile entities instead of giving me the coordinates when I do this.xCoord (for example), they give me always 0. What am I doing wrong?
  16. How do I get the EntityPlayerMP from the event? I made it work like this @ForgeSubscribe public void preventInvalidBlocks(PlayerInteractEvent event) { try { if (event.action == event.action.RIGHT_CLICK_BLOCK && Block.blocksList[event.entityPlayer.inventory.getCurrentItem().itemID].getFlammability(null, 0, 0, 0, 0, null)>0) { int x = event.x; int y = event.y; int z = event.z; int face = event.face; switch(face){ case 0: --y; break; case 1: ++y; break; case 2: --z; break; case 3: ++z; break; case 4: --x; break; case 5: ++x; break; } if(event.entityLiving instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entityLiving; //player.inventory.decrStackSize(player.inventory.currentItem, 1); int newStackSize = player.inventory.mainInventory[player.inventory.currentItem].stackSize - 1; for (int j = 0; j < MinecraftServer.getServer().worldServers.length; j++) { if(player.inventory.mainInventory[player.inventory.currentItem].stackSize != newStackSize){ MinecraftServer.getServer().worldServers[j].getPlayerEntityByName(player.username). inventory.decrStackSize(player.inventory.currentItem, 1); //It seems to be necessary otherwise the player wouldn't catch on fire when walking over it MinecraftServer.getServer().worldServers[j].setBlock(x, y, z, Block.fire.blockID); break; } } } event.setCanceled(true); System.out.println("Invalid block placed!"); } } catch (NullPointerException e) { System.out.println(e.getMessage()); } }
  17. How do I get the EntityPlayerMP from the event?
  18. So I've this code: @ForgeSubscribe public void preventInvalidBlocks(PlayerInteractEvent event) { try { if (event.action == event.action.RIGHT_CLICK_BLOCK && Block.blocksList[event.entityPlayer.inventory.getCurrentItem().itemID].getFlammability(null, 0, 0, 0, 0, null)>0) { int x = event.x; int y = event.y; int z = event.z; int face = event.face; switch(face){ case 0: --y; break; case 1: ++y; break; case 2: --z; break; case 3: ++z; break; case 4: --x; break; case 5: ++x; break; } if(event.entityPlayer.inventory.getCurrentItem().stackSize>0) event.entityPlayer.inventory.getCurrentItem().stackSize--; //It seems to be necessary otherwise the player wouldn't catch on fire when walking over it for (int j = 0; j < MinecraftServer.getServer().worldServers.length; j++) { MinecraftServer.getServer().worldServers[j].setBlock(x, y, z, Block.fire.blockID); } event.setCanceled(true); System.out.println("Invalid block placed!"); } } catch (NullPointerException e) { System.out.println(e.getMessage()); } } and it places fire instead the block. this part works well, the only problem seems to be reducing the size of the itemstack. I tried many ways and didn't succeed. What happens is that the stacks loses an item but it have it back immediately. Example: I've 64 wooden planks. I place one on the ground and it's replaced by fire. The stacksize drops to 63 and goes back to 64.
  19. How do I "tell" to the renderer to use another texture?
  20. The Arm is rendered using the player's skin.
  21. In my mod I've a armor that's supposed to cover all the body. In 3rd person view it does because it only depends of the armor's texture, but I also want to change it 1st person view. I would like to have the arm covered with the armor when the player is using the chest plate. Can anyone help me?
  22. The items could have a smeltingTime attribute because if we think it doens't make sense have some items with the same time. Thank's for your answer, I just needed to know if it was possible or not. About the furnace, I'm fine with the code
  23. Where's that return? Note, this item is not the fuel, but the item that's gonna me transformed.
×
×
  • Create New...

Important Information

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