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. Yes because it is better to extend classes. And sometimes vanilla classes are used in special cases where they are expected to work, which you may not fulfil. Vanilla EntityFX are spawned in RenderGlobal, check if anything special happens for the class you copied over. I would investigate getBrightness(int) or getBrightnessForRender(int) if i were you.
  2. By using setAttribute, and getBaseValue() you are overwriting any modifiers already existing, potion effects for the most part. Here is how i do it in the LevelUp! mod update: AttributeInstance atinst = player.getEntityAttribute(SharedMonsterAttributes.movementSpeed);//enter the attribute speed without triggering any calculation AttributeModifier mod; skill = getSkill(player,6);//consider this a whatever value you want if(skill!=0) { //Here is the modifier we want to apply, the speedID needs to be unique (!= from any other speed modifier id) //see func_111129_g() in ModifiableAttributeInstance to understand what the values do //in this case, the modifier will do speed*=1+skill/100, where "speed" is a intermediate calculated value with previous modifiers mod = new AttributeModifier(speedID,"SprintingSkillSpeed",skill/100F,2); if(player.isSprinting())//we apply when conditions are met { if(atinst.getModifier(speedID) == null)//you'll get a crash if you apply twice the same modifier, thus we check with the unique modifier id { atinst.applyModifier(mod); } } else if(atinst.getModifier(speedID) != null)//we remove when conditions are not met { atinst.removeModifier(mod); } Here is a suggested modifier for your case: new AttributeModifier(wtvID,"MySpeedModifier",2.5,2);
  3. You probably want to use the bindTexture(...) one. Though it would be easier to help if you showed some code.
  4. Don't see anything random in your code... Do you really want to duplicate your chisel when it is on the crafting bench ? (stacksize = 2 ) And you are checking all slots here, without stopping at the first chisel found. What is the recipe calling your crafting handler ? it should contain a chisel.
  5. Did you copied that code from another class instead of extending said class ?
  6. Localisation handled by the server ? Are you crazy ? This would mean different packet length for each receiving part depending on the receiver settings...this a f* nightmare ! Let that to client, please... Or next time you are going to try handling the rendering on server side.
  7. Use the attribute system. Any entity speed can be changed there.
  8. No, this is based on modid. Use Loader#getModList(), this will give you the complete list of ModContainer. Then you can check whatever you want inside that.
  9. Personally, i would use Minecraft.getMinecraft().mcResourcePackRepository.setRepositoryEntries(array); to add a custom ResourcePackRepositoryEntry which override updateResourcePack() to call your custom ResourcePack. As a side note, there is no "last call to refreshResources()". Minecraft itself does it regularly. So you can do that anytime, i assume. And how is that a drawback for a ResourcePack ? A server doesn't need multiple versions of the same thing...
  10. Sort of, look at mcp/conf folder.
  11. Config files are already doing this, so yes it is OK. Loader#getConfigDir(); As for images/textures. Resource packs are now a built-in feature of Minecraft. That means users don't have to open your jar. They only need to make a resource pack following your jar structure and add whatever textures they want to change.
  12. @ForgeSubscribe public void onPlayerLeftClick(PlayerInteractEvent event){ if(event.action==Action.LEFT_CLICK_BLOCK && event.entityPlayer.getHeldItem()!=null && event.player.getHeldItem().itemID==your_Item_ID && event.entityplayer.worldObj.getBlockId(event.x,event.y,event.z)==Block.grass.blockID){ //do things } }
  13. @TheyCallMeDanger Nice idea. But think about servers. And... This had me laughing so hard. ... Sadly.
  14. @Mazetar No events, but an interface: ICraftingHandler
  15. Actually, how you would do things depends on how the API is made. If the API is good, it provides events classes linked to the Nuclear Reactor, which you can subscribe to and give new results/functions. Forge provides the event system, I hope IC2 authors were nice enough to use it.
  16. You should use PlayerInteractEvent with left click block as action.
  17. Extend TileEntityFurnace and BlockFurnace, then remove every piece of code that you didn't make yourself. We will all see much better what you did wrong.
  18. There is a finite number of items and nothing prevents a mod from using them all. In other words, there is no such thing as unique item id. If you are looking for unused item id, you can check for Item.itemsList[id] == null . You can also use Forge methods, like Configuration#getItem(args).
  19. Get stack in slot and decrease stack size. You'll need loops in the worst case that the player has redstone all over its inventory.
  20. First: If it is not placed on the world grid, it is not a block. It is an Item (ItemBlock by default) or an EntityItem. Second: It needs to be called that much, since the renderer doesn't know when the texture is going to change. Because, yes, it can change. You can return a random icon if you like.
  21. Well if you can't use id above 256, use id below 256...
  22. My bad, you use mc.ingameGUI ,right ?
  23. What is the point you can always access the actual list with getSmeltingList() in FurnaceRecipes.
  24. if(!mc.currentScreen instanceof MyNewScreen) //open MyNewScreen else //close
  25. public static Icon getBlueStone_Wire(String string) { return null; } ...I am afraid null isn't any of your icons.

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.