Render Block Entities from further away
This commit is contained in:
@ -49,6 +49,15 @@ As a challenge I'm trying to make it as user-friendly as possible.
|
|||||||
- Toggleable
|
- Toggleable
|
||||||
- Keybinding for /camera
|
- Keybinding for /camera
|
||||||
|
|
||||||
|
# Currently working on
|
||||||
|
|
||||||
|
## Client Side
|
||||||
|
|
||||||
|
- [x] Render block entities from a longer range
|
||||||
|
- [x] Toggleable via GUI
|
||||||
|
- [x] Configurable value
|
||||||
|
- [ ] In GUI
|
||||||
|
|
||||||
# To-do
|
# To-do
|
||||||
|
|
||||||
## General
|
## General
|
||||||
|
@ -11,4 +11,6 @@ public class ClientConfig {
|
|||||||
public boolean renderSnowFog = false;
|
public boolean renderSnowFog = false;
|
||||||
public boolean removeDarknessEffect = true;
|
public boolean removeDarknessEffect = true;
|
||||||
public boolean lockTeleportHeadMovement = true;
|
public boolean lockTeleportHeadMovement = true;
|
||||||
|
public boolean alwaysRenderBlockEntities = true;
|
||||||
|
public int renderBlockEntitiesRange = 512;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
package wtf.hak.survivalfabric.mixin.client;
|
||||||
|
|
||||||
|
import net.minecraft.block.entity.BlockEntity;
|
||||||
|
import net.minecraft.client.render.Camera;
|
||||||
|
import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher;
|
||||||
|
import net.minecraft.client.render.block.entity.BlockEntityRenderer;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
import wtf.hak.survivalfabric.config.ConfigManager;
|
||||||
|
import wtf.hak.survivalfabric.config.client.ClientConfigManager;
|
||||||
|
|
||||||
|
@Mixin(BlockEntityRenderer.class)
|
||||||
|
public interface BlockEntityRendererMixin<T extends BlockEntity> {
|
||||||
|
|
||||||
|
@Inject(method = "getRenderDistance", at = @At("HEAD"), cancellable = true)
|
||||||
|
private void getRenderDistance(CallbackInfoReturnable<Integer> cir) {
|
||||||
|
if(ClientConfigManager.getConfig().alwaysRenderBlockEntities)
|
||||||
|
cir.setReturnValue(ClientConfigManager.getConfig().renderBlockEntitiesRange);
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@
|
|||||||
"compatibilityLevel": "JAVA_21",
|
"compatibilityLevel": "JAVA_21",
|
||||||
"client": [
|
"client": [
|
||||||
"BackgroundRendererMixin",
|
"BackgroundRendererMixin",
|
||||||
|
"BlockEntityRendererMixin",
|
||||||
"EntityMixin"
|
"EntityMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
|
Reference in New Issue
Block a user