how 2 police

This commit is contained in:
Shadows_of_Fire 2017-08-06 04:29:28 -04:00
parent ab76551cde
commit 64e6df805b
2 changed files with 13 additions and 1 deletions

View file

@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.data;
import de.ellpeck.actuallyadditions.api.laser.Network;
import de.ellpeck.actuallyadditions.mod.data.PlayerData.PlayerSave;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.LaserRelayConnectionHandler;
import de.ellpeck.actuallyadditions.mod.util.AwfulUtil;
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
import io.netty.util.internal.ConcurrentSet;
import net.minecraft.nbt.CompressedStreamTools;
@ -98,7 +99,7 @@ public class WorldData extends WorldSavedData{
ModUtil.LOGGER.info("Created temporary WorldData to cache data on the client!");
}
}
if(data == null) AwfulUtil.callTheFuckinPolice(world, forceLoad, data);
return data;
}

View file

@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.storage.loot.LootContext;
import net.minecraft.world.storage.loot.LootTable;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
import java.util.Collections;
@ -95,4 +96,14 @@ public final class AwfulUtil{
Collections.shuffle(list, rand);
return list;
}
public static void callTheFuckinPolice(Object... stuff) {
int i = 0;
String error = "Actually Additions: Something is incredibly wrong. I don't know what you did, or how this method got called. But something is just completely wrong. This method was provided with ";
for(Object k : stuff) {
error += ("\n" + i++ + ":" + (k == null ? "null" : (k.getClass() + "<- CLASS | INSTANCE ->" + k.toString() + ", ")));
}
error += "\n" + "The current side is: " + FMLCommonHandler.instance().getEffectiveSide();
throw new IllegalStateException(error);
}
}