Fix dimension types being incorrect when connecting to a non-Forge server. Closes #6203

This commit is contained in:
LexManos 2019-10-04 10:36:50 -07:00
parent 35bd69808c
commit dc5a06aab4

View file

@ -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) {