Jump to content

strumshot

Members
  • Posts

    133
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://elmore.photography/mods
  • Location
    US
  • Personal Text
    KOTR lead modder

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

strumshot's Achievements

Creeper Killer

Creeper Killer (4/8)

12

Reputation

  1. Thanks for informing me! I will get right on that. Keep an eye for my update!
  2. Yes, you do have permission! Just mention the mod in any promotional posts, and if you wouldn't ming linking to your server in this thread! Thanks and enjoy.
  3. You should be able to get it now. Maybe the flow would be like: Client presses button(handled in the gui) Gui sends a packet "pressedUpButton" to server Server makes changes to item nbt according to "up button" packet Server responds with a "ichangedthenbt" packet Client changes the local nbt or refreshes from server, etc. to you can see the changes in the gui Eat a cookie
  4. Primed Entity and... RenderingRegistry.registerEntityRenderingHandler(NewTNTPrimed.class, new RenderTNTPrimed()); I don't expect it to help, as again, I'm using the default texture and renderer, but maybe you missed a line of code, and maybe you can just assign a different texture. Good luck!
  5. Yes, that can be tricky! I added a field to store my TE in my container, which I assigned in construction. Then, I was able to access the TE through the container in the client packet handler like such: GuiScreen screen = Minecraft.getMinecraft().currentScreen; if (screen instanceof GuiShopper) { ContainerShopper container = ((GuiShopper) screen).container; container.tileEntity.Cost = message.cost; container.tileEntity.markDirty(); } Your usage will look different, but you get the idea. You are right, you cant access the player simply!
  6. If you plan on doing this sort of thing often, I would suggest making a custom function that takes the desired message and inserts the formatting before every word, because multiple line messages will stop the formatting as of the second line. Some of the code would look like this: String msg="This is the message you want to format correctly so it displays the formatting on multiple lines."; String[] tmp = msg.split(" "); String formatted = ""; for(int x = 0; x < tmp.length; x++){ formatted += EnumChatFormatting.AQUA.toString(); formatted += tmp[x]; formatted += " "; } You would have to mess around with that, and would have to be more creative to use multiple formats in one message, but that's the idea.
  7. I dealt with this recently and solved my issues, however, I was simply replacing the core classes and not the textures, but I still had to address the renderer. If you think my code would help you, I'd be happy to share it.
  8. I can tell you from that error that you haven't numbered your packets correctly - they each need an individual number - or you haven't referenced that number correctly.
  9. Its about time... I always thought that was odd about most people's 1.7 code. I feel like one tutorial chained the calls that way to keep all the code in the main mod file and then many modders/newer programmers just thought that was how it worked!
  10. Well same here lol, but when you request a gui the handler is done through your proxies... it tells the server to open a TileEntity/container and the client the gui item, as gui is only on the client. I will share something when I can.
  11. Wait a sec... does this mean one would be able to connect to a non-debug server? (should I post this in a new thread? not meaning to hijack...)
  12. We may generically have a language issue here. I think we are all debuggers telling you how to discern if a specific block is an instance of an interface, while you are wanting to search for one in your world... is this correct?
  13. This is in the Block base class and can be overridden by any custom block /** * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity */ public void onEntityWalking(World p_149724_1_, int p_149724_2_, int p_149724_3_, int p_149724_4_, Entity p_149724_5_) {}
  14. And the final version of my renderer, with the rendering from metadata method copied and cleaned up a bit, so I can play with the color. Note: it only changes the color of the inside of the hopper (which is fine enough for what I wanted) but its calling an IIcon which could easily enough be overridden if someone else finds this and needs to do that. @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture); return this.renderBlockHopperMetadata(renderer, (BlockHopper)block, x, y, z, renderer.blockAccess.getBlockMetadata(x, y, z), false); } public boolean renderBlockHopperMetadata(RenderBlocks renderer, BlockHopper p_147799_1_, int p_147799_2_, int p_147799_3_, int p_147799_4_, int p_147799_5_, boolean p_147799_6_) { Tessellator tessellator = Tessellator.instance; int i1 = BlockHopper.getDirectionFromMetadata(p_147799_5_); double d0 = 0.625D; renderer.setRenderBounds(0.0D, d0, 0.0D, 1.0D, 1.0D, 1.0D); renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); float f1; if (!p_147799_6_) { tessellator.setBrightness(p_147799_1_.getMixedBrightnessForBlock(renderer.blockAccess, p_147799_2_, p_147799_3_, p_147799_4_)); int j1 = p_147799_1_.colorMultiplier(renderer.blockAccess, p_147799_2_, p_147799_3_, p_147799_4_); float f = (float) (j1 >> 16 & 255) / 255.0F; f1 = (float) (j1 >> 8 & 255) / 255.0F; float f2 = (float) (j1 & 255) / 255.0F; if (EntityRenderer.anaglyphEnable) { float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; f = f3; f1 = f4; f2 = f5; } } IIcon iicon = BlockHopper.getHopperIcon("hopper_outside"); IIcon iicon1 = BlockHopper.getHopperIcon("hopper_inside"); f1 = 0.125F; tessellator.setColorOpaque(150, 25, 25); renderer.renderFaceXPos(p_147799_1_, (double) ((float) p_147799_2_ - 1.0F + f1), (double) p_147799_3_, (double) p_147799_4_, iicon); renderer.renderFaceXNeg(p_147799_1_, (double) ((float) p_147799_2_ + 1.0F - f1), (double) p_147799_3_, (double) p_147799_4_, iicon); renderer.renderFaceZPos(p_147799_1_, (double) p_147799_2_, (double) p_147799_3_, (double) ((float) p_147799_4_ - 1.0F + f1), iicon); renderer.renderFaceZNeg(p_147799_1_, (double) p_147799_2_, (double) p_147799_3_, (double) ((float) p_147799_4_ + 1.0F - f1), iicon); renderer.renderFaceYPos(p_147799_1_, (double) p_147799_2_, (double) ((float) p_147799_3_ - 1.0F) + d0, (double) p_147799_4_, iicon1); renderer.setOverrideBlockTexture(iicon); double d3 = 0.25D; double d4 = 0.25D; renderer.setRenderBounds(d3, d4, d3, 1.0D - d3, d0 - 0.002D, 1.0D - d3); renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); if (!p_147799_6_) { double d1 = 0.375D; double d2 = 0.25D; renderer.setOverrideBlockTexture(iicon); if (i1 == 0) { renderer.setRenderBounds(d1, 0.0D, d1, 1.0D - d1, 0.25D, 1.0D - d1); renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); } if (i1 == 2) { renderer.setRenderBounds(d1, d4, 0.0D, 1.0D - d1, d4 + d2, d3); renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); } if (i1 == 3) { renderer.setRenderBounds(d1, d4, 1.0D - d3, 1.0D - d1, d4 + d2, 1.0D); renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); } if (i1 == 4) { renderer.setRenderBounds(0.0D, d4, d1, d3, d4 + d2, 1.0D - d1); renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); } if (i1 == 5) { renderer.setRenderBounds(1.0D - d3, d4, d1, 1.0D, d4 + d2, 1.0D - d1); renderer.renderStandardBlock(p_147799_1_, p_147799_2_, p_147799_3_, p_147799_4_); } } renderer.clearOverrideBlockTexture(); return true; }
  15. Definitely this! I'd like to note that I was attempting to offer an alternate solution, assuming instanceof "doesn't work" - but as they pointed out, it should.
×
×
  • Create New...

Important Information

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