mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 02:45:13 +00:00
Update spawner claw to use methodhandles
This commit is contained in:
1 parent
91d234e6ed
commit
d7d4440b0e
21 files changed
+128
-117
No files matched your search
@@ -17,7 +17,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -27,7 +26,6 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -37,7 +35,6 @@ import vazkii.botania.api.wand.ICoordBoundItem;
|
||||
import vazkii.botania.api.wand.IWireframeAABBProvider;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public final class BoundTileRenderer {
|
||||
|
||||
@@ -103,9 +100,9 @@ public final class BoundTileRenderer {
|
||||
double renderPosX, renderPosY, renderPosZ;
|
||||
|
||||
try {
|
||||
renderPosX = (double) BotaniaMethodHandles.GETRENDERPOSX.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.GETRENDERPOSY.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.GETRENDERPOSZ.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosX = (double) BotaniaMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
} catch (Throwable t) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BlockRendererDispatcher;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.model.IBakedModel;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -26,7 +25,6 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.lexicon.multiblock.IMultiblockRenderHook;
|
||||
@@ -36,7 +34,6 @@ import vazkii.botania.api.lexicon.multiblock.component.MultiblockComponent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public final class MultiblockRenderHandler {
|
||||
|
||||
@@ -145,9 +142,9 @@ public final class MultiblockRenderHandler {
|
||||
double renderPosX, renderPosY, renderPosZ;
|
||||
|
||||
try {
|
||||
renderPosX = (double) BotaniaMethodHandles.GETRENDERPOSX.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.GETRENDERPOSY.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.GETRENDERPOSZ.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosX = (double) BotaniaMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
} catch (Throwable t) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -17,20 +17,17 @@ import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.common.block.tile.string.TileRedString;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public final class RedStringRenderer {
|
||||
|
||||
@@ -73,9 +70,9 @@ public final class RedStringRenderer {
|
||||
double renderPosX, renderPosY, renderPosZ;
|
||||
|
||||
try {
|
||||
renderPosX = (double) BotaniaMethodHandles.GETRENDERPOSX.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.GETRENDERPOSY.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.GETRENDERPOSZ.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosX = (double) BotaniaMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
} catch (Throwable t) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import java.awt.Color;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -24,7 +23,6 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.subtile.ISubTileContainer;
|
||||
@@ -35,7 +33,6 @@ import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.item.ItemTwigWand;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public final class SubTileRadiusRenderHandler {
|
||||
|
||||
@@ -89,9 +86,9 @@ public final class SubTileRadiusRenderHandler {
|
||||
double renderPosX, renderPosY, renderPosZ;
|
||||
|
||||
try {
|
||||
renderPosX = (double) BotaniaMethodHandles.GETRENDERPOSX.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.GETRENDERPOSY.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.GETRENDERPOSZ.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosX = (double) BotaniaMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
} catch (Throwable t) {
|
||||
return;
|
||||
}
|
||||
@@ -134,9 +131,9 @@ public final class SubTileRadiusRenderHandler {
|
||||
double renderPosX, renderPosY, renderPosZ;
|
||||
|
||||
try {
|
||||
renderPosX = (double) BotaniaMethodHandles.GETRENDERPOSX.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.GETRENDERPOSY.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.GETRENDERPOSZ.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosX = (double) BotaniaMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
} catch (Throwable t) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ import net.minecraftforge.client.model.animation.Animation;
|
||||
import net.minecraftforge.client.model.animation.Event;
|
||||
import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.common.property.Properties;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -49,7 +48,6 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelCrystalCube;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -67,7 +65,7 @@ public class RenderTileCorporeaCrystalCube extends TileEntitySpecialRenderer<Til
|
||||
entity = new EntityItem(cube.getWorld(), cube.getPos().getX(), cube.getPos().getY(), cube.getPos().getZ(), new ItemStack(Blocks.stone));
|
||||
|
||||
try {
|
||||
BotaniaMethodHandles.SETITEMAGE.invokeExact(entity, ClientTickHandler.ticksInGame);
|
||||
BotaniaMethodHandles.itemAge_setter.invokeExact(entity, ClientTickHandler.ticksInGame);
|
||||
} catch (Throwable ignored) {}
|
||||
|
||||
stack = cube.getRequestTarget();
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
@@ -29,7 +28,6 @@ import vazkii.botania.client.core.handler.MiscellaneousIcons;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.common.block.tile.TileEnchanter;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class RenderTileEnchanter extends TileEntitySpecialRenderer<TileEnchanter> {
|
||||
|
||||
@@ -51,7 +49,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer<TileEnchanter
|
||||
item = new EntityItem(enchanter.getWorld(), enchanter.getPos().getX(), enchanter.getPos().getY() + 1, enchanter.getPos().getZ(), enchanter.itemToEnchant);
|
||||
|
||||
try {
|
||||
BotaniaMethodHandles.SETITEMAGE.invokeExact(item, ClientTickHandler.ticksInGame);
|
||||
BotaniaMethodHandles.itemAge_setter.invokeExact(item, ClientTickHandler.ticksInGame);
|
||||
} catch (Throwable ignored) {}
|
||||
|
||||
item.setEntityItemStack(enchanter.itemToEnchant);
|
||||
|
||||
@@ -18,14 +18,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class SubTileDaffomill extends SubTileFunctional {
|
||||
|
||||
@@ -56,7 +54,7 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
for(EntityItem item : items) {
|
||||
int age;
|
||||
try {
|
||||
age = (int) BotaniaMethodHandles.GETITEMAGE.invokeExact(item);
|
||||
age = (int) BotaniaMethodHandles.itemAge_getter.invokeExact(item);
|
||||
} catch (Throwable t) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -44,7 +43,6 @@ import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class SubTileHopperhock extends SubTileFunctional {
|
||||
|
||||
@@ -77,7 +75,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
for(EntityItem item : items) {
|
||||
int age;
|
||||
try {
|
||||
age = (int) BotaniaMethodHandles.GETITEMAGE.invokeExact(item);
|
||||
age = (int) BotaniaMethodHandles.itemAge_getter.invokeExact(item);
|
||||
} catch (Throwable t) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
@@ -49,7 +48,7 @@ public class SubTilePollidisiac extends SubTileFunctional {
|
||||
for(EntityItem item : items) {
|
||||
int age;
|
||||
try {
|
||||
age = (int) BotaniaMethodHandles.GETITEMAGE.invokeExact(item);
|
||||
age = (int) BotaniaMethodHandles.itemAge_getter.invokeExact(item);
|
||||
} catch (Throwable t) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-2
@@ -31,7 +31,6 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.item.IFlowerPlaceable;
|
||||
@@ -83,7 +82,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
for(EntityItem item : items) {
|
||||
int age;
|
||||
try {
|
||||
age = (int) BotaniaMethodHandles.GETITEMAGE.invokeExact(item);
|
||||
age = (int) BotaniaMethodHandles.itemAge_getter.invokeExact(item);
|
||||
} catch (Throwable t) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-3
@@ -19,7 +19,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
@@ -29,7 +28,6 @@ import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
|
||||
@@ -60,7 +58,7 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
for(EntityItem item : items) {
|
||||
int age;
|
||||
try {
|
||||
age = (int) BotaniaMethodHandles.GETITEMAGE.invokeExact(item);
|
||||
age = (int) BotaniaMethodHandles.itemAge_getter.invokeExact(item);
|
||||
} catch (Throwable t) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -19,14 +19,12 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class SubTileEndoflame extends SubTileGenerating {
|
||||
|
||||
@@ -51,7 +49,7 @@ public class SubTileEndoflame extends SubTileGenerating {
|
||||
for(EntityItem item : items) {
|
||||
int age;
|
||||
try {
|
||||
age = (int) BotaniaMethodHandles.GETITEMAGE.invokeExact(item);
|
||||
age = (int) BotaniaMethodHandles.itemAge_getter.invokeExact(item);
|
||||
} catch (Throwable t) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-3
@@ -20,13 +20,11 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
|
||||
@@ -60,7 +58,7 @@ public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
|
||||
int age;
|
||||
try {
|
||||
age = (int) BotaniaMethodHandles.GETITEMAGE.invokeExact(item);
|
||||
age = (int) BotaniaMethodHandles.itemAge_getter.invokeExact(item);
|
||||
} catch (Throwable t) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
@@ -33,7 +32,6 @@ import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class SubTileSpectrolus extends SubTileGenerating {
|
||||
|
||||
@@ -58,7 +56,7 @@ public class SubTileSpectrolus extends SubTileGenerating {
|
||||
|
||||
int age;
|
||||
try {
|
||||
age = (int) BotaniaMethodHandles.GETITEMAGE.invokeExact(item);
|
||||
age = (int) BotaniaMethodHandles.itemAge_getter.invokeExact(item);
|
||||
} catch (Throwable t) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -18,10 +18,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class TileOpenCrate extends TileSimpleInventory {
|
||||
|
||||
@@ -74,7 +72,7 @@ public class TileOpenCrate extends TileSimpleInventory {
|
||||
|
||||
if(redstone) {
|
||||
try {
|
||||
BotaniaMethodHandles.SETITEMAGE.invokeExact(item, -200);
|
||||
BotaniaMethodHandles.itemAge_setter.invokeExact(item, -200);
|
||||
} catch (Throwable ignored) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
*
|
||||
* File Created @ [Jul 23, 2014, 5:32:11 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.tile;
|
||||
@@ -26,8 +26,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import vazkii.botania.api.mana.IManaReceiver;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
|
||||
public class TileSpawnerClaw extends TileMod implements IManaReceiver {
|
||||
|
||||
@@ -35,13 +34,6 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
|
||||
|
||||
int mana = 0;
|
||||
|
||||
private static final Method isActivated = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.IS_ACTIVATED);
|
||||
private static final Field spawnDelay = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_DELAY);
|
||||
private static final Field mobRotation = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MOB_ROTATION);
|
||||
private static final Field prevMobRotation = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.PREV_MOB_ROTATION);
|
||||
private static final Method spawnNewEntity = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.SPAWN_NEW_ENTITY, Entity.class, boolean.class);
|
||||
private static final Method getEntityNameToSpawn = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.GET_ENTITY_TO_SPAWN);
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
TileEntity tileBelow = worldObj.getTileEntity(pos.down());
|
||||
@@ -51,26 +43,26 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
|
||||
|
||||
try {
|
||||
// Directly drawn from MobSpawnerBaseLogic, with inverted isActivated check and mana consumption
|
||||
if(!((Boolean) isActivated.invoke(logic))) {
|
||||
if(!((boolean) BotaniaMethodHandles.isActivated.invokeExact(logic))) {
|
||||
if(!worldObj.isRemote)
|
||||
mana -= 6;
|
||||
|
||||
if(logic.getSpawnerWorld().isRemote) {
|
||||
int delay = spawnDelay.getInt(logic);
|
||||
int delay = ((int) BotaniaMethodHandles.spawnDelay_getter.invokeExact(logic));
|
||||
if(delay > 0)
|
||||
spawnDelay.setInt(logic, delay - 1);
|
||||
BotaniaMethodHandles.spawnDelay_setter.invokeExact(logic, delay - 1);
|
||||
|
||||
if(Math.random() > 0.5)
|
||||
Botania.proxy.wispFX(worldObj, getPos().getX() + 0.3 + Math.random() * 0.5, getPos().getY() - 0.3 + Math.random() * 0.25, getPos().getZ() + Math.random(), 0.6F - (float) Math.random() * 0.3F, 0.1F, 0.6F - (float) Math.random() * 0.3F, (float) Math.random() / 3F, -0.025F - 0.005F * (float) Math.random(), 2F);
|
||||
|
||||
prevMobRotation.set(logic, logic.getMobRotation());
|
||||
mobRotation.set(logic, (logic.getMobRotation() + 1000.0F / (spawnDelay.getInt(logic) + 200.0F)) % 360.0D);
|
||||
BotaniaMethodHandles.prevMobRotation_setter.invokeExact(logic, logic.getMobRotation());
|
||||
BotaniaMethodHandles.mobRotation_setter.invokeExact(logic, (logic.getMobRotation() + 1000.0F / (((int) BotaniaMethodHandles.spawnDelay_getter.invokeExact(logic)) + 200.0F)) % 360.0D);
|
||||
} else {
|
||||
if(spawnDelay.getInt(logic) == -1)
|
||||
if(((int) BotaniaMethodHandles.spawnDelay_getter.invokeExact(logic)) == -1)
|
||||
resetTimer(logic);
|
||||
int delay = spawnDelay.getInt(logic);
|
||||
int delay = ((int) BotaniaMethodHandles.spawnDelay_getter.invokeExact(logic));
|
||||
if(delay > 0) {
|
||||
spawnDelay.setInt(logic, delay - 1);
|
||||
BotaniaMethodHandles.spawnDelay_setter.invokeExact(logic, delay - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,12 +71,12 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
|
||||
|
||||
boolean flag = false;
|
||||
|
||||
int spawnCount = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_COUNT);
|
||||
int spawnRange = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.SPAWN_RANGE);
|
||||
int maxNearbyEntities = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_NEARBY_ENTITIES);
|
||||
int spawnCount = ((int) BotaniaMethodHandles.spawnCount_getter.invokeExact(logic));
|
||||
int spawnRange = ((int) BotaniaMethodHandles.spawnRange_getter.invokeExact(logic));
|
||||
int maxNearbyEntities = ((int) BotaniaMethodHandles.maxNearbyEntities_getter.invokeExact(logic));
|
||||
|
||||
for(int i = 0; i < spawnCount; ++i) {
|
||||
Entity entity = EntityList.createEntityByName(((String) getEntityNameToSpawn.invoke(logic)), logic.getSpawnerWorld());
|
||||
Entity entity = EntityList.createEntityByName(((String) BotaniaMethodHandles.getEntityNameToSpawn.invokeExact(logic)), logic.getSpawnerWorld());
|
||||
|
||||
if (entity == null)
|
||||
return;
|
||||
@@ -103,7 +95,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
|
||||
entity.setLocationAndAngles(d2, d3, d4, logic.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F);
|
||||
|
||||
if(entityliving == null || entityliving.getCanSpawnHere() && entityliving.isNotColliding()) {
|
||||
spawnNewEntity.invoke(logic, entity, true);
|
||||
BotaniaMethodHandles.spawnNewEntity.invokeExact(logic, entity, true);
|
||||
this.getWorld().playAuxSFX(2004, logic.getSpawnerPosition(), 0);
|
||||
|
||||
if(entityliving != null) {
|
||||
@@ -120,23 +112,23 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver {
|
||||
|
||||
|
||||
}
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Direct copy of MobSpawnerBaseLogic.resetTimer()
|
||||
private void resetTimer(MobSpawnerBaseLogic logic) throws IllegalAccessException {
|
||||
int maxSpawnDelay = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MAX_SPAWN_DELAY);
|
||||
int minSpawnDelay = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.MIN_SPAWN_DELAY);
|
||||
List potentialEntitySpawns = ReflectionHelper.getPrivateValue(MobSpawnerBaseLogic.class, logic, LibObfuscation.POTENTIAL_ENTITY_SPAWNS);
|
||||
private void resetTimer(MobSpawnerBaseLogic logic) throws Throwable {
|
||||
int maxSpawnDelay = ((int) BotaniaMethodHandles.maxSpawnDelay_getter.invokeExact(logic));
|
||||
int minSpawnDelay = ((int) BotaniaMethodHandles.minSpawnDelay_getter.invokeExact(logic));
|
||||
List potentialEntitySpawns = ((List) BotaniaMethodHandles.potentialSpawns_getter.invokeExact(logic));
|
||||
|
||||
if(maxSpawnDelay <= minSpawnDelay)
|
||||
spawnDelay.set(logic, minSpawnDelay);
|
||||
BotaniaMethodHandles.spawnDelay_setter.invokeExact(logic, minSpawnDelay);
|
||||
else {
|
||||
int i = maxSpawnDelay - minSpawnDelay;
|
||||
spawnDelay.set(logic, minSpawnDelay + logic.getSpawnerWorld().rand.nextInt(i));
|
||||
BotaniaMethodHandles.spawnDelay_setter.invokeExact(logic, minSpawnDelay + logic.getSpawnerWorld().rand.nextInt(i));
|
||||
}
|
||||
|
||||
if(potentialEntitySpawns != null && potentialEntitySpawns.size() > 0)
|
||||
|
||||
@@ -34,7 +34,6 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -65,7 +64,6 @@ import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.item.ItemManaTablet;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLocked, ISparkAttachable, IThrottledPacket {
|
||||
|
||||
@@ -153,7 +151,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
|
||||
|
||||
int age;
|
||||
try {
|
||||
age = ((int) BotaniaMethodHandles.GETITEMAGE.invokeExact(item));
|
||||
age = ((int) BotaniaMethodHandles.itemAge_getter.invokeExact(item));
|
||||
} catch (Throwable throwable) { return false; }
|
||||
|
||||
if(age > 100 && age < 130 || !catalystsRegistered)
|
||||
@@ -173,7 +171,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
|
||||
ItemStack output = recipe.getOutput().copy();
|
||||
EntityItem outputItem = new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, output);
|
||||
try {
|
||||
BotaniaMethodHandles.SETITEMAGE.invokeExact(outputItem, 105);
|
||||
BotaniaMethodHandles.itemAge_setter.invokeExact(outputItem, 105);
|
||||
} catch (Throwable ignored) {}
|
||||
worldObj.spawnEntityInWorld(outputItem);
|
||||
}
|
||||
|
||||
@@ -2,43 +2,103 @@ package vazkii.botania.common.core.handler;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.tileentity.MobSpawnerBaseLogic;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
// MethodHandles for frequently reflected fields and methods.
|
||||
// Handles suffixed with _getter and _setter are for fields, while those without suffixes are normal methods.
|
||||
public final class BotaniaMethodHandles {
|
||||
|
||||
public static final MethodHandle
|
||||
GETRENDERPOSX, GETRENDERPOSY, GETRENDERPOSZ,
|
||||
GETITEMAGE, SETITEMAGE,
|
||||
GETPICKUPDELAY; // Already has setter in vanilla
|
||||
renderPosX_getter, renderPosY_getter, renderPosZ_getter, // RenderManager
|
||||
itemAge_getter, itemAge_setter, pickupDelay_getter, // EntityItem, pickup delay already has setter in vanilla
|
||||
spawnRange_getter, spawnCount_getter, maxNearbyEntities_getter,
|
||||
maxSpawnDelay_getter, minSpawnDelay_getter,
|
||||
spawnDelay_getter, spawnDelay_setter, prevMobRotation_setter, mobRotation_setter, potentialSpawns_getter,
|
||||
getEntityNameToSpawn, isActivated, spawnNewEntity; // MobSpawnerBaseLogic
|
||||
|
||||
static {
|
||||
try {
|
||||
Field f = ReflectionHelper.findField(RenderManager.class, LibObfuscation.RENDERPOSX);
|
||||
f.setAccessible(true);
|
||||
GETRENDERPOSX = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
renderPosX_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(RenderManager.class, LibObfuscation.RENDERPOSY);
|
||||
f.setAccessible(true);
|
||||
GETRENDERPOSY = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
renderPosY_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(RenderManager.class, LibObfuscation.RENDERPOSZ);
|
||||
f.setAccessible(true);
|
||||
GETRENDERPOSZ = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
renderPosZ_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(EntityItem.class, LibObfuscation.AGE);
|
||||
f.setAccessible(true);
|
||||
GETITEMAGE = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
SETITEMAGE = MethodHandles.publicLookup().unreflectSetter(f);
|
||||
itemAge_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
itemAge_setter = MethodHandles.publicLookup().unreflectSetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(EntityItem.class, LibObfuscation.PICKUP_DELAY);
|
||||
f.setAccessible(true);
|
||||
GETPICKUPDELAY = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
pickupDelay_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_RANGE);
|
||||
f.setAccessible(true);
|
||||
spawnRange_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_COUNT);
|
||||
f.setAccessible(true);
|
||||
spawnCount_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MAX_NEARBY_ENTITIES);
|
||||
f.setAccessible(true);
|
||||
maxNearbyEntities_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MAX_SPAWN_DELAY);
|
||||
f.setAccessible(true);
|
||||
maxSpawnDelay_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MIN_SPAWN_DELAY);
|
||||
f.setAccessible(true);
|
||||
minSpawnDelay_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_DELAY);
|
||||
f.setAccessible(true);
|
||||
spawnDelay_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_DELAY);
|
||||
f.setAccessible(true);
|
||||
spawnDelay_setter = MethodHandles.publicLookup().unreflectSetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.PREV_MOB_ROTATION);
|
||||
f.setAccessible(true);
|
||||
prevMobRotation_setter = MethodHandles.publicLookup().unreflectSetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MOB_ROTATION);
|
||||
f.setAccessible(true);
|
||||
mobRotation_setter = MethodHandles.publicLookup().unreflectSetter(f);
|
||||
|
||||
f = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.POTENTIAL_ENTITY_SPAWNS);
|
||||
f.setAccessible(true);
|
||||
potentialSpawns_getter = MethodHandles.publicLookup().unreflectGetter(f);
|
||||
|
||||
Method m = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.IS_ACTIVATED);
|
||||
m.setAccessible(true);
|
||||
isActivated = MethodHandles.publicLookup().unreflect(m);
|
||||
|
||||
m = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.SPAWN_NEW_ENTITY, Entity.class, boolean.class);
|
||||
m.setAccessible(true);
|
||||
spawnNewEntity = MethodHandles.publicLookup().unreflect(m);
|
||||
|
||||
m = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.GET_ENTITY_TO_SPAWN);
|
||||
m.setAccessible(true);
|
||||
getEntityNameToSpawn = MethodHandles.publicLookup().unreflect(m);
|
||||
} catch (Throwable t) {
|
||||
throw Throwables.propagate(t);
|
||||
}
|
||||
|
||||
@@ -21,10 +21,8 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import vazkii.botania.common.core.handler.BotaniaMethodHandles;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class EntityThrownItem extends EntityItem {
|
||||
|
||||
@@ -38,7 +36,7 @@ public class EntityThrownItem extends EntityItem {
|
||||
|
||||
int pickupDelay = 0;
|
||||
try {
|
||||
pickupDelay = (int) BotaniaMethodHandles.GETPICKUPDELAY.invokeExact(item);
|
||||
pickupDelay = (int) BotaniaMethodHandles.pickupDelay_getter.invokeExact(item);
|
||||
} catch (Throwable ignored) {}
|
||||
|
||||
item.setPickupDelay(pickupDelay);
|
||||
@@ -73,7 +71,7 @@ public class EntityThrownItem extends EntityItem {
|
||||
|
||||
int pickupDelay;
|
||||
try {
|
||||
pickupDelay = (int) BotaniaMethodHandles.GETPICKUPDELAY.invokeExact(this);
|
||||
pickupDelay = (int) BotaniaMethodHandles.pickupDelay_getter.invokeExact(this);
|
||||
} catch (Throwable ignored) { continue; }
|
||||
|
||||
if (entity1.canBeCollidedWith() && (!(entity1 instanceof EntityPlayer) || pickupDelay == 0))
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -37,7 +36,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
@@ -58,7 +56,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
|
||||
|
||||
@@ -401,9 +398,9 @@ public class ItemCraftingHalo extends ItemMod implements ICraftAchievement {
|
||||
double renderPosX, renderPosY, renderPosZ;
|
||||
|
||||
try {
|
||||
renderPosX = (double) BotaniaMethodHandles.GETRENDERPOSX.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.GETRENDERPOSY.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.GETRENDERPOSZ.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosX = (double) BotaniaMethodHandles.renderPosX_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosY = (double) BotaniaMethodHandles.renderPosY_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
renderPosZ = (double) BotaniaMethodHandles.renderPosZ_getter.invokeExact(Minecraft.getMinecraft().getRenderManager());
|
||||
} catch (Throwable t) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
import vazkii.botania.api.item.IExtendedWireframeCoordinateListProvider;
|
||||
@@ -43,7 +42,6 @@ import com.google.common.collect.Multimap;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
|
||||
public class ItemAesirRing extends ItemRelicBauble implements IExtendedWireframeCoordinateListProvider, ICraftAchievement {
|
||||
|
||||
@@ -73,12 +71,12 @@ public class ItemAesirRing extends ItemRelicBauble implements IExtendedWireframe
|
||||
entity.motionZ = event.entityItem.motionZ;
|
||||
|
||||
try {
|
||||
BotaniaMethodHandles.SETITEMAGE.invokeExact(entity, BotaniaMethodHandles.GETITEMAGE.invokeExact(entity));
|
||||
BotaniaMethodHandles.itemAge_setter.invokeExact(entity, BotaniaMethodHandles.itemAge_getter.invokeExact(entity));
|
||||
} catch (Throwable ignored) {}
|
||||
|
||||
int pickupDelay = 0;
|
||||
try {
|
||||
pickupDelay = (int) BotaniaMethodHandles.GETPICKUPDELAY.invokeExact(event.entityItem);
|
||||
pickupDelay = (int) BotaniaMethodHandles.pickupDelay_getter.invokeExact(event.entityItem);
|
||||
} catch (Throwable ignored) {}
|
||||
entity.setPickupDelay(pickupDelay);
|
||||
|
||||
|
||||
Reference in new issue
Block a user