when I change the methods/classes to the 1.17 mappings
@SubscribeEvent
public void onFogColor(EntityViewRenderEvent.FogColors event) {
Camera info = event.getInfo();
FogType state = info.getFluidInCamera();
if (state instanceof OilFluid) {
event.setRed(0.02F);
event.setGreen(0.01F);
event.setBlue(0.0F);
}
}
@SubscribeEvent
public void onFogDensity(EntityViewRenderEvent.FogDensity event) {
Camera info = event.getInfo();
FogType state = info.getFluidInCamera();
if (state instanceof OilFluid) {
GlStateManager._blendEquation(2048);
event.setDensity(1.0F);
event.setCanceled(true);
}
}
the error says the OilFluid is not a FogType (obviously)
I need help with fluid fog in 1.17.1 I know in 1.16.5 I would use
@SubscribeEvent @OnlyIn(Dist.CLIENT)
public void onFogColor(EntityViewRenderEvent.FogColors event) {
ActiveRenderInfo info = event.getInfo();
FluidState state = info.getFluidInCamera();
if (state.getType() instanceof OilFluid) {
event.setRed(0.02F);
event.setGreen(0.01F);
event.setBlue(0.0F);
}
}
@SubscribeEvent @OnlyIn(Dist.CLIENT)
public void onFogDensity(EntityViewRenderEvent.FogDensity event) {
ActiveRenderInfo info = event.getInfo();
FluidState state = info.getFluidInCamera();
if (state.getType() instanceof OilFluid) {
GlStateManager._fogMode(2048);
event.setDensity(1.0F);
event.setCanceled(true);
}
}
how do I do it in 1.17.1?
Ok Here is the Updated Code:
The Model Class:
My Renderer class:
And the updated Main Class:
Also, I realized that the Main Class Events shouldn't be static and now the game runs but the model isn't rendering.
Ok so I need getParentModel().copyPropertiesTo(suitModel);
And I ran to game to see no change.
looking back at the armor layer code I saw the copyPropertiesTo was in HumanoidModel
So I made my model extend HumanoidModel instead of AgeableListModel and I added:
but now the game won't run and I'm getting
Description: Rendering overlay
net.minecraftforge.fml.ModLoadingException: TestMod (test) encountered an error during the done event phase
§7java.util.NoSuchElementException: Can't find part head
What have I done wrong?
I've made a custom layer for the player but its not showing in game.
Here is my model class
Here is my Layer class
And the registry in the main class
What have I done wrong?
Ok here is my capability classes
My Capability:
My Provider:
And my IAstroInv just extends IItemHandlerModifiable
And it works... Until I quit the game and the items are no longer in the slots.
How do I fix the items disappearing after I quit the game?
Edit: I'm an idiot and I forgot to add super.serializeNBT(); and super.deserializeNBT(nbt); .
And last question how do I have the player drop all the items on death?
Edit Again I got it working with
public static Capability<IItemHandler> ITEM_HANDLER_CAPABILITY = CapabilityManager.get(new CapabilityToken<>(){});
but now the slots are filled with items in the hotbar slots.