mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Modify ScreenEvent.RenderInventoryMobEffects to allow moving the effect stack left or right (#8951)
This commit is contained in:
1 parent
b8b3201372
commit
a4f52f4057
4 files changed
+44
-9
No files matched your search
@@ -7,6 +7,7 @@ package net.minecraftforge.debug.client;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.ScreenEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -49,10 +50,15 @@ public class PotionSizeEventTest
|
||||
if (player.getActiveEffects().size() <= 3)
|
||||
{
|
||||
event.setCompact(true); // Force compact mode for 3 or less active effects
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
event.setCompact(false); // Force classic mode for 4 or more active effects
|
||||
}
|
||||
if (player.hasEffect(MobEffects.MOVEMENT_SLOWDOWN))
|
||||
{
|
||||
event.addHorizontalOffset(20); // Move the effect rendering to the right when slowness is enabled
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user