Fix mistake in spawnerclaw, made debug atlas dump harder to trigger

This commit is contained in:
Vincent Lee committed 2016-02-22 23:10:01 -06:00
1 parent 9d6c10f354
commit 1ed833a4a7
2 files changed
+8 -5

No files matched your search

@@ -19,6 +19,7 @@ import net.minecraft.launchwrapper.Launch;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import org.apache.commons.lang3.text.WordUtils;
import org.lwjgl.BufferUtils;
@@ -165,14 +166,15 @@ public class MiscellaneousIcons {
@SubscribeEvent
public void dumpAtlas(ArrowLooseEvent evt) {
if (!evt.entityPlayer.worldObj.isRemote || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")))
if (!evt.entityPlayer.worldObj.isRemote || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"))
|| !evt.entityPlayer.isSneaking())
return;
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
System.out.printf("Atlas is %d wide by %d tall%n", width, height);
FMLLog.info("[Botania]: Dumped atlas %d wide by %d tall%n", width, height);
int pixels = width * height;
@@ -202,7 +204,7 @@ public class MiscellaneousIcons {
try {
ImageIO.write(bufferedimage, "png", result);
} catch (IOException e) {
e.printStackTrace();
FMLLog.warning("[Botania]: Failed to dump debug atlas");
}
}
@@ -91,8 +91,9 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
EntityLiving entityliving = entity instanceof EntityLiving ? (EntityLiving)entity : null;
entity.setLocationAndAngles(d2, d3, d4, logic.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F);
if(entityliving == null || entityliving.getCanSpawnHere() && entityliving.isNotColliding()) {
MethodHandles.spawnNewEntity.invokeExact(logic, entity, true);
if(entityliving == null || entityliving.getCanSpawnHere()) {
// Must accept return value so methodhandle dynamically binds correctly
Entity e = ((Entity) MethodHandles.spawnNewEntity.invokeExact(logic, entity, true));
this.getWorld().playAuxSFX(2004, logic.getSpawnerPosition(), 0);
if(entityliving != null) {