-
Posts
211 -
Joined
-
Last visited
Everything posted by Insane96MCP
-
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.
-
How do I properly get the BlockState of a Block/Item?
Insane96MCP replied to Insane96MCP's topic in Modder Support
Yeah sorry, I meant ItemBlocks -
How do I properly get the BlockState of a Block/Item?
Insane96MCP replied to Insane96MCP's topic in Modder Support
Exactly. So unless I overwrite the items, there's no way to set itemstack for each itemblock blockstate -
How do I properly get the BlockState of a Block/Item?
Insane96MCP replied to Insane96MCP's topic in Modder Support
There's no way to do it for every single item with blockdata/meta? -
How do I properly get the BlockState of a Block/Item?
Insane96MCP replied to Insane96MCP's topic in Modder Support
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 -
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?
-
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?
-
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();
-
I might be wrong but isn't @SubscribeEvent the annotation for every event?
-
Ok seems like that even removing the recipe doesn't work It doesn't enter into the event (RegistryEvent.Register<IRecipe> or <Potion>)
-
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.
-
I have set in the config the number of torches a crafting gives and I need to change it.
-
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?
-
GuiIngameForge.renderFood = false not working
Insane96MCP replied to Insane96MCP's topic in Modder Support
Thanks a lot. World.getTotalWorldTime() and a subtraction did the job. Not a problem in my case. -
GuiIngameForge.renderFood = false not working
Insane96MCP replied to Insane96MCP's topic in Modder Support
How I can get game ticks (or seconds) elapsed? -
Check if two blocks are equal ignoring data (nbt, properties)
Insane96MCP replied to Insane96MCP's topic in Modder Support
Ok, I need to sleep now. I didn't think about comparing Blocks ... -
GuiIngameForge.renderFood = false not working
Insane96MCP replied to Insane96MCP's topic in Modder Support
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 -
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