Added a config option to reduce the rendering range of drawers
This commit is contained in:
parent
37deecbbdc
commit
6afd5ee8ba
|
@ -12,7 +12,7 @@ buildscript {
|
||||||
apply plugin: 'net.minecraftforge.gradle'
|
apply plugin: 'net.minecraftforge.gradle'
|
||||||
|
|
||||||
group = 'com.buuz135'
|
group = 'com.buuz135'
|
||||||
version = '1.18.2-0.0.15'
|
version = '1.18.2-0.0.16'
|
||||||
|
|
||||||
java {
|
java {
|
||||||
archivesBaseName = 'functionalstorage'
|
archivesBaseName = 'functionalstorage'
|
||||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.BlockHitResult;
|
import net.minecraft.world.phys.BlockHitResult;
|
||||||
import net.minecraft.world.phys.HitResult;
|
import net.minecraft.world.phys.HitResult;
|
||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
|
@ -127,4 +128,5 @@ public class DrawerTile extends ControllableDrawerTile<DrawerTile> {
|
||||||
public BigInventoryHandler getHandler() {
|
public BigInventoryHandler getHandler() {
|
||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,9 @@ public class CompactingDrawerRenderer implements BlockEntityRenderer<CompactingD
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(CompactingDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
public void render(CompactingDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
||||||
|
if (Minecraft.getInstance().player != null && !tile.getBlockPos().closerThan(Minecraft.getInstance().player.getOnPos(), FunctionalStorageClientConfig.DRAWER_RENDER_RANGE)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
matrixStack.pushPose();
|
matrixStack.pushPose();
|
||||||
|
|
||||||
Direction facing = tile.getFacingDirection();
|
Direction facing = tile.getFacingDirection();
|
||||||
|
|
|
@ -47,6 +47,9 @@ public class DrawerRenderer implements BlockEntityRenderer<DrawerTile> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(DrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
public void render(DrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
||||||
|
if (Minecraft.getInstance().player != null && !tile.getBlockPos().closerThan(Minecraft.getInstance().player.getOnPos(), FunctionalStorageClientConfig.DRAWER_RENDER_RANGE)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
matrixStack.pushPose();
|
matrixStack.pushPose();
|
||||||
|
|
||||||
Direction facing = tile.getFacingDirection();
|
Direction facing = tile.getFacingDirection();
|
||||||
|
|
|
@ -38,6 +38,9 @@ public class EnderDrawerRenderer implements BlockEntityRenderer<EnderDrawerTile>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(EnderDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
public void render(EnderDrawerTile tile, float partialTicks, PoseStack matrixStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) {
|
||||||
|
if (Minecraft.getInstance().player != null && !tile.getBlockPos().closerThan(Minecraft.getInstance().player.getOnPos(), FunctionalStorageClientConfig.DRAWER_RENDER_RANGE)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
matrixStack.pushPose();
|
matrixStack.pushPose();
|
||||||
|
|
||||||
Direction facing = tile.getFacingDirection();
|
Direction facing = tile.getFacingDirection();
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.buuz135.functionalstorage.client;
|
||||||
|
|
||||||
|
import com.hrznstudio.titanium.annotation.config.ConfigFile;
|
||||||
|
import com.hrznstudio.titanium.annotation.config.ConfigVal;
|
||||||
|
|
||||||
|
@ConfigFile(value = "functionalstorage-client")
|
||||||
|
public class FunctionalStorageClientConfig {
|
||||||
|
|
||||||
|
@ConfigVal(comment = "Drawer content render range in blocks")
|
||||||
|
@ConfigVal.InRangeInt(min = 1)
|
||||||
|
public static int DRAWER_RENDER_RANGE = 16;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user