Package me.desht.pneumaticcraft.client
Class ClientRegistryImpl
java.lang.Object
me.desht.pneumaticcraft.client.ClientRegistryImpl
- All Implemented Interfaces:
IClientRegistry
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HashMap<net.minecraft.resources.ResourceLocation,IAssemblyRenderOverriding> -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawPressureGauge(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.gui.Font fontRenderer, float minPressure, float maxPressure, float dangerPressure, float minWorkingPressure, float currentPressure, int xPos, int yPos) Draw a Pressure Gauge in GUI context, the same as in many PneumaticCraft machine GUI's.getAnimatedStat(net.minecraft.client.gui.screens.Screen gui, int backgroundColor) Creates a GuiAnimatedStat without icon.getAnimatedStat(net.minecraft.client.gui.screens.Screen gui, net.minecraft.resources.ResourceLocation iconTexture, int backgroundColor) Creates a GuiAnimatedStat which uses a texture location as static icon.getAnimatedStat(net.minecraft.client.gui.screens.Screen gui, net.minecraft.world.item.ItemStack iconStack, int backgroundColor) Creates a GuiAnimatedStat which uses an itemstack as static icon.static ClientRegistryImplvoidregisterRenderOverride(net.minecraftforge.registries.IForgeRegistryEntry<?> entry, IAssemblyRenderOverriding renderOverride) Register some custom item rendering behaviour for an item when held in an Assembly machine.
-
Field Details
-
renderOverrides
public static final HashMap<net.minecraft.resources.ResourceLocation,IAssemblyRenderOverriding> renderOverrides
-
-
Method Details
-
getInstance
-
getAnimatedStat
public IGuiAnimatedStat getAnimatedStat(net.minecraft.client.gui.screens.Screen gui, int backgroundColor) Description copied from interface:IClientRegistryCreates a GuiAnimatedStat without icon.- Specified by:
getAnimatedStatin interfaceIClientRegistry- Parameters:
gui- the owning GUI screenbackgroundColor- background color for the stat in ARGB format- Returns:
- a new stat widget
-
getAnimatedStat
public IGuiAnimatedStat getAnimatedStat(net.minecraft.client.gui.screens.Screen gui, net.minecraft.world.item.ItemStack iconStack, int backgroundColor) Description copied from interface:IClientRegistryCreates a GuiAnimatedStat which uses an itemstack as static icon.- Specified by:
getAnimatedStatin interfaceIClientRegistry- Parameters:
gui- the owning GUI screeniconStack- an itemstack to use as the stat widget's iconbackgroundColor- background color for the stat in ARGB format- Returns:
- a new stat widget
-
getAnimatedStat
public IGuiAnimatedStat getAnimatedStat(net.minecraft.client.gui.screens.Screen gui, net.minecraft.resources.ResourceLocation iconTexture, int backgroundColor) Description copied from interface:IClientRegistryCreates a GuiAnimatedStat which uses a texture location as static icon.- Specified by:
getAnimatedStatin interfaceIClientRegistry- Parameters:
gui- the owning GUI screeniconTexture- a texture to use as the stat widget's iconbackgroundColor- background color for the stat in ARGB format- Returns:
- a new stat widget
-
drawPressureGauge
public void drawPressureGauge(com.mojang.blaze3d.vertex.PoseStack matrixStack, net.minecraft.client.gui.Font fontRenderer, float minPressure, float maxPressure, float dangerPressure, float minWorkingPressure, float currentPressure, int xPos, int yPos) Description copied from interface:IClientRegistryDraw a Pressure Gauge in GUI context, the same as in many PneumaticCraft machine GUI's.- Specified by:
drawPressureGaugein interfaceIClientRegistry- Parameters:
matrixStack- the matrix stackfontRenderer- fontrenderer used to draw the numbers of the pressure gauge.minPressure- The minimal pressure that needs to be displayed (this is -1 in most applications).maxPressure- The maximal pressure that needs to be rendered (seePressureTierfor standard pressure thresholds)dangerPressure- The transition pressure from green to red (seePressureTierfor standard pressure thresholds)minWorkingPressure- The transition pressure from yellow to green (varies per machine).currentPressure- The pressure that the needle should point to.xPos- x position of the gauge.yPos- y position of the gauge.
-
registerRenderOverride
public void registerRenderOverride(@Nonnull net.minecraftforge.registries.IForgeRegistryEntry<?> entry, @Nonnull IAssemblyRenderOverriding renderOverride) Description copied from interface:IClientRegistryRegister some custom item rendering behaviour for an item when held in an Assembly machine.- Specified by:
registerRenderOverridein interfaceIClientRegistry- Parameters:
entry- a Forge registry entry, which should be an itemrenderOverride- customized rendering behaviour for that item
-