Fix dimension types being incorrect when connecting to a non-Forge server. Closes #6203
This commit is contained in:
parent
35bd69808c
commit
dc5a06aab4
1 changed files with 2 additions and 2 deletions
|
@ -66,7 +66,7 @@ public class NetworkHooks
|
|||
|
||||
public static IPacket<?> getEntitySpawningPacket(Entity entity)
|
||||
{
|
||||
return FMLNetworkConstants.playChannel.toVanillaPacket(new FMLPlayMessages.SpawnEntity(entity), NetworkDirection.PLAY_TO_CLIENT);
|
||||
return FMLNetworkConstants.playChannel.toVanillaPacket(new FMLPlayMessages.SpawnEntity(entity), NetworkDirection.PLAY_TO_CLIENT);
|
||||
}
|
||||
|
||||
public static boolean onCustomPayload(final ICustomPacket<?> packet, final NetworkManager manager) {
|
||||
|
@ -198,7 +198,7 @@ public class NetworkHooks
|
|||
// internal tracking map for custom dimensions received from servers for use on client.
|
||||
private static Int2ObjectMap<DimensionType> trackingMap = new Int2ObjectOpenHashMap<>();
|
||||
public static DimensionType getDummyDimType(final int dimension) {
|
||||
return trackingMap.getOrDefault(dimension, DimensionType.OVERWORLD);
|
||||
return trackingMap.computeIfAbsent(dimension, id -> DimensionType.getById(id));
|
||||
}
|
||||
|
||||
static void addCachedDimensionType(final DimensionType dimensionType, final ResourceLocation dimName) {
|
||||
|
|
Loading…
Reference in a new issue