Skip to content

Commit 54046fc

Browse files
committed
Patched up
- Bump rope pulley view distance Creators-of-Create#4836 - Add mod git commit to debug information
1 parent b180f9a commit 54046fc

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorPulleyRenderer.java

-5
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ protected SuperByteBuffer getRotatedCoil(KineticBlockEntity be) {
103103
blockState.getValue(ElevatorPulleyBlock.HORIZONTAL_FACING));
104104
}
105105

106-
@Override
107-
public int getViewDistance() {
108-
return 128;
109-
}
110-
111106
@Override
112107
public boolean shouldRenderOffScreen(ElevatorPulleyBlockEntity p_188185_1_) {
113108
return true;

src/main/java/com/simibubi/create/content/contraptions/pulley/AbstractPulleyRenderer.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.mojang.blaze3d.vertex.VertexConsumer;
55
import com.simibubi.create.content.kinetics.base.KineticBlockEntity;
66
import com.simibubi.create.content.kinetics.base.KineticBlockEntityRenderer;
7+
import com.simibubi.create.infrastructure.config.AllConfigs;
78

89
import dev.engine_room.flywheel.api.visualization.VisualizationManager;
910
import dev.engine_room.flywheel.lib.model.baked.PartialModel;
@@ -90,7 +91,7 @@ public static void renderAt(LevelAccessor world, SuperByteBuffer partial, float
9091
protected abstract Axis getShaftAxis(T be);
9192

9293
protected abstract PartialModel getCoil();
93-
94+
9495
protected abstract SpriteShiftEntry getCoilShift();
9596

9697
protected abstract SuperByteBuffer renderRope(T be);
@@ -126,7 +127,7 @@ public static SuperByteBuffer scrollCoil(SuperByteBuffer sbb, SpriteShiftEntry c
126127

127128
@Override
128129
public int getViewDistance() {
129-
return 256;
130+
return AllConfigs.server().kinetics.maxRopeLength.get();
130131
}
131132

132133
}

src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyRenderer.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public static boolean isPulleyRunning(PulleyBlockEntity be) {
5858
protected SpriteShiftEntry getCoilShift() {
5959
return AllSpriteShifts.ROPE_PULLEY_COIL;
6060
}
61-
61+
6262
public static float getBlockEntityOffset(float partialTicks, PulleyBlockEntity blockEntity) {
6363
float offset = blockEntity.getInterpolatedOffset(partialTicks);
6464

@@ -72,9 +72,4 @@ public static float getBlockEntityOffset(float partialTicks, PulleyBlockEntity b
7272
return offset;
7373
}
7474

75-
@Override
76-
public int getViewDistance() {
77-
return 128;
78-
}
79-
8075
}

src/main/java/com/simibubi/create/infrastructure/debugInfo/DebugInformation.java

+11-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import net.minecraft.Util;
3131
import net.minecraft.client.Minecraft;
3232
import net.minecraft.client.resources.language.I18n;
33-
import oshi.SystemInfo;
3433

3534
/**
3635
* Allows for providing easily accessible debugging information.
@@ -72,6 +71,8 @@ public static List<DebugInfoSection> getServerInfo() {
7271
static {
7372
DebugInfoSection.builder(Create.NAME)
7473
.put("Mod Version", CreateBuildInfo.VERSION)
74+
.put("Mod Git Commit", CreateBuildInfo.GIT_COMMIT)
75+
.put("Ponder Version", getVersionOfMod("ponder"))
7576
.put("Forge Version", getVersionOfMod("forge"))
7677
.put("Minecraft Version", SharedConstants.getCurrentVersion().getName())
7778
.buildTo(DebugInformation::registerBothInfo);
@@ -115,7 +116,11 @@ public static String getVersionOfMod(String id) {
115116
public static Collection<InfoElement> listAllOtherMods() {
116117
List<InfoElement> mods = new ArrayList<>();
117118
ModList.get().forEachModContainer((id, mod) -> {
118-
if (!id.equals(Create.ID) && !id.equals("forge") && !id.equals("minecraft") && !id.equals("flywheel")) {
119+
if (!id.equals(Create.ID) &&
120+
!id.equals("forge") &&
121+
!id.equals("minecraft") &&
122+
!id.equals("flywheel") &&
123+
!id.equals("ponder")) {
119124
IModInfo info = mod.getModInfo();
120125
String name = info.getDisplayName();
121126
String version = info.getVersion().toString();
@@ -141,10 +146,11 @@ public static Collection<InfoElement> listAllGraphicsCards() {
141146
}
142147

143148
public static String getTotalRam() {
144-
long availableMemory = new SystemInfo().getHardware().getMemory().getAvailable();
145-
long totalMemory = new SystemInfo().getHardware().getMemory().getTotal();
149+
Runtime runtime = Runtime.getRuntime();
150+
long availableMemory = runtime.freeMemory();
151+
long totalMemory = runtime.totalMemory();
146152
long usedMemory = totalMemory - availableMemory;
147-
return String.format("%s bytes (%s MiB) / %s bytes (%s MiB)", usedMemory, usedMemory / 1049000, totalMemory, totalMemory / 1049000);
153+
return String.format("%s bytes (%s MiB) / %s bytes (%s MiB)", usedMemory, usedMemory / 1048576L, totalMemory, totalMemory / 1048576L);
148154
}
149155

150156
public static String getCpuInfo() {

0 commit comments

Comments
 (0)