Jump to content

Abastro

Forge Modder
  • Posts

    1075
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Abastro

  1. In case the blocks are nearby blocks, In Block#onNeighborChange get the changed TileEntity. If the tileentity is what you are looking for, then do what you want. That's how you detect markdirty call.
  2. It's not good that using CommonProxy as the GUI Handler, but anyway.. This problem is not related with gui. In the entity's writeEntityToNBT code, you saves this.getOwner().getName() when getOwner() can be null. Then. Please post your current readEntityfromNBT and writeEntityToNBT code, I think you should change many codes from the methods to fix this issue.
  3. It is really simply this (other variations yield similar results). public EntityBirdOfPrey(parWorld) { super(parWorld); System.out.println("Rand ="+parWorld.rand.nextInt(6)); } Oh, and how did you created the multiple instances of the EntityBirdOfPrey?
  4. Then, the GuiHandler code is also needed.
  5. You missed the point of this issue. Randoms with same seed gives same values in same time, but in this case it gives same values for different times!
  6. No. It only changes nearby blocks. So it can only be detected by nearby blocks or tileentities.
  7. The whole code in the entity constructor is needed.
  8. You also need to override Block#hasTileEntity(int metadata) and Block#createTileEntity(World world, int metadata). In hasTileEntity you should return true(if it is not meta-block), and in Block#createTileEntity you should return the instance of the tileentity.
  9. No, I mean where you call the constructor of the Gui. The gui should be constructed and opened there.
  10. Do not use drawTexturedModalRect. It has several problems with texture size, etc. Make your custom implementation replacing that. (Texture u,v should be 0,1 -> 1,1 -> 1,0 -> 0,0)
  11. Yes, you're right. I might see illusion or something... (I saw something setting ResourceLocation in DynamicTexture code) Anyway, Dynamic Texture will be needed to do what OP wanted to do. EDIT: I'd upse my previous admission, see TextureManager#getDynamicTextureLocation code. It registers the DynamicTexture with key 'ResourceLocation'. So in this case ResourceLocation is actually an abstract expression of resource location, as key for the resource
  12. To analyze why random class gives same value there, it is needed that when and where the Random#nexInt() is called. So please post the code.
  13. He wanted to transform Image to ResourceLocation, which is not possible. ResourceLocation is just reference, "path", to resource with modid and internal path. What he needed to use, you said above... No. It is actually possible. Think about skin, it is also from URL! So, Look into the class 'DynamicTexture'. It will give you a hint. + This thread will also help you: http://www.minecraftforge.net/forum/index.php/topic,25161.msg127886.html#msg127886
  14. That's simply size problem. Please post the rendering code.
  15. Just @SubscribeEvent the ClientTickEvent, for client tick checking. (in your case WorldTickEvent might be better.)
  16. Where is the code for opening Gui, 'cause it is related with this crash.
  17. TGG already said how to do it. You need to send the value of the field using icrafting.sendProgressBarUpdate in Container#detectAndSendChanges, and override Contaier#updateProgressBar to update the field.
  18. So where do you opens the dog gui? I cannot find one.
  19. That means your texture is too big. How big is it?
  20. You need TESR for that. There is RenderItemFrame#renderItem(EntityItemFrame) which would be useful to understand how to render item.
  21. Use DynamicTexture. You can easily construct a DynamicTexture with BufferedImage, and get its ResourceLocation from TextureManager#getDynamicTextureLocation(String key, BufferedImage img);
  22. What is your forge version and how did you registered the block and tileentity?
  23. That's really strange. Try printing the block's name, to make sure that it is gold ore.
×
×
  • Create New...

Important Information

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