Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

daafganggdg

Members
  • Joined

  • Last visited

Everything posted by daafganggdg

  1. Are you already setting the metadata for your crop anywhere? fully grown is somewhat weird i guess
  2. You noticed you dont set the stages in the constructor?
  3. Alright Thanks so far, but I get a crash Dont know why it wont work, only thing im not too sure about is where to register my generator? (currently in my preInit) There's my code : public class PlantGenerator implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if(world.provider.dimensionId == 0) generateFlowers(world, random, chunkX*16, chunkZ*16); } private void generateFlowers(World world, Random random, int x, int z) { for(int i = 0; i < 3; i++){ int xCoord = x + random.nextInt(16); int zCoord = z + random.nextInt(16); new WorldGenFlowers(Blocks.red_flower).generate(world, random, xCoord, world.getHeightValue(xCoord, zCoord), zCoord); } } } public static PlantGenerator plantGene; public void preInit(FMLPreInitializationEvent event) { GameRegistry.registerWorldGenerator(plantGene, 0); } Crash:
  4. unfortunatly not, you know a good tutorial on that?
  5. add @Override in front of that method Override public Item getItemDropped(int i, Random rand, int j) { return MItems.S; } if you get an error you are probably importing wrong Edit: There are different Random classes, make sure you import java.util.Random and not scala.util.Random
  6. Hey guys, I made a few new plants and now I wonder how I can get them to spawn just like minecraft flowers Thanks in advance
  7. Ok I think I kind of got it done, GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // render here GL11.glPopAttrib(); that made it look transparent, however I now got a bigger problem And big is just the keyword, its about 100 times as big as a normal item, not in the right rotation nor at the right place, how do I fix that?
  8. I found the method public int getRenderBlockPass(){ return 1; } in 1 of your post, so that makes blocks semi trasparent but just like ice it still has 0% transparency when the player is holding it.. and finally I have an Item not a block So you said I have to use an IItemRenderer for that, how would I go on using one?
  9. So just to clarify, When you hold for example the green stained glass plane in hand in 1st person its semi transparent (it still has a coulour but you can see through), Thats what i want my item to look like. Right now my items pixels either are 100% transparent and you just cant see them or 0%. I just realized that when holding the green stained glass plane in 3rd person it looks as weird as my item with either 100% or 0% transparency
  10. ? I dont have no code, thats why i am asking
  11. Hey, How can i render an item with an alpha channel when the player is holding it, like glass pane? (not with 100% transparency). I already have a texture and its working in the inventory but looks super weird when the player is holding it
  12. Thank you, this works. I dont know how I didnt think of that earlier. But im having a problem where sometimes it gives me 3 items, sometimes 4 and sometimes 5 uhhm, U have to put itemstack[2] = new ItemStack(theItemYouWant, TheAmountUWant); and so on ofc into there too (up too 19). If you have already done that and its still not working show your code. And if its adding e.g. 5 eggs 3 eggs u dont get 5 and 3 eggs but 8 in one stack ofc. And I dont know if you want to deny the chance of an ItemStack beeing added twice, if so u have to put in a check for that.
  13. I'd just use this: Random rand = new Random(); ItemStack[] itemstack = new ItemStack[20]; itemstack[0] = new ItemStack(Items.apple, 2); itemstack[1] = new ItemStack(Items.bread, 34); //... for(int i = 0; i < 5; i++) { player.inventory.addItemStackToInventory(itemstack[rand.nextInt(20)]); }
  14. I'm not quiet sure if I understand u right, but you want this code to change the textures to the next stage? Cause that is completly wrong, if not what is actually not working or where is the problem?
  15. alright working now, thanks ^^
  16. so i have to download the new forge or can i do it inside the gradlew? how do I keep my code?
  17. hey guys, I'm trying to send a packet from client to server but i cant get it to work So, thats my code public static SimpleNetworkWrapper network; @EventHandler public static void preInit(FMLPreInitializationEvent event) { network= NetworkRegistry.INSTANCE.newSimpleChannel(modid); network.registerMessage(MessageHandler.class, Message.class, 0, Side.SERVER); } public class MessageHandler implements IMessageHandler<Message, IMessage> { @Override public IMessage onMessage(Message message, MessageContext ctx) { System.out.println(message.x); return null; } } public class Message implements IMessage{ public int x; public Message() {} public Message(int a) { this.x = a; } @Override public void toBytes(ByteBuf buf) { buf.writeInt(x); } @Override public void fromBytes(ByteBuf buf) { this.x= buf.readInt(); } } It's crashing on startup [15:40:50] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue [15:40:50] [Client thread/ERROR] [FML]: mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized FM{ALPHA 1.0} [XY] (bin) Unloaded->Constructed->Errored [15:40:50] [Client thread/ERROR] [FML]: The following problems were captured during this phase [15:40:50] [Client thread/ERROR] [FML]: Caught exception from XY java.lang.IllegalStateException: cannot determine the type of the type parameter 'REQ': class cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper
  18. Well, I came up with this: @EventHandler public static void preInit(FMLPreInitializationEvent event) { network = NetworkRegistry.INSTANCE.newSimpleChannel("MyChannel"); network.registerMessage(ClearSlotMessage.Handler.class, ClearSlotMessage.class, 0, Side.SERVER); } public class ClearSlotMessage implements IMessage{ public int x; public int y; public int z; public ClearSlotMessage(int x, int y, int z) { this.x = x; this.y = y; this.z = z; } @Override public void fromBytes(ByteBuf buf) { } @Override public void toBytes(ByteBuf buf) { } public static class Handler implements IMessageHandler<ClearSlotMessage, IMessage> { @Override public IMessage onMessage(ClearSlotMessage message, MessageContext ctx) { TileEntityCutter entity = (TileEntityCutter) ctx.getServerHandler().playerEntity.worldObj.getTileEntity(message.x, message.y, message.z); if(entity != null) { // entity. System.out.print("safasfasfasfasfafasfasfas"); } return null; } } } public void onButtonClick() { //the method in my tileEntity FM.network.sendToServer(new ClearSlotMessage(xCoord, yCoord, zCoord)); } I'm not sure how I use the methods fromByte and toByte (just make x y z binary?) And what is the "MyChannel"? Rest ok?
  19. Is there a good tutorial for packets? (never worked with that :
  20. me again Uhm so i want to delete a slot and draw the items texture over it, I have @Override public void mouseClicked(int x, int y, int z) { super.mouseClicked(x, y, z); if(y - guiTop > 30 && y - guiTop < 55 && x - guiLeft > 92 && x - guiLeft < 141) { tileEntity.onButtonClick(); } } in my gui and public void onButtonClick() { slots[0] = null; } in my tileEntity, however the slot actually becomes invisible, but when i ckick it it still seems to contain the ItemStack I guess thats because the Gui stuff where i call the method is client. Then how do I solve that problem?
  21. With the item drop you mean to cklick your new block type? you can use @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { return false; } @Override is actually not doing anything, but checking if you are overriding properly, so if you for example use this: @Override public boolean onBlockActivated(World world, int x, int y, int z, int player, int side, float hitX, float hitY, float hitZ) { return false; } you get an error (you can change the names of the variables ofc. but not the type) and for the future, always post your error message
  22. Exact, only your new block would drop the item, but you should be careful cuz by overriding a method you loose all the "regular feastures" of that method, to get around that put super.theMethodYouAreOverriding in the method you are overriding, which basically does everything what the old method did (you dont have to do it in most cases)
  23. Look for any Tutorial to set the language file up properly. And in the ItemFood just delete all the methods! What you are doing is extending the class of the vanilla food class, so u get all the methods and then u override them with the same code? Just override if u want to change something public class YourFood extends ItemFood{ public YourFood (int par1, float par2, boolean par3) { super(par1, par2, par3); } @Override public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.drink; } For example the getItemUseAction is eating the food by default, so override the method ONLY if u want to actually take any changes like setting it to drinking.
  24. Thanks. But is there a way to not make the glass item go straight for the player causing the player to instantly pick it up and not have it fall to the ground like normal. Because that is what is happening I mine the glass block and the glass item spawns and goes to the player. If I had to I would just go with that, but I would like it to fall to the ground like normal and the player has to walk over to pick it up not it come to the player. Also, how would I make this work for if a boat crashes and breaks so I can make it drop 5 planks? To the instant pick up, I think u just have to set item.delayBeforeCanPickup to any value u wish ^^

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.