Archive incari-client (client, 26.3, clean)
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Tue, 29 Sep 2026 18:53:34 -0400
|
||||
Subject: [PATCH] blocks: Collide with 1.8's block shapes on 1.8 servers
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index 3eee59b8eb2c635605a013b982fe57731a96e162..dcdeef5b5d58e0ba1ef8b69734d057e634fce0c6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -681,2 +681,6 @@
|
||||
public VoxelShape getShape(final BlockGetter level, final BlockPos pos, final CollisionContext context) {
|
||||
+ // Incari start: 1.8's shapes on 1.8 servers
|
||||
+ VoxelShape legacy = incari.client.legacy.LegacyShapes.outline(this.asState(), level, pos);
|
||||
+ if (legacy != null) return legacy;
|
||||
+ // Incari end
|
||||
return this.getBlock().getShape(this.asState(), level, pos, context);
|
||||
@@ -685,2 +689,6 @@
|
||||
public VoxelShape getCollisionShape(final BlockGetter level, final BlockPos pos) {
|
||||
+ // Incari start: 1.8's shapes on 1.8 servers
|
||||
+ VoxelShape legacy = incari.client.legacy.LegacyShapes.collision(this.asState(), level, pos);
|
||||
+ if (legacy != null) return legacy;
|
||||
+ // Incari end
|
||||
return this.cache != null ? this.cache.collisionShape : this.getCollisionShape(level, pos, CollisionContext.empty());
|
||||
@@ -689,2 +697,6 @@
|
||||
public VoxelShape getCollisionShape(final BlockGetter level, final BlockPos pos, final CollisionContext context) {
|
||||
+ // Incari start: 1.8's shapes on 1.8 servers
|
||||
+ VoxelShape legacy = incari.client.legacy.LegacyShapes.collision(this.asState(), level, pos);
|
||||
+ if (legacy != null) return legacy;
|
||||
+ // Incari end
|
||||
return this.getBlock().getCollisionShape(this.asState(), level, pos, context);
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Wed, 30 Sep 2026 23:13:24 -0400
|
||||
Subject: [PATCH] blocks: Share block states' arrays of occlusion faces
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Blocks.java b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
index bb709f69cdc3615528568a98dab97ec8493b8026..801f5ada3e1426c033dd783f101a09320e1de88a 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Blocks.java
|
||||
@@ -5945,2 +5945,5 @@
|
||||
});
|
||||
+ // Incari start: what the states share is settled
|
||||
+ incari.client.memory.BlockStateSharing.done();
|
||||
+ // Incari end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index dcdeef5b5d58e0ba1ef8b69734d057e634fce0c6..c3d583ea0aed5a432b55cf365c997302ee2e8be8 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -531,2 +531,5 @@
|
||||
}
|
||||
+ // Incari start: states with the same faces share one array of them
|
||||
+ this.occlusionShapesByFace = incari.client.memory.BlockStateSharing.faces(this.occlusionShapesByFace);
|
||||
+ // Incari end
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Wed, 30 Sep 2026 23:13:24 -0400
|
||||
Subject: [PATCH] blocks: Work out sturdy faces once per support shape, and
|
||||
share the tables
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index c3d583ea0aed5a432b55cf365c997302ee2e8be8..c184f3cd81cefa738f82d8ce9a9a70626f687665 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -980,3 +980,4 @@
|
||||
.anyMatch(axis -> this.collisionShape.min(axis) < 0.0 || this.collisionShape.max(axis) > 1.0);
|
||||
- this.faceSturdy = new boolean[DIRECTIONS.length * SUPPORT_TYPE_COUNT];
|
||||
+ // Incari start: worked out once per support shape, and states with the same answers share one table
|
||||
+ boolean[] faceSturdy = new boolean[DIRECTIONS.length * SUPPORT_TYPE_COUNT];
|
||||
|
||||
@@ -984,3 +985,3 @@
|
||||
for (SupportType type : SupportType.values()) {
|
||||
- this.faceSturdy[getFaceSupportIndex(direction, type)] = type.isSupporting(state, EmptyBlockGetter.INSTANCE, BlockPos.ZERO, direction);
|
||||
+ faceSturdy[getFaceSupportIndex(direction, type)] = incari.client.memory.BlockStateSharing.isSupporting(type, state, direction);
|
||||
}
|
||||
@@ -988,2 +989,5 @@
|
||||
|
||||
+ this.faceSturdy = incari.client.memory.BlockStateSharing.flags(faceSturdy);
|
||||
+ // Incari end
|
||||
+
|
||||
this.isCollisionShapeFullBlock = Block.isShapeFullBlock(state.getCollisionShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO));
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: incari-client <335801235+incari-client@users.noreply.github.com>
|
||||
Date: Wed, 30 Sep 2026 23:16:03 -0400
|
||||
Subject: [PATCH] blocks: Ask whether a shape fills the block once per shape at
|
||||
bootstrap
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
index c184f3cd81cefa738f82d8ce9a9a70626f687665..8541a39dac02e8b0432e7c9a74ad4dec9e7d46f3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
|
||||
@@ -520,3 +520,5 @@
|
||||
this.occlusionShape = this.canOcclude ? this.owner.getOcclusionShape(this.asState()) : Shapes.empty();
|
||||
- this.solidRender = Block.isShapeFullBlock(this.occlusionShape);
|
||||
+ // Incari start: asked once per shape at bootstrap
|
||||
+ this.solidRender = incari.client.memory.BlockStateSharing.isFullBlock(this.occlusionShape);
|
||||
+ // Incari end
|
||||
if (this.occlusionShape.isEmpty()) {
|
||||
@@ -992,3 +994,5 @@
|
||||
|
||||
- this.isCollisionShapeFullBlock = Block.isShapeFullBlock(state.getCollisionShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO));
|
||||
+ // Incari start: asked once per shape at bootstrap
|
||||
+ this.isCollisionShapeFullBlock = incari.client.memory.BlockStateSharing.isFullBlock(state.getCollisionShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO));
|
||||
+ // Incari end
|
||||
}
|
||||
Reference in New Issue
Block a user