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.

GotoLink

Members
  • Joined

  • Last visited

Everything posted by GotoLink

  1. Don't use obfuscated names, and try searching a bit, there are other threads.
  2. Set opaqueCubeLookup[id]=true; and use Material.glass ? Not sure about this one.
  3. Override this method in your block: @SideOnly(Side.CLIENT) /** * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given * coordinates. Args: blockAccess, x, y, z, side */ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
  4. FileWriter has a constructor with a boolean to disable overwriting the entire file.
  5. if (player.inventory.armorItemInSlot(2) != null) { ItemStack itemstack = player.inventory.armorItemInSlot(2); if (itemstack.itemID == FuturologyCore.grapheneSuitChest.itemID) { player.capabilities.allowFlying = true; player.sendPlayerAbilities(); }else if(itemstack.itemID != FuturologyCore.grapheneSuitChest.itemID){ player.capabilities.allowFlying = false; player.capabilities.isFlying = false; } } else { //case where player doesn't have any armor }
  6. Well, you can save whole object into bits and reconstruct it by reading them. This is a lot of information and packets are limited in size. You should consider what is the minimum data you need in each case. I am quite sure you don't need whole objects.
  7. It doesn't really matter if clients don't see exactly the same entity animation at the same time. Just look at the vanilla "flying" player animation to see how senseless animations are. What matters is collision and positions, which are handled by the server. As for the question at hand, it is not needed to separate client and server sides in most cases. Of course, client-side only methods (rendering, animation...) should only be called client-side. And if there is any chance of desync between client and server (say, you add a bit of random in the logic), stay on server side. This is what i would say in general.
  8. The model doesn't affect it. You can catch a player swing and run vectors math to get the entity hit, then call the damage method.
  9. What is wrong with using @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { return null; } ? It worked last time I checked.
  10. Use EntityInteractEvent. It contains the player instance and the entity targetted. Do a check for a cow entity, and the bucket stack in the player's hand. Decrease the stack size, and give the player a filled bucket.
  11. Why ? You never see blocks in the inventory. They are all ItemBlock by default, which is already made automatically for all blocks that don't have a subclass of ItemBlock.
  12. EntityRegistry.registerModEntity(args) doesn't register any Entity id. The given modID is internal to Forge, and has nothing to do with the id in EntityList. You can start your modID at 0, it doesn't matter. The error you are having can be due to left-over from old code. Try in a new world. Also check that all your entities have a default (World) constructor.
  13. It is called by getToolTip(EntityPlayer, boolean) in ItemStack. You can simply add any info as String to the given List argument, and you can format the String to put colors and such.
  14. If the Entity failed at construction step (not having a constructor with the World argument), you should get another exception stack trace before this one. On the other case, a "Skipping Entity with id " log message.
  15. It is not needed, and is wrong anyway. Your entity is EntityCustom, not Entity. Also, move RenderingRegistry.registerEntityRenderingHandler( EntityCustom.class, new RenderCustom(new ModelCustom(), 0.3f)); after the entity registration, and run it only on client side.
  16. Use IChatListener or ServerChatEvent or a GUI.
  17. Use a TickHandler to trigger the next two shots.
  18. Remove: EntityRegistry.registerGlobalEntityID( Entity.class, "custom", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102);
  19. Yes, this code will spawn an EntityItem. The only data useful for the ice block is its id, Block.ice.blockID. Make it so the ItemStack in EntityItem has this blockID.
  20. Harvest setting will only affect damage done to the item. To drop the item, spawn an EntityItem with the block data.
  21. The method setPotionEffect(String) in the type Item is not applicable for the arguments (Potion, int, int, float) Translation: You are using wrong arguments in setPotionEffect(arguments). You can only use a String with this method.
  22. I think you'll want to spawn it into the water at first... Then... public void onUpdate() { if(this.isInWater()) { this.moveSpeed = 0.95F; } else { //search for water blocks and set it as a path target } super.onUpdate(); }
  23. Map usage for newbie: Map<Key,Value> map = new HashMap();//Initialization with an HashMap and generics, where Key and Value are any Object you want map.put(key,value);//adds a key->value couple, or replace the value linked by the key Value val = map.get(key);//gets a value from a key
  24. You should load the info at some point. ClickId = par1ItemStack.stackTagCompound.getInteger("ClickCount");
  25. This piece of code does exactly what you are saying, it skips one of the images. Now, learn some programming. Copying someone else code will take you nowhere.

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.