Jump to content

Titanium237458

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Titanium237458

  1. Hey, I'm made a model that uses up a 3x3x1 space, and it originates in the middle block, the master block which does all the work. Around it there are 8 blocks which only give the multiblock a bigger collision. My problem now is that if you don't have the master block in the screen, the model vanishes, even though you still look at the blocks that gives the model a collision box. As all the blocks have different meta data, as their collision box isn't the same, I could solve this by letting MC render parts of the model in all the blocks, bt that would require more TESR and with it more performance, which I try to avoid. Here are some pictures that show the problem: And here's the model class: public class ModelHopperBig extends ModelBase { public ModelRenderer Connector; public ModelRenderer Middle; public ModelRenderer Wall1; public ModelRenderer Wall2; public ModelRenderer Wall3; public ModelRenderer Wall4; public ModelRenderer InnerWall1; public ModelRenderer InnerWall2; public ModelRenderer InnerWall3; public ModelRenderer InnerWall4; public ModelHopperBig() { this.textureWidth = 256; this.textureHeight = 128; this.Connector = new ModelRenderer(this, 0, 0); this.Connector.setRotationPoint(-6.0F, 20.0F, -6.0F); this.Connector.addBox(0.0F, 0.0F, 0.0F, 12, 4, 12, 0.0F); this.Middle = new ModelRenderer(this, 0, 92); this.Middle.setRotationPoint(-16.0F, 17.0F, -16.0F); this.Middle.addBox(0.0F, 0.0F, 0.0F, 32, 3, 32, 0.0F); this.Wall1 = new ModelRenderer(this, 90, 11); this.Wall1.setRotationPoint(-24.0F, 10.0F, -24.0F); this.Wall1.addBox(0.0F, 0.0F, 0.0F, 48, 6, 2, 0.0F); this.Wall2 = new ModelRenderer(this, 90, 0); this.Wall2.setRotationPoint(-24.0F, 10.0F, 22.0F); this.Wall2.addBox(0.0F, 0.0F, 0.0F, 48, 6, 2, 0.0F); this.Wall3 = new ModelRenderer(this, 105, 65); this.Wall3.setRotationPoint(-24.0F, 10.0F, -22.0F); this.Wall3.addBox(0.0F, 0.0F, 0.0F, 2, 6, 44, 0.0F); this.Wall4 = new ModelRenderer(this, 160, 77); this.Wall4.setRotationPoint(22.0F, 10.0F, -22.0F); this.Wall4.addBox(0.0F, 0.0F, 0.0F, 2, 6, 44, 0.0F); this.InnerWall1 = new ModelRenderer(this, 90, 50); this.InnerWall1.setRotationPoint(-22.0F, 15.0F, 16.0F); this.InnerWall1.addBox(0.0F, 0.0F, 0.0F, 44, 3, 6, 0.0F); this.InnerWall2 = new ModelRenderer(this, 90, 30); this.InnerWall2.setRotationPoint(-22.0F, 15.0F, -22.0F); this.InnerWall2.addBox(0.0F, 0.0F, 0.0F, 44, 3, 6, 0.0F); this.InnerWall3 = new ModelRenderer(this, 0, 54); this.InnerWall3.setRotationPoint(-22.0F, 15.0F, -16.0F); this.InnerWall3.addBox(0.0F, 0.0F, 0.0F, 6, 3, 32, 0.0F); this.InnerWall4 = new ModelRenderer(this, 21, 10); this.InnerWall4.setRotationPoint(16.0F, 15.0F, -16.0F); this.InnerWall4.addBox(0.0F, 0.0F, 0.0F, 6, 3, 32, 0.0F); } @Override public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { this.Connector.render(f5); this.Middle.render(f5); this.Wall1.render(f5); this.Wall2.render(f5); this.Wall3.render(f5); this.Wall4.render(f5); this.InnerWall1.render(f5); this.InnerWall2.render(f5); this.InnerWall3.render(f5); this.InnerWall4.render(f5); } } And the renderer class: public class TileEntityHopperBigRender extends TileEntitySpecialRenderer { ModelHopperBig model = new ModelHopperBig(); @Override public void renderTileEntityAt(TileEntity tile, double d, double d1, double d2, float f) { GL11.glPushMatrix(); GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glRotatef(180F, 0, 0, 1F); TileModHopper tileE = (TileModHopper) tile; render(tileE, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, ModBlocks.hopperEnder); GL11.glPopMatrix(); } public void render(TileModHopper tl, World world, int i, int j, int k, Block block) { Tessellator tessellator = Tessellator.instance; float f = block.getLightValue(); int l = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int l1 = l % 65536; int l2 = l / 65536; tessellator.setColorOpaque_F(f, f, f); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) l1, (float) l2); GL11.glPushMatrix(); GL11.glRotatef(0, 0F, 1F, 0F); bindTexture(new ResourceLocation(LibMisc.MODID, "textures/model/ModelHopperBig.png")); model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } } I hope you can help me, I appreciate anything that can help me, thank you
  2. Welp, forgot the most important thing haha. I was on 1.7.10 But everything you suggested worked out, thank you for that!
  3. I decided to make the mod I'm working on a bit fancier, so I started using particle effects. Everything is well and good, however, one block makes problems. As it prevents the player's death, I had to use the LivingDeathEvent, which is only fired server-side. I want to spawn some particles when said block prevents a player's death, which isn't possible on its own when the Method is only fired by the sever, hence I looked into packets. With the packets everything works so far, but the strange thing is, that even though the server sends a packet to the client, the world is still no remote (world.isRemote is false). Here is the neccessary code:
  4. Still same result You mean like this? @Override public void writeToPacketNBT(NBTTagCompound cmp) { super.writeToPacketNBT(cmp); if(player == null){ cmp.setString(TAG_PLAYER, ""); } else { cmp.setString(TAG_PLAYER, player.getPersistentID().toString()); } cmp.setInteger(TAG_SECONDS, seconds); } @Override public void readFromPacketNBT(NBTTagCompound cmp) { super.readFromPacketNBT(cmp); String str = cmp.getString(TAG_PLAYER); if(str != null && !str.equals("")){ UUID uuid = UUID.fromString(str); if(uuid == null){ player = null; } else { String playerName = MinecraftServer.getServer().func_152358_ax().func_152652_a(uuid).getName(); player = MinecraftServer.getServer().getConfigurationManager().func_152612_a(playerName); } } seconds = cmp.getInteger(TAG_SECONDS); } When I reload the world the flower transforms into "Botania Flower", which you only get when something went wrong. So that doesn't work either, or am I using it wrong?
  5. In "onBlockActivated" it will print out the Bound Player and the seconds the tile existed. When I shift right click it will bind myself to it and then everytime I right click it it will print my username and the time the tile existed. When I log out and log in, and right click the tile, it will print "null", as in no player is bound to it, so it didn't save properly. I don't think this is the case because it saves the seconds the tile existed properly, but I will try in a bit
  6. I am working on a flower which should save the player that makes a shift-right click on it, but I can't figure out how to save the player entity. I know how NBT works, and I try to save the player's username in that block and then get the EntityPlayer from the username again, but it doesn't seem to work. This is the flower code (Note that my mod should be a Botania Addon): EDIT: I fixed it now. I no longer use EntityPlayer but the GameProfile and made some other adjustments to the NBT saving / loading, took out the debug stuff with the second saving etc. For anyone interested, here's what the code now looks like: Thank you for your help anyway
  7. That fixed it, thank you really much And you were right. I loaded my recipes in the init part. Moving them in the postInit fixed the problem.
  8. Hi, I'm new to Forge Modding and wanted to make a Thaumcraft Addon which add new wand rods and caps. Everything is working fine except one thing: I can't access the items from Thaumcraft, but I need to do that for my recipes. I try it with public static Item thaumResource = GameRegistry.findItem("Thaumcraft", "ItemResource"); AWLog.AWLogger.log(Level.INFO, "ItemResource: " + thaumcraftItem.thaumResource); //Just prints out messages for debugging //ItemResource: thaumcraft.common.items.ItemResource@59ec437 (This it what appears in the console) But when I the want to make a recipe with that like that: GameRegistry.addShapelessRecipe(new ItemStack(thaumcraftItem.thaumResource, 1, 0), new Object[]{Item.diamond}); It crashes with this report:
×
×
  • Create New...

Important Information

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