Render Block Entities from further away

This commit is contained in:
2025-04-12 20:53:52 +02:00
parent ba6153fa41
commit f51bde3d6e
4 changed files with 35 additions and 1 deletions

View File

@ -49,12 +49,21 @@ As a challenge I'm trying to make it as user-friendly as possible.
- Toggleable
- 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
## General
- Rework config system
- Store server settings in world folder for better singleplayer use
- Rework Mod Menu integration to be more flexible
- Rework Mod Menu integration to be more flexible
## Server Side
- Telekinesis

View File

@ -11,4 +11,6 @@ public class ClientConfig {
public boolean renderSnowFog = false;
public boolean removeDarknessEffect = true;
public boolean lockTeleportHeadMovement = true;
public boolean alwaysRenderBlockEntities = true;
public int renderBlockEntitiesRange = 512;
}

View File

@ -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);
}
}

View File

@ -4,6 +4,7 @@
"compatibilityLevel": "JAVA_21",
"client": [
"BackgroundRendererMixin",
"BlockEntityRendererMixin",
"EntityMixin"
],
"injectors": {