New guard condition in genreateLightBrightnessTable()

Some users were reporting very sporatic crashes in
generateLightBrightnessTable() when the server was starting up.  It's
possible that very occasionally, the server will register the pocket
dimension before any pocket dimension data is initialized, forcing the
light brightness table to get generated server side with bad values.
This commit is contained in:
Stephen Baynham 2015-07-21 19:01:36 -04:00
parent 7a82abf182
commit 27d17d86a1

View file

@ -1,5 +1,6 @@
package StevenDimDoors.mod_pocketDim.world;
import StevenDimDoors.mod_pocketDim.core.NewDimData;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.Vec3;
@ -89,7 +90,8 @@ public class PocketProvider extends WorldProvider
@Override
protected void generateLightBrightnessTable()
{
if(!PocketManager.isLoaded() || PocketManager.getDimensionData(this.dimensionId).type() == DimensionType.POCKET)
NewDimData data = PocketManager.getDimensionData(this.dimensionId);
if(!PocketManager.isLoaded() || data == null || data.type() == DimensionType.POCKET)
{
super.generateLightBrightnessTable();
return;