forked from SteamWar/SteamWar
Fix FlatteningWrapper
This commit is contained in:
@@ -329,10 +329,6 @@ public class FlatteningWrapper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNamedSpawnPacketDataWatcher(Object packet) {
|
|
||||||
// field not present
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object formatDisplayName(String displayName) {
|
public Object formatDisplayName(String displayName) {
|
||||||
return displayName != null ? Optional.of(ChatWrapper.impl.stringToChatComponent(displayName)) : Optional.empty();
|
return displayName != null ? Optional.of(ChatWrapper.impl.stringToChatComponent(displayName)) : Optional.empty();
|
||||||
}
|
}
|
||||||
@@ -340,7 +336,7 @@ public class FlatteningWrapper {
|
|||||||
private static final Reflection.Field<net.minecraft.world.entity.EntityType> spawnType = Reflection.getField(ProtocolWrapper.spawnPacket, net.minecraft.world.entity.EntityType.class, 0);
|
private static final Reflection.Field<net.minecraft.world.entity.EntityType> spawnType = Reflection.getField(ProtocolWrapper.spawnPacket, net.minecraft.world.entity.EntityType.class, 0);
|
||||||
public void setSpawnPacketType(Object packet, EntityType type) {
|
public void setSpawnPacketType(Object packet, EntityType type) {
|
||||||
ResourceLocation key = CraftNamespacedKey.toMinecraft(type.getKey());
|
ResourceLocation key = CraftNamespacedKey.toMinecraft(type.getKey());
|
||||||
spawnType.set(packet, BuiltInRegistries.ENTITY_TYPE.get(key));
|
spawnType.set(packet, BuiltInRegistries.ENTITY_TYPE.get(key).get().value());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getViewDistance(Player player) {
|
public int getViewDistance(Player player) {
|
||||||
|
|||||||
Reference in New Issue
Block a user