Jump to content

Insane96MCP

Members
  • Posts

    211
  • Joined

  • Last visited

Everything posted by Insane96MCP

  1. I get a nullPointerException when trying to join a world: Here's the the code of PlayerDataProvider And CapabilityHandler Here's the full code: https://github.com/Insane-96/GalaxiteMod/tree/master/common/net/insane96mcp/galaxite/capabilities I really don't know what's causing this.
  2. Yeah sorry, I meant ItemBlocks
  3. Exactly. So unless I overwrite the items, there's no way to set itemstack for each itemblock blockstate
  4. There's no way to do it for every single item with blockdata/meta?
  5. My objective is to change item stacks taking in consideration blockstate/meta (diorite, granite, for stone. Concrete colors, etc.), but using Item.setMaxStackSize works for every blockstate of the block
  6. I'm iterating through the player inventory so I have a list of ItemStacks which I can get the block and the item. I need the blockstate of the blocks the player has in the inventory (if the item is a block), but seems like that Block#getStateFromMeta(int) returns the default state. How do I properly get an Item/Block BlockState?
  7. Seems like that using @SubscribeEvent isn't enough. I had to register the event class with @Mod.EventBusSubscriber(modid = MOD_ID) Now back to the original question. How to dynamically register a recipe with variable output count?
  8. Yep, I was writing only on client in the Update. I have misdone the if (world.isRemote)
  9. Didn't check anywhere if client or server so it should write it in both
  10. Wow, capabilities are pretty useful BUT, the problem still persist. In LivingHurtEvent I set an int and if I read it in LivingUpdateEvent it always reads 0. You can check the code for living hurt here where I set the damageSlownessDuration And here when I get the damageSlownessDuration.
  11. This is the Events Class package net.insane96mcp.iguanatweaks.events; import net.insane96mcp.iguanatweaks.IguanaTweaks; import net.insane96mcp.iguanatweaks.modules.ModuleGeneral; import net.minecraft.item.crafting.IRecipe; import net.minecraft.potion.Potion; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class RegistryRegister { @SubscribeEvent public static void EventRegisterIRecipe(RegistryEvent.Register<IRecipe> event) { IguanaTweaks.logger.info("RegisteringRecipes"); ModuleGeneral.TorchesPerCoal(event); } @SubscribeEvent public static void EventRegisterPotion(RegistryEvent.Register<Potion> event) { IguanaTweaks.logger.info("RegisteringPotions"); ModuleGeneral.AlterPoison(event); } } And I register it with MinecraftForge.EVENT_BUS.register(RegistryRegister.class); in Proxy's Init();
  12. Saving some timers, a "weight" value for the player.
  13. I might be wrong but isn't @SubscribeEvent the annotation for every event?
  14. Ok seems like that even removing the recipe doesn't work It doesn't enter into the event (RegistryEvent.Register<IRecipe> or <Potion>)
  15. I have two prints for the player tags in LivingUpdate and LivingHurt @SubscribeEvent public static void EventLivingHurt(LivingHurtEvent event) { if (event.getEntityLiving() instanceof EntityPlayer){ System.out.println("LivingHurt: " + event.getEntityLiving().getEntityData()); } } @SubscribeEvent public static void EventLivingUpdate(LivingUpdateEvent event) { if (event.getEntityLiving() instanceof EntityPlayer){ System.out.println("LivingUpdate: " + event.getEntityLiving().getEntityData()); } } One returns a set of tags, the other one, one other set.
  16. I have set in the config the number of torches a crafting gives and I need to change it.
  17. I've managed to remove the vanilla recipe for the torch public static void TorchesPerCoal(RegistryEvent.Register<IRecipe> event){ ResourceLocation torch = new ResourceLocation("minecraft:torch"); IForgeRegistryModifiable modRegistry = (IForgeRegistryModifiable) event.getRegistry(); modRegistry.remove(torch); } But how to properly re-add the recipe since is configurable via Config?
  18. Thanks a lot. World.getTotalWorldTime() and a subtraction did the job. Not a problem in my case.
  19. How I can get game ticks (or seconds) elapsed?
  20. Ok, I need to sleep now. I didn't think about comparing Blocks ...
  21. This thing works but is ugly af: world.getBlockState(bedPos).getBlock().getRegistryName().toString().equals(Blocks.BED.getRegistryName().toString())
  22. Does RenderGameOverlayEvent run every frame and not every tick? I'm the bar should hide after 5 seconds but the timer increases at crazy speed and hides after less than 1 sec
  23. I'm trying to hide the hunger bar. I've done the same with the renderHealth, and works properly, but for some reasons doesn't work with the hunger bar. This is the method called in a LivingUpdateEvent public static void HideHungerBar(EntityPlayer player) { if (player.getFoodStats().getFoodLevel() >= Properties.Hud.hideHungerBarThreshold) { GuiIngameForge.renderFood = false; } } Using the logger I know that the game enter in the method, and placing a log for renderFood before GuiIngameForge.renderFood = false will return true before and false after, but the bar doesn't disappear. ForgeVersion: 14.23.0.2545
×
×
  • Create New...

Important Information

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