Everything posted by Insane96MCP
-
Capabilities crash the world on loading
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?
Yeah sorry, I meant ItemBlocks
-
How do I properly get the BlockState of a Block/Item?
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?
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?
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
-
How do I properly get the BlockState of a Block/Item?
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?
-
[1.12] Replace Vanilla recipes?
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?
-
Player's EntityData in LivingHurt and LivingUpdate events return different values?
Yep, I was writing only on client in the Update. I have misdone the if (world.isRemote)
-
Player's EntityData in LivingHurt and LivingUpdate events return different values?
Didn't check anywhere if client or server so it should write it in both
-
Player's EntityData in LivingHurt and LivingUpdate events return different values?
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.
-
[1.12] Replace Vanilla recipes?
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();
-
Player's EntityData in LivingHurt and LivingUpdate events return different values?
I mean one for each event
-
Player's EntityData in LivingHurt and LivingUpdate events return different values?
Saving some timers, a "weight" value for the player.
-
[1.12] Replace Vanilla recipes?
I might be wrong but isn't @SubscribeEvent the annotation for every event?
-
Player's EntityData in LivingHurt and LivingUpdate events return different values?
What should I use?
-
[1.12] Replace Vanilla recipes?
Ok seems like that even removing the recipe doesn't work It doesn't enter into the event (RegistryEvent.Register<IRecipe> or <Potion>)
-
Player's EntityData in LivingHurt and LivingUpdate events return different values?
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.
-
[1.12] Replace Vanilla recipes?
I have set in the config the number of torches a crafting gives and I need to change it.
-
[1.12] Replace Vanilla recipes?
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
Thanks a lot. World.getTotalWorldTime() and a subtraction did the job. Not a problem in my case.
-
GuiIngameForge.renderFood = false not working
How I can get game ticks (or seconds) elapsed?
-
Check if two blocks are equal ignoring data (nbt, properties)
Ok, I need to sleep now. I didn't think about comparing Blocks ...
-
Check if two blocks are equal ignoring data (nbt, properties)
This thing works but is ugly af: world.getBlockState(bedPos).getBlock().getRegistryName().toString().equals(Blocks.BED.getRegistryName().toString())
-
GuiIngameForge.renderFood = false not working
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
-
GuiIngameForge.renderFood = false not working
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
IPS spam blocked by CleanTalk.