Jump to content

Whyneb360

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by Whyneb360

  1. Is there any other way you would be able to do it? If not, what do I have to change in my code to make it work. Like I said in one of my above posts, the Sysout in: public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) { int l = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, l, 2); System.out.println(l); } } works, but the Sysout in: public class RenderBoard extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(Main.modID + ":" + "textures/props/BoardTexture.png"); private ModelBoard model; public RenderBoard() { this.model = new ModelBoard(); } @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { World world = tileEntity.getWorldObj(); int dir = world.getBlockMetadata((int)x, (int)y, (int)z); System.out.println(dir); GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); GL11.glRotatef(dir * (-90F), 0F, 1F, 0F); this.bindTexture(texture); this.model.renderModel(0.0625F); GL11.glPopMatrix(); } } Doesn't work (just puts out a constant stream of 0s when one of the blocks is placed in the world. I'm not exactly sure, but I would hazard a guess that the metadata is being stored or read properly. Thanks, -Whyneb360
  2. Thanks for the help, but it still isn't placing the way I am facing. I only changed the render class, so I will re-post that (in case I messed something up) public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) { int l = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; world.setBlockMetadataWithNotify(x, y, z, l, 2); System.out.println(l); } }
  3. So I have attempted some debugging to help determine the error, and it seems that in the code below, the Sysout on the onBlockPlacedBy method is all good, but the Sysout for the 'dir' integer in the Render class is only printing continuous 0s. I imagine this means that the rotation stuff is working, but the metadata isn't being set (that or I got the Sysout wrong). My problem is still that the block placed with no errors, but the model doesn't rotate when it's placed from different directions. The game sometimes gives off an error about the tile entity missing a mapping, but I'm not sure if that has anything to do with it. BoardProp: public class BoardProp extends BlockContainer { public BoardProp(Material material) { super(material); this.setCreativeTab(DesconCreativeTabs.tabGeneral); this.setHarvestLevel("axe", 1); this.setHardness(1F); this.setBlockBounds(0F, 0F, 1F, 1F, 1F, 0.875F); this.setBlockTextureName(Main.modID + ":" + "textures/blocks/board.png"); } public int getRenderType() { return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World var1, int var2) { return new TileEntityBoard(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon(Main.modID + ":" + this.getUnlocalizedName().substring(5)); } //Directional Bollocks public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) { int l = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if (l == 0) { world.setBlockMetadataWithNotify(x, y, z, 0, l); System.out.println("0"); } if (l == 1) { world.setBlockMetadataWithNotify(x, y, z, 1, l); System.out.println("1"); } if (l == 2) { world.setBlockMetadataWithNotify(x, y, z, 2, l); System.out.println("2"); } if (l == 3) { world.setBlockMetadataWithNotify(x, y, z, 3, l); System.out.println("3"); } } } RenderBoard: public class RenderBoard extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(Main.modID + ":" + "textures/props/BoardTexture.png"); private ModelBoard model; public RenderBoard() { this.model = new ModelBoard(); } @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { World world = tileEntity.getWorldObj(); int dir = world.getBlockMetadata((int)x, (int)y, (int)z); System.out.println(dir); GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); GL11.glRotatef(dir * (-90F), 0F, 1F, 0F); this.bindTexture(texture); this.model.renderModel(0.0625F); GL11.glPopMatrix(); } } Thanks, -Whyneb360
  4. When I say doesn't work, it loads up the game, and I can place the model, but it faces the same direction no matter which way I face EDIT: I'll clarify that, the Sysout works and changes, but the model doesn't rotate
  5. Okay, at this point, I have this code: Render: public class RenderBoard extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(Main.modID + ":" + "textures/props/BoardTexture.png"); private ModelBoard model; public RenderBoard() { this.model = new ModelBoard(); } @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { World world = tileEntity.getWorldObj(); int dir = world.getBlockMetadata((int)x, (int)y, (int)z); GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); GL11.glRotatef(dir * (90F), 0F, 1F, 0F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } Block Class: public class BoardProp extends BlockContainer { public BoardProp(Material material) { super(material); this.setCreativeTab(DesconCreativeTabs.tabGeneral); this.setHarvestLevel("axe", 1); this.setHardness(1F); this.setBlockBounds(0F, 0F, 1F, 1F, 1F, 0.875F); this.setBlockTextureName(Main.modID + ":" + "textures/blocks/board.png"); } public int getRenderType() { return -1; } public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } @Override public TileEntity createNewTileEntity(World var1, int var2) { return new TileEntityBoard(); } @SideOnly(Side.CLIENT) public void registerBlockIcons(IIconRegister iconRegister) { this.blockIcon = iconRegister.registerIcon(Main.modID + ":" + this.getUnlocalizedName().substring(5)); } //Directional Bollocks public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) { int l = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i1 = world.getBlockMetadata(x, y, z) & 4; if (l == 0) { world.setBlockMetadataWithNotify(x, y, z, 1 | i1, 2); System.out.println("0"); } if (l == 1) { world.setBlockMetadataWithNotify(x, y, z, 2 | i1, 2); System.out.println("1"); } if (l == 2) { world.setBlockMetadataWithNotify(x, y, z, 3 | i1, 2); System.out.println("2"); } if (l == 3) { world.setBlockMetadataWithNotify(x, y, z, 4 | i1, 2); System.out.println("3"); } } } But it still doesn't work. Anything look wrong?
  6. Seeing the kind of stuff I want to do in my mod, and given my limited understanding of the environment, I will definitely be taking up some Java courses to get the basics down. Until I do though, I am getting an error here: @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { World world = tileEntity.getWorldObj(); int dir = world.getBlockMetadata(x, y, z); GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); GL11.glRotatef(dir * (-90F), 0F, 1F, 0F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } at int dir = world.getBlockMetadata(x, y, z) it wants me to change getBlockMetadata to getBlock. Specifically it says that getBlockMetadata (int, int, int) is not applicable for the arguments double, double, double. Any ideas?
  7. Again, sorry if I have made a rookie mistake, but should I be putting the tileEntity.getWorldObj() in the renderTileEntityAt method and then have the world.getBlockMetadata stright after that? If so, how should I tell the Java that world is the above tileEntity line? This is what I have now (Block class unchanged): public class RenderBoard extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(Main.modID + ":" + "textures/props/BoardTexture.png"); private ModelBoard model; public RenderBoard() { this.model = new ModelBoard(); } @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) { tileEntity.getWorldObj(); int dir = world.getBlockMetadata(x, y, z); GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); GL11.glRotatef(dir * (-90F), 0F, 1F, 0F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } Thanks for all your help so far
  8. So with the world.getBlockMetadata, does that replace the getBlockNotify thing or is it meant to go somewhere else? Also, where would I put the tileEntity.getWorldObj() as I already have a parameter 'World world' for getting the world. And sorry, the switch statement was just me trying out some different ideas when I was testing Here is my code now (Forgive me if I placed the world.getBlockMetadata in the wrong place): public int metadir; public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) { int l = MathHelper.floor_double((double)(player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i1 = world.getBlockMetadata(x, y, z) & 4; if (l == 0) { world.getBlockMetadata(x,y,z); metadir = 0; System.out.println("0"); } if (l == 1) { world.getBlockMetadata(x,y,z); metadir = 1; System.out.println("1"); } if (l == 2) { world.getBlockMetadata(x,y,z); metadir = 2; System.out.println("2"); } if (l == 3) { world.getBlockMetadata(x,y,z); metadir = 3; System.out.println("3"); } } And: public class RenderBoard extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(Main.modID + ":" + "textures/props/BoardTexture.png"); private ModelBoard model; public RenderBoard() { this.model = new ModelBoard(); } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); GL11.glRotatef(metadir * (-90F), 0F, 1F, 0F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } Though I still haven't figured out how to reference the metadir from my directional methods into my class with the GL11.glRotatef stuff. Thanks, -Whyneb360
  9. Make sure your lang file really is a lang file, not just a text document under the path {resources/assets/bg/lang/en_US.lang} . Also, you have referenced the texture to be in a folder called items at {resources/assets/bg/textures/items/[yourtexturehere]}, so check that the path is right
  10. That's what I though originally, but when I take away the static variable I get an error with int dir = BoardProp.metadir; I imagine I am just missing something obvious, so apologies in advance
  11. I have been messing around with this idea a bit, but all I have is this - doesn't work yet: Block Class public static int metadir = 1; public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { int l = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; int i1 = p_149689_1_.getBlockMetadata(p_149689_2_, p_149689_3_, p_149689_4_) & 4; if (l == 0) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 2 | i1, 2); metadir = 1; } if (l == 1) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 1 | i1, 2); metadir = 2; } if (l == 2) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 3 | i1, 2); metadir = 3; } if (l == 3) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 0 | i1, 2); metadir = 4; } switch (metadir) { case 1: System.out.println("1"); break; case 2: System.out.println("2"); break; case 3: System.out.println("3"); break; case 4: System.out.println("4"); break; default: break; } } Render Class public class RenderBoard extends TileEntitySpecialRenderer { private static final ResourceLocation texture = new ResourceLocation(Main.modID + ":" + "textures/props/BoardTexture.png"); private ModelBoard model; int dir = BoardProp.metadir; public RenderBoard() { this.model = new ModelBoard(); } @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); GL11.glRotatef(180, 0F, 0F, 1F); GL11.glRotatef(dir * (-90F), 0F, 1F, 0F); this.bindTexture(texture); GL11.glPushMatrix(); this.model.renderModel(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } Any help would be appreciated -Whyneb360
  12. Thanks for the advice. I managed to figure it out based on what you said and got the following code for anyone else who wants it: public class YourClassHere extends Item{ @Override public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack) { return false; } //Change this to make the item not stay in the crafting grid @Override public ItemStack getContainerItem(ItemStack itemstack) { return itemstack; } @Override public boolean hasContainerItem(ItemStack itemstack) { return true; } }
  13. I'm not sure I understand what you mean. I have done this, and it doesn't let me put the @Override in. public class BoardProp extends BlockContainer{ public BoardProp(Material material) { super(material); this.setCreativeTab(DesconCreativeTabs.tabGeneral); this.setHarvestLevel("axe", 1); this.setHardness(1F); this.setBlockBounds(0F, 0F, 1F, 1F, 1F, 0.875F); this.setBlockTextureName(Main.modID + ":" + "textures/blocks/board.png"); } @Override public void getContainerItem() { } @Override public void hasContainerItem() { }
  14. How would you return an item (say a saw) used in crafting to the player without any durability Thanks, -Whyneb360
  15. So I made a post not long ago about a similar issue, but neglected to mention that my tile entity was a model, and so the usual getIcon method doesn't do much. I have seen models be rotated depending on where the player is/is looking in Mr. Crayfish's Furniture mod (so it is possible), and was wondering how to get a similar effect. Thanks in advance, -Whyneb360
  16. Could the problem be that I don't have a getIcon method? And what would I need to include in the method to complete it for a tile entity with a custom model? Thanks for all your help by the way, much appreciated
  17. So I got rid of the setDefaultDirection method, and just left the onBlockAdded and onBlockPlacedBy (with the System println) and saw that the metadata was changing, but the block still only faced one way. which bit of code am I missing to make the block actually turn?
  18. Thanks, What should I change it to? EDIT: I looked at the vanilla furnace code, and it it written as pretty much the same. Does this mean it has to do with the block being a tile entity?: public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) { super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); this.func_149930_e(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_); } private void func_149930_e(World p_149930_1_, int p_149930_2_, int p_149930_3_, int p_149930_4_) { if (!p_149930_1_.isRemote) { Block block = p_149930_1_.getBlock(p_149930_2_, p_149930_3_, p_149930_4_ - 1); Block block1 = p_149930_1_.getBlock(p_149930_2_, p_149930_3_, p_149930_4_ + 1); Block block2 = p_149930_1_.getBlock(p_149930_2_ - 1, p_149930_3_, p_149930_4_); Block block3 = p_149930_1_.getBlock(p_149930_2_ + 1, p_149930_3_, p_149930_4_); byte b0 = 3; if (block.func_149730_j() && !block1.func_149730_j()) { b0 = 3; } if (block1.func_149730_j() && !block.func_149730_j()) { b0 = 2; } if (block2.func_149730_j() && !block3.func_149730_j()) { b0 = 5; } if (block3.func_149730_j() && !block2.func_149730_j()) { b0 = 4; } p_149930_1_.setBlockMetadataWithNotify(p_149930_2_, p_149930_3_, p_149930_4_, b0, 2); } } public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) { int l = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if (l == 0) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 2, 2); } if (l == 1) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 5, 2); } if (l == 2) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 3, 2); } if (l == 3) { p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 4, 2); } if (p_149689_6_.hasDisplayName()) { ((TileEntityFurnace)p_149689_1_.getTileEntity(p_149689_2_, p_149689_3_, p_149689_4_)).func_145951_a(p_149689_6_.getDisplayName()); } }
  19. I have this code now for the rotation: public void onBlockAdded(World world, int x, int y, int z) { super.onBlockAdded(world, x, y, z); this.setDefaultDirection(world, x, y, z); } private void setDefaultDirection(World world, int x, int y, int z) { if(!world.isRemote) { Block b1 = world.getBlock(x, y, z - 1); Block b2 = world.getBlock(x, y, z + 1); Block b3 = world.getBlock(x - 1, y, z); Block b4 = world.getBlock(x + 1, y, z); byte b0 = 3; if(b1.func_149730_j() && !b2.func_149730_j()) { b0 = 3; } if(b2.func_149730_j() && !b1.func_149730_j()) { b0 = 2; } if(b3.func_149730_j() && !b4.func_149730_j()) { b0 = 5; } if(b4.func_149730_j() && !b3.func_149730_j()) { b0 = 4; } world.setBlockMetadataWithNotify(x, y, z, b0, 2); } } public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityplayer, ItemStack itemstack) { int l = MathHelper.floor_double((double)(entityplayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if(l == 0) { world.setBlockMetadataWithNotify(x, y, z, 2, 2); } if(l == 1) { world.setBlockMetadataWithNotify(x, y, z, 5, 2); } if(l == 2) { world.setBlockMetadataWithNotify(x, y, z, 3, 2); } if(l == 3) { world.setBlockMetadataWithNotify(x, y, z, 4, 2); } } ...but it still just faces in one direction. Any ideas why?
  20. I hate to double post as it seems slightly selfish, but I would still appreciate at least a few links to the right place.
  21. Okay, so I have two questions, and the first might get a little complicated - I want to make a multiblock structure similar to the research table in Thaumcraft 4 (Place two blocks on the ground, and right click with a certain item to turn it into a different tile entity all together). Specifically, I want to place two tables on the ground, and then two flat panels above it against the wall, right click it with an item and it turns into a workbench of sorts. My questions are how would I make this multiblock structure (just by it self - not including the custom crafting bench as I can probably find a tutorial on that) and how would I make a block face the way I want it to: e.g. 16x16x1 pixel panel against the wall, but which way it faces depends on the way you are facing when you place it. I recognise that the second problem is most likely easier to solve than the first, but any help on either would be greatly appreciated. P.S. Also, if you know of any tutorials of either text or video and would help me, please provide a link. Thanks, -Whyneb360
  22. You my friend, are a legend. Many thanks, -Whyneb360 P.S. Here's the code in case anyone wants it in the future @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { if(type == ItemRenderType.INVENTORY) { return false; }else{ return true; } }
  23. So the title says most of it - I have created an item, and given it a custom model - first person, and third person mode only. The item in the hotbar should still have just a normal item texture, but it is invisible. There is no pink and black square, and I have tested other textures with the same model, and then with a test item I created, and they worked fine. The texture for the item only shows up if I get rid of desconProxy.registerItemRenderers();, but then the item model doesn't render. Is there a certain way I need to give this item a texture? So to summarise: - I have a custom modeled item - Model works perfectly - Item has a texture when the model is disabled - When I enable the model in the main mod class, it turns the item invisible Item Render Class: public class MultitoolRender implements IItemRenderer{ protected ModelMultitool multitool; public MultitoolRender() { multitool = new ModelMultitool(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { return true; } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch(type) { //Third Person View case EQUIPPED: GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("descon:textures/items/descon_multitool.png")); GL11.glScalef(2.0F, 2.0F, 2.0F); GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(190.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(165.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.25F, -0.225F, -0.05F); multitool.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; //First Person View case EQUIPPED_FIRST_PERSON: GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("descon:textures/items/descon_multitool.png")); GL11.glScalef(2.0F, 2.0F, 2.0F); GL11.glRotatef(0.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(200.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(165.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.25F, -0.225F, -0.05F); multitool.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); break; default: break; } } } Item Class: public class DesconItems { public static void mainRegistry() { initializeItem(); registerItem(); } public static Item multitool; public static void initializeItem() { multitool = new Item().setUnlocalizedName("multitool").setCreativeTab(DesconCreativeTabs.tabGeneral).setTextureName(Main.modID + ":descon_multitoolitem"); } public static void registerItem() { GameRegistry.registerItem(multitool, multitool.getUnlocalizedName()); } }
  24. So, this is what I have now: @Override @SideOnly(Side.CLIENT) public void randomDisplayTick(World w, int x, int y, int z, Random rand) { renderParticle(w, x, y, z, w); } private void renderParticle(World w, int x, int y, int z, World world) { Random random = w.rand; double d0 = 0.0625D; for(int l = 0; l < 6; ++l) { double d1 = (double)((float)x + random.nextFloat()); double d2 = (double)((float)y + random.nextFloat()); double d3 = (double)((float)z + random.nextFloat()); if(l == 0 && !w.getBlock(x, y + 1, z).isOpaqueCube()) d2 = (double)(y + 1) + d0; if(l == 1 && !w.getBlock(x, y - 1, z).isOpaqueCube()) d2 = (double)(y + 0) - d0; if(l == 2 && !w.getBlock(x, y, z + 1).isOpaqueCube()) d3 = (double)(z + 1) + d0; if(l == 3 && !w.getBlock(x, y, z - 1).isOpaqueCube()) d3 = (double)(z + 0) - d0; if(l == 4 && !w.getBlock(x + 1, y, z).isOpaqueCube()) d1 = (double)(x + 1) + d0; if(l == 5 && !w.getBlock(x - 1, y, z).isOpaqueCube()) d1 = (double)(x + 0) - d0; if(d1 < (double)x || d1 > (double)(x + 1) || d2 < 0.0D || d2 > (double)(y + 1) || d3 < (double)z || d3 > (double)(z + 1)) { world.spawnParticle("flame", x, y, z, 0.0D, 0.0D, 0.0D); } } } This doesn't work, and I know I've done something wrong, but I just can't crack it. Thanks for all of your help so far though - much appreciated
  25. What would I replace "OreParticleFX" with? Do I have to create a new class and put a flame effect in there? How would I reference that? Sorry for the rapid-fire questions
×
×
  • Create New...

Important Information

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