Skip to content

Commit fe520c4

Browse files
committed
fix: Use Block Display for client performance reasons
1 parent abe0cc0 commit fe520c4

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Project Specifics
2-
projectVersion=0.9.3
2+
projectVersion=0.9.3-blanketcon.1
33
modrinthId=G9eJHDO2
44

55
# Minecraft

src/main/java/gay/ampflower/polysit/SeatEntity.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,12 @@
1414
import net.minecraft.entity.damage.DamageSource;
1515
import net.minecraft.entity.data.DataTracker;
1616
import net.minecraft.nbt.NbtCompound;
17-
import net.minecraft.network.packet.s2c.play.EntityAttributesS2CPacket;
18-
import net.minecraft.network.packet.s2c.play.EntitySpawnS2CPacket;
1917
import net.minecraft.server.network.ServerPlayerEntity;
2018
import net.minecraft.util.math.BlockPos;
2119
import net.minecraft.world.World;
2220

2321
import java.util.Collection;
2422
import java.util.Collections;
25-
import java.util.List;
26-
27-
import static net.minecraft.entity.decoration.ArmorStandEntity.ARMOR_STAND_FLAGS;
2823

2924
/**
3025
* The ephemeral seat entity used to allow the player to have a sit pose
@@ -73,25 +68,7 @@ public SeatEntity(World world, double x, double y, double z) {
7368
*/
7469
@Override
7570
public EntityType<?> getPolymerEntityType(ServerPlayerEntity player) {
76-
return EntityType.ARMOR_STAND;
77-
}
78-
79-
/**
80-
* Tells the client that we're a marker armor stand, and that we have no health.
81-
*/
82-
@Override
83-
public void modifyRawTrackedData(List<DataTracker.SerializedEntry<?>> data, ServerPlayerEntity player,
84-
boolean initial) {
85-
data.add(new DataTracker.Entry<>(ARMOR_STAND_FLAGS, (byte) 16).toSerialized());
86-
// This must be manually sent as there's no other mechanism we can use to send
87-
// this.
88-
if (player != null) {
89-
// Really, this shouldn't be null but apparently Polymer 0.3.13+1.19.3 is
90-
// slightly busted in that joining a world while sitting on a seat causes an
91-
// instant crash.
92-
// We can at least mitigate it here.
93-
player.networkHandler.sendPacket(new EntityAttributesS2CPacket(getId(), MAX_HEALTH_NULL_SINGLE));
94-
}
71+
return EntityType.BLOCK_DISPLAY;
9572
}
9673

9774
@Override

0 commit comments

Comments
 (0)