mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 23:33:08 +00:00
Update to 1.11.2. Untested, still using outdated MCMP
This commit is contained in:
1 parent
2b02042f4c
commit
6a42eb64e3
666 files changed
+11360
-3713
No files matched your search
@@ -45,7 +45,7 @@ public class Coord4D
|
||||
yCoord = (int)entity.posY;
|
||||
zCoord = (int)entity.posZ;
|
||||
|
||||
dimensionId = entity.worldObj.provider.getDimension();
|
||||
dimensionId = entity.world.provider.getDimension();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,9 +57,9 @@ public class Coord4D
|
||||
*/
|
||||
public Coord4D(double x, double y, double z, int dimension)
|
||||
{
|
||||
xCoord = MathHelper.floor_double(x);
|
||||
yCoord = MathHelper.floor_double(y);
|
||||
zCoord = MathHelper.floor_double(z);
|
||||
xCoord = MathHelper.floor(x);
|
||||
yCoord = MathHelper.floor(y);
|
||||
zCoord = MathHelper.floor(z);
|
||||
|
||||
dimensionId = dimension;
|
||||
}
|
||||
@@ -295,7 +295,7 @@ public class Coord4D
|
||||
int subX = xCoord - obj.xCoord;
|
||||
int subY = yCoord - obj.yCoord;
|
||||
int subZ = zCoord - obj.zCoord;
|
||||
return (int)MathHelper.sqrt_double(subX * subX + subY * subY + subZ * subZ);
|
||||
return (int)MathHelper.sqrt(subX * subX + subY * subY + subZ * subZ);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -181,7 +181,7 @@ public class Pos3D extends Vec3d
|
||||
double subX = xCoord - pos.xCoord;
|
||||
double subY = yCoord - pos.yCoord;
|
||||
double subZ = zCoord - pos.zCoord;
|
||||
return MathHelper.sqrt_double(subX * subX + subY * subY + subZ * subZ);
|
||||
return MathHelper.sqrt(subX * subX + subY * subY + subZ * subZ);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
protected int updateDelay = 0;
|
||||
|
||||
protected boolean firstUpdate = true;
|
||||
protected World worldObj = null;
|
||||
protected World world = null;
|
||||
|
||||
public void addNewTransmitters(Collection<IGridTransmitter<A, N>> newTransmitters)
|
||||
{
|
||||
@@ -61,9 +61,9 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
{
|
||||
if(transmitter.isValid())
|
||||
{
|
||||
if(worldObj == null)
|
||||
if(world == null)
|
||||
{
|
||||
worldObj = transmitter.world();
|
||||
world = transmitter.world();
|
||||
}
|
||||
|
||||
for(EnumFacing side : EnumFacing.VALUES)
|
||||
@@ -180,7 +180,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
|
||||
public void invalidateTransmitter(IGridTransmitter<A, N> transmitter)
|
||||
{
|
||||
if(!worldObj.isRemote && transmitter.isValid())
|
||||
if(!world.isRemote && transmitter.isValid())
|
||||
{
|
||||
transmitter.takeShare();
|
||||
transmitter.setTransmitterNetwork(null);
|
||||
@@ -334,7 +334,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
|
||||
public World getWorld()
|
||||
{
|
||||
return worldObj;
|
||||
return world;
|
||||
}
|
||||
|
||||
public abstract Set<Pair<Coord4D, A>> getAcceptors(Object data);
|
||||
|
||||
@@ -11,21 +11,21 @@ public final class StackUtils
|
||||
{
|
||||
public static List<ItemStack> split(ItemStack stack)
|
||||
{
|
||||
if(stack == null || stack.stackSize == 0)
|
||||
if(stack == null || stack.getCount() == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
List<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
if(stack.stackSize == 1)
|
||||
if(stack.getCount() == 1)
|
||||
{
|
||||
ret.add(stack);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int remain = stack.stackSize % 2;
|
||||
int split = (int)((float)(stack.stackSize)/2F);
|
||||
int remain = stack.getCount() % 2;
|
||||
int split = (int)((float)(stack.getCount())/2F);
|
||||
|
||||
ret.add(size(stack, split+remain));
|
||||
ret.add(size(stack, split));
|
||||
@@ -145,7 +145,7 @@ public final class StackUtils
|
||||
}
|
||||
|
||||
ItemStack ret = stack.copy();
|
||||
ret.stackSize = size;
|
||||
ret.setCount(size);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public final class StackUtils
|
||||
|
||||
public static int getSize(ItemStack stack)
|
||||
{
|
||||
return stack != null ? stack.stackSize : 0;
|
||||
return stack != null ? stack.getCount() : 0;
|
||||
}
|
||||
|
||||
public static List<ItemStack> getMergeRejects(ItemStack[] orig, ItemStack[] toAdd)
|
||||
@@ -213,7 +213,7 @@ public final class StackUtils
|
||||
return orig;
|
||||
}
|
||||
|
||||
return StackUtils.size(orig, Math.min(orig.getMaxStackSize(), orig.stackSize+toAdd.stackSize));
|
||||
return StackUtils.size(orig, Math.min(orig.getMaxStackSize(), orig.getCount()+toAdd.getCount()));
|
||||
}
|
||||
|
||||
public static ItemStack getMergeReject(ItemStack orig, ItemStack toAdd)
|
||||
@@ -233,7 +233,7 @@ public final class StackUtils
|
||||
return orig;
|
||||
}
|
||||
|
||||
int newSize = orig.stackSize+toAdd.stackSize;
|
||||
int newSize = orig.getCount()+toAdd.getCount();
|
||||
|
||||
if(newSize > orig.getMaxStackSize())
|
||||
{
|
||||
|
||||
@@ -212,7 +212,7 @@ import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderSkeleton;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.AbstractSkeleton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -289,7 +289,7 @@ public class ClientProxy extends CommonProxy
|
||||
@Override
|
||||
public void openPersonalChest(EntityPlayer entityplayer, int id, int windowId, boolean isBlock, BlockPos pos, EnumHand hand)
|
||||
{
|
||||
TileEntityPersonalChest tileEntity = (TileEntityPersonalChest)entityplayer.worldObj.getTileEntity(pos);
|
||||
TileEntityPersonalChest tileEntity = (TileEntityPersonalChest)entityplayer.world.getTileEntity(pos);
|
||||
|
||||
if(id == 0)
|
||||
{
|
||||
@@ -856,7 +856,7 @@ public class ClientProxy extends CommonProxy
|
||||
@Override
|
||||
public void addHitEffects(Coord4D coord, RayTraceResult mop)
|
||||
{
|
||||
if(Minecraft.getMinecraft().theWorld != null)
|
||||
if(Minecraft.getMinecraft().world != null)
|
||||
{
|
||||
Minecraft.getMinecraft().effectRenderer.addBlockHitEffects(coord.getPos(), mop);
|
||||
}
|
||||
@@ -1007,7 +1007,7 @@ public class ClientProxy extends CommonProxy
|
||||
});
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBabySkeleton.class, new IRenderFactory<EntityBabySkeleton>() {
|
||||
@Override
|
||||
public Render<EntitySkeleton> createRenderFor(RenderManager manager)
|
||||
public Render<AbstractSkeleton> createRenderFor(RenderManager manager)
|
||||
{
|
||||
return new RenderSkeleton(manager);
|
||||
}
|
||||
@@ -1114,20 +1114,20 @@ public class ClientProxy extends CommonProxy
|
||||
return context.getServerHandler().playerEntity;
|
||||
}
|
||||
else {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
return Minecraft.getMinecraft().player;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePacket(Runnable runnable, EntityPlayer player)
|
||||
{
|
||||
if(player == null || player.worldObj.isRemote)
|
||||
if(player == null || player.world.isRemote)
|
||||
{
|
||||
Minecraft.getMinecraft().addScheduledTask(runnable);
|
||||
}
|
||||
else if(player != null && !player.worldObj.isRemote)
|
||||
else if(player != null && !player.world.isRemote)
|
||||
{
|
||||
((WorldServer)player.worldObj).addScheduledTask(runnable); //singleplayer
|
||||
((WorldServer)player.world).addScheduledTask(runnable); //singleplayer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,9 +94,9 @@ public class ClientTickHandler
|
||||
{
|
||||
MekanismClient.ticksPassed++;
|
||||
|
||||
if(!hasNotified && mc.theWorld != null && Mekanism.latestVersionNumber != null && Mekanism.recentNews != null)
|
||||
if(!hasNotified && mc.world != null && Mekanism.latestVersionNumber != null && Mekanism.recentNews != null)
|
||||
{
|
||||
MekanismUtils.checkForUpdates(mc.thePlayer);
|
||||
MekanismUtils.checkForUpdates(mc.player);
|
||||
hasNotified = true;
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public class ClientTickHandler
|
||||
}
|
||||
}
|
||||
|
||||
if(mc.theWorld != null)
|
||||
if(mc.world != null)
|
||||
{
|
||||
shouldReset = true;
|
||||
}
|
||||
@@ -126,15 +126,15 @@ public class ClientTickHandler
|
||||
shouldReset = false;
|
||||
}
|
||||
|
||||
if(mc.theWorld != null && !Mekanism.proxy.isPaused())
|
||||
if(mc.world != null && !Mekanism.proxy.isPaused())
|
||||
{
|
||||
if((!initHoliday || MekanismClient.ticksPassed % 1200 == 0) && mc.thePlayer != null)
|
||||
if((!initHoliday || MekanismClient.ticksPassed % 1200 == 0) && mc.player != null)
|
||||
{
|
||||
HolidayManager.check();
|
||||
initHoliday = true;
|
||||
}
|
||||
|
||||
for(EntityPlayer entityPlayer : mc.theWorld.playerEntities)
|
||||
for(EntityPlayer entityPlayer : mc.world.playerEntities)
|
||||
{
|
||||
if(entityPlayer instanceof AbstractClientPlayer)
|
||||
{
|
||||
@@ -203,63 +203,63 @@ public class ClientTickHandler
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack bootStack = mc.thePlayer.getItemStackFromSlot(EntityEquipmentSlot.FEET);
|
||||
ItemStack bootStack = mc.player.getItemStackFromSlot(EntityEquipmentSlot.FEET);
|
||||
|
||||
if(bootStack != null && bootStack.getItem() instanceof ItemFreeRunners)
|
||||
{
|
||||
mc.thePlayer.stepHeight = 1.002F;
|
||||
mc.player.stepHeight = 1.002F;
|
||||
}
|
||||
else {
|
||||
if(mc.thePlayer.stepHeight == 1.002F)
|
||||
if(mc.player.stepHeight == 1.002F)
|
||||
{
|
||||
mc.thePlayer.stepHeight = 0.5F;
|
||||
mc.player.stepHeight = 0.5F;
|
||||
}
|
||||
}
|
||||
|
||||
if(Mekanism.flamethrowerActive.contains(mc.thePlayer.getName()) != isFlamethrowerOn(mc.thePlayer))
|
||||
if(Mekanism.flamethrowerActive.contains(mc.player.getName()) != isFlamethrowerOn(mc.player))
|
||||
{
|
||||
if(isFlamethrowerOn(mc.thePlayer))
|
||||
if(isFlamethrowerOn(mc.player))
|
||||
{
|
||||
Mekanism.flamethrowerActive.add(mc.thePlayer.getName());
|
||||
Mekanism.flamethrowerActive.add(mc.player.getName());
|
||||
}
|
||||
else {
|
||||
Mekanism.flamethrowerActive.remove(mc.thePlayer.getName());
|
||||
Mekanism.flamethrowerActive.remove(mc.player.getName());
|
||||
}
|
||||
|
||||
Mekanism.packetHandler.sendToServer(new FlamethrowerDataMessage(PacketFlamethrowerData.FlamethrowerPacket.UPDATE, null, mc.thePlayer.getName(), isFlamethrowerOn(mc.thePlayer)));
|
||||
Mekanism.packetHandler.sendToServer(new FlamethrowerDataMessage(PacketFlamethrowerData.FlamethrowerPacket.UPDATE, null, mc.player.getName(), isFlamethrowerOn(mc.player)));
|
||||
}
|
||||
|
||||
if(Mekanism.jetpackOn.contains(mc.thePlayer.getName()) != isJetpackOn(mc.thePlayer))
|
||||
if(Mekanism.jetpackOn.contains(mc.player.getName()) != isJetpackOn(mc.player))
|
||||
{
|
||||
if(isJetpackOn(mc.thePlayer))
|
||||
if(isJetpackOn(mc.player))
|
||||
{
|
||||
Mekanism.jetpackOn.add(mc.thePlayer.getName());
|
||||
Mekanism.jetpackOn.add(mc.player.getName());
|
||||
}
|
||||
else {
|
||||
Mekanism.jetpackOn.remove(mc.thePlayer.getName());
|
||||
Mekanism.jetpackOn.remove(mc.player.getName());
|
||||
}
|
||||
|
||||
Mekanism.packetHandler.sendToServer(new JetpackDataMessage(JetpackPacket.UPDATE, mc.thePlayer.getName(), isJetpackOn(mc.thePlayer)));
|
||||
Mekanism.packetHandler.sendToServer(new JetpackDataMessage(JetpackPacket.UPDATE, mc.player.getName(), isJetpackOn(mc.player)));
|
||||
}
|
||||
|
||||
if(Mekanism.gasmaskOn.contains(mc.thePlayer.getName()) != isGasMaskOn(mc.thePlayer))
|
||||
if(Mekanism.gasmaskOn.contains(mc.player.getName()) != isGasMaskOn(mc.player))
|
||||
{
|
||||
if(isGasMaskOn(mc.thePlayer) && mc.currentScreen == null)
|
||||
if(isGasMaskOn(mc.player) && mc.currentScreen == null)
|
||||
{
|
||||
Mekanism.gasmaskOn.add(mc.thePlayer.getName());
|
||||
Mekanism.gasmaskOn.add(mc.player.getName());
|
||||
}
|
||||
else {
|
||||
Mekanism.gasmaskOn.remove(mc.thePlayer.getName());
|
||||
Mekanism.gasmaskOn.remove(mc.player.getName());
|
||||
}
|
||||
|
||||
Mekanism.packetHandler.sendToServer(new ScubaTankDataMessage(ScubaTankPacket.UPDATE, mc.thePlayer.getName(), isGasMaskOn(mc.thePlayer)));
|
||||
Mekanism.packetHandler.sendToServer(new ScubaTankDataMessage(ScubaTankPacket.UPDATE, mc.player.getName(), isGasMaskOn(mc.player)));
|
||||
}
|
||||
|
||||
if(client.enablePlayerSounds)
|
||||
{
|
||||
for(String username : Mekanism.jetpackOn)
|
||||
{
|
||||
EntityPlayer player = mc.theWorld.getPlayerEntityByName(username);
|
||||
EntityPlayer player = mc.world.getPlayerEntityByName(username);
|
||||
|
||||
if(player != null)
|
||||
{
|
||||
@@ -274,7 +274,7 @@ public class ClientTickHandler
|
||||
|
||||
for(String username : Mekanism.gasmaskOn)
|
||||
{
|
||||
EntityPlayer player = mc.theWorld.getPlayerEntityByName(username);
|
||||
EntityPlayer player = mc.world.getPlayerEntityByName(username);
|
||||
|
||||
if(player != null)
|
||||
{
|
||||
@@ -287,7 +287,7 @@ public class ClientTickHandler
|
||||
}
|
||||
}
|
||||
|
||||
for(EntityPlayer player : (List<EntityPlayer>)mc.theWorld.playerEntities)
|
||||
for(EntityPlayer player : (List<EntityPlayer>)mc.world.playerEntities)
|
||||
{
|
||||
if(hasFlamethrower(player))
|
||||
{
|
||||
@@ -301,7 +301,7 @@ public class ClientTickHandler
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack chestStack = mc.thePlayer.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
||||
ItemStack chestStack = mc.player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
||||
|
||||
if(chestStack != null && chestStack.getItem() instanceof ItemJetpack)
|
||||
{
|
||||
@@ -309,84 +309,84 @@ public class ClientTickHandler
|
||||
MekanismClient.updateKey(mc.gameSettings.keyBindSneak, KeySync.DESCEND);
|
||||
}
|
||||
|
||||
if(isFlamethrowerOn(mc.thePlayer))
|
||||
if(isFlamethrowerOn(mc.player))
|
||||
{
|
||||
ItemFlamethrower flamethrower = (ItemFlamethrower)mc.thePlayer.inventory.getCurrentItem().getItem();
|
||||
ItemFlamethrower flamethrower = (ItemFlamethrower)mc.player.inventory.getCurrentItem().getItem();
|
||||
|
||||
if(!mc.thePlayer.capabilities.isCreativeMode)
|
||||
if(!mc.player.capabilities.isCreativeMode)
|
||||
{
|
||||
flamethrower.useGas(mc.thePlayer.inventory.getCurrentItem());
|
||||
flamethrower.useGas(mc.player.inventory.getCurrentItem());
|
||||
}
|
||||
}
|
||||
|
||||
if(isJetpackOn(mc.thePlayer))
|
||||
if(isJetpackOn(mc.player))
|
||||
{
|
||||
ItemJetpack jetpack = (ItemJetpack)chestStack.getItem();
|
||||
|
||||
if(jetpack.getMode(chestStack) == JetpackMode.NORMAL)
|
||||
{
|
||||
mc.thePlayer.motionY = Math.min(mc.thePlayer.motionY + 0.15D, 0.5D);
|
||||
mc.thePlayer.fallDistance = 0.0F;
|
||||
mc.player.motionY = Math.min(mc.player.motionY + 0.15D, 0.5D);
|
||||
mc.player.fallDistance = 0.0F;
|
||||
}
|
||||
else if(jetpack.getMode(chestStack) == JetpackMode.HOVER)
|
||||
{
|
||||
if((!mc.gameSettings.keyBindJump.isKeyDown() && !mc.gameSettings.keyBindSneak.isKeyDown()) || (mc.gameSettings.keyBindJump.isKeyDown() && mc.gameSettings.keyBindSneak.isKeyDown()) || mc.currentScreen != null)
|
||||
{
|
||||
if(mc.thePlayer.motionY > 0)
|
||||
if(mc.player.motionY > 0)
|
||||
{
|
||||
mc.thePlayer.motionY = Math.max(mc.thePlayer.motionY - 0.15D, 0);
|
||||
mc.player.motionY = Math.max(mc.player.motionY - 0.15D, 0);
|
||||
}
|
||||
else if(mc.thePlayer.motionY < 0)
|
||||
else if(mc.player.motionY < 0)
|
||||
{
|
||||
if(!CommonPlayerTickHandler.isOnGround(mc.thePlayer))
|
||||
if(!CommonPlayerTickHandler.isOnGround(mc.player))
|
||||
{
|
||||
mc.thePlayer.motionY = Math.min(mc.thePlayer.motionY + 0.15D, 0);
|
||||
mc.player.motionY = Math.min(mc.player.motionY + 0.15D, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(mc.gameSettings.keyBindJump.isKeyDown() && mc.currentScreen == null)
|
||||
{
|
||||
mc.thePlayer.motionY = Math.min(mc.thePlayer.motionY + 0.15D, 0.2D);
|
||||
mc.player.motionY = Math.min(mc.player.motionY + 0.15D, 0.2D);
|
||||
}
|
||||
else if(mc.gameSettings.keyBindSneak.isKeyDown() && mc.currentScreen == null)
|
||||
{
|
||||
if(!CommonPlayerTickHandler.isOnGround(mc.thePlayer))
|
||||
if(!CommonPlayerTickHandler.isOnGround(mc.player))
|
||||
{
|
||||
mc.thePlayer.motionY = Math.max(mc.thePlayer.motionY - 0.15D, -0.2D);
|
||||
mc.player.motionY = Math.max(mc.player.motionY - 0.15D, -0.2D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mc.thePlayer.fallDistance = 0.0F;
|
||||
mc.player.fallDistance = 0.0F;
|
||||
}
|
||||
|
||||
jetpack.useGas(chestStack);
|
||||
}
|
||||
|
||||
if(isGasMaskOn(mc.thePlayer))
|
||||
if(isGasMaskOn(mc.player))
|
||||
{
|
||||
ItemScubaTank tank = (ItemScubaTank)chestStack.getItem();
|
||||
|
||||
final int max = 300;
|
||||
|
||||
tank.useGas(chestStack);
|
||||
GasStack received = tank.useGas(chestStack, max-mc.thePlayer.getAir());
|
||||
GasStack received = tank.useGas(chestStack, max-mc.player.getAir());
|
||||
|
||||
if(received != null)
|
||||
{
|
||||
mc.thePlayer.setAir(mc.thePlayer.getAir()+received.amount);
|
||||
mc.player.setAir(mc.player.getAir()+received.amount);
|
||||
}
|
||||
|
||||
if(mc.thePlayer.getAir() == max)
|
||||
if(mc.player.getAir() == max)
|
||||
{
|
||||
for(Object obj : mc.thePlayer.getActivePotionEffects())
|
||||
for(Object obj : mc.player.getActivePotionEffects())
|
||||
{
|
||||
if(obj instanceof PotionEffect)
|
||||
{
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
((PotionEffect)obj).onUpdate(mc.thePlayer);
|
||||
((PotionEffect)obj).onUpdate(mc.player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -423,12 +423,12 @@ public class ClientTickHandler
|
||||
|
||||
public static boolean isJetpackOn(EntityPlayer player)
|
||||
{
|
||||
if(player != mc.thePlayer)
|
||||
if(player != mc.player)
|
||||
{
|
||||
return Mekanism.jetpackOn.contains(player.getName());
|
||||
}
|
||||
|
||||
ItemStack stack = player.inventory.armorInventory[2];
|
||||
ItemStack stack = player.inventory.armorInventory.get(2);
|
||||
|
||||
if(stack != null && !player.capabilities.isCreativeMode)
|
||||
{
|
||||
@@ -464,13 +464,13 @@ public class ClientTickHandler
|
||||
|
||||
public static boolean isGasMaskOn(EntityPlayer player)
|
||||
{
|
||||
if(player != mc.thePlayer)
|
||||
if(player != mc.player)
|
||||
{
|
||||
return Mekanism.gasmaskOn.contains(player.getName());
|
||||
}
|
||||
|
||||
ItemStack tank = player.inventory.armorInventory[2];
|
||||
ItemStack mask = player.inventory.armorInventory[3];
|
||||
ItemStack tank = player.inventory.armorInventory.get(2);
|
||||
ItemStack mask = player.inventory.armorInventory.get(3);
|
||||
|
||||
if(tank != null && mask != null)
|
||||
{
|
||||
@@ -493,7 +493,7 @@ public class ClientTickHandler
|
||||
|
||||
public static boolean isFlamethrowerOn(EntityPlayer player)
|
||||
{
|
||||
if(player != mc.thePlayer)
|
||||
if(player != mc.player)
|
||||
{
|
||||
return Mekanism.flamethrowerActive.contains(player.getName());
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public final class HolidayManager
|
||||
{
|
||||
if(holiday.getDate().equals(date))
|
||||
{
|
||||
holiday.onEvent(mc.thePlayer);
|
||||
holiday.onEvent(mc.player);
|
||||
holidaysNotified.add(holiday);
|
||||
}
|
||||
}
|
||||
@@ -103,13 +103,13 @@ public final class HolidayManager
|
||||
public void onEvent(EntityPlayer player)
|
||||
{
|
||||
String themedLines = getThemedLines(new EnumColor[] {EnumColor.DARK_GREEN, EnumColor.DARK_RED}, 13);
|
||||
player.addChatMessage(new TextComponentString(themedLines + EnumColor.DARK_BLUE + "[Mekanism]" + themedLines));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.RED + "Merry Christmas, " + EnumColor.DARK_BLUE + player.getName() + EnumColor.RED + "!"));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.RED + "May you have plenty of Christmas cheer"));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.RED + "and have a relaxing holiday with your"));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.RED + "family :)"));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.DARK_GREY + "-aidancbrady"));
|
||||
player.addChatMessage(new TextComponentString(themedLines + EnumColor.DARK_BLUE + "[=======]" + themedLines));
|
||||
player.sendMessage(new TextComponentString(themedLines + EnumColor.DARK_BLUE + "[Mekanism]" + themedLines));
|
||||
player.sendMessage(new TextComponentString(EnumColor.RED + "Merry Christmas, " + EnumColor.DARK_BLUE + player.getName() + EnumColor.RED + "!"));
|
||||
player.sendMessage(new TextComponentString(EnumColor.RED + "May you have plenty of Christmas cheer"));
|
||||
player.sendMessage(new TextComponentString(EnumColor.RED + "and have a relaxing holiday with your"));
|
||||
player.sendMessage(new TextComponentString(EnumColor.RED + "family :)"));
|
||||
player.sendMessage(new TextComponentString(EnumColor.DARK_GREY + "-aidancbrady"));
|
||||
player.sendMessage(new TextComponentString(themedLines + EnumColor.DARK_BLUE + "[=======]" + themedLines));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -152,12 +152,12 @@ public final class HolidayManager
|
||||
public void onEvent(EntityPlayer player)
|
||||
{
|
||||
String themedLines = getThemedLines(new EnumColor[] {EnumColor.WHITE, EnumColor.YELLOW}, 13);
|
||||
player.addChatMessage(new TextComponentString(themedLines + EnumColor.DARK_BLUE + "[Mekanism]" + themedLines));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.AQUA + "Happy New Year, " + EnumColor.DARK_BLUE + player.getName() + EnumColor.RED + "!"));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.AQUA + "Best wishes to you as we enter this"));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.AQUA + "new and exciting year of " + calendar.get(Calendar.YEAR) + "! :)"));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.DARK_GREY + "-aidancbrady"));
|
||||
player.addChatMessage(new TextComponentString(themedLines + EnumColor.DARK_BLUE + "[=======]" + themedLines));
|
||||
player.sendMessage(new TextComponentString(themedLines + EnumColor.DARK_BLUE + "[Mekanism]" + themedLines));
|
||||
player.sendMessage(new TextComponentString(EnumColor.AQUA + "Happy New Year, " + EnumColor.DARK_BLUE + player.getName() + EnumColor.RED + "!"));
|
||||
player.sendMessage(new TextComponentString(EnumColor.AQUA + "Best wishes to you as we enter this"));
|
||||
player.sendMessage(new TextComponentString(EnumColor.AQUA + "new and exciting year of " + calendar.get(Calendar.YEAR) + "! :)"));
|
||||
player.sendMessage(new TextComponentString(EnumColor.DARK_GREY + "-aidancbrady"));
|
||||
player.sendMessage(new TextComponentString(themedLines + EnumColor.DARK_BLUE + "[=======]" + themedLines));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ public class MekanismClient extends Mekanism
|
||||
{
|
||||
boolean down = Minecraft.getMinecraft().currentScreen == null && key.isPressed();
|
||||
|
||||
if(down != keyMap.has(Minecraft.getMinecraft().thePlayer, type))
|
||||
if(down != keyMap.has(Minecraft.getMinecraft().player, type))
|
||||
{
|
||||
Mekanism.packetHandler.sendToServer(new KeyMessage(type, down));
|
||||
keyMap.update(Minecraft.getMinecraft().thePlayer, type, down);
|
||||
keyMap.update(Minecraft.getMinecraft().player, type, down);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ public class MekanismKeyHandler extends MekKeyHandler
|
||||
{
|
||||
if(kb == modeSwitchKey)
|
||||
{
|
||||
EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
|
||||
EntityPlayer player = FMLClientHandler.instance().getClient().player;
|
||||
ItemStack toolStack = player.inventory.getCurrentItem();
|
||||
|
||||
Item item = StackUtils.getItem(toolStack);
|
||||
@@ -87,7 +87,7 @@ public class MekanismKeyHandler extends MekKeyHandler
|
||||
int toSet = configurator.getState(toolStack).ordinal() < ConfiguratorMode.values().length-1 ? configurator.getState(toolStack).ordinal() + 1 : 0;
|
||||
configurator.setState(toolStack, ConfiguratorMode.values()[toSet]);
|
||||
Mekanism.packetHandler.sendToServer(new ConfiguratorStateMessage(EnumHand.MAIN_HAND, configurator.getState(toolStack)));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.configureState") + ": " + configurator.getColor(configurator.getState(toolStack)) + configurator.getStateDisplay(configurator.getState(toolStack))));
|
||||
player.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.configureState") + ": " + configurator.getColor(configurator.getState(toolStack)) + configurator.getStateDisplay(configurator.getState(toolStack))));
|
||||
}
|
||||
else if(player.isSneaking() && item instanceof ItemElectricBow)
|
||||
{
|
||||
@@ -95,7 +95,7 @@ public class MekanismKeyHandler extends MekKeyHandler
|
||||
|
||||
bow.setFireState(toolStack, !bow.getFireState(toolStack));
|
||||
Mekanism.packetHandler.sendToServer(new ElectricBowStateMessage(EnumHand.MAIN_HAND, bow.getFireState(toolStack)));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.fireMode") + ": " + (bow.getFireState(toolStack) ? EnumColor.DARK_GREEN : EnumColor.DARK_RED) + LangUtils.transOnOff(bow.getFireState(toolStack))));
|
||||
player.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.fireMode") + ": " + (bow.getFireState(toolStack) ? EnumColor.DARK_GREEN : EnumColor.DARK_RED) + LangUtils.transOnOff(bow.getFireState(toolStack))));
|
||||
}
|
||||
else if(player.isSneaking() && item instanceof ItemBlockMachine)
|
||||
{
|
||||
@@ -105,7 +105,7 @@ public class MekanismKeyHandler extends MekKeyHandler
|
||||
{
|
||||
machine.setBucketMode(toolStack, !machine.getBucketMode(toolStack));
|
||||
Mekanism.packetHandler.sendToServer(new PortableTankStateMessage(EnumHand.MAIN_HAND, machine.getBucketMode(toolStack)));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.portableTank.bucketMode") + ": " + (machine.getBucketMode(toolStack) ? EnumColor.DARK_GREEN : EnumColor.DARK_RED) + LangUtils.transOnOff(machine.getBucketMode(toolStack))));
|
||||
player.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.portableTank.bucketMode") + ": " + (machine.getBucketMode(toolStack) ? EnumColor.DARK_GREEN : EnumColor.DARK_RED) + LangUtils.transOnOff(machine.getBucketMode(toolStack))));
|
||||
}
|
||||
}
|
||||
else if(player.isSneaking() && item instanceof ItemWalkieTalkie)
|
||||
@@ -126,12 +126,12 @@ public class MekanismKeyHandler extends MekKeyHandler
|
||||
|
||||
flamethrower.incrementMode(toolStack);
|
||||
Mekanism.packetHandler.sendToServer(new PacketFlamethrowerData.FlamethrowerDataMessage(PacketFlamethrowerData.FlamethrowerPacket.MODE, EnumHand.MAIN_HAND, null, false));
|
||||
player.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.flamethrower.modeBump") + ": " + flamethrower.getMode(toolStack).getName()));
|
||||
player.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.flamethrower.modeBump") + ": " + flamethrower.getMode(toolStack).getName()));
|
||||
}
|
||||
}
|
||||
else if(kb == armorModeSwitchKey)
|
||||
{
|
||||
EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
|
||||
EntityPlayer player = FMLClientHandler.instance().getClient().player;
|
||||
ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
||||
Item chestItem = StackUtils.getItem(chestStack);
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public class GuiDictionary extends GuiMekanism
|
||||
if(stack != null)
|
||||
{
|
||||
itemType = stack.copy();
|
||||
itemType.stackSize = 1;
|
||||
itemType.setCount(1);
|
||||
|
||||
scrollList.setText(MekanismUtils.getOreDictName(itemType));
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
@@ -133,12 +133,12 @@ public class GuiDictionary extends GuiMekanism
|
||||
|
||||
if(xAxis >= 6 && xAxis <= 22 && yAxis >= 6 && yAxis <= 22)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(stack != null && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
{
|
||||
itemType = stack.copy();
|
||||
itemType.stackSize = 1;
|
||||
itemType.setCount(1);
|
||||
|
||||
scrollList.setText(MekanismUtils.getOreDictName(itemType));
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ public class GuiFactory extends GuiMekanism
|
||||
|
||||
if(xAxis > 8 && xAxis < 168 && yAxis > 78 && yAxis < 83)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof ItemGaugeDropper)
|
||||
{
|
||||
|
||||
@@ -206,11 +206,11 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
|
||||
|
||||
if(slot.getStack() == null || !slot.getStack().isItemEqual(stack))
|
||||
{
|
||||
drawGradientRect(guiWidth + slot.xDisplayPosition, guiHeight + slot.yDisplayPosition, guiWidth + slot.xDisplayPosition + 16, guiHeight + slot.yDisplayPosition + 16, -2137456640, -2137456640);
|
||||
drawGradientRect(guiWidth + slot.xPos, guiHeight + slot.yPos, guiWidth + slot.xPos + 16, guiHeight + slot.yPos + 16, -2137456640, -2137456640);
|
||||
}
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRender.renderItemAndEffectIntoGUI(stack, guiWidth + slot.xDisplayPosition, guiHeight + slot.yDisplayPosition);
|
||||
itemRender.renderItemAndEffectIntoGUI(stack, guiWidth + slot.xPos, guiHeight + slot.yPos);
|
||||
MekanismRenderer.resetColor();
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ public class GuiMItemStackFilter extends GuiMekanism
|
||||
|
||||
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(stack != null && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
{
|
||||
@@ -284,7 +284,7 @@ public class GuiMItemStackFilter extends GuiMekanism
|
||||
if(Block.getBlockFromItem(stack.getItem()) != Blocks.BEDROCK)
|
||||
{
|
||||
filter.itemType = stack.copy();
|
||||
filter.itemType.stackSize = 1;
|
||||
filter.itemType.setCount(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,7 +299,7 @@ public class GuiMItemStackFilter extends GuiMekanism
|
||||
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
boolean doNull = false;
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
ItemStack toUse = null;
|
||||
|
||||
if(stack != null && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
@@ -309,7 +309,7 @@ public class GuiMItemStackFilter extends GuiMekanism
|
||||
if(Block.getBlockFromItem(stack.getItem()) != Blocks.BEDROCK)
|
||||
{
|
||||
toUse = stack.copy();
|
||||
toUse.stackSize = 1;
|
||||
toUse.setCount(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ public class GuiMMaterialFilter extends GuiMekanism
|
||||
|
||||
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(stack != null && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
{
|
||||
@@ -266,7 +266,7 @@ public class GuiMMaterialFilter extends GuiMekanism
|
||||
if(Block.getBlockFromItem(stack.getItem()) != Blocks.BEDROCK)
|
||||
{
|
||||
filter.materialItem = stack.copy();
|
||||
filter.materialItem.stackSize = 1;
|
||||
filter.materialItem.setCount(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,7 +281,7 @@ public class GuiMMaterialFilter extends GuiMekanism
|
||||
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
boolean doNull = false;
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
ItemStack toUse = null;
|
||||
|
||||
if(stack != null && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
@@ -291,7 +291,7 @@ public class GuiMMaterialFilter extends GuiMekanism
|
||||
if(Block.getBlockFromItem(stack.getItem()) != Blocks.BEDROCK)
|
||||
{
|
||||
toUse = stack.copy();
|
||||
toUse.stackSize = 1;
|
||||
toUse.setCount(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ public class GuiMModIDFilter extends GuiMekanism
|
||||
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
boolean doNull = false;
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
ItemStack toUse = null;
|
||||
|
||||
if(stack != null && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
@@ -337,7 +337,7 @@ public class GuiMModIDFilter extends GuiMekanism
|
||||
if(Block.getBlockFromItem(stack.getItem()) != Blocks.BEDROCK)
|
||||
{
|
||||
toUse = stack.copy();
|
||||
toUse.stackSize = 1;
|
||||
toUse.setCount(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ public class GuiMOreDictFilter extends GuiMekanism
|
||||
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
boolean doNull = false;
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
ItemStack toUse = null;
|
||||
|
||||
if(stack != null && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
@@ -337,7 +337,7 @@ public class GuiMOreDictFilter extends GuiMekanism
|
||||
if(Block.getBlockFromItem(stack.getItem()) != Blocks.BEDROCK)
|
||||
{
|
||||
toUse = stack.copy();
|
||||
toUse.stackSize = 1;
|
||||
toUse.setCount(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof ItemConfigurator && hovering != null)
|
||||
{
|
||||
@@ -158,7 +158,7 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
|
||||
|
||||
protected boolean isMouseOverSlot(Slot slot, int mouseX, int mouseY)
|
||||
{
|
||||
return isPointInRegion(slot.xDisplayPosition, slot.yDisplayPosition, 16, 16, mouseX, mouseY);
|
||||
return isPointInRegion(slot.xPos, slot.yPos, 16, 16, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -108,7 +108,7 @@ public class GuiRobitCrafting extends GuiMekanism
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 21, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
|
||||
{
|
||||
@@ -118,19 +118,19 @@ public class GuiRobitCrafting extends GuiMekanism
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 23, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 24, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 4, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 25, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,13 +108,13 @@ public class GuiRobitInventory extends GuiMekanism
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 21, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 1, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 22, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
|
||||
{
|
||||
@@ -124,13 +124,13 @@ public class GuiRobitInventory extends GuiMekanism
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 24, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 4, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 25, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class GuiRobitMain extends GuiMekanism
|
||||
}
|
||||
else if(i == Keyboard.KEY_ESCAPE)
|
||||
{
|
||||
mc.thePlayer.closeScreen();
|
||||
mc.player.closeScreen();
|
||||
}
|
||||
|
||||
nameChangeField.textboxKeyTyped(c, i);
|
||||
@@ -275,25 +275,25 @@ public class GuiRobitMain extends GuiMekanism
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 1, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 22, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 23, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 24, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 4, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 25, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 152 && xAxis <= 170 && yAxis >= 54 && yAxis <= 72)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ package mekanism.client.gui;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.Mekanism;
|
||||
@@ -24,6 +23,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.network.play.client.CPacketCustomPayload;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -86,7 +86,7 @@ public class GuiRobitRepair extends GuiMekanism implements IContainerListener
|
||||
boolean flag = true;
|
||||
String s = I18n.translateToLocalFormatted("container.repair.cost", repairContainer.maximumCost);
|
||||
|
||||
if(repairContainer.maximumCost >= 40 && !mc.thePlayer.capabilities.isCreativeMode)
|
||||
if(repairContainer.maximumCost >= 40 && !mc.player.capabilities.isCreativeMode)
|
||||
{
|
||||
s = LangUtils.localize("container.repair.expensive");
|
||||
k = 16736352;
|
||||
@@ -132,7 +132,7 @@ public class GuiRobitRepair extends GuiMekanism implements IContainerListener
|
||||
if(itemNameField.textboxKeyTyped(c, i))
|
||||
{
|
||||
repairContainer.updateItemName(itemNameField.getText());
|
||||
mc.thePlayer.connection.sendPacket(new CPacketCustomPayload("MC|ItemName", (new PacketBuffer(Unpooled.buffer())).writeString(itemNameField.getText())));
|
||||
mc.player.connection.sendPacket(new CPacketCustomPayload("MC|ItemName", (new PacketBuffer(Unpooled.buffer())).writeString(itemNameField.getText())));
|
||||
}
|
||||
else {
|
||||
super.keyTyped(c, i);
|
||||
@@ -155,25 +155,25 @@ public class GuiRobitRepair extends GuiMekanism implements IContainerListener
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 21, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 1, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 22, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 23, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 24, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
|
||||
{
|
||||
@@ -254,7 +254,7 @@ public class GuiRobitRepair extends GuiMekanism implements IContainerListener
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCraftingInventory(Container container, List list)
|
||||
public void updateCraftingInventory(Container container, NonNullList<ItemStack> list)
|
||||
{
|
||||
sendSlotContents(container, 0, container.getSlot(0).getStack());
|
||||
}
|
||||
@@ -270,7 +270,7 @@ public class GuiRobitRepair extends GuiMekanism implements IContainerListener
|
||||
if(itemstack != null)
|
||||
{
|
||||
repairContainer.updateItemName(itemNameField.getText());
|
||||
mc.thePlayer.connection.sendPacket(new CPacketCustomPayload("MC|ItemName", (new PacketBuffer(Unpooled.buffer())).writeString(itemNameField.getText())));
|
||||
mc.player.connection.sendPacket(new CPacketCustomPayload("MC|ItemName", (new PacketBuffer(Unpooled.buffer())).writeString(itemNameField.getText())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,19 +116,19 @@ public class GuiRobitSmelting extends GuiMekanism
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 21, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 1, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 22, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 23, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
|
||||
{
|
||||
@@ -138,7 +138,7 @@ public class GuiRobitSmelting extends GuiMekanism
|
||||
{
|
||||
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 4, robit.getEntityId(), null));
|
||||
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, robit.getEntityId(), 0, 0);
|
||||
mc.player.openGui(Mekanism.instance, 25, mc.world, robit.getEntityId(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class GuiSecurityDesk extends GuiMekanism
|
||||
int xAxis = (mouseX - (width - xSize) / 2);
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
if(tileEntity.frequency != null && tileEntity.owner != null && tileEntity.owner.equals(mc.thePlayer.getName()))
|
||||
if(tileEntity.frequency != null && tileEntity.owner != null && tileEntity.owner.equals(mc.player.getName()))
|
||||
{
|
||||
if(xAxis >= 123 && xAxis <= 134 && yAxis >= 68 && yAxis <= 79)
|
||||
{
|
||||
@@ -309,7 +309,7 @@ public class GuiSecurityDesk extends GuiMekanism
|
||||
int xAxis = (mouseX - (width - xSize) / 2);
|
||||
int yAxis = (mouseY - (height - ySize) / 2);
|
||||
|
||||
if(tileEntity.frequency != null && tileEntity.owner != null && mc.thePlayer.getName().equals(tileEntity.owner))
|
||||
if(tileEntity.frequency != null && tileEntity.owner != null && mc.player.getName().equals(tileEntity.owner))
|
||||
{
|
||||
drawTexturedModalRect(guiWidth + 145, guiHeight + 78, xSize + (tileEntity.frequency.override ? 0 : 6), 22, 6, 6);
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ public class GuiSideConfiguration extends GuiMekanism
|
||||
|
||||
TileEntity tile = (TileEntity)configurable;
|
||||
|
||||
if(tile == null || mc.theWorld.getTileEntity(tile.getPos()) == null)
|
||||
if(tile == null || mc.world.getTileEntity(tile.getPos()) == null)
|
||||
{
|
||||
mc.displayGuiScreen(null);
|
||||
}
|
||||
|
||||
@@ -310,12 +310,12 @@ public class GuiTItemStackFilter extends GuiMekanism
|
||||
|
||||
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(stack != null && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
{
|
||||
filter.itemType = stack.copy();
|
||||
filter.itemType.stackSize = 1;
|
||||
filter.itemType.setCount(1);
|
||||
}
|
||||
else if(stack == null && Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
{
|
||||
|
||||
@@ -241,7 +241,7 @@ public class GuiTMaterialFilter extends GuiMekanism
|
||||
|
||||
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(stack != null && !Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
|
||||
{
|
||||
@@ -250,7 +250,7 @@ public class GuiTMaterialFilter extends GuiMekanism
|
||||
if(Block.getBlockFromItem(stack.getItem()) != Blocks.BEDROCK)
|
||||
{
|
||||
filter.materialItem = stack.copy();
|
||||
filter.materialItem.stackSize = 1;
|
||||
filter.materialItem.setCount(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class GuiFluidGauge extends GuiGauge<Fluid>
|
||||
{
|
||||
if(xAxis >= xLocation + 1 && xAxis <= xLocation + width - 1 && yAxis >= yLocation + 1 && yAxis <= yLocation + height - 1)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(guiObj instanceof GuiMekanism && stack != null && stack.getItem() instanceof ItemGaugeDropper)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GuiGasGauge extends GuiGauge<Gas>
|
||||
{
|
||||
if(xAxis >= xLocation + 1 && xAxis <= xLocation + width - 1 && yAxis >= yLocation + 1 && yAxis <= yLocation + height - 1)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(guiObj instanceof GuiMekanism && stack != null && stack.getItem() instanceof ItemGaugeDropper)
|
||||
{
|
||||
|
||||
@@ -131,7 +131,7 @@ public abstract class GuiGauge<T> extends GuiElement
|
||||
{
|
||||
if(xAxis >= xLocation + 1 && xAxis <= xLocation + width - 1 && yAxis >= yLocation + 1 && yAxis <= yLocation + height - 1)
|
||||
{
|
||||
ItemStack stack = mc.thePlayer.inventory.getItemStack();
|
||||
ItemStack stack = mc.player.inventory.getItemStack();
|
||||
|
||||
if(stack != null && stack.getItem() instanceof ItemConfigurator && color != null)
|
||||
{
|
||||
|
||||
@@ -72,7 +72,7 @@ public class GuiSecurityTab extends GuiElement
|
||||
|
||||
int renderX = 26 + (18*mode.ordinal());
|
||||
|
||||
if(getOwner() != null && getOwner().equals(mc.thePlayer.getName()) &&
|
||||
if(getOwner() != null && getOwner().equals(mc.player.getName()) &&
|
||||
(data == null || !data.override))
|
||||
{
|
||||
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 36 && yAxis <= 54)
|
||||
@@ -99,7 +99,7 @@ public class GuiSecurityTab extends GuiElement
|
||||
{
|
||||
String securityDisplay = isItem ? SecurityUtils.getSecurityDisplay(getItem(), Side.CLIENT) : SecurityUtils.getSecurityDisplay(tileEntity, Side.CLIENT);
|
||||
String securityText = EnumColor.GREY + LangUtils.localize("gui.security") + ": " + securityDisplay;
|
||||
String ownerText = SecurityUtils.getOwnerDisplay(mc.thePlayer.getName(), getOwner());
|
||||
String ownerText = SecurityUtils.getOwnerDisplay(mc.player.getName(), getOwner());
|
||||
String overrideText = EnumColor.RED + "(" + LangUtils.localize("gui.overridden") + ")";
|
||||
|
||||
if(isItem ? SecurityUtils.isOverridden(getItem(), Side.CLIENT) : SecurityUtils.isOverridden(tileEntity, Side.CLIENT))
|
||||
@@ -120,7 +120,7 @@ public class GuiSecurityTab extends GuiElement
|
||||
{
|
||||
if(getItem() == null || !(getItem().getItem() instanceof ISecurityItem))
|
||||
{
|
||||
mc.thePlayer.closeScreen();
|
||||
mc.player.closeScreen();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ public class GuiSecurityTab extends GuiElement
|
||||
{
|
||||
if(getItem() == null || !(getItem().getItem() instanceof ISecurityItem))
|
||||
{
|
||||
mc.thePlayer.closeScreen();
|
||||
mc.player.closeScreen();
|
||||
return SecurityMode.PUBLIC;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class GuiSecurityTab extends GuiElement
|
||||
{
|
||||
if(getItem() == null || !(getItem().getItem() instanceof ISecurityItem))
|
||||
{
|
||||
mc.thePlayer.closeScreen();
|
||||
mc.player.closeScreen();
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public class GuiSecurityTab extends GuiElement
|
||||
|
||||
private ItemStack getItem()
|
||||
{
|
||||
return mc.thePlayer.getHeldItem(currentHand);
|
||||
return mc.player.getHeldItem(currentHand);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -181,7 +181,7 @@ public class GuiSecurityTab extends GuiElement
|
||||
{
|
||||
if(button == 0 && general.allowProtection)
|
||||
{
|
||||
if(getOwner() != null && mc.thePlayer.getName().equals(getOwner()))
|
||||
if(getOwner() != null && mc.player.getName().equals(getOwner()))
|
||||
{
|
||||
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 36 && yAxis <= 54)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ import mekanism.client.gui.element.GuiProgress.ProgressBar;
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
import mekanism.client.render.MekanismRenderer.FluidType;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
@@ -72,9 +73,6 @@ public abstract class BaseRecipeCategory implements IRecipeCategory, IGuiWrapper
|
||||
e.renderBackground(0, 0, -xOffset, -yOffset);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft) {}
|
||||
|
||||
@Override
|
||||
public void drawTexturedRect(int x, int y, int u, int v, int w, int h)
|
||||
@@ -172,4 +170,16 @@ public abstract class BaseRecipeCategory implements IRecipeCategory, IGuiWrapper
|
||||
public void addGuiElements() {}
|
||||
|
||||
public static class GuiDummy extends Gui {}
|
||||
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -36,4 +36,10 @@ public class GuiElementHandler implements IAdvancedGuiHandler
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getIngredientUnderMouse(GuiContainer guiContainer, int mouseX, int mouseY)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -104,10 +104,9 @@ import mekanism.common.recipe.machines.SeparatorRecipe;
|
||||
import mekanism.common.recipe.machines.SolarNeutronRecipe;
|
||||
import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
|
||||
import mekanism.common.recipe.machines.WasherRecipe;
|
||||
import mekanism.common.util.ItemDataUtils;
|
||||
import mezz.jei.api.IJeiRuntime;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.BlankModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.ISubtypeRegistry;
|
||||
import mezz.jei.api.ISubtypeRegistry.ISubtypeInterpreter;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
@@ -116,7 +115,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@JEIPlugin
|
||||
public class MekanismJEI implements IModPlugin
|
||||
public class MekanismJEI extends BlankModPlugin
|
||||
{
|
||||
public static ISubtypeInterpreter NBT_INTERPRETER = new ISubtypeInterpreter() {
|
||||
@Override
|
||||
@@ -138,25 +137,29 @@ public class MekanismJEI implements IModPlugin
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void registerItemSubtypes(ISubtypeRegistry registry)
|
||||
{
|
||||
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.EnergyCube), NBT_INTERPRETER);
|
||||
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.MachineBlock), NBT_INTERPRETER);
|
||||
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.MachineBlock2), NBT_INTERPRETER);
|
||||
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.MachineBlock3), NBT_INTERPRETER);
|
||||
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.BasicBlock), NBT_INTERPRETER);
|
||||
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.BasicBlock2), NBT_INTERPRETER);
|
||||
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.GasTank), NBT_INTERPRETER);
|
||||
registry.registerSubtypeInterpreter(Item.getItemFromBlock(MekanismBlocks.CardboardBox), NBT_INTERPRETER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register(IModRegistry registry)
|
||||
{
|
||||
registry.addAdvancedGuiHandlers(new GuiElementHandler());
|
||||
|
||||
registry.addRecipeHandlers(new ShapedMekanismRecipeHandler());
|
||||
registry.addRecipeHandlers(new ShapelessMekanismRecipeHandler());
|
||||
registry.addRecipeHandlers(new ShapedMekanismRecipeHandler(registry.getJeiHelpers()));
|
||||
registry.addRecipeHandlers(new ShapelessMekanismRecipeHandler(registry.getJeiHelpers()));
|
||||
|
||||
registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(MekanismItems.ItemProxy));
|
||||
registry.getJeiHelpers().getItemBlacklist().addItemToBlacklist(new ItemStack(MekanismBlocks.BoundingBlock));
|
||||
|
||||
registry.getJeiHelpers().getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(MekanismBlocks.EnergyCube), NBT_INTERPRETER);
|
||||
registry.getJeiHelpers().getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(MekanismBlocks.MachineBlock), NBT_INTERPRETER);
|
||||
registry.getJeiHelpers().getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(MekanismBlocks.MachineBlock2), NBT_INTERPRETER);
|
||||
registry.getJeiHelpers().getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(MekanismBlocks.MachineBlock3), NBT_INTERPRETER);
|
||||
registry.getJeiHelpers().getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(MekanismBlocks.BasicBlock), NBT_INTERPRETER);
|
||||
registry.getJeiHelpers().getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(MekanismBlocks.BasicBlock2), NBT_INTERPRETER);
|
||||
registry.getJeiHelpers().getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(MekanismBlocks.GasTank), NBT_INTERPRETER);
|
||||
registry.getJeiHelpers().getSubtypeRegistry().registerNbtInterpreter(Item.getItemFromBlock(MekanismBlocks.CardboardBox), NBT_INTERPRETER);
|
||||
registry.getJeiHelpers().getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(MekanismItems.ItemProxy));
|
||||
registry.getJeiHelpers().getIngredientBlacklist().addIngredientToBlacklist(new ItemStack(MekanismBlocks.BoundingBlock));
|
||||
|
||||
try {
|
||||
registerBasicMachine(registry, Recipe.ENRICHMENT_CHAMBER, "tile.MachineBlock.EnrichmentChamber.name", ProgressBar.BLUE, EnrichmentRecipeHandler.class, EnrichmentRecipeWrapper.class);
|
||||
@@ -329,7 +332,4 @@ public class MekanismJEI implements IModPlugin
|
||||
|
||||
registry.addRecipes(recipes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRuntimeAvailable(IJeiRuntime runtime) {}
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
package mekanism.client.jei.crafting;
|
||||
|
||||
import mekanism.common.recipe.ShapedMekanismRecipe;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
|
||||
public class ShapedMekanismRecipeHandler implements IRecipeHandler<ShapedMekanismRecipe>
|
||||
{
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ShapedMekanismRecipeHandler(IJeiHelpers helpers)
|
||||
{
|
||||
return VanillaRecipeCategoryUid.CRAFTING;
|
||||
jeiHelpers = helpers;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Class<ShapedMekanismRecipe> getRecipeClass()
|
||||
{
|
||||
@@ -22,7 +24,7 @@ public class ShapedMekanismRecipeHandler implements IRecipeHandler<ShapedMekanis
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(ShapedMekanismRecipe recipe)
|
||||
{
|
||||
return new ShapedMekanismRecipeWrapper(recipe);
|
||||
return new ShapedMekanismRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,45 +7,53 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mekanism.common.recipe.ShapedMekanismRecipe;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.IStackHelper;
|
||||
import mezz.jei.api.recipe.wrapper.IShapedCraftingRecipeWrapper;
|
||||
import mezz.jei.util.BrokenCraftingRecipeException;
|
||||
import mezz.jei.util.ErrorUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ShapedMekanismRecipeWrapper extends BlankRecipeWrapper implements IShapedCraftingRecipeWrapper
|
||||
{
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
private final ShapedMekanismRecipe recipe;
|
||||
|
||||
public ShapedMekanismRecipeWrapper(@Nonnull ShapedMekanismRecipe r)
|
||||
public ShapedMekanismRecipeWrapper(IJeiHelpers helpers, ShapedMekanismRecipe r)
|
||||
{
|
||||
jeiHelpers = helpers;
|
||||
recipe = r;
|
||||
|
||||
for(Object input : this.recipe.getInput())
|
||||
for(Object input : recipe.getInput())
|
||||
{
|
||||
if(input instanceof ItemStack)
|
||||
{
|
||||
ItemStack itemStack = (ItemStack)input;
|
||||
|
||||
if(itemStack.stackSize != 1)
|
||||
if(itemStack.getCount() != 1)
|
||||
{
|
||||
itemStack.stackSize = 1;
|
||||
itemStack.setCount(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@Override
|
||||
public List getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return Arrays.asList(recipe.getInput());
|
||||
}
|
||||
IStackHelper stackHelper = jeiHelpers.getStackHelper();
|
||||
ItemStack recipeOutput = recipe.getRecipeOutput();
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Collections.singletonList(recipe.getRecipeOutput());
|
||||
try {
|
||||
List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(Arrays.asList(recipe.getInput()));
|
||||
ingredients.setInputLists(ItemStack.class, inputs);
|
||||
ingredients.setOutput(ItemStack.class, recipeOutput);
|
||||
} catch (RuntimeException e) {
|
||||
String info = ErrorUtil.getInfoFromBrokenCraftingRecipe(recipe, Arrays.asList(recipe.getInput()), recipeOutput);
|
||||
throw new BrokenCraftingRecipeException(info, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,12 +3,20 @@ package mekanism.client.jei.crafting;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mekanism.common.recipe.ShapelessMekanismRecipe;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.IRecipeHandler;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
|
||||
|
||||
public class ShapelessMekanismRecipeHandler implements IRecipeHandler<ShapelessMekanismRecipe>
|
||||
{
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
||||
public ShapelessMekanismRecipeHandler(IJeiHelpers helpers)
|
||||
{
|
||||
jeiHelpers = helpers;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public Class<ShapelessMekanismRecipe> getRecipeClass()
|
||||
@@ -16,18 +24,11 @@ public class ShapelessMekanismRecipeHandler implements IRecipeHandler<ShapelessM
|
||||
return ShapelessMekanismRecipe.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return VanillaRecipeCategoryUid.CRAFTING;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ShapelessMekanismRecipe recipe)
|
||||
{
|
||||
return new ShapelessMekanismRecipeWrapper(recipe);
|
||||
return new ShapelessMekanismRecipeWrapper(jeiHelpers, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,17 +6,23 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mekanism.common.recipe.ShapelessMekanismRecipe;
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.IStackHelper;
|
||||
import mezz.jei.api.recipe.wrapper.ICraftingRecipeWrapper;
|
||||
import mezz.jei.util.BrokenCraftingRecipeException;
|
||||
import mezz.jei.util.ErrorUtil;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ShapelessMekanismRecipeWrapper extends BlankRecipeWrapper implements ICraftingRecipeWrapper
|
||||
{
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
private final ShapelessMekanismRecipe recipe;
|
||||
|
||||
public ShapelessMekanismRecipeWrapper(@Nonnull ShapelessMekanismRecipe r)
|
||||
public ShapelessMekanismRecipeWrapper(IJeiHelpers helpers, ShapelessMekanismRecipe r)
|
||||
{
|
||||
jeiHelpers = helpers;
|
||||
recipe = r;
|
||||
|
||||
for(Object input : recipe.getInput())
|
||||
@@ -25,25 +31,31 @@ public class ShapelessMekanismRecipeWrapper extends BlankRecipeWrapper implement
|
||||
{
|
||||
ItemStack itemStack = (ItemStack)input;
|
||||
|
||||
if(itemStack.stackSize != 1)
|
||||
if(itemStack.getCount() != 1)
|
||||
{
|
||||
itemStack.stackSize = 1;
|
||||
itemStack.setCount(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return recipe.getInput();
|
||||
}
|
||||
IStackHelper stackHelper = jeiHelpers.getStackHelper();
|
||||
ItemStack recipeOutput = recipe.getRecipeOutput();
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Collections.singletonList(recipe.getRecipeOutput());
|
||||
try {
|
||||
List<List<ItemStack>> inputs = stackHelper.expandRecipeItemStackInputs(recipe.getInput());
|
||||
ingredients.setInputLists(ItemStack.class, inputs);
|
||||
|
||||
if (recipeOutput != null)
|
||||
{
|
||||
ingredients.setOutput(ItemStack.class, recipeOutput);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
String info = ErrorUtil.getInfoFromBrokenCraftingRecipe(recipe, recipe.getInput(), recipeOutput);
|
||||
throw new BrokenCraftingRecipeException(info, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package mekanism.client.jei.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.client.gui.element.GuiPowerBar;
|
||||
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
|
||||
@@ -12,6 +14,7 @@ import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
@@ -19,6 +22,7 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -91,7 +95,7 @@ public class AdvancedMachineRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof AdvancedMachineRecipeWrapper)
|
||||
{
|
||||
@@ -106,8 +110,20 @@ public class AdvancedMachineRecipeCategory extends BaseRecipeCategory
|
||||
itemStacks.init(1, false, 87, 18);
|
||||
itemStacks.init(2, false, 27, 36);
|
||||
|
||||
itemStacks.setFromRecipe(0, recipeWrapper.getInputs());
|
||||
itemStacks.setFromRecipe(1, recipeWrapper.getOutputs());
|
||||
itemStacks.set(0, input.itemStack);
|
||||
itemStacks.set(1, ((ItemStackOutput)tempRecipe.recipeOutput).output);
|
||||
itemStacks.set(2, ((AdvancedMachineRecipeWrapper)recipeWrapper).getFuelStacks(input.gasType));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -24,13 +24,6 @@ public class AdvancedMachineRecipeHandler<T extends AdvancedMachineRecipeWrapper
|
||||
return wrapperClass;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull T recipe)
|
||||
|
||||
@@ -11,6 +11,7 @@ import mekanism.api.gas.Gas;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -26,18 +27,11 @@ public abstract class AdvancedMachineRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return Arrays.asList(((AdvancedMachineInput)recipe.getInput()).itemStack);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Arrays.asList(((ItemStackOutput)recipe.getOutput()).output);
|
||||
ingredients.setInput(ItemStack.class, ((AdvancedMachineInput)recipe.getInput()).itemStack);
|
||||
ingredients.setOutput(ItemStack.class, ((ItemStackOutput)recipe.getOutput()).output);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package mekanism.client.jei.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.client.gui.element.GuiPowerBar;
|
||||
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
|
||||
import mekanism.client.gui.element.GuiProgress;
|
||||
@@ -9,6 +11,7 @@ import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.machines.ChanceMachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ChanceOutput;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
@@ -18,6 +21,7 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -73,7 +77,7 @@ public class ChanceMachineRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof ChanceMachineRecipeWrapper)
|
||||
{
|
||||
@@ -86,13 +90,13 @@ public class ChanceMachineRecipeCategory extends BaseRecipeCategory
|
||||
itemStacks.init(1, false, 87, 18);
|
||||
itemStacks.init(2, false, 103, 18);
|
||||
|
||||
itemStacks.setFromRecipe(0, recipeWrapper.getInputs());
|
||||
itemStacks.set(0, ((ItemStackInput)tempRecipe.recipeInput).ingredient);
|
||||
|
||||
ChanceOutput output = (ChanceOutput)tempRecipe.getOutput();
|
||||
|
||||
if(output.hasPrimary())
|
||||
{
|
||||
itemStacks.setFromRecipe(1, output.primaryOutput);
|
||||
itemStacks.set(1, output.primaryOutput);
|
||||
}
|
||||
|
||||
if(output.hasSecondary())
|
||||
@@ -100,4 +104,16 @@ public class ChanceMachineRecipeCategory extends BaseRecipeCategory
|
||||
itemStacks.set(2, output.secondaryOutput);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -24,13 +24,6 @@ public class ChanceMachineRecipeHandler<T extends ChanceMachineRecipeWrapper> im
|
||||
return wrapperClass;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull T recipe)
|
||||
|
||||
@@ -5,9 +5,12 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.machines.ChanceMachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ChanceOutput;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
@@ -25,20 +28,12 @@ public class ChanceMachineRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
{
|
||||
return Arrays.asList(((ItemStackInput)recipe.getInput()).ingredient);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
ChanceOutput output = (ChanceOutput)recipe.getOutput();
|
||||
|
||||
return Arrays.asList(output.primaryOutput, output.secondaryOutput);
|
||||
ingredients.setInput(ItemStack.class, ((AdvancedMachineInput)recipe.getInput()).itemStack);
|
||||
ingredients.setOutputs(ItemStack.class, Arrays.asList(output.primaryOutput, output.secondaryOutput));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package mekanism.client.jei.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.client.gui.element.GuiPowerBar;
|
||||
import mekanism.client.gui.element.GuiPowerBar.IPowerInfoHandler;
|
||||
import mekanism.client.gui.element.GuiProgress;
|
||||
@@ -17,7 +19,9 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class MachineRecipeCategory extends BaseRecipeCategory
|
||||
@@ -72,7 +76,7 @@ public class MachineRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof MachineRecipeWrapper)
|
||||
{
|
||||
@@ -84,7 +88,18 @@ public class MachineRecipeCategory extends BaseRecipeCategory
|
||||
itemStacks.init(0, true, 27, 0);
|
||||
itemStacks.init(1, false, 87, 18);
|
||||
|
||||
itemStacks.setFromRecipe(0, recipeWrapper.getInputs());
|
||||
itemStacks.setFromRecipe(1, recipeWrapper.getOutputs());
|
||||
itemStacks.set(ingredients);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -24,13 +24,6 @@ public class MachineRecipeHandler<T extends MachineRecipeWrapper> implements IRe
|
||||
return wrapperClass;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull T recipe)
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
package mekanism.client.jei.machine;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mekanism.common.recipe.inputs.ItemStackInput;
|
||||
import mekanism.common.recipe.inputs.AdvancedMachineInput;
|
||||
import mekanism.common.recipe.machines.BasicMachineRecipe;
|
||||
import mekanism.common.recipe.outputs.ItemStackOutput;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -23,17 +19,10 @@ public class MachineRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return Arrays.asList(((ItemStackInput)recipe.getInput()).ingredient);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Arrays.asList(((ItemStackOutput)recipe.getOutput()).output);
|
||||
ingredients.setInput(ItemStack.class, ((AdvancedMachineInput)recipe.getInput()).itemStack);
|
||||
ingredients.setOutput(ItemStack.class, ((ItemStackOutput)recipe.getOutput()).output);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import mekanism.client.jei.machine.AdvancedMachineRecipeCategory;
|
||||
import mekanism.client.jei.machine.AdvancedMachineRecipeWrapper;
|
||||
import mekanism.common.MekanismItems;
|
||||
import mekanism.common.recipe.machines.AdvancedMachineRecipe;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class OsmiumCompressorRecipeWrapper extends AdvancedMachineRecipeWrapper
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -59,7 +60,7 @@ public class ChemicalCrystallizerRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof ChemicalCrystallizerRecipeWrapper)
|
||||
{
|
||||
|
||||
-7
@@ -20,13 +20,6 @@ public class ChemicalCrystallizerRecipeHandler implements IRecipeHandler<Chemica
|
||||
return ChemicalCrystallizerRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalCrystallizerRecipeWrapper recipe)
|
||||
|
||||
+5
-12
@@ -1,14 +1,14 @@
|
||||
package mekanism.client.jei.machine.chemical;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.recipe.machines.CrystallizerRecipe;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -24,18 +24,11 @@ public class ChemicalCrystallizerRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Arrays.asList(recipe.getOutput().output);
|
||||
ingredients.setInput(GasStack.class, recipe.recipeInput.ingredient);
|
||||
ingredients.setOutput(ItemStack.class, recipe.recipeOutput.output);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -62,7 +63,7 @@ public class ChemicalDissolutionChamberRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof ChemicalDissolutionChamberRecipeWrapper)
|
||||
{
|
||||
|
||||
-7
@@ -20,13 +20,6 @@ public class ChemicalDissolutionChamberRecipeHandler implements IRecipeHandler<C
|
||||
return ChemicalDissolutionChamberRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalDissolutionChamberRecipeWrapper recipe)
|
||||
|
||||
+6
-10
@@ -8,8 +8,10 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.GasRegistry;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.recipe.machines.DissolutionRecipe;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -25,18 +27,12 @@ public class ChemicalDissolutionChamberRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return Arrays.asList(recipe.getInput().ingredient);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
ingredients.setInput(GasStack.class, new GasStack(GasRegistry.getGas("sulfuricAcid"), 1000));
|
||||
ingredients.setInput(ItemStack.class, recipe.recipeInput.ingredient);
|
||||
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@ import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -65,7 +66,7 @@ public class ChemicalInfuserRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof ChemicalInfuserRecipeWrapper)
|
||||
{
|
||||
|
||||
@@ -20,13 +20,6 @@ public class ChemicalInfuserRecipeHandler implements IRecipeHandler<ChemicalInfu
|
||||
return ChemicalInfuserRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalInfuserRecipeWrapper recipe)
|
||||
|
||||
+6
-10
@@ -1,13 +1,16 @@
|
||||
package mekanism.client.jei.machine.chemical;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.recipe.machines.ChemicalInfuserRecipe;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -23,18 +26,11 @@ public class ChemicalInfuserRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
ingredients.setInputs(GasStack.class, Arrays.asList(recipe.recipeInput.leftGas, recipe.recipeInput.rightGas));
|
||||
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+2
-2
@@ -16,6 +16,7 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -82,7 +83,7 @@ public class ChemicalOxidizerRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof ChemicalOxidizerRecipeWrapper)
|
||||
{
|
||||
@@ -92,7 +93,6 @@ public class ChemicalOxidizerRecipeCategory extends BaseRecipeCategory
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
itemStacks.init(0, true, 25-xOffset, 35-yOffset);
|
||||
|
||||
itemStacks.set(0, tempRecipe.getInput().ingredient);
|
||||
}
|
||||
}
|
||||
@@ -20,13 +20,6 @@ public class ChemicalOxidizerRecipeHandler implements IRecipeHandler<ChemicalOxi
|
||||
return ChemicalOxidizerRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalOxidizerRecipeWrapper recipe)
|
||||
|
||||
+7
-10
@@ -7,10 +7,14 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.recipe.machines.OxidationRecipe;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ChemicalOxidizerRecipeWrapper extends BlankRecipeWrapper
|
||||
{
|
||||
@@ -24,18 +28,11 @@ public class ChemicalOxidizerRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return Arrays.asList(recipe.getInput().ingredient);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
ingredients.setInput(ItemStack.class, recipe.recipeInput.ingredient);
|
||||
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+3
-2
@@ -10,6 +10,7 @@ import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.gui.ITooltipCallback;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -66,7 +67,7 @@ public class ChemicalWasherRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof ChemicalWasherRecipeWrapper)
|
||||
{
|
||||
@@ -76,7 +77,7 @@ public class ChemicalWasherRecipeCategory extends BaseRecipeCategory
|
||||
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
fluidStacks.init(0, true, 6-xOffset, 5-yOffset, 16, 58, 1000, false, fluidOverlay);
|
||||
fluidStacks.set(0, recipeWrapper.getFluidInputs());
|
||||
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
|
||||
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,13 +20,6 @@ public class ChemicalWasherRecipeHandler implements IRecipeHandler<ChemicalWashe
|
||||
return ChemicalWasherRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ChemicalWasherRecipeWrapper recipe)
|
||||
|
||||
+6
-20
@@ -1,16 +1,15 @@
|
||||
package mekanism.client.jei.machine.chemical;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.recipe.machines.WasherRecipe;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -26,25 +25,12 @@ public class ChemicalWasherRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs()
|
||||
{
|
||||
return Arrays.asList(new FluidStack(FluidRegistry.WATER, 1000));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
ingredients.setInput(FluidStack.class, new FluidStack(FluidRegistry.WATER, 1000));
|
||||
ingredients.setInput(GasStack.class, recipe.recipeInput.ingredient);
|
||||
ingredients.setOutput(GasStack.class, recipe.recipeOutput.output);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+4
-2
@@ -1,5 +1,6 @@
|
||||
package mekanism.client.jei.machine.other;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.client.gui.element.GuiFluidGauge;
|
||||
@@ -23,6 +24,7 @@ import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.gui.ITooltipCallback;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -113,7 +115,7 @@ public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof ElectrolyticSeparatorRecipeWrapper)
|
||||
{
|
||||
@@ -123,7 +125,7 @@ public class ElectrolyticSeparatorRecipeCategory extends BaseRecipeCategory
|
||||
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
fluidStacks.init(0, true, 2, 2, 16, 58, tempRecipe.getInput().ingredient.amount, false, fluidOverlay);
|
||||
fluidStacks.set(0, recipeWrapper.getFluidInputs());
|
||||
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
|
||||
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
|
||||
|
||||
@Override
|
||||
|
||||
-7
@@ -20,13 +20,6 @@ public class ElectrolyticSeparatorRecipeHandler implements IRecipeHandler<Electr
|
||||
return ElectrolyticSeparatorRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ElectrolyticSeparatorRecipeWrapper recipe)
|
||||
|
||||
+5
-19
@@ -4,12 +4,12 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.recipe.machines.SeparatorRecipe;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ElectrolyticSeparatorRecipeWrapper extends BlankRecipeWrapper
|
||||
@@ -24,25 +24,11 @@ public class ElectrolyticSeparatorRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs()
|
||||
{
|
||||
return Arrays.asList(recipe.getInput().ingredient);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
ingredients.setInput(FluidStack.class, recipe.recipeInput.ingredient);
|
||||
ingredients.setOutputs(GasStack.class, Arrays.asList(recipe.recipeOutput.leftGas, recipe.recipeOutput.rightGas));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+3
-2
@@ -25,6 +25,7 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -110,7 +111,7 @@ public class MetallurgicInfuserRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof MetallurgicInfuserRecipeWrapper)
|
||||
{
|
||||
@@ -124,7 +125,7 @@ public class MetallurgicInfuserRecipeCategory extends BaseRecipeCategory
|
||||
itemStacks.init(2, true, 11, 18);
|
||||
|
||||
itemStacks.set(0, tempRecipe.getInput().inputStack);
|
||||
itemStacks.setFromRecipe(1, recipeWrapper.getOutputs());
|
||||
itemStacks.set(1, tempRecipe.getOutput().output);
|
||||
itemStacks.set(2, getInfuseStacks(tempRecipe.getInput().infuse.type));
|
||||
}
|
||||
}
|
||||
@@ -20,13 +20,6 @@ public class MetallurgicInfuserRecipeHandler implements IRecipeHandler<Metallurg
|
||||
return MetallurgicInfuserRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull MetallurgicInfuserRecipeWrapper recipe)
|
||||
|
||||
+7
-16
@@ -1,12 +1,10 @@
|
||||
package mekanism.client.jei.machine.other;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mekanism.common.recipe.machines.MetallurgicInfuserRecipe;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -22,21 +20,14 @@ public class MetallurgicInfuserRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
List<ItemStack> list = new ArrayList<ItemStack>();
|
||||
list.add(recipe.getInput().inputStack);
|
||||
list.addAll(MetallurgicInfuserRecipeCategory.getInfuseStacks(recipe.getInput().infuse.type));
|
||||
List<ItemStack> inputStacks = Arrays.asList(recipe.recipeInput.inputStack);
|
||||
List<ItemStack> infuseStacks = MetallurgicInfuserRecipeCategory.getInfuseStacks(recipe.getInput().infuse.type);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Arrays.asList(recipe.getOutput().output);
|
||||
ingredients.setInput(ItemStack.class, recipe.recipeInput.inputStack);
|
||||
ingredients.setInputLists(ItemStack.class, Arrays.asList(inputStacks, infuseStacks));
|
||||
ingredients.setOutput(ItemStack.class, recipe.recipeOutput.output);
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.gui.ITooltipCallback;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -111,7 +112,7 @@ public class PRCRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof PRCRecipeWrapper)
|
||||
{
|
||||
@@ -123,15 +124,14 @@ public class PRCRecipeCategory extends BaseRecipeCategory
|
||||
itemStacks.init(0, true, 53-xOffset, 34-yOffset);
|
||||
itemStacks.init(1, false, 115-xOffset, 34-yOffset);
|
||||
|
||||
itemStacks.set(0, recipeWrapper.getInputs());
|
||||
itemStacks.set(1, recipeWrapper.getOutputs());
|
||||
itemStacks.set(0, tempRecipe.recipeInput.getSolid());
|
||||
itemStacks.set(1, tempRecipe.recipeOutput.getItemOutput());
|
||||
|
||||
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
fluidStacks.init(0, true, 3, 0, 16, 58, tempRecipe.getInput().getFluid().amount, false, fluidOverlay);
|
||||
fluidStacks.set(0, recipeWrapper.getFluidInputs());
|
||||
fluidStacks.set(0, tempRecipe.recipeInput.getFluid());
|
||||
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
|
||||
|
||||
@Override
|
||||
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
|
||||
{
|
||||
|
||||
@@ -20,13 +20,6 @@ public class PRCRecipeHandler implements IRecipeHandler<PRCRecipeWrapper>
|
||||
return PRCRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull PRCRecipeWrapper recipe)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package mekanism.client.jei.machine.other;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.recipe.machines.PressurizedRecipe;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
@@ -25,25 +25,14 @@ public class PRCRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return Arrays.asList(recipe.getInput().getSolid());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs()
|
||||
{
|
||||
return Arrays.asList(recipe.getInput().getFluid());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Arrays.asList(recipe.getOutput().getItemOutput());
|
||||
ingredients.setInput(ItemStack.class, recipe.recipeInput.getSolid());
|
||||
ingredients.setInput(FluidStack.class, recipe.recipeInput.getFluid());
|
||||
ingredients.setInput(GasStack.class, recipe.recipeInput.getGas());
|
||||
ingredients.setOutput(ItemStack.class, recipe.recipeOutput.getItemOutput());
|
||||
ingredients.setOutput(GasStack.class, recipe.recipeOutput.getGasOutput());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+13
-2
@@ -1,5 +1,7 @@
|
||||
package mekanism.client.jei.machine.other;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
@@ -7,9 +9,11 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class RotaryCondensentratorRecipeCategory extends BaseRecipeCategory
|
||||
{
|
||||
@@ -63,7 +67,7 @@ public class RotaryCondensentratorRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof RotaryCondensentratorRecipeWrapper)
|
||||
{
|
||||
@@ -73,6 +77,13 @@ public class RotaryCondensentratorRecipeCategory extends BaseRecipeCategory
|
||||
IGuiFluidStackGroup fluidStacks = recipeLayout.getFluidStacks();
|
||||
|
||||
fluidStacks.init(0, !tempRecipe.condensentrating, 134-xOffset, 14-yOffset, 16, 58, 1000, false, fluidOverlay);
|
||||
fluidStacks.set(0, tempRecipe.condensentrating ? recipeWrapper.getFluidOutputs() : recipeWrapper.getFluidInputs());
|
||||
|
||||
if(tempRecipe.condensentrating)
|
||||
{
|
||||
fluidStacks.set(0, ingredients.getOutputs(FluidStack.class).get(0));
|
||||
}
|
||||
else {
|
||||
fluidStacks.set(0, ingredients.getInputs(FluidStack.class).get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
-7
@@ -20,13 +20,6 @@ public class RotaryCondensentratorRecipeHandler implements IRecipeHandler<Rotary
|
||||
return RotaryCondensentratorRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull RotaryCondensentratorRecipeWrapper recipe)
|
||||
|
||||
+7
-33
@@ -1,18 +1,18 @@
|
||||
package mekanism.client.jei.machine.other;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.Gas;
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -34,43 +34,17 @@ public class RotaryCondensentratorRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
if(condensentrating)
|
||||
{
|
||||
return new ArrayList<FluidStack>();
|
||||
ingredients.setInput(GasStack.class, new GasStack(gasType, 1000));
|
||||
ingredients.setOutput(FluidStack.class, new FluidStack(fluidType, 1000));
|
||||
}
|
||||
else {
|
||||
return Arrays.asList(new FluidStack(fluidType, 1000));
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs()
|
||||
{
|
||||
if(condensentrating)
|
||||
{
|
||||
return Arrays.asList(new FluidStack(fluidType, 1000));
|
||||
}
|
||||
else {
|
||||
return new ArrayList<FluidStack>();
|
||||
ingredients.setInput(FluidStack.class, new FluidStack(fluidType, 1000));
|
||||
ingredients.setOutput(GasStack.class, new GasStack(gasType, 1000));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package mekanism.client.jei.machine.other;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.client.jei.BaseRecipeCategory;
|
||||
import mekanism.common.recipe.machines.SolarNeutronRecipe;
|
||||
import mezz.jei.api.IGuiHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -59,7 +62,7 @@ public class SolarNeutronRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof SolarNeutronRecipeWrapper)
|
||||
{
|
||||
|
||||
@@ -20,13 +20,6 @@ public class SolarNeutronRecipeHandler implements IRecipeHandler<SolarNeutronRec
|
||||
return SolarNeutronRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull SolarNeutronRecipeWrapper recipe)
|
||||
|
||||
@@ -3,13 +3,13 @@ package mekanism.client.jei.machine.other;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.gas.GasStack;
|
||||
import mekanism.common.recipe.machines.SolarNeutronRecipe;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class SolarNeutronRecipeWrapper extends BlankRecipeWrapper
|
||||
{
|
||||
@@ -23,18 +23,11 @@ public class SolarNeutronRecipeWrapper extends BlankRecipeWrapper
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return new ArrayList<ItemStack>();
|
||||
ingredients.setInput(GasStack.class, recipe.getInput().ingredient);
|
||||
ingredients.setOutput(GasStack.class, recipe.getOutput().output);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+4
-4
@@ -10,6 +10,7 @@ import mezz.jei.api.gui.IGuiFluidStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.gui.ITooltipCallback;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -56,7 +57,7 @@ public class ThermalEvaporationRecipeCategory extends BaseRecipeCategory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
if(recipeWrapper instanceof ThermalEvaporationRecipeWrapper)
|
||||
{
|
||||
@@ -68,11 +69,10 @@ public class ThermalEvaporationRecipeCategory extends BaseRecipeCategory
|
||||
fluidStacks.init(0, true, 7-xOffset, 14-yOffset, 16, 58, tempRecipe.getInput().ingredient.amount, false, fluidOverlay);
|
||||
fluidStacks.init(1, false, 153-xOffset, 14-yOffset, 16, 58, tempRecipe.getOutput().output.amount, false, fluidOverlay);
|
||||
|
||||
fluidStacks.set(0, recipeWrapper.getFluidInputs());
|
||||
fluidStacks.set(1, recipeWrapper.getFluidOutputs());
|
||||
fluidStacks.set(0, tempRecipe.recipeInput.ingredient);
|
||||
fluidStacks.set(1, tempRecipe.recipeOutput.output);
|
||||
|
||||
fluidStacks.addTooltipCallback(new ITooltipCallback<FluidStack>() {
|
||||
|
||||
@Override
|
||||
public void onTooltip(int slotIndex, boolean input, FluidStack ingredient, List<String> tooltip)
|
||||
{
|
||||
|
||||
@@ -20,13 +20,6 @@ public class ThermalEvaporationRecipeHandler implements IRecipeHandler<ThermalEv
|
||||
return ThermalEvaporationRecipeWrapper.class;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return category.getUid();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeWrapper getRecipeWrapper(@Nonnull ThermalEvaporationRecipeWrapper recipe)
|
||||
|
||||
+5
-11
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -20,18 +21,11 @@ public class ThermalEvaporationRecipeWrapper extends BlankRecipeWrapper
|
||||
recipe = r;
|
||||
category = c;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
||||
@Override
|
||||
public List<FluidStack> getFluidInputs()
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
return Arrays.asList(recipe.getInput().ingredient);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<FluidStack> getFluidOutputs()
|
||||
{
|
||||
return Arrays.asList(recipe.getOutput().output);
|
||||
ingredients.setInput(FluidStack.class, recipe.getInput().ingredient);
|
||||
ingredients.setOutput(FluidStack.class, recipe.getOutput().output);
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public final class MinerVisualRenderer
|
||||
{
|
||||
if(x == -data.radius || x == data.radius || y == data.minY-data.yCoord || y == data.maxY-data.yCoord || z == -data.radius || z == data.radius)
|
||||
{
|
||||
models.add(createModel(new Coord4D(x, y, z, mc.theWorld.provider.getDimension())));
|
||||
models.add(createModel(new Coord4D(x, y, z, mc.world.provider.getDimension())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ public class RenderTickHandler
|
||||
{
|
||||
if(event.phase == Phase.END)
|
||||
{
|
||||
if(mc.thePlayer != null && mc.theWorld != null && !mc.isGamePaused())
|
||||
if(mc.player != null && mc.world != null && !mc.isGamePaused())
|
||||
{
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
World world = mc.thePlayer.worldObj;
|
||||
EntityPlayer player = mc.player;
|
||||
World world = mc.player.world;
|
||||
FontRenderer font = mc.fontRendererObj;
|
||||
RayTraceResult pos = player.rayTrace(40.0D, 1.0F);
|
||||
|
||||
@@ -109,7 +109,7 @@ public class RenderTickHandler
|
||||
{
|
||||
for(String s : Mekanism.jetpackOn)
|
||||
{
|
||||
EntityPlayer p = mc.theWorld.getPlayerEntityByName(s);
|
||||
EntityPlayer p = mc.world.getPlayerEntityByName(s);
|
||||
|
||||
if(p == null)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ public class RenderTickHandler
|
||||
{
|
||||
for(String s : Mekanism.gasmaskOn)
|
||||
{
|
||||
EntityPlayer p = mc.theWorld.getPlayerEntityByName(s);
|
||||
EntityPlayer p = mc.world.getPlayerEntityByName(s);
|
||||
|
||||
if(p == null || !p.isInWater())
|
||||
{
|
||||
|
||||
@@ -483,6 +483,12 @@ public class Quad
|
||||
|
||||
private boolean applyDiffuseLighting;
|
||||
|
||||
@Override
|
||||
public void setTexture(TextureAtlasSprite sprite)
|
||||
{
|
||||
//TODO ignore for now
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setQuadTint(int tint)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ public class RenderObsidianTNTPrimed extends Render<EntityObsidianTNT>
|
||||
if(entityobsidiantnt.fuse - partialTicks + 1.0F < 10.0F)
|
||||
{
|
||||
float f = 1.0F - (entityobsidiantnt.fuse - partialTicks + 1.0F) / 10.0F;
|
||||
f = MathHelper.clamp_float(f, 0.0F, 1.0F);
|
||||
f = MathHelper.clamp(f, 0.0F, 1.0F);
|
||||
f = f * f;
|
||||
f = f * f;
|
||||
float f1 = 1.0F + f * 0.3F;
|
||||
|
||||
@@ -44,7 +44,7 @@ public class RenderConfigurableMachine<S extends TileEntity & ISideConfiguration
|
||||
{
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
EntityPlayer player = mc.player;
|
||||
ItemStack itemStack = player.inventory.getCurrentItem();
|
||||
RayTraceResult pos = player.rayTrace(8.0D, 1.0F);
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class RenderLogisticalTransporter extends RenderTransmitterBase<PartLogis
|
||||
entityItem.hoverStart = 0;
|
||||
|
||||
entityItem.setPosition(transporter.getPos().getX() + 0.5, transporter.getPos().getY() + 0.5, transporter.getPos().getZ() + 0.5);
|
||||
entityItem.worldObj = transporter.getWorld();
|
||||
entityItem.world = transporter.getWorld();
|
||||
|
||||
for(TransporterStack stack : transporter.getTransmitter().transit.clone())
|
||||
{
|
||||
@@ -97,8 +97,8 @@ public class RenderLogisticalTransporter extends RenderTransmitterBase<PartLogis
|
||||
|
||||
if(transporter instanceof PartDiversionTransporter)
|
||||
{
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
World world = mc.thePlayer.worldObj;
|
||||
EntityPlayer player = mc.player;
|
||||
World world = mc.player.world;
|
||||
ItemStack itemStack = player.inventory.getCurrentItem();
|
||||
RayTraceResult pos = player.rayTrace(8.0D, 1.0F);
|
||||
|
||||
|
||||
@@ -32,6 +32,6 @@ public class GasMaskSound extends PlayerSound
|
||||
|
||||
private boolean hasGasMask(EntityPlayer player)
|
||||
{
|
||||
return player.inventory.armorInventory[3] != null && player.inventory.armorInventory[3].getItem() instanceof ItemGasMask;
|
||||
return player.inventory.armorInventory.get(3) != null && player.inventory.armorInventory.get(3).getItem() instanceof ItemGasMask;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,6 @@ public class JetpackSound extends PlayerSound
|
||||
|
||||
private boolean hasJetpack(EntityPlayer player)
|
||||
{
|
||||
return player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() instanceof ItemJetpack;
|
||||
return player.inventory.armorInventory.get(2) != null && player.inventory.armorInventory.get(2).getItem() instanceof ItemJetpack;
|
||||
}
|
||||
}
|
||||
@@ -27,19 +27,19 @@ public class CommandMekanism extends CommandBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandName()
|
||||
public String getName()
|
||||
{
|
||||
return "mk";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender sender)
|
||||
public String getUsage(ICommandSender sender)
|
||||
{
|
||||
return "/mk <parameters>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getCommandAliases()
|
||||
public List getAliases()
|
||||
{
|
||||
return Arrays.asList(new String[] {"mekanism", "mek"});
|
||||
}
|
||||
@@ -49,13 +49,13 @@ public class CommandMekanism extends CommandBase
|
||||
{
|
||||
if(params.length < 1)
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + " *Version: " + EnumColor.DARK_GREY + Mekanism.versionNumber));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + " *Latest Version: " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + " *Developed on Mac OS X 10.8 Mountain Lion"));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + " *Code, textures, and ideas by aidancbrady"));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + " *Recent News: " + EnumColor.INDIGO + Mekanism.recentNews));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + " *Version: " + EnumColor.DARK_GREY + Mekanism.versionNumber));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + " *Latest Version: " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + " *Developed on Mac OS X 10.8 Mountain Lion"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + " *Code, textures, and ideas by aidancbrady"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + " *Recent News: " + EnumColor.INDIGO + Mekanism.recentNews));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
}
|
||||
else if(params.length >= 1)
|
||||
{
|
||||
@@ -63,25 +63,25 @@ public class CommandMekanism extends CommandBase
|
||||
{
|
||||
if(params.length == 1)
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk" + EnumColor.GREY + " -- displays the main page."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk help" + EnumColor.GREY + " -- displays this guide."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk version" + EnumColor.GREY + " -- displays the version number."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk latest" + EnumColor.GREY + " -- displays the latest version number."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk news" + EnumColor.GREY + " -- displays most recent recent news."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk debug" + EnumColor.GREY + " -- toggles Mekanism's debug mode."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter" + EnumColor.GREY + " -- provides information on teleporters."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk" + EnumColor.GREY + " -- displays the main page."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk help" + EnumColor.GREY + " -- displays this guide."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk version" + EnumColor.GREY + " -- displays the version number."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk latest" + EnumColor.GREY + " -- displays the latest version number."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk news" + EnumColor.GREY + " -- displays most recent recent news."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk debug" + EnumColor.GREY + " -- toggles Mekanism's debug mode."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter" + EnumColor.GREY + " -- provides information on teleporters."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
}
|
||||
else if(params[1].equalsIgnoreCase("teleporter"))
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq list" + EnumColor.GREY + " -- displays a list of the public frequencies."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq list [user]" + EnumColor.GREY + " -- displays a list of a certain user's private frequencies."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq delete [freq]" + EnumColor.GREY + " -- removes a frequency from the public list."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq delete [user] [freq]" + EnumColor.GREY + " -- removes a freqency from a certain user's private list."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq deleteAll [user]" + EnumColor.GREY + " -- removes all frequencies owned by a certain user."));
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq list" + EnumColor.GREY + " -- displays a list of the public frequencies."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq list [user]" + EnumColor.GREY + " -- displays a list of a certain user's private frequencies."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq delete [freq]" + EnumColor.GREY + " -- removes a frequency from the public list."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq delete [user] [freq]" + EnumColor.GREY + " -- removes a freqency from a certain user's private list."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " /mk teleporter freq deleteAll [user]" + EnumColor.GREY + " -- removes all frequencies owned by a certain user."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
}
|
||||
}
|
||||
else if(params[0].equalsIgnoreCase("version"))
|
||||
@@ -90,38 +90,38 @@ public class CommandMekanism extends CommandBase
|
||||
{
|
||||
if(general.updateNotifications || Mekanism.latestVersionNumber == null || Mekanism.recentNews == null || Mekanism.latestVersionNumber.equals("null"))
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Minecraft is in offline mode, could not check for updates."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Minecraft is in offline mode, could not check for updates."));
|
||||
}
|
||||
else {
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Your client is up to date."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Your client is up to date."));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(params[0].equalsIgnoreCase("news"))
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Most recent news: " + EnumColor.INDIGO + Mekanism.recentNews));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Most recent news: " + EnumColor.INDIGO + Mekanism.recentNews));
|
||||
}
|
||||
else if(params[0].equalsIgnoreCase("latest"))
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " The latest version for this mod is " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber + EnumColor.GREY + "."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " The latest version for this mod is " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber + EnumColor.GREY + "."));
|
||||
}
|
||||
else if(params[0].equalsIgnoreCase("teleporter"))
|
||||
{
|
||||
if(params.length == 2)
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Invalid parameters."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Invalid parameters."));
|
||||
}
|
||||
else if(params[1].equalsIgnoreCase("freq") || params[1].equalsIgnoreCase("frequencies"))
|
||||
{
|
||||
if(params[2].equalsIgnoreCase("list"))
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"));
|
||||
|
||||
if(params.length == 3)
|
||||
{
|
||||
for(Frequency freq : Mekanism.publicTeleporters.getFrequencies())
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " - " + freq.name + EnumColor.GREY + " (" + freq.owner + ")"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " - " + freq.name + EnumColor.GREY + " (" + freq.owner + ")"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -131,15 +131,15 @@ public class CommandMekanism extends CommandBase
|
||||
{
|
||||
for(Frequency freq : manager.getFrequencies())
|
||||
{
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.INDIGO + " - " + freq.name + EnumColor.GREY + " (" + freq.owner + ")"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.INDIGO + " - " + freq.name + EnumColor.GREY + " (" + freq.owner + ")"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " User profile doesn't exist."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " User profile doesn't exist."));
|
||||
}
|
||||
}
|
||||
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
}
|
||||
else if(params[2].equalsIgnoreCase("delete"))
|
||||
{
|
||||
@@ -148,10 +148,10 @@ public class CommandMekanism extends CommandBase
|
||||
if(Mekanism.publicTeleporters.containsFrequency(params[3].trim()))
|
||||
{
|
||||
Mekanism.publicTeleporters.remove(params[3].trim());
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Successfully removed frequency."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Successfully removed frequency."));
|
||||
}
|
||||
else {
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " No such frequency found."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " No such frequency found."));
|
||||
}
|
||||
}
|
||||
else if(params.length == 5)
|
||||
@@ -163,14 +163,14 @@ public class CommandMekanism extends CommandBase
|
||||
if(manager.containsFrequency(params[4].trim()))
|
||||
{
|
||||
manager.remove(params[4].trim());
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Successfully removed frequency."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Successfully removed frequency."));
|
||||
}
|
||||
else {
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " No such frequency found."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " No such frequency found."));
|
||||
}
|
||||
}
|
||||
else {
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " User profile doesn't exist."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " User profile doesn't exist."));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,10 +186,10 @@ public class CommandMekanism extends CommandBase
|
||||
int amount = Mekanism.publicTeleporters.removeAll(owner);
|
||||
amount += manager.removeAll(owner);
|
||||
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Successfully removed " + amount + " frequencies."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Successfully removed " + amount + " frequencies."));
|
||||
}
|
||||
else {
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " User profile doesn't exist."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " User profile doesn't exist."));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -198,7 +198,7 @@ public class CommandMekanism extends CommandBase
|
||||
else if(params[0].equalsIgnoreCase("debug"))
|
||||
{
|
||||
MekanismAPI.debug = !MekanismAPI.debug;
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Debug mode set to " + EnumColor.DARK_GREY + MekanismAPI.debug));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Debug mode set to " + EnumColor.DARK_GREY + MekanismAPI.debug));
|
||||
}
|
||||
else if(params[0].equalsIgnoreCase("op"))
|
||||
{
|
||||
@@ -221,7 +221,7 @@ public class CommandMekanism extends CommandBase
|
||||
}
|
||||
}
|
||||
else {
|
||||
sender.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Unknown command. Type '" + EnumColor.INDIGO + "/mk help" + EnumColor.GREY + "' for help."));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " Unknown command. Type '" + EnumColor.INDIGO + "/mk help" + EnumColor.GREY + "' for help."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class CommonPlayerTickHandler
|
||||
|
||||
if(isFlamethrowerOn(player))
|
||||
{
|
||||
player.worldObj.spawnEntityInWorld(new EntityFlame(player));
|
||||
player.world.spawnEntity(new EntityFlame(player));
|
||||
|
||||
if(!player.capabilities.isCreativeMode)
|
||||
{
|
||||
@@ -144,13 +144,13 @@ public class CommonPlayerTickHandler
|
||||
|
||||
public static boolean isOnGround(EntityPlayer player)
|
||||
{
|
||||
int x = MathHelper.floor_double(player.posX);
|
||||
int x = MathHelper.floor(player.posX);
|
||||
int y = (int)Math.round(player.posY - 1);
|
||||
int z = MathHelper.floor_double(player.posZ);
|
||||
int z = MathHelper.floor(player.posZ);
|
||||
|
||||
BlockPos pos = new BlockPos(x, y, z);
|
||||
IBlockState s = player.worldObj.getBlockState(pos);
|
||||
AxisAlignedBB box = s.getCollisionBoundingBox(player.worldObj, pos);
|
||||
IBlockState s = player.world.getBlockState(pos);
|
||||
AxisAlignedBB box = s.getCollisionBoundingBox(player.world, pos);
|
||||
AxisAlignedBB playerBox = player.getCollisionBoundingBox();
|
||||
|
||||
return box != null && playerBox != null && playerBox.offset(0, -0.01, 0).intersectsWith(box);
|
||||
@@ -158,7 +158,7 @@ public class CommonPlayerTickHandler
|
||||
|
||||
public boolean isJetpackOn(EntityPlayer player)
|
||||
{
|
||||
ItemStack stack = player.inventory.armorInventory[2];
|
||||
ItemStack stack = player.inventory.armorInventory.get(2);
|
||||
|
||||
if(stack != null && !player.capabilities.isCreativeMode)
|
||||
{
|
||||
@@ -194,8 +194,8 @@ public class CommonPlayerTickHandler
|
||||
|
||||
public static boolean isGasMaskOn(EntityPlayer player)
|
||||
{
|
||||
ItemStack tank = player.inventory.armorInventory[2];
|
||||
ItemStack mask = player.inventory.armorInventory[3];
|
||||
ItemStack tank = player.inventory.armorInventory.get(2);
|
||||
ItemStack mask = player.inventory.armorInventory.get(3);
|
||||
|
||||
if(tank != null && mask != null)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ public class CommonPlayerTracker
|
||||
@SubscribeEvent
|
||||
public void onPlayerLoginEvent(PlayerLoggedInEvent event)
|
||||
{
|
||||
if(!event.player.worldObj.isRemote)
|
||||
if(!event.player.world.isRemote)
|
||||
{
|
||||
Mekanism.packetHandler.sendTo(new ConfigSyncMessage(), (EntityPlayerMP)event.player);
|
||||
Mekanism.packetHandler.sendTo(new BoxBlacklistMessage(), (EntityPlayerMP)event.player);
|
||||
@@ -52,7 +52,7 @@ public class CommonPlayerTracker
|
||||
Mekanism.gasmaskOn.remove(event.player.getName());
|
||||
Mekanism.flamethrowerActive.remove(event.player.getName());
|
||||
|
||||
if(!event.player.worldObj.isRemote)
|
||||
if(!event.player.world.isRemote)
|
||||
{
|
||||
Mekanism.packetHandler.sendTo(new JetpackDataMessage(JetpackPacket.FULL, null, false), (EntityPlayerMP)event.player);
|
||||
Mekanism.packetHandler.sendTo(new ScubaTankDataMessage(ScubaTankPacket.FULL, null, false), (EntityPlayerMP)event.player);
|
||||
|
||||
@@ -632,7 +632,7 @@ public class CommonProxy implements IGuiProvider
|
||||
dummyPlayer = createNewPlayer(world);
|
||||
}
|
||||
else {
|
||||
dummyPlayer.get().worldObj = world;
|
||||
dummyPlayer.get().world = world;
|
||||
}
|
||||
|
||||
return dummyPlayer;
|
||||
@@ -645,7 +645,7 @@ public class CommonProxy implements IGuiProvider
|
||||
dummyPlayer = createNewPlayer(world, x, y, z);
|
||||
}
|
||||
else {
|
||||
dummyPlayer.get().worldObj = world;
|
||||
dummyPlayer.get().world = world;
|
||||
dummyPlayer.get().posX = x;
|
||||
dummyPlayer.get().posY = y;
|
||||
dummyPlayer.get().posZ = z;
|
||||
@@ -663,7 +663,7 @@ public class CommonProxy implements IGuiProvider
|
||||
{
|
||||
if(player instanceof EntityPlayerMP)
|
||||
{
|
||||
((WorldServer)player.worldObj).addScheduledTask(runnable);
|
||||
((WorldServer)player.world).addScheduledTask(runnable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ public class CreativeTabMekanism extends CreativeTabs
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem()
|
||||
public ItemStack getTabIconItem()
|
||||
{
|
||||
return MekanismItems.AtomicAlloy;
|
||||
return new ItemStack(MekanismItems.AtomicAlloy);
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class LaserManager
|
||||
|
||||
if(energy > 256)
|
||||
{
|
||||
e.attackEntityFrom(DamageSource.generic, (float)energy/1000F);
|
||||
e.attackEntityFrom(DamageSource.GENERIC, (float)energy/1000F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1191,11 +1191,11 @@ public class Mekanism
|
||||
public void addEntities()
|
||||
{
|
||||
//Registrations
|
||||
EntityRegistry.registerModEntity(EntityObsidianTNT.class, "ObsidianTNT", 0, this, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityRobit.class, "Robit", 1, this, 64, 2, true);
|
||||
EntityRegistry.registerModEntity(EntityBalloon.class, "Balloon", 2, this, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityBabySkeleton.class, "BabySkeleton", 3, this, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(EntityFlame.class, "Flame", 4, this, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(new ResourceLocation("mekanism", "ObsidianTNT"), EntityObsidianTNT.class, "ObsidianTNT", 0, this, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(new ResourceLocation("mekanism", "Robit"), EntityRobit.class, "Robit", 1, this, 64, 2, true);
|
||||
EntityRegistry.registerModEntity(new ResourceLocation("mekanism", "Balloon"), EntityBalloon.class, "Balloon", 2, this, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(new ResourceLocation("mekanism", "BabySkeleton"), EntityBabySkeleton.class, "BabySkeleton", 3, this, 64, 5, true);
|
||||
EntityRegistry.registerModEntity(new ResourceLocation("mekanism", "Flame"), EntityFlame.class, "Flame", 4, this, 64, 5, true);
|
||||
|
||||
//Tile entities
|
||||
GameRegistry.registerTileEntity(TileEntityBoundingBlock.class, "BoundingBlock");
|
||||
@@ -1556,7 +1556,7 @@ public class Mekanism
|
||||
return;
|
||||
}
|
||||
|
||||
ChunkPos coordPair = event.getChunk().getChunkCoordIntPair();
|
||||
ChunkPos coordPair = event.getChunk().getPos();
|
||||
worldTickHandler.addRegenChunk(event.getWorld().provider.getDimension(), coordPair);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ public class PacketHandler
|
||||
{
|
||||
MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
|
||||
|
||||
for(EntityPlayerMP player : server.getPlayerList().getPlayerList())
|
||||
for(EntityPlayerMP player : server.getPlayerList().getPlayers())
|
||||
{
|
||||
sendTo(message, player);
|
||||
}
|
||||
@@ -336,7 +336,7 @@ public class PacketHandler
|
||||
|
||||
if(server != null && cuboid != null)
|
||||
{
|
||||
for(EntityPlayerMP player : (List<EntityPlayerMP>)server.getPlayerList().getPlayerList())
|
||||
for(EntityPlayerMP player : (List<EntityPlayerMP>)server.getPlayerList().getPlayers())
|
||||
{
|
||||
if(player.dimension == dimId && cuboid.isVecInside(new Vec3d(player.posX, player.posY, player.posZ)))
|
||||
{
|
||||
@@ -352,7 +352,7 @@ public class PacketHandler
|
||||
|
||||
if(server != null)
|
||||
{
|
||||
for(EntityPlayerMP player : (List<EntityPlayerMP>)server.getPlayerList().getPlayerList())
|
||||
for(EntityPlayerMP player : (List<EntityPlayerMP>)server.getPlayerList().getPlayers())
|
||||
{
|
||||
if(player.dimension == range.dimensionId && Range4D.getChunkRange(player).intersects(range))
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ package mekanism.common.base;
|
||||
import mekanism.common.capabilities.ItemCapabilityWrapper.ItemCapability;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.FluidTankProperties;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
@@ -19,7 +18,7 @@ public class FluidItemWrapper extends ItemCapability implements IFluidHandler
|
||||
@Override
|
||||
public int fill(FluidStack resource, boolean doFill)
|
||||
{
|
||||
if(getStack().stackSize != 1)
|
||||
if(getStack().getCount() != 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -30,7 +29,7 @@ public class FluidItemWrapper extends ItemCapability implements IFluidHandler
|
||||
@Override
|
||||
public FluidStack drain(FluidStack resource, boolean doDrain)
|
||||
{
|
||||
if(getStack().stackSize != 1 || resource == null)
|
||||
if(getStack().getCount() != 1 || resource == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -51,7 +50,7 @@ public class FluidItemWrapper extends ItemCapability implements IFluidHandler
|
||||
@Override
|
||||
public FluidStack drain(int maxDrain, boolean doDrain)
|
||||
{
|
||||
if(getStack().stackSize != 1)
|
||||
if(getStack().getCount() != 1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -59,9 +58,9 @@ public class FluidItemWrapper extends ItemCapability implements IFluidHandler
|
||||
return getItem().drain(getStack(), maxDrain, doDrain);
|
||||
}
|
||||
|
||||
public IFluidContainerItem getItem()
|
||||
public IFluidItemWrapper getItem()
|
||||
{
|
||||
return (IFluidContainerItem)getStack().getItem();
|
||||
return (IFluidItemWrapper)getStack().getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package mekanism.common.base;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public interface IFluidItemWrapper
|
||||
{
|
||||
public FluidStack getFluid(ItemStack container);
|
||||
|
||||
public int getCapacity(ItemStack container);
|
||||
|
||||
public int fill(ItemStack container, FluidStack resource, boolean doFill);
|
||||
|
||||
public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain);
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package mekanism.common.block;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
@@ -58,9 +57,11 @@ import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.EnumSkyBlock;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -220,7 +221,7 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock)
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock, BlockPos fromPos)
|
||||
{
|
||||
if(!world.isRemote)
|
||||
{
|
||||
@@ -299,7 +300,7 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativetabs, List<ItemStack> list)
|
||||
public void getSubBlocks(Item item, CreativeTabs creativetabs, NonNullList<ItemStack> list)
|
||||
{
|
||||
for(BasicBlockType type : BasicBlockType.values())
|
||||
{
|
||||
@@ -412,10 +413,10 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
{
|
||||
if(!player.isSneaking())
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, bin.removeStack().copy()));
|
||||
world.spawnEntity(new EntityItem(world, player.posX, player.posY, player.posZ, bin.removeStack().copy()));
|
||||
}
|
||||
else {
|
||||
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, bin.remove(1).copy()));
|
||||
world.spawnEntity(new EntityItem(world, player.posX, player.posY, player.posZ, bin.remove(1).copy()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -423,10 +424,11 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer entityplayer, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
BasicBlockType type = BasicBlockType.get(state);
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
ItemStack stack = entityplayer.getHeldItem(hand);
|
||||
|
||||
if(type == BasicBlockType.REFINED_OBSIDIAN)
|
||||
{
|
||||
@@ -487,13 +489,13 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
|
||||
if(MekanismUtils.isBCWrench(tool))
|
||||
{
|
||||
((IToolWrench)tool).wrenchUsed(entityplayer, pos);
|
||||
((IToolWrench)tool).wrenchUsed(entityplayer, hand, stack, new RayTraceResult(new Vec3d(hitX, hitY, hitZ), side, pos));
|
||||
}
|
||||
|
||||
int change = bin.facing.rotateY().ordinal();
|
||||
|
||||
bin.setFacing((short)change);
|
||||
world.notifyNeighborsOfStateChange(pos, this);
|
||||
world.notifyNeighborsOfStateChange(pos, this, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -514,19 +516,19 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
}
|
||||
else if(bin.addTicks > 0 && bin.getItemCount() > 0)
|
||||
{
|
||||
ItemStack[] inv = entityplayer.inventory.mainInventory;
|
||||
NonNullList<ItemStack> inv = entityplayer.inventory.mainInventory;
|
||||
|
||||
for(int i = 0; i < inv.length; i++)
|
||||
for(int i = 0; i < inv.size(); i++)
|
||||
{
|
||||
if(bin.getItemCount() == bin.tier.storage)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if(inv[i] != null)
|
||||
if(inv.get(i) != null)
|
||||
{
|
||||
ItemStack remain = bin.add(inv[i]);
|
||||
inv[i] = remain;
|
||||
ItemStack remain = bin.add(inv.get(i));
|
||||
inv.set(i, remain);
|
||||
bin.addTicks = 5;
|
||||
}
|
||||
|
||||
@@ -598,15 +600,15 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
{
|
||||
tileEntity.structure.fluidStored.amount -= filled;
|
||||
}
|
||||
else if(itemStack.stackSize == 1)
|
||||
else if(itemStack.getCount() == 1)
|
||||
{
|
||||
tileEntity.structure.fluidStored.amount -= filled;
|
||||
player.setHeldItem(hand, copyStack);
|
||||
}
|
||||
else if(itemStack.stackSize > 1 && player.inventory.addItemStackToInventory(copyStack))
|
||||
else if(itemStack.getCount() > 1 && player.inventory.addItemStackToInventory(copyStack))
|
||||
{
|
||||
tileEntity.structure.fluidStored.amount -= filled;
|
||||
itemStack.stackSize--;
|
||||
itemStack.shrink(1);
|
||||
}
|
||||
|
||||
if(tileEntity.structure.fluidStored.amount == 0)
|
||||
@@ -631,7 +633,7 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
boolean filled = false;
|
||||
FluidStack drained = handler.drain(needed, !player.capabilities.isCreativeMode);
|
||||
|
||||
if(copyStack.stackSize == 0)
|
||||
if(copyStack.getCount() == 0)
|
||||
{
|
||||
copyStack = null;
|
||||
}
|
||||
@@ -645,7 +647,7 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
else {
|
||||
if(copyStack != null)
|
||||
{
|
||||
if(itemStack.stackSize == 1)
|
||||
if(itemStack.getCount() == 1)
|
||||
{
|
||||
player.setHeldItem(hand, copyStack);
|
||||
filled = true;
|
||||
@@ -653,16 +655,16 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
else {
|
||||
if(player.inventory.addItemStackToInventory(copyStack))
|
||||
{
|
||||
itemStack.stackSize--;
|
||||
itemStack.shrink(1);
|
||||
|
||||
filled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
itemStack.stackSize--;
|
||||
itemStack.shrink(1);
|
||||
|
||||
if(itemStack.stackSize == 0)
|
||||
if(itemStack.getCount() == 0)
|
||||
{
|
||||
player.setHeldItem(hand, null);
|
||||
}
|
||||
@@ -777,7 +779,7 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
if(world.getTileEntity(pos) instanceof TileEntityBasicBlock)
|
||||
{
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(pos);
|
||||
int side = MathHelper.floor_double((placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
int side = MathHelper.floor((placer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
int height = Math.round(placer.rotationPitch);
|
||||
int change = 3;
|
||||
|
||||
@@ -910,7 +912,7 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, pos.getX() + motionX, pos.getY() + motionY, pos.getZ() + motionZ, getPickBlock(state, null, world, pos, player));
|
||||
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
world.spawnEntity(entityItem);
|
||||
}
|
||||
|
||||
return world.setBlockToAir(pos);
|
||||
@@ -931,7 +933,7 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
|
||||
EntityItem entityItem = new EntityItem(world, pos.getX() + motionX, pos.getY() + motionY, pos.getZ() + motionZ, itemStack);
|
||||
|
||||
world.spawnEntityInWorld(entityItem);
|
||||
world.spawnEntity(entityItem);
|
||||
}
|
||||
|
||||
return itemStack;
|
||||
@@ -1035,8 +1037,8 @@ public abstract class BlockBasic extends Block implements ICTMBlock
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, BlockPos pos, BlockPos beacon)
|
||||
public boolean isBeaconBase(IBlockAccess world, BlockPos pos, BlockPos beacon)
|
||||
{
|
||||
return BasicBlockType.get(worldObj.getBlockState(pos)).isBeaconBase;
|
||||
return BasicBlockType.get(world.getBlockState(pos)).isBeaconBase;
|
||||
}
|
||||
}
|
||||
@@ -49,12 +49,12 @@ public class BlockBounding extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack stack, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(pos);
|
||||
IBlockState state1 = world.getBlockState(tileEntity.mainPos);
|
||||
return state1.getBlock().onBlockActivated(world, tileEntity.mainPos, state1, player, hand, stack, side, hitX, hitY, hitZ);
|
||||
return state1.getBlock().onBlockActivated(world, tileEntity.mainPos, state1, player, hand, side, hitX, hitY, hitZ);
|
||||
} catch(Exception e) {
|
||||
return false;
|
||||
}
|
||||
@@ -93,13 +93,13 @@ public class BlockBounding extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock)
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock, BlockPos neighborPos)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(pos);
|
||||
tileEntity.onNeighborChange(state.getBlock());
|
||||
IBlockState state1 = world.getBlockState(tileEntity.mainPos);
|
||||
state1.getBlock().neighborChanged(state1, world, tileEntity.mainPos, this);
|
||||
state1.getBlock().neighborChanged(state1, world, tileEntity.mainPos, neighborBlock, neighborPos);
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
|
||||
|
||||
Loaded 100 of 666 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user