<200 errors. All I have left is a bit of rendering work and the new "off hand" stuff

This commit is contained in:
aidancbrady committed 2016-05-25 17:30:22 -04:00
1 parent c73eef6be8
commit a89b8f666c
152 files changed
+754 -439

No files matched your search

@@ -38,6 +38,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ResourceLocation;
@@ -199,8 +200,10 @@ public class ClientTickHandler
}
}
}
ItemStack bootStack = mc.thePlayer.getItemStackFromSlot(EntityEquipmentSlot.FEET);
if(mc.thePlayer.getEquipmentInSlot(1) != null && mc.thePlayer.getEquipmentInSlot(1).getItem() instanceof ItemFreeRunners)
if(bootStack != null && bootStack.getItem() instanceof ItemFreeRunners)
{
mc.thePlayer.stepHeight = 1.002F;
}
@@ -296,7 +299,9 @@ public class ClientTickHandler
}
}
if(mc.thePlayer.getEquipmentInSlot(3) != null && mc.thePlayer.getEquipmentInSlot(3).getItem() instanceof ItemJetpack)
ItemStack chestStack = mc.thePlayer.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
if(chestStack != null && chestStack.getItem() instanceof ItemJetpack)
{
MekanismClient.updateKey(mc.gameSettings.keyBindJump, KeySync.ASCEND);
MekanismClient.updateKey(mc.gameSettings.keyBindSneak, KeySync.DESCEND);
@@ -314,14 +319,14 @@ public class ClientTickHandler
if(isJetpackOn(mc.thePlayer))
{
ItemJetpack jetpack = (ItemJetpack)mc.thePlayer.getEquipmentInSlot(3).getItem();
ItemJetpack jetpack = (ItemJetpack)chestStack.getItem();
if(jetpack.getMode(mc.thePlayer.getEquipmentInSlot(3)) == JetpackMode.NORMAL)
if(jetpack.getMode(chestStack) == JetpackMode.NORMAL)
{
mc.thePlayer.motionY = Math.min(mc.thePlayer.motionY + 0.15D, 0.5D);
mc.thePlayer.fallDistance = 0.0F;
}
else if(jetpack.getMode(mc.thePlayer.getEquipmentInSlot(3)) == JetpackMode.HOVER)
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)
{
@@ -354,17 +359,17 @@ public class ClientTickHandler
mc.thePlayer.fallDistance = 0.0F;
}
jetpack.useGas(mc.thePlayer.getEquipmentInSlot(3));
jetpack.useGas(chestStack);
}
if(isGasMaskOn(mc.thePlayer))
{
ItemScubaTank tank = (ItemScubaTank)mc.thePlayer.getEquipmentInSlot(3).getItem();
ItemScubaTank tank = (ItemScubaTank)chestStack.getItem();
final int max = 300;
tank.useGas(mc.thePlayer.getEquipmentInSlot(3));
GasStack received = tank.useGas(mc.thePlayer.getEquipmentInSlot(3), max-mc.thePlayer.getAir());
tank.useGas(chestStack);
GasStack received = tank.useGas(chestStack, max-mc.thePlayer.getAir());
if(received != null)
{
@@ -4,6 +4,7 @@ import mekanism.api.EnumColor;
import mekanism.api.util.StackUtils;
import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism;
import mekanism.common.MekanismSounds;
import mekanism.common.block.states.BlockStateMachine;
import mekanism.common.item.ItemBlockMachine;
import mekanism.common.item.ItemConfigurator;
@@ -115,7 +116,7 @@ public class MekanismKeyHandler extends MekKeyHandler
int newChan = wt.getChannel(toolStack) < 9 ? wt.getChannel(toolStack) + 1 : 1;
wt.setChannel(toolStack, newChan);
Mekanism.packetHandler.sendToServer(new WalkieTalkieStateMessage(newChan));
SoundHandler.playSound("mekanism:etc.Ding");
SoundHandler.playSound(MekanismSounds.DING);
}
}
else if(player.isSneaking() && item instanceof ItemFlamethrower)
@@ -146,7 +147,7 @@ public class MekanismKeyHandler extends MekKeyHandler
}
Mekanism.packetHandler.sendToServer(new JetpackDataMessage(JetpackPacket.MODE, null, player.isSneaking()));
SoundHandler.playSound("mekanism:etc.Hydraulic");
SoundHandler.playSound(MekanismSounds.HYDRAULIC);
}
else if(chestItem instanceof ItemScubaTank)
{
@@ -154,7 +155,7 @@ public class MekanismKeyHandler extends MekKeyHandler
scubaTank.toggleFlowing(chestStack);
Mekanism.packetHandler.sendToServer(new ScubaTankDataMessage(ScubaTankPacket.MODE, null, false));
SoundHandler.playSound("mekanism:etc.Hydraulic");
SoundHandler.playSound(MekanismSounds.HYDRAULIC);
}
}
}
@@ -6,9 +6,11 @@ import java.util.Set;
import mekanism.api.Coord4D;
import mekanism.api.MekanismConfig.general;
import mekanism.common.MekanismSounds;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -35,7 +37,7 @@ public class SparkleAnimation
try {
if(general.dynamicTankEasterEgg)
{
pointer.getWorld().playSound(pointer.getPos().getX(), pointer.getPos().getY(), pointer.getPos().getZ(), "mekanism:etc.cj", 1F, 1F, false);
pointer.getWorld().playSound(null, pointer.getPos().getX(), pointer.getPos().getY(), pointer.getPos().getZ(), MekanismSounds.CJ_EASTER_EGG, SoundCategory.BLOCKS, 1F, 1F);
}
loop(pointer);
@@ -10,6 +10,7 @@ import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -122,7 +123,7 @@ public class GuiDictionary extends GuiMekanism
itemType.stackSize = 1;
scrollList.setText(MekanismUtils.getOreDictName(itemType));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
return;
}
@@ -147,7 +148,7 @@ public class GuiDictionary extends GuiMekanism
scrollList.setText(null);
}
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
@@ -32,6 +32,7 @@ import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -304,7 +305,7 @@ public class GuiDigitalMiner extends GuiMekanism
if(xAxis >= 147 && xAxis <= 161 && yAxis >= 47 && yAxis <= 61)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList<Object> data = new ArrayList<Object>();
data.add(0);
@@ -314,7 +315,7 @@ public class GuiDigitalMiner extends GuiMekanism
if(xAxis >= 147 && xAxis <= 161 && yAxis >= 63 && yAxis <= 77)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList<Object> data = new ArrayList<Object>();
data.add(1);
@@ -324,7 +325,7 @@ public class GuiDigitalMiner extends GuiMekanism
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 47 && yAxis <= 61)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList<Object> data = new ArrayList<Object>();
data.add(5);
@@ -334,7 +335,7 @@ public class GuiDigitalMiner extends GuiMekanism
if(xAxis >= 131 && xAxis <= 145 && yAxis >= 63 && yAxis <= 77)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList<Object> data = new ArrayList<Object>();
data.add(9);
@@ -31,6 +31,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -244,7 +245,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
data.add(getFilterIndex() + i);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
return;
}
@@ -260,7 +261,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
data.add(getFilterIndex() + i);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
return;
}
@@ -272,22 +273,22 @@ public class GuiDigitalMinerConfig extends GuiMekanism
if(filter instanceof MItemStackFilter)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 1, getFilterIndex()+i, 0));
}
else if(filter instanceof MOreDictFilter)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 2, getFilterIndex()+i, 0));
}
else if(filter instanceof MMaterialFilter)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 3, getFilterIndex()+i, 0));
}
else if(filter instanceof MModIDFilter)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 6, getFilterIndex()+i, 0));
}
}
@@ -296,25 +297,25 @@ public class GuiDigitalMinerConfig extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 4, 0, 0));
}
if(xAxis >= 39 && xAxis <= 50 && yAxis >= 67 && yAxis <= 78)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
setRadius();
}
if(xAxis >= 39 && xAxis <= 50 && yAxis >= 92 && yAxis <= 103)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
setMinY();
}
if(xAxis >= 39 && xAxis <= 50 && yAxis >= 117 && yAxis <= 128)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
setMaxY();
}
@@ -324,7 +325,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
data.add(10);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -34,6 +34,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -114,7 +115,7 @@ public class GuiElectrolyticSeparator extends GuiMekanism
data.add((byte)0);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
else if(xAxis > 160 && xAxis < 169 && yAxis > 73 && yAxis < 82)
{
@@ -122,7 +123,7 @@ public class GuiElectrolyticSeparator extends GuiMekanism
data.add((byte)1);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
@@ -28,6 +28,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -175,7 +176,7 @@ public class GuiFactory extends GuiMekanism
data.add(1);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -29,6 +29,7 @@ import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
@@ -241,7 +242,7 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
{
if(xAxis >= 44 && xAxis <= 60 && yAxis >= 75 && yAxis <= 91)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList data = new ArrayList();
data.add(4);
@@ -255,7 +256,7 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
{
if(xAxis >= 7 && xAxis <= 21 && yAxis >= 45 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList data = new ArrayList();
data.add(1);
@@ -266,7 +267,7 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
if(xAxis >= 71 && xAxis <= 87 && yAxis >= 75 && yAxis <= 91)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList data = new ArrayList();
data.add(2);
@@ -276,7 +277,7 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
if(xAxis >= 89 && xAxis <= 105 && yAxis >= 75 && yAxis <= 91)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList data = new ArrayList();
data.add(3);
@@ -290,7 +291,7 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
{
if(xAxis >= 107 && xAxis <= 123 && yAxis >= 75 && yAxis <= 91)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
ArrayList data = new ArrayList();
data.add(0);
@@ -20,6 +20,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -97,7 +98,7 @@ public class GuiGasTank extends GuiMekanism
data.add(0);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
@@ -15,6 +15,7 @@ import mekanism.client.gui.element.GuiSecurityTab;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism;
import mekanism.common.MekanismSounds;
import mekanism.common.OreDictCache;
import mekanism.common.content.transporter.TItemStackFilter;
import mekanism.common.content.transporter.TMaterialFilter;
@@ -32,6 +33,7 @@ import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -263,7 +265,7 @@ public class GuiLogisticalSorter extends GuiMekanism
data.add(getFilterIndex() + i);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
return;
}
@@ -279,7 +281,7 @@ public class GuiLogisticalSorter extends GuiMekanism
data.add(getFilterIndex() + i);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
return;
}
@@ -289,22 +291,22 @@ public class GuiLogisticalSorter extends GuiMekanism
if(filter instanceof TItemStackFilter)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 1, getFilterIndex() + i, 0));
}
else if(filter instanceof TOreDictFilter)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 2, getFilterIndex() + i, 0));
}
else if(filter instanceof TMaterialFilter)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 3, getFilterIndex() + i, 0));
}
else if(filter instanceof TModIDFilter)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 5, getFilterIndex() + i, 0));
}
}
@@ -318,7 +320,7 @@ public class GuiLogisticalSorter extends GuiMekanism
data.add(1);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
// Check for round robin button
@@ -328,7 +330,7 @@ public class GuiLogisticalSorter extends GuiMekanism
data.add(2);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
@@ -345,7 +347,7 @@ public class GuiLogisticalSorter extends GuiMekanism
data.add(mouseBtn);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("mekanism:etc.Ding");
SoundHandler.playSound(MekanismSounds.DING);
}
}
@@ -14,6 +14,7 @@ import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -115,7 +116,7 @@ public class GuiMFilterSelect extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), 0, 0, 0));
}
}
@@ -21,6 +21,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -255,19 +256,19 @@ public class GuiMItemStackFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0, 0, 0));
}
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
filter.requireStack = !filter.requireStack;
}
if(xAxis >= 15 && xAxis <= 29 && yAxis >= 45 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
filter.fuzzy = !filter.fuzzy;
}
@@ -291,7 +292,7 @@ public class GuiMItemStackFilter extends GuiMekanism
filter.itemType = null;
}
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
@@ -321,7 +322,7 @@ public class GuiMItemStackFilter extends GuiMekanism
filter.replaceStack = toUse;
}
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -21,6 +21,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -243,13 +244,13 @@ public class GuiMMaterialFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0, 0, 0));
}
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
filter.requireStack = !filter.requireStack;
}
@@ -273,7 +274,7 @@ public class GuiMMaterialFilter extends GuiMekanism
filter.materialItem = null;
}
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
@@ -303,7 +304,7 @@ public class GuiMMaterialFilter extends GuiMekanism
filter.replaceStack = toUse;
}
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -25,6 +25,7 @@ import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -306,19 +307,19 @@ public class GuiMModIDFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0, 0, 0));
}
if(xAxis >= 131 && xAxis <= 143 && yAxis >= 47 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
setModID();
}
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
filter.requireStack = !filter.requireStack;
}
@@ -349,7 +350,7 @@ public class GuiMModIDFilter extends GuiMekanism
filter.replaceStack = toUse;
}
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -25,6 +25,7 @@ import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -306,19 +307,19 @@ public class GuiMOreDictFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new DigitalMinerGuiMessage(MinerGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 5 : 0, 0, 0));
}
if(xAxis >= 131 && xAxis <= 143 && yAxis >= 47 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
setOreDictKey();
}
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
filter.requireStack = !filter.requireStack;
}
@@ -349,7 +350,7 @@ public class GuiMOreDictFilter extends GuiMekanism
filter.replaceStack = toUse;
}
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -30,6 +30,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -127,7 +128,7 @@ public class GuiMetallurgicInfuser extends GuiMekanism
data.add(0);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -28,6 +28,7 @@ import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -214,7 +215,7 @@ public class GuiOredictionificator extends GuiMekanism
{
OredictionificatorFilter filter = tileEntity.filters.get(getFilterIndex()+i);
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new OredictionificatorGuiMessage(OredictionificatorGuiPacket.SERVER_INDEX, Coord4D.get(tileEntity), 1, getFilterIndex()+i, 0));
}
}
@@ -20,6 +20,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -310,19 +311,19 @@ public class GuiOredictionificatorFilter extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 0, 52));
}
if(xAxis >= 130 && xAxis <= 142 && yAxis >= 48 && yAxis <= 60)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
setFilter();
}
if(xAxis >= 31 && xAxis <= 43 && yAxis >= 21 && yAxis <= 33)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
if(filter.filter != null)
{
@@ -342,7 +343,7 @@ public class GuiOredictionificatorFilter extends GuiMekanism
if(xAxis >= 63 && xAxis <= 75 && yAxis >= 21 && yAxis <= 33)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
if(filter.filter != null)
{
@@ -24,6 +24,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -209,7 +210,7 @@ public class GuiQuantumEntangloporter extends GuiMekanism
{
setFrequency(frequencyField.getText());
frequencyField.setText("");
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -28,6 +28,7 @@ import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -161,7 +162,7 @@ public class GuiResistiveHeater extends GuiMekanism
if(xAxis >= 116 && xAxis <= 126 && yAxis >= 51 && yAxis <= 61)
{
setEnergyUsage();
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -11,6 +11,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -105,29 +106,29 @@ public class GuiRobitCrafting extends GuiMekanism
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, entityId, null));
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, entityId, null));
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, entityId, null));
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 4, entityId, null));
mc.thePlayer.openGui(Mekanism.instance, 25, mc.theWorld, entityId, 0, 0);
}
@@ -12,6 +12,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -105,29 +106,29 @@ public class GuiRobitInventory extends GuiMekanism
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{
SoundHandler.playSound("gui.button.press");
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);
}
@@ -14,6 +14,7 @@ import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -268,51 +269,51 @@ public class GuiRobitMain extends GuiMekanism
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 152 && xAxis <= 170 && yAxis >= 54 && yAxis <= 72)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.FOLLOW, robit.getEntityId(), 0, null));
}
else if(xAxis >= 6 && xAxis <= 24 && yAxis >= 54 && yAxis <= 72)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
toggleNameChange();
}
else if(xAxis >= 6 && xAxis <= 24 && yAxis >= 16 && yAxis <= 34)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GO_HOME, robit.getEntityId(), 0, null));
mc.displayGuiScreen(null);
}
else if(xAxis >= 6 && xAxis <= 24 && yAxis >= 35 && yAxis <= 53)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.DROP_PICKUP, robit.getEntityId(), 0, null));
}
}
@@ -15,6 +15,7 @@ import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerRepair;
import net.minecraft.inventory.IContainerListener;
@@ -152,31 +153,31 @@ public class GuiRobitRepair extends GuiMekanism implements IContainerListener
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 0, entityId, null));
mc.thePlayer.openGui(Mekanism.instance, 21, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 1, entityId, null));
mc.thePlayer.openGui(Mekanism.instance, 22, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 2, entityId, null));
mc.thePlayer.openGui(Mekanism.instance, 23, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.GUI, 3, entityId, null));
mc.thePlayer.openGui(Mekanism.instance, 24, mc.theWorld, entityId, 0, 0);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -12,6 +12,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import org.lwjgl.opengl.GL11;
@@ -113,29 +114,29 @@ public class GuiRobitSmelting extends GuiMekanism
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 30 && yAxis <= 48)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 50 && yAxis <= 68)
{
SoundHandler.playSound("gui.button.press");
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);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 70 && yAxis <= 88)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
else if(xAxis >= 179 && xAxis <= 197 && yAxis >= 90 && yAxis <= 108)
{
SoundHandler.playSound("gui.button.press");
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);
}
@@ -32,6 +32,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -177,7 +178,7 @@ public class GuiRotaryCondensentrator extends GuiMekanism
data.add(0);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -21,6 +21,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -151,7 +152,7 @@ public class GuiSecurityDesk extends GuiMekanism
{
addTrusted(trustedField.getText());
trustedField.setText("");
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
ArrayList<Object> data = new ArrayList<Object>();
@@ -25,6 +25,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.relauncher.Side;
@@ -230,13 +231,13 @@ public class GuiSideConfiguration extends GuiMekanism
if(xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20)
{
int guiId = Mekanism.proxy.getGuiId(tile.getBlockType(), tile.getBlockMetadata());
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tile), 0, guiId));
}
if(xAxis >= 156 && xAxis <= 170 && yAxis >= 6 && yAxis <= 20)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new ConfigurationUpdateMessage(ConfigurationPacket.EJECT, Coord4D.get(tile), 0, 0, currentType));
}
}
@@ -253,7 +254,7 @@ public class GuiSideConfiguration extends GuiMekanism
if(xAxis >= x && xAxis <= x+14 && yAxis >= y && yAxis <= y+14)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new ConfigurationUpdateMessage(ConfigurationPacket.SIDE_DATA, Coord4D.get(tile), button, i, currentType));
}
}
@@ -14,6 +14,7 @@ import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -115,7 +116,7 @@ public class GuiTFilterSelect extends GuiMekanism
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0, 0, 0));
}
}
@@ -7,6 +7,7 @@ import mekanism.api.EnumColor;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism;
import mekanism.common.MekanismSounds;
import mekanism.common.content.transporter.TItemStackFilter;
import mekanism.common.inventory.container.ContainerFilter;
import mekanism.common.network.PacketEditFilter.EditFilterMessage;
@@ -22,6 +23,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -301,7 +303,7 @@ public class GuiTItemStackFilter extends GuiMekanism
{
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0, 0, 0));
}
@@ -319,12 +321,12 @@ public class GuiTItemStackFilter extends GuiMekanism
filter.itemType = null;
}
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
if(xAxis >= 128 && xAxis <= 139 && yAxis >= 44 && yAxis <= 55)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
filter.sizeMode = !filter.sizeMode;
}
}
@@ -336,7 +338,7 @@ public class GuiTItemStackFilter extends GuiMekanism
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 44 && yAxis <= 60)
{
SoundHandler.playSound("mekanism:etc.Ding");
SoundHandler.playSound(MekanismSounds.DING);
if(button == 0)
{
@@ -7,6 +7,7 @@ import mekanism.api.EnumColor;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism;
import mekanism.common.MekanismSounds;
import mekanism.common.content.transporter.TMaterialFilter;
import mekanism.common.inventory.container.ContainerFilter;
import mekanism.common.network.PacketEditFilter.EditFilterMessage;
@@ -23,6 +24,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -232,7 +234,7 @@ public class GuiTMaterialFilter extends GuiMekanism
{
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0, 0, 0));
}
@@ -256,7 +258,7 @@ public class GuiTMaterialFilter extends GuiMekanism
filter.materialItem = null;
}
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
@@ -267,7 +269,7 @@ public class GuiTMaterialFilter extends GuiMekanism
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 44 && yAxis <= 60)
{
SoundHandler.playSound("mekanism:etc.Ding");
SoundHandler.playSound(MekanismSounds.DING);
if(button == 0)
{
@@ -8,6 +8,7 @@ import mekanism.api.EnumColor;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism;
import mekanism.common.MekanismSounds;
import mekanism.common.OreDictCache;
import mekanism.common.content.transporter.TModIDFilter;
import mekanism.common.content.transporter.TransporterFilter;
@@ -25,6 +26,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -292,13 +294,13 @@ public class GuiTModIDFilter extends GuiMekanism
{
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0, 0, 0));
}
if(xAxis >= 131 && xAxis <= 143 && yAxis >= 47 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
setModID();
}
}
@@ -310,7 +312,7 @@ public class GuiTModIDFilter extends GuiMekanism
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 44 && yAxis <= 60)
{
SoundHandler.playSound("mekanism:etc.Ding");
SoundHandler.playSound(MekanismSounds.DING);
if(button == 0)
{
@@ -8,6 +8,7 @@ import mekanism.api.EnumColor;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.sound.SoundHandler;
import mekanism.common.Mekanism;
import mekanism.common.MekanismSounds;
import mekanism.common.OreDictCache;
import mekanism.common.content.transporter.TOreDictFilter;
import mekanism.common.content.transporter.TransporterFilter;
@@ -25,6 +26,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -292,13 +294,13 @@ public class GuiTOreDictFilter extends GuiMekanism
{
if(xAxis >= 5 && xAxis <= 16 && yAxis >= 5 && yAxis <= 16)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), isNew ? 4 : 0, 0, 0));
}
if(xAxis >= 131 && xAxis <= 143 && yAxis >= 47 && yAxis <= 59)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
setOreDictKey();
}
}
@@ -310,7 +312,7 @@ public class GuiTOreDictFilter extends GuiMekanism
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 44 && yAxis <= 60)
{
SoundHandler.playSound("mekanism:etc.Ding");
SoundHandler.playSound(MekanismSounds.DING);
if(button == 0)
{
@@ -31,6 +31,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
@@ -314,7 +315,7 @@ public class GuiTeleporter extends GuiMekanism
{
setFrequency(frequencyField.getText());
frequencyField.setText("");
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -23,6 +23,7 @@ import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.relauncher.Side;
@@ -197,13 +198,13 @@ public class GuiTransporterConfig extends GuiMekanism
if(xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20)
{
int guiId = Mekanism.proxy.getGuiId(tile.getBlockType(), tile.getBlockMetadata());
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tile), 0, guiId));
}
if(xAxis >= 156 && xAxis <= 170 && yAxis >= 6 && yAxis <= 20)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new ConfigurationUpdateMessage(ConfigurationPacket.STRICT_INPUT, Coord4D.get(tile), 0, 0, null));
}
}
@@ -215,7 +216,7 @@ public class GuiTransporterConfig extends GuiMekanism
if(xAxis >= 122 && xAxis <= 138 && yAxis >= 49 && yAxis <= 65)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new ConfigurationUpdateMessage(ConfigurationPacket.EJECT_COLOR, Coord4D.get(tile), button, 0, null));
}
@@ -226,7 +227,7 @@ public class GuiTransporterConfig extends GuiMekanism
if(xAxis >= x && xAxis <= x+14 && yAxis >= y && yAxis <= y+14)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new ConfigurationUpdateMessage(ConfigurationPacket.INPUT_COLOR, Coord4D.get(tile), button, i, null));
}
}
@@ -18,6 +18,7 @@ import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -303,13 +304,13 @@ public class GuiUpgradeManagement extends GuiMekanism
if(xAxis >= 6 && xAxis <= 20 && yAxis >= 6 && yAxis <= 20)
{
int guiId = MachineType.get(tile.getBlockType(), tile.getBlockMetadata()).guiId;
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tile), 0, guiId));
}
if(selectedType != null && xAxis >= 136 && xAxis <= 148 && yAxis >= 57 && yAxis <= 69)
{
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RemoveUpgradeMessage(Coord4D.get(tile), selectedType.ordinal()));
}
@@ -8,6 +8,7 @@ import mekanism.common.network.PacketSimpleGui.SimpleGuiMessage;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
@@ -77,7 +78,7 @@ public class GuiBoilerTab extends GuiElement
if(xAxis >= -21 && xAxis <= -3 && yAxis >= yPos+4 && yAxis <= yPos+22)
{
tabType.openGui(tileEntity);
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -6,6 +6,7 @@ import mekanism.client.gui.IGuiWrapper;
import mekanism.client.sound.SoundHandler;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
@@ -114,7 +115,7 @@ public class GuiConfigTypeTab extends GuiElement
{
((GuiSideConfiguration)guiObj).currentType = transmission;
((GuiSideConfiguration)guiObj).updateTabs();
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -9,6 +9,7 @@ import mekanism.common.network.PacketContainerEditMode.ContainerEditModeMessage;
import mekanism.common.util.FluidContainerUtils.ContainerEditMode;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
@@ -83,7 +84,7 @@ public class GuiContainerEditMode extends GuiElement
ContainerEditMode current = manager.getContainerEditMode();
int ordinalToSet = current.ordinal() < (ContainerEditMode.values().length-1) ? current.ordinal()+1 : 0;
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new ContainerEditModeMessage(Coord4D.get(tileEntity), ContainerEditMode.values()[ordinalToSet]));
}
}
@@ -11,6 +11,7 @@ import mekanism.common.tile.TileEntityLaserAmplifier;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
@@ -80,7 +81,7 @@ public class GuiDetectionTab extends GuiElement
data.add(3);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -8,6 +8,7 @@ import mekanism.common.network.PacketSimpleGui.SimpleGuiMessage;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
@@ -77,7 +78,7 @@ public class GuiMatrixTab extends GuiElement
if(xAxis >= -21 && xAxis <= -3 && yAxis >= yPos+4 && yAxis <= yPos+22)
{
tabType.openGui(tileEntity);
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -9,6 +9,7 @@ import mekanism.common.base.IRedstoneControl.RedstoneControl;
import mekanism.common.network.PacketRedstoneControl.RedstoneControlMessage;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
@@ -84,7 +85,7 @@ public class GuiRedstoneControl extends GuiElement
int ordinalToSet = current.ordinal() < (RedstoneControl.values().length-1) ? current.ordinal()+1 : 0;
if(ordinalToSet == RedstoneControl.PULSE.ordinal() && !control.canPulse()) ordinalToSet = 0;
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
Mekanism.packetHandler.sendToServer(new RedstoneControlMessage(Coord4D.get(tileEntity), RedstoneControl.values()[ordinalToSet]));
}
}
@@ -17,6 +17,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import mekanism.common.util.SecurityUtils;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
@@ -180,7 +181,7 @@ public class GuiSecurityTab extends GuiElement
SecurityMode current = getSecurity();
int ordinalToSet = current.ordinal() < (SecurityMode.values().length-1) ? current.ordinal()+1 : 0;
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
if(isItem)
{
@@ -8,6 +8,7 @@ import mekanism.common.network.PacketSimpleGui.SimpleGuiMessage;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
@@ -74,7 +75,7 @@ public class GuiSideConfigurationTab extends GuiElement
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
{
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 0, 9));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -11,6 +11,7 @@ import mekanism.common.tile.TileEntityFactory;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -79,7 +80,7 @@ public class GuiSortingTab extends GuiElement
ArrayList data = new ArrayList();
data.add(0);
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -8,6 +8,7 @@ import mekanism.common.network.PacketSimpleGui.SimpleGuiMessage;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
@@ -75,7 +76,7 @@ public class GuiTransporterConfigTab extends GuiElement
if(xAxis >= -21 && xAxis <= -3 && yAxis >= yPos+4 && yAxis <= yPos+22)
{
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 0, 51));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -8,6 +8,7 @@ import mekanism.common.network.PacketSimpleGui.SimpleGuiMessage;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
@@ -71,7 +72,7 @@ public class GuiUpgradeTab extends GuiElement
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
{
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 0, 43));
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -6,6 +6,7 @@ import mekanism.common.tile.TileEntityDigitalMiner;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.ResourceLocation;
@@ -68,7 +69,7 @@ public class GuiVisualsTab extends GuiElement
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
{
tileEntity.clientRendering = !tileEntity.clientRendering;
SoundHandler.playSound("gui.button.press");
SoundHandler.playSound(SoundEvents.UI_BUTTON_CLICK);
}
}
}
@@ -2,6 +2,7 @@ package mekanism.client.render.ctm;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
import javax.vecmath.Matrix4f;
@@ -14,33 +15,35 @@ import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.common.property.IExtendedBlockState;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
/**
* Model for all chisel blocks
*/
@SuppressWarnings("deprecation")
public class CTMModelFactory implements ISmartBlockModel, ISmartItemModel, IPerspectiveAwareModel
public class CTMModelFactory implements IPerspectiveAwareModel
{
public static final TRSRTransformation DEFAULT_BLOCK_THIRD_PERSON_TRANSOFRM = new TRSRTransformation(new Vector3f(0, 1.5f / 16f, -2.75f / 16f), TRSRTransformation.quatFromYXZDegrees(new Vector3f(10, -45, 170)), new Vector3f(0.375f, 0.375f, 0.375f), null);
public static final Matrix4f DEFAULT_BLOCK_THIRD_PERSON_MATRIX = DEFAULT_BLOCK_THIRD_PERSON_TRANSOFRM.getMatrix();
private List<BakedQuad> face;
private List<BakedQuad> general;
private ModelCTM model;
private CTMOverride override;
public CTMModelFactory(List<BakedQuad> f, List<BakedQuad> g, ModelCTM m)
{
@@ -101,13 +104,6 @@ public class CTMModelFactory implements ISmartBlockModel, ISmartItemModel, IPers
{
return ItemCameraTransforms.DEFAULT;
}
@Override
public IBakedModel handleItemState(ItemStack stack)
{
Block block = ((ItemBlock)stack.getItem()).getBlock();
return createModel(block.getDefaultState(), model, null);
}
private CTMModelFactory createModel(IBlockState state, ModelCTM model, CTMBlockRenderContext ctx)
{
@@ -143,22 +139,51 @@ public class CTMModelFactory implements ISmartBlockModel, ISmartItemModel, IPers
to.addAll(tex.transformQuad(q, ctx == null ? null : ctx, quadGoal));
}
}
private static TRSRTransformation get(float tx, float ty, float tz, float ax, float ay, float az, float s)
{
return new TRSRTransformation(
new Vector3f(tx / 16, ty / 16, tz / 16),
TRSRTransformation.quatFromXYZDegrees(new Vector3f(ax, ay, az)),
new Vector3f(s, s, s),
null);
}
private Pair<IPerspectiveAwareModel, Matrix4f> thirdPersonTransform;
public static Map<TransformType, TRSRTransformation> transforms = ImmutableMap.<TransformType, TRSRTransformation>builder()
.put(TransformType.GUI, get(0, 0, 0, 30, 45, 0, 0.625f))
.put(TransformType.THIRD_PERSON_RIGHT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f))
.put(TransformType.THIRD_PERSON_LEFT_HAND, get(0, 2.5f, 0, 75, 45, 0, 0.375f))
.put(TransformType.FIRST_PERSON_RIGHT_HAND, get(0, 0, 0, 0, 45, 0, 0.4f))
.put(TransformType.FIRST_PERSON_LEFT_HAND, get(0, 0, 0, 0, 225, 0, 0.4f))
.put(TransformType.GROUND, get(0, 2, 0, 0, 0, 0, 0.25f))
.put(TransformType.HEAD, get(0, 0, 0, 0, 0, 0, 1))
.put(TransformType.FIXED, get(0, 0, 0, 0, 0, 0, 1))
.build();
@Override
public Pair<? extends IPerspectiveAwareModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
{
if(cameraTransformType == TransformType.THIRD_PERSON_RIGHT_HAND)
{
if(thirdPersonTransform == null)
{
thirdPersonTransform = ImmutablePair.of(this, DEFAULT_BLOCK_THIRD_PERSON_MATRIX);
}
return thirdPersonTransform;
}
return Pair.of(this, null);
return Pair.of(this, transforms.get(cameraTransformType).getMatrix());
}
@Override
public ItemOverrideList getOverrides()
{
return override;
}
private class CTMOverride extends ItemOverrideList
{
public CTMOverride()
{
super(Lists.newArrayList());
}
@Override
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
{
Block block = ((ItemBlock)stack.getItem()).getBlock();
return createModel(block.getDefaultState(), model, null);
}
}
}
@@ -1,6 +1,5 @@
package mekanism.client.render.ctm;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -16,6 +15,7 @@ import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.client.model.Attributes;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.common.model.TRSRTransformation;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@@ -42,9 +42,9 @@ public class CTMRegistry
}
@SubscribeEvent
public void onModelBake(ModelBakeEvent event) throws IOException
public void onModelBake(ModelBakeEvent event) throws Exception
{
IModel model = event.getModelLoader().getModel(baseResource);
IModel model = ModelLoaderRegistry.getModel(baseResource);
baseModel = model.bake(new TRSRTransformation(ModelRotation.X0_Y0), Attributes.DEFAULT_BAKED_FORMAT, r -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(r.toString()));
for(Pair<String, String> pair : ctmTypes)
@@ -479,6 +479,8 @@ public class Quad
private EnumFacing quadOrientation;
private boolean applyDiffuseLighting;
@Override
public void setQuadTint(int tint)
{
@@ -498,7 +500,10 @@ public class Quad
}
@Override
public void setQuadColored() {}
public void setApplyDiffuseLighting(boolean lighting)
{
applyDiffuseLighting = lighting;
}
private ListMultimap<EnumUsage, float[]> vertexData = MultimapBuilder.enumKeys(EnumUsage.class).arrayListValues().build();
@@ -4,6 +4,7 @@ import mekanism.client.render.MekanismRenderer;
import mekanism.common.entity.EntityFlame;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
@@ -45,7 +46,7 @@ public class RenderFlame extends Render<EntityFlame>
GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTick, 0.0F, 0.0F, 1.0F);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
VertexBuffer worldrenderer = tessellator.getBuffer();
int i = 0;
float f2 = 0.0F;
@@ -58,13 +58,13 @@ import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.fluids.Fluid;
@@ -462,11 +462,12 @@ public class BakedCustomItemModel implements IBakedModel, IPerspectiveAwareModel
{
prevTransform = cameraTransformType;
if(cameraTransformType == TransformType.THIRD_PERSON_RIGHT_HAND)
{
ForgeHooksClient.multiplyCurrentGlMatrix(CTMModelFactory.DEFAULT_BLOCK_THIRD_PERSON_MATRIX);
}
return Pair.of(this, null);
return Pair.of(this, CTMModelFactory.transforms.get(cameraTransformType).getMatrix());
}
@Override
public ItemOverrideList getOverrides()
{
return ItemOverrideList.NONE;
}
}
@@ -2,36 +2,38 @@ package mekanism.client.render.item;
import java.util.List;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemOverrideList;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
public class CustomItemModelFactory implements ISmartItemModel
import com.google.common.collect.Lists;
public class CustomItemModelFactory implements IBakedModel
{
private IBakedModel baseModel;
private MachineOverride override = new MachineOverride();
public CustomItemModelFactory(IBakedModel base)
{
baseModel = base;
}
@Override
public IBakedModel handleItemState(ItemStack stack)
public ItemOverrideList getOverrides()
{
return new BakedCustomItemModel(baseModel, stack);
return override;
}
@Override
public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_)
{
throw new UnsupportedOperationException();
}
@Override
public List<BakedQuad> getGeneralQuads()
public List<BakedQuad> getQuads(IBlockState state, EnumFacing facing, long rand)
{
throw new UnsupportedOperationException();
}
@@ -65,4 +67,18 @@ public class CustomItemModelFactory implements ISmartItemModel
{
throw new UnsupportedOperationException();
}
private class MachineOverride extends ItemOverrideList
{
public MachineOverride()
{
super(Lists.newArrayList());
}
@Override
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
{
return new BakedCustomItemModel(baseModel, stack);
}
}
}
@@ -24,7 +24,7 @@ public class RenderBin extends TileEntitySpecialRenderer<TileEntityBin>
{
Coord4D obj = Coord4D.get(tileEntity).offset(tileEntity.facing);
if(obj.getBlockState(tileEntity.getWorld()).getBlock().isSideSolid(tileEntity.getWorld(), obj.getPos(), tileEntity.facing.getOpposite()))
if(obj.getBlockState(tileEntity.getWorld()).isSideSolid(tileEntity.getWorld(), obj.getPos(), tileEntity.facing.getOpposite()))
{
return;
}
@@ -111,7 +111,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer<TileEntityDynam
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Blocks.water;
toReturn.baseBlock = Blocks.WATER;
toReturn.setTexture(MekanismRenderer.getFluidTexture(fluid, FluidType.STILL));
final int stages = getStages(data.height);
@@ -158,7 +158,7 @@ public class RenderDynamicTank extends TileEntitySpecialRenderer<TileEntityDynam
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Blocks.water;
toReturn.baseBlock = Blocks.WATER;
MekanismRenderer.prepFlowing(toReturn, fluid);
DisplayInteger display = DisplayInteger.createAndStart();
@@ -107,7 +107,7 @@ public class RenderFluidTank extends TileEntitySpecialRenderer<TileEntityFluidTa
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Blocks.water;
toReturn.baseBlock = Blocks.WATER;
MekanismRenderer.prepFlowing(toReturn, fluid);
DisplayInteger[] displays = new DisplayInteger[stages];
@@ -144,7 +144,7 @@ public class RenderFluidTank extends TileEntitySpecialRenderer<TileEntityFluidTa
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Blocks.water;
toReturn.baseBlock = Blocks.WATER;
toReturn.setTexture(MekanismRenderer.getFluidTexture(fluid, FluidType.STILL));
DisplayInteger[] displays = new DisplayInteger[stages];
@@ -83,7 +83,7 @@ public class RenderThermalEvaporationController extends TileEntitySpecialRendere
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Blocks.water;
toReturn.baseBlock = Blocks.WATER;
toReturn.setTexture(MekanismRenderer.getFluidTexture(fluid, FluidType.STILL));
final int stages = getStages(data.height);
@@ -151,7 +151,7 @@ public class RenderThermoelectricBoiler extends TileEntitySpecialRenderer<TileEn
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Blocks.water;
toReturn.baseBlock = Blocks.WATER;
toReturn.setTexture(MekanismRenderer.getFluidTexture(fluid, FluidType.STILL));
final int stages = getStages(data.height);
@@ -190,7 +190,7 @@ public class RenderThermoelectricBoiler extends TileEntitySpecialRenderer<TileEn
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Blocks.water;
toReturn.baseBlock = Blocks.WATER;
toReturn.setTexture(MekanismRenderer.getFluidTexture(fluid, FluidType.STILL));
final int stages = getStages(data.height);
@@ -224,7 +224,7 @@ public class RenderThermoelectricBoiler extends TileEntitySpecialRenderer<TileEn
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Blocks.water;
toReturn.baseBlock = Blocks.WATER;
MekanismRenderer.prepFlowing(toReturn, fluid);
DisplayInteger display = DisplayInteger.createAndStart();
@@ -10,6 +10,7 @@ import mekanism.common.ColourRGBA;
import mekanism.common.multipart.PartMechanicalPipe;
import mekanism.common.multipart.PartSidedPipe.ConnectionType;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.init.Blocks;
import net.minecraft.util.EnumFacing;
@@ -97,7 +98,7 @@ public class RenderMechanicalPipe extends RenderTransmitterBase<PartMechanicalPi
{
GL11.glTranslated(0.5, 0.5, 0.5);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
VertexBuffer worldRenderer = tessellator.getBuffer();
renderFluidInOut(worldRenderer, side, pipe);
tessellator.draw();
GL11.glTranslated(-0.5, -0.5, -0.5);
@@ -141,7 +142,7 @@ public class RenderMechanicalPipe extends RenderTransmitterBase<PartMechanicalPi
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Blocks.water;
toReturn.baseBlock = Blocks.WATER;
toReturn.setTexture(MekanismRenderer.getFluidTexture(fluid, FluidType.STILL));
if(side != null)
@@ -254,7 +255,7 @@ public class RenderMechanicalPipe extends RenderTransmitterBase<PartMechanicalPi
return displays;
}
public void renderFluidInOut(WorldRenderer renderer, EnumFacing side, PartMechanicalPipe pipe)
public void renderFluidInOut(VertexBuffer renderer, EnumFacing side, PartMechanicalPipe pipe)
{
bindTexture(MekanismRenderer.getBlocksTexture());
TextureAtlasSprite tex = MekanismRenderer.getFluidTexture(pipe.getTransmitter().getTransmitterNetwork().refFluid, FluidType.STILL);
@@ -4,6 +4,7 @@ import mekanism.client.render.MekanismRenderer;
import mekanism.common.ColourRGBA;
import mekanism.common.multipart.PartPressurizedTube;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.util.EnumFacing;
import org.lwjgl.opengl.GL11;
@@ -25,7 +26,7 @@ public class RenderPressurizedTube extends RenderTransmitterBase<PartPressurized
push();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
VertexBuffer worldRenderer = tessellator.getBuffer();
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
for(EnumFacing side : EnumFacing.VALUES)
@@ -43,7 +44,7 @@ public class RenderPressurizedTube extends RenderTransmitterBase<PartPressurized
pop();
}
public void renderGasSide(WorldRenderer renderer, EnumFacing side, PartPressurizedTube tube)
public void renderGasSide(VertexBuffer renderer, EnumFacing side, PartPressurizedTube tube)
{
bindTexture(MekanismRenderer.getBlocksTexture());
renderTransparency(renderer, tube.getTransmitter().getTransmitterNetwork().refGas.getSprite(), getModelForSide(tube, side), new ColourRGBA(1.0, 1.0, 1.0, tube.currentScale));
@@ -5,6 +5,7 @@ import mekanism.client.render.MekanismRenderer;
import mekanism.common.ColourRGBA;
import mekanism.common.multipart.PartUniversalCable;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.util.EnumFacing;
import org.lwjgl.opengl.GL11;
@@ -26,7 +27,7 @@ public class RenderUniversalCable extends RenderTransmitterBase<PartUniversalCab
push();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldRenderer = tessellator.getWorldRenderer();
VertexBuffer worldRenderer = tessellator.getBuffer();
GL11.glTranslated(x + 0.5, y+0.5, z + 0.5);
for(EnumFacing side : EnumFacing.VALUES)
@@ -43,7 +44,7 @@ public class RenderUniversalCable extends RenderTransmitterBase<PartUniversalCab
pop();
}
public void renderEnergySide(WorldRenderer renderer, EnumFacing side, PartUniversalCable cable)
public void renderEnergySide(VertexBuffer renderer, EnumFacing side, PartUniversalCable cable)
{
bindTexture(MekanismRenderer.getBlocksTexture());
renderTransparency(renderer, MekanismRenderer.energyIcon, getModelForSide(cable, side), new ColourRGBA(1.0, 1.0, 1.0, cable.currentPower));
@@ -17,7 +17,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
*
*/
@SideOnly(Side.CLIENT)
public class Sound implements ISound
public class MekSound implements ISound
{
protected AttenuationType attenuation;
@@ -37,72 +37,72 @@ public class Sound implements ISound
protected int repeatDelay;
public Sound(String sound)
public MekSound(String sound)
{
this(sound, 0);
}
public Sound(String sound, float volume)
public MekSound(String sound, float volume)
{
this(sound, volume, 0);
}
public Sound(String sound, float volume, float pitch)
public MekSound(String sound, float volume, float pitch)
{
this(sound, volume, pitch, false, 0);
}
public Sound(String sound, float volume, float pitch, boolean repeat, int repeatDelay)
public MekSound(String sound, float volume, float pitch, boolean repeat, int repeatDelay)
{
this(sound, volume, pitch, repeat, repeatDelay, 0, 0, 0, AttenuationType.NONE);
}
public Sound(String sound, float volume, float pitch, double x, double y, double z)
public MekSound(String sound, float volume, float pitch, double x, double y, double z)
{
this(sound, volume, pitch, false, 0, x, y, z);
}
public Sound(String sound, float volume, float pitch, boolean repeat, int repeatDelay, double x, double y, double z)
public MekSound(String sound, float volume, float pitch, boolean repeat, int repeatDelay, double x, double y, double z)
{
this(sound, volume, pitch, repeat, repeatDelay, x, y, z, AttenuationType.LINEAR);
}
public Sound(String sound, float volume, float pitch, boolean repeat, int repeatDelay, double x, double y, double z, AttenuationType attenuation)
public MekSound(String sound, float volume, float pitch, boolean repeat, int repeatDelay, double x, double y, double z, AttenuationType attenuation)
{
this(new ResourceLocation(sound), volume, pitch, repeat, repeatDelay, x, y, z, attenuation);
}
public Sound(ResourceLocation sound)
public MekSound(ResourceLocation sound)
{
this(sound, 0);
}
public Sound(ResourceLocation sound, float volume)
public MekSound(ResourceLocation sound, float volume)
{
this(sound, volume, 0);
}
public Sound(ResourceLocation sound, float volume, float pitch)
public MekSound(ResourceLocation sound, float volume, float pitch)
{
this(sound, volume, pitch, false, 0);
}
public Sound(ResourceLocation sound, float volume, float pitch, boolean repeat, int repeatDelay)
public MekSound(ResourceLocation sound, float volume, float pitch, boolean repeat, int repeatDelay)
{
this(sound, volume, pitch, repeat, repeatDelay, 0, 0, 0, AttenuationType.NONE);
}
public Sound(ResourceLocation sound, float volume, float pitch, double x, double y, double z)
public MekSound(ResourceLocation sound, float volume, float pitch, double x, double y, double z)
{
this(sound, volume, pitch, false, 0, x, y, z);
}
public Sound(ResourceLocation sound, float volume, float pitch, boolean repeat, int repeatDelay, double x, double y, double z)
public MekSound(ResourceLocation sound, float volume, float pitch, boolean repeat, int repeatDelay, double x, double y, double z)
{
this(sound, volume, pitch, repeat, repeatDelay, x, y, z, AttenuationType.LINEAR);
}
public Sound(ResourceLocation resource, float v, float p, boolean rep, int delay, double xPos, double yPos, double zPos, AttenuationType att)
public MekSound(ResourceLocation resource, float v, float p, boolean rep, int delay, double xPos, double yPos, double zPos, AttenuationType att)
{
attenuation = att;
sound = resource;
@@ -115,7 +115,7 @@ public class Sound implements ISound
repeatDelay = delay;
}
public Sound(Sound other)
public MekSound(MekSound other)
{
attenuation = other.attenuation;
sound = other.sound;
@@ -6,7 +6,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public abstract class PlayerSound extends Sound implements IResettableSound
public abstract class PlayerSound extends MekSound implements IResettableSound
{
public EntityPlayer player;
@@ -11,7 +11,7 @@ import net.minecraft.client.audio.ITickableSound;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.audio.SoundManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -144,9 +144,9 @@ public class SoundHandler
return sound.isDonePlaying() && !getSoundMap().containsKey(sound);
}
public static void playSound(String sound)
public static void playSound(SoundEvent sound)
{
playSound(PositionedSoundRecord.create(new ResourceLocation(sound), 1.0F));
playSound(PositionedSoundRecord.getMasterRecord(sound, 1.0F));
}
public static void playSound(ISound sound)
@@ -6,7 +6,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class TileSound extends Sound implements IResettableSound
public class TileSound extends MekSound implements IResettableSound
{
IHasSound source;
@@ -23,12 +23,6 @@ import mekanism.common.block.states.BlockStateMachine.MachineBlockStateMapper;
import mekanism.common.block.states.BlockStatePlastic.PlasticBlockStateMapper;
import mekanism.common.block.states.BlockStatePlastic.PlasticBlockType;
import mekanism.common.item.ItemBlockBasic;
import mekanism.common.item.ItemBlockCardboardBox;
import mekanism.common.item.ItemBlockEnergyCube;
import mekanism.common.item.ItemBlockGasTank;
import mekanism.common.item.ItemBlockMachine;
import mekanism.common.item.ItemBlockOre;
import mekanism.common.item.ItemBlockPlastic;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.block.statemap.IStateMapper;
import net.minecraftforge.client.model.ModelLoader;
@@ -68,24 +62,40 @@ public class MekanismBlocks
*/
public static void register()
{
GameRegistry.registerBlock(BasicBlock, ItemBlockBasic.class, "BasicBlock");
GameRegistry.registerBlock(BasicBlock2, ItemBlockBasic.class, "BasicBlock2");
GameRegistry.registerBlock(MachineBlock, ItemBlockMachine.class, "MachineBlock");
GameRegistry.registerBlock(MachineBlock2, ItemBlockMachine.class, "MachineBlock2");
GameRegistry.registerBlock(MachineBlock3, ItemBlockMachine.class, "MachineBlock3");
GameRegistry.registerBlock(OreBlock, ItemBlockOre.class, "OreBlock");
GameRegistry.registerBlock(EnergyCube, ItemBlockEnergyCube.class, "EnergyCube");
GameRegistry.registerBlock(ObsidianTNT, "ObsidianTNT");
GameRegistry.registerBlock(BoundingBlock, "BoundingBlock");
GameRegistry.registerBlock(GasTank, ItemBlockGasTank.class, "GasTank");
GameRegistry.registerBlock(CardboardBox, ItemBlockCardboardBox.class, "CardboardBox");
GameRegistry.registerBlock(PlasticBlock, ItemBlockPlastic.class, "PlasticBlock");
GameRegistry.registerBlock(SlickPlasticBlock, ItemBlockPlastic.class, "SlickPlasticBlock");
GameRegistry.registerBlock(GlowPlasticBlock, ItemBlockPlastic.class, "GlowPlasticBlock");
GameRegistry.registerBlock(ReinforcedPlasticBlock, ItemBlockPlastic.class, "ReinforcedPlasticBlock");
GameRegistry.registerBlock(RoadPlasticBlock, ItemBlockPlastic.class, "RoadPlasticBlock");
GameRegistry.registerBlock(PlasticFence, ItemBlockPlastic.class, "PlasticFence");
GameRegistry.registerBlock(SaltBlock, "SaltBlock");
GameRegistry.register(BasicBlock);
GameRegistry.register(BasicBlock2);
GameRegistry.register(MachineBlock);
GameRegistry.register(MachineBlock2);
GameRegistry.register(MachineBlock3);
GameRegistry.register(OreBlock);
GameRegistry.register(EnergyCube);
GameRegistry.register(ObsidianTNT);
GameRegistry.register(BoundingBlock);
GameRegistry.register(GasTank);
GameRegistry.register(CardboardBox);
GameRegistry.register(PlasticBlock);
GameRegistry.register(SlickPlasticBlock);
GameRegistry.register(GlowPlasticBlock);
GameRegistry.register(ReinforcedPlasticBlock);
GameRegistry.register(RoadPlasticBlock);
GameRegistry.register(PlasticFence);
GameRegistry.register(SaltBlock);
GameRegistry.register(new ItemBlockBasic(BasicBlock).setUnlocalizedName("BasicBlock"));
GameRegistry.register(new ItemBlockBasic(BasicBlock2).setUnlocalizedName("BasicBlock2"));
GameRegistry.register(new ItemBlockBasic(MachineBlock).setUnlocalizedName("MachineBlock"));
GameRegistry.register(new ItemBlockBasic(MachineBlock2).setUnlocalizedName("MachineBlock2"));
GameRegistry.register(new ItemBlockBasic(MachineBlock3).setUnlocalizedName("MachineBlock3"));
GameRegistry.register(new ItemBlockBasic(OreBlock).setUnlocalizedName("OreBlock"));
GameRegistry.register(new ItemBlockBasic(EnergyCube).setUnlocalizedName("EnergyCube"));
GameRegistry.register(new ItemBlockBasic(GasTank).setUnlocalizedName("GasTank"));
GameRegistry.register(new ItemBlockBasic(CardboardBox).setUnlocalizedName("CardboardBox"));
GameRegistry.register(new ItemBlockBasic(PlasticBlock).setUnlocalizedName("PlasticBlock"));
GameRegistry.register(new ItemBlockBasic(SlickPlasticBlock).setUnlocalizedName("SlickPlasticBlock"));
GameRegistry.register(new ItemBlockBasic(GlowPlasticBlock).setUnlocalizedName("GlowPlasticBlock"));
GameRegistry.register(new ItemBlockBasic(ReinforcedPlasticBlock).setUnlocalizedName("ReinforcedPlasticBlock"));
GameRegistry.register(new ItemBlockBasic(RoadPlasticBlock).setUnlocalizedName("RoadPlasticBlock"));
GameRegistry.register(new ItemBlockBasic(PlasticFence).setUnlocalizedName("PlasticFence"));
ModelLoader.setCustomStateMapper(MachineBlock, machineMapper);
ModelLoader.setCustomStateMapper(MachineBlock2, machineMapper);
@@ -0,0 +1,25 @@
package mekanism.common;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
public final class MekanismSounds
{
public static final SoundEvent CJ_EASTER_EGG = getRegisteredSoundEvent("mekanism:etc.cj");
public static final SoundEvent POP = getRegisteredSoundEvent("mekanism:etc.Pop");
public static final SoundEvent DING = getRegisteredSoundEvent("mekanism:etc.Ding");
public static final SoundEvent HYDRAULIC = getRegisteredSoundEvent("mekanism:etc.Hydraulic");
private static SoundEvent getRegisteredSoundEvent(String id)
{
SoundEvent soundevent = (SoundEvent)SoundEvent.REGISTRY.getObject(new ResourceLocation(id));
if(soundevent == null)
{
throw new IllegalStateException("Invalid Sound requested: " + id);
}
else {
return soundevent;
}
}
}
@@ -1,9 +1,14 @@
package mekanism.common;
import mekanism.common.entity.EntityRobit;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.pathfinding.PathNavigateGround;
import net.minecraft.pathfinding.PathNodeType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
@@ -34,8 +39,7 @@ public class RobitAIFollow extends EntityAIBase
/** The distance between the owner the robit must reach before it stops the protocol. */
private float minDist;
/** Whether or not this robit avoids water. */
private boolean avoidWater;
private float oldWaterCost;
public RobitAIFollow(EntityRobit entityRobit, float speed, float min, float max)
{
@@ -57,7 +61,7 @@ public class RobitAIFollow extends EntityAIBase
{
return false;
}
else if(theRobit.worldObj.provider.getDimensionId() != player.worldObj.provider.getDimensionId())
else if(theRobit.worldObj.provider.getDimension() != player.worldObj.provider.getDimension())
{
return false;
}
@@ -85,15 +89,15 @@ public class RobitAIFollow extends EntityAIBase
@Override
public boolean continueExecuting()
{
return !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(theOwner) > (maxDist * maxDist) && theRobit.getFollowing() && theRobit.getEnergy() > 0 && theOwner.worldObj.provider.getDimensionId() == theRobit.worldObj.provider.getDimensionId();
return !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(theOwner) > (maxDist * maxDist) && theRobit.getFollowing() && theRobit.getEnergy() > 0 && theOwner.worldObj.provider.getDimension() == theRobit.worldObj.provider.getDimension();
}
@Override
public void startExecuting()
{
ticker = 0;
avoidWater = theRobit.getNavigator().getAvoidsWater();
theRobit.getNavigator().setAvoidsWater(false);
oldWaterCost = theRobit.getPathPriority(PathNodeType.WATER);
theRobit.setPathPriority(PathNodeType.WATER, 0.0F);
}
@Override
@@ -101,7 +105,7 @@ public class RobitAIFollow extends EntityAIBase
{
theOwner = null;
thePathfinder.clearPathEntity();
theRobit.getNavigator().setAvoidsWater(avoidWater);
theRobit.setPathPriority(PathNodeType.WATER, oldWaterCost);
}
@Override
@@ -128,7 +132,9 @@ public class RobitAIFollow extends EntityAIBase
for(int i1 = 0; i1 <= 4; ++i1)
{
BlockPos pos = new BlockPos(x+l, y, z+i1);
if((l < 1 || i1 < 1 || l > 3 || i1 > 3) && World.doesBlockHaveSolidTopSurface(theWorld, pos.down()) && !theWorld.getBlockState(pos).getBlock().isNormalCube() && !theWorld.getBlockState(pos.up()).getBlock().isNormalCube())
BlockPos under = new BlockPos(x + l, y - 1, z + i1);
if((l < 1 || i1 < 1 || l > 3 || i1 > 3) && theWorld.getBlockState(under).isSideSolid(theWorld, under, EnumFacing.UP) && isEmptyBlock(pos) && isEmptyBlock(new BlockPos(x + l, y + 1, z + i1)))
{
theRobit.setLocationAndAngles((x + l) + 0.5F, y, (z + i1) + 0.5F, theRobit.rotationYaw, theRobit.rotationPitch);
thePathfinder.clearPathEntity();
@@ -141,4 +147,12 @@ public class RobitAIFollow extends EntityAIBase
}
}
}
private boolean isEmptyBlock(BlockPos pos)
{
IBlockState iblockstate = theWorld.getBlockState(pos);
Block block = iblockstate.getBlock();
return block == Blocks.AIR ? true : !iblockstate.isFullCube();
}
}
@@ -4,9 +4,14 @@ import java.util.Iterator;
import java.util.List;
import mekanism.common.entity.EntityRobit;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.pathfinding.PathNavigate;
import net.minecraft.pathfinding.PathNodeType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
@@ -33,8 +38,8 @@ public class RobitAIPickup extends EntityAIBase
/** The ticker for updates. */
private int ticker;
/** Whether or not this robit avoids water. */
private boolean avoidWater;
private float oldWaterCost;
private EntityItem closest;
public RobitAIPickup(EntityRobit entityRobit, float speed)
@@ -95,22 +100,22 @@ public class RobitAIPickup extends EntityAIBase
@Override
public boolean continueExecuting()
{
return !closest.isDead && !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(closest) > 100 && theRobit.getFollowing() && theRobit.getEnergy() > 0 && closest.worldObj.provider.getDimensionId() == theRobit.worldObj.provider.getDimensionId();
return !closest.isDead && !thePathfinder.noPath() && theRobit.getDistanceSqToEntity(closest) > 100 && theRobit.getFollowing() && theRobit.getEnergy() > 0 && closest.worldObj.provider.getDimension() == theRobit.worldObj.provider.getDimension();
}
@Override
public void startExecuting()
{
ticker = 0;
avoidWater = theRobit.getNavigator().getAvoidsWater();
theRobit.getNavigator().setAvoidsWater(false);
oldWaterCost = theRobit.getPathPriority(PathNodeType.WATER);
theRobit.setPathPriority(PathNodeType.WATER, 0.0F);
}
@Override
public void resetTask()
{
thePathfinder.clearPathEntity();
theRobit.getNavigator().setAvoidsWater(avoidWater);
theRobit.setPathPriority(PathNodeType.WATER, oldWaterCost);
}
@Override
@@ -140,10 +145,13 @@ public class RobitAIPickup extends EntityAIBase
for(int i1 = 0; i1 <= 4; ++i1)
{
BlockPos pos = new BlockPos(x+l, y, z+i1);
if((l < 1 || i1 < 1 || l > 3 || i1 > 3) && World.doesBlockHaveSolidTopSurface(theWorld, pos.down()) && !theWorld.getBlockState(pos).getBlock().isNormalCube() && !theWorld.getBlockState(pos.up()).getBlock().isNormalCube())
BlockPos under = new BlockPos(x + l, y - 1, z + i1);
if((l < 1 || i1 < 1 || l > 3 || i1 > 3) && theWorld.getBlockState(under).isSideSolid(theWorld, under, EnumFacing.UP) && isEmptyBlock(pos) && isEmptyBlock(new BlockPos(x + l, y + 1, z + i1)))
{
theRobit.setLocationAndAngles((x + l) + 0.5F, y, (z + i1) + 0.5F, theRobit.rotationYaw, theRobit.rotationPitch);
thePathfinder.clearPathEntity();
return;
}
}
@@ -153,4 +161,12 @@ public class RobitAIPickup extends EntityAIBase
}
}
}
private boolean isEmptyBlock(BlockPos pos)
{
IBlockState iblockstate = theWorld.getBlockState(pos);
Block block = iblockstate.getBlock();
return block == Blocks.AIR ? true : !iblockstate.isFullCube();
}
}
@@ -385,10 +385,10 @@ public abstract class BlockBasic extends Block implements ICTMBlock
}
}
default:
return super.canCreatureSpawn(world, pos, type);
return super.canCreatureSpawn(state, world, pos, type);
}
default:
return super.canCreatureSpawn(world, pos, type);
return super.canCreatureSpawn(state, world, pos, type);
}
}
@@ -202,7 +202,7 @@ public class BlockGasTank extends BlockContainer
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
EntityItem entityItem = new EntityItem(world, pos.getX() + motionX, pos.getY() + motionY, pos.getZ() + motionZ, getPickBlock(null, world, pos, player));
EntityItem entityItem = new EntityItem(world, pos.getX() + motionX, pos.getY() + motionY, pos.getZ() + motionZ, getPickBlock(state, null, world, pos, player));
world.spawnEntityInWorld(entityItem);
}
@@ -210,9 +210,9 @@ public class BlockGasTank extends BlockContainer
return world.setBlockToAir(pos);
}
public ItemStack dismantleBlock(World world, BlockPos pos, boolean returnBlock)
public ItemStack dismantleBlock(IBlockState state, World world, BlockPos pos, boolean returnBlock)
{
ItemStack itemStack = getPickBlock(null, world, pos, null);
ItemStack itemStack = getPickBlock(state, null, world, pos, null);
world.setBlockToAir(pos);
@@ -296,13 +296,13 @@ public class BlockGasTank extends BlockContainer
}
@Override
public boolean hasComparatorInputOverride()
public boolean hasComparatorInputOverride(IBlockState state)
{
return true;
}
@Override
public int getComparatorInputOverride(World world, BlockPos pos)
public int getComparatorInputOverride(IBlockState state, World world, BlockPos pos)
{
TileEntityGasTank tileEntity = (TileEntityGasTank)world.getTileEntity(pos);
return tileEntity.getRedstoneLevel();
@@ -9,6 +9,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.Explosion;
@@ -69,7 +70,7 @@ public class BlockObsidianTNT extends Block
{
EntityObsidianTNT entity = new EntityObsidianTNT(world, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F);
world.spawnEntityInWorld(entity);
world.playSoundAtEntity(entity, "game.tnt.primed", 1.0F, 1.0F);
entity.playSound(SoundEvents.ENTITY_TNT_PRIMED, 1.0F, 1.0F);
}
}
@@ -108,7 +108,7 @@ public abstract class Finder
return false;
}
return Block.getBlockFromItem(stack.getItem()).getMaterial() == materialType;
return Block.getBlockFromItem(stack.getItem()).getStateFromMeta(stack.getItemDamage()).getMaterial() == materialType;
}
}
@@ -19,7 +19,7 @@ public class TMaterialFilter extends TransporterFilter
public Material getMaterial()
{
return Block.getBlockFromItem(materialItem.getItem()).getMaterial();
return Block.getBlockFromItem(materialItem.getItem()).getStateFromMeta(materialItem.getItemDamage()).getMaterial();
}
@Override
@@ -7,6 +7,9 @@ import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.world.World;
public class EntityBabySkeleton extends EntitySkeleton
@@ -14,6 +17,8 @@ public class EntityBabySkeleton extends EntitySkeleton
private static final UUID babySpeedBoostUUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(babySpeedBoostUUID, "Baby speed boost", 0.5D, 1);
private static final DataParameter<Boolean> IS_CHILD = EntityDataManager.<Boolean>createKey(EntityBalloon.class, DataSerializers.BOOLEAN);
public EntityBabySkeleton(World world)
{
super(world);
@@ -25,16 +30,16 @@ public class EntityBabySkeleton extends EntitySkeleton
{
super.entityInit();
getDataWatcher().addObject(12, new Byte((byte)0));
dataManager.register(IS_CHILD, false);
}
public void setChild(boolean child)
{
getDataWatcher().updateObject(12, Byte.valueOf((byte)(child ? 1 : 0)));
dataManager.set(IS_CHILD, child);
if(worldObj != null && !worldObj.isRemote)
{
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED);
iattributeinstance.removeModifier(babySpeedBoostModifier);
if(child)
@@ -49,7 +54,7 @@ public class EntityBabySkeleton extends EntitySkeleton
@Override
public boolean isChild()
{
return getDataWatcher().getWatchableObjectByte(12) == 1;
return dataManager.get(IS_CHILD);
}
@Override
@@ -7,6 +7,7 @@ import java.util.UUID;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.api.Pos3D;
import mekanism.common.MekanismSounds;
import net.minecraft.client.Minecraft;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.ParticleRedstone;
@@ -14,6 +15,9 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -32,6 +36,12 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
public boolean hasCachedEntity;
public UUID cachedEntityUUID;
private static final DataParameter<Byte> IS_LATCHED = EntityDataManager.<Byte>createKey(EntityBalloon.class, DataSerializers.BYTE);
private static final DataParameter<Integer> LATCHED_X = EntityDataManager.<Integer>createKey(EntityBalloon.class, DataSerializers.VARINT);
private static final DataParameter<Integer> LATCHED_Y = EntityDataManager.<Integer>createKey(EntityBalloon.class, DataSerializers.VARINT);
private static final DataParameter<Integer> LATCHED_Z = EntityDataManager.<Integer>createKey(EntityBalloon.class, DataSerializers.VARINT);
private static final DataParameter<Integer> LATCHED_ID = EntityDataManager.<Integer>createKey(Entity.class, DataSerializers.VARINT);
public EntityBalloon(World world)
{
@@ -43,11 +53,11 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
setSize(0.25F, 0.25F);
motionY = 0.04;
dataWatcher.addObject(5, (byte)0); /* Is latched */
dataWatcher.addObject(6, 0); /* Latched X */
dataWatcher.addObject(7, 0); /* Latched Y */
dataWatcher.addObject(8, 0); /* Latched Z */
dataWatcher.addObject(9, -1); /* Latched entity ID */
dataManager.register(IS_LATCHED, (byte)0);
dataManager.register(LATCHED_X, 0);
dataManager.register(LATCHED_Y, 0);
dataManager.register(LATCHED_Z, 0);
dataManager.register(LATCHED_ID, -1);
}
public EntityBalloon(World world, double x, double y, double z, EnumColor c)
@@ -76,11 +86,8 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
color = c;
dataWatcher.updateObject(5, (byte)2); /* Is latched */
dataWatcher.updateObject(6, 0); /* Latched X */
dataWatcher.updateObject(7, 0); /* Latched Y */
dataWatcher.updateObject(8, 0); /* Latched Z */
dataWatcher.updateObject(9, entity.getEntityId()); /* Latched entity ID */
dataManager.set(IS_LATCHED, (byte)2);
dataManager.set(LATCHED_ID, entity.getEntityId());
}
public EntityBalloon(World world, Coord4D obj, EnumColor c)
@@ -96,11 +103,10 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
color = c;
dataWatcher.updateObject(5, (byte)1); /* Is latched */
dataWatcher.updateObject(6, latched != null ? latched.xCoord : 0); /* Latched X */
dataWatcher.updateObject(7, latched != null ? latched.yCoord : 0); /* Latched Y */
dataWatcher.updateObject(8, latched != null ? latched.zCoord : 0); /* Latched Z */
dataWatcher.updateObject(9, -1); /* Latched entity ID */
dataManager.set(IS_LATCHED, (byte)1);
dataManager.set(LATCHED_X, latched != null ? latched.xCoord : 0); /* Latched X */
dataManager.set(LATCHED_Y, latched != null ? latched.yCoord : 0); /* Latched Y */
dataManager.set(LATCHED_Z, latched != null ? latched.zCoord : 0); /* Latched Z */
}
@Override
@@ -118,17 +124,17 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
if(worldObj.isRemote)
{
if(dataWatcher.getWatchableObjectByte(5) == 1)
if(dataManager.get(IS_LATCHED) == 1)
{
latched = new Coord4D(dataWatcher.getWatchableObjectInt(6), dataWatcher.getWatchableObjectInt(7), dataWatcher.getWatchableObjectInt(8), worldObj.provider.getDimensionId());
latched = new Coord4D((int)dataManager.get(LATCHED_X), (int)dataManager.get(LATCHED_Y), (int)dataManager.get(LATCHED_Z), worldObj.provider.getDimension());
}
else {
latched = null;
}
if(dataWatcher.getWatchableObjectByte(5) == 2)
if(dataManager.get(IS_LATCHED) == 2)
{
latchedEntity = (EntityLivingBase)worldObj.getEntityByID(dataWatcher.getWatchableObjectInt(9));
latchedEntity = (EntityLivingBase)worldObj.getEntityByID(dataManager.get(LATCHED_ID));
}
else {
latchedEntity = null;
@@ -144,11 +150,11 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
if(ticksExisted == 1)
{
dataWatcher.updateObject(5, new Byte(latched != null ? (byte)1 : (latchedEntity != null ? (byte)2 : (byte)0))); /* Is latched */
dataWatcher.updateObject(6, new Integer(latched != null ? latched.xCoord : 0)); /* Latched X */
dataWatcher.updateObject(7, new Integer(latched != null ? latched.yCoord : 0)); /* Latched Y */
dataWatcher.updateObject(8, new Integer(latched != null ? latched.zCoord : 0)); /* Latched Z */
dataWatcher.updateObject(9, new Integer(latchedEntity != null ? latchedEntity.getEntityId() : -1)); /* Latched entity ID */
dataManager.set(IS_LATCHED, new Byte(latched != null ? (byte)1 : (latchedEntity != null ? (byte)2 : (byte)0)));
dataManager.set(LATCHED_X, new Integer(latched != null ? latched.xCoord : 0));
dataManager.set(LATCHED_Y, new Integer(latched != null ? latched.yCoord : 0));
dataManager.set(LATCHED_Z, new Integer(latched != null ? latched.zCoord : 0));
dataManager.set(LATCHED_ID, new Integer(latchedEntity != null ? latchedEntity.getEntityId() : -1));
}
}
@@ -158,14 +164,14 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
{
latched = null;
dataWatcher.updateObject(5, (byte)0); /* Is latched */
dataManager.set(IS_LATCHED, (byte)0);
}
if(latchedEntity != null && (latchedEntity.getHealth() <= 0 || latchedEntity.isDead || !worldObj.loadedEntityList.contains(latchedEntity)))
{
latchedEntity = null;
dataWatcher.updateObject(5, (byte)0); /* Is latched */
dataManager.set(IS_LATCHED, (byte)0);
}
}
@@ -253,7 +259,7 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
private void pop()
{
worldObj.playSoundAtEntity(this, "mekanism:etc.Pop", 1, 1);
playSound(MekanismSounds.POP, 1, 1);
if(worldObj.isRemote)
{
@@ -438,12 +444,12 @@ public class EntityBalloon extends Entity implements IEntityAdditionalSpawnData
return latched != null || latchedEntity != null;
}
else {
return dataWatcher.getWatchableObjectByte(5) > 0;
return dataManager.get(IS_LATCHED) > 0;
}
}
public boolean isLatchedToEntity()
{
return dataWatcher.getWatchableObjectByte(5) == 2 && latchedEntity != null;
return dataManager.get(IS_LATCHED) == 2 && latchedEntity != null;
}
}
@@ -16,6 +16,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
@@ -202,7 +203,7 @@ public class EntityFlame extends Entity implements IEntityAdditionalSpawnData
if(fluid)
{
spawnParticlesAt(new Pos3D(this));
worldObj.playSoundAtEntity(this, "random.fizz", 1.0F, 1.0F);
playSound(SoundEvents.BLOCK_FIRE_EXTINGUISH, 1.0F, 1.0F);
}
}
@@ -220,7 +221,7 @@ public class EntityFlame extends Entity implements IEntityAdditionalSpawnData
item.ticksExisted = 0;
spawnParticlesAt(new Pos3D(item));
worldObj.playSoundAtEntity(item, "random.fizz", 1.0F, 1.0F);
playSound(SoundEvents.BLOCK_FIRE_EXTINGUISH, 1.0F, 1.0F);
return true;
}
@@ -29,11 +29,15 @@ import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.datasync.DataParameter;
import net.minecraft.network.datasync.DataSerializers;
import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.pathfinding.PathNavigateGround;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.DamageSource;
@@ -59,14 +63,19 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
public int furnaceCookTime = 0;
public boolean texTick;
private static final DataParameter<Float> ELECTRICITY = EntityDataManager.<Float>createKey(EntityBalloon.class, DataSerializers.FLOAT);
private static final DataParameter<String> OWNER = EntityDataManager.<String>createKey(EntityBalloon.class, DataSerializers.STRING);
private static final DataParameter<Boolean> FOLLOW = EntityDataManager.<Boolean>createKey(EntityBalloon.class, DataSerializers.BOOLEAN);
private static final DataParameter<Boolean> DROP_PICKUP = EntityDataManager.<Boolean>createKey(EntityBalloon.class, DataSerializers.BOOLEAN);
public EntityRobit(World world)
{
super(world);
setSize(0.5F, 0.5F);
getNavigator().setAvoidsWater(true);
getNavigator().setCanSwim(false);
tasks.addTask(1, new RobitAIPickup(this, 1.0F));
tasks.addTask(2, new RobitAIFollow(this, 1.0F, 4.0F, 2.0F));
@@ -99,8 +108,8 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
{
super.applyEntityAttributes();
getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.3);
getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(1);
getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3);
getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(1);
}
@Override
@@ -109,19 +118,15 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
return false;
}
@Override
protected void updateAITick() {}
@Override
protected void entityInit()
{
super.entityInit();
dataWatcher.addObject(16, ""); /* Electricity */
dataWatcher.addObject(17, ""); /* Owner */
dataWatcher.addObject(18, (byte)0); /* Follow */
//unused
dataWatcher.addObject(20, (byte)0); /* Drop Pickup */
dataManager.register(ELECTRICITY, 0F);
dataManager.register(OWNER, "");
dataManager.register(FOLLOW, false);
dataManager.register(DROP_PICKUP, false);
}
public double getRoundedTravelEnergy()
@@ -272,7 +277,7 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
onItemPickup(item, item.getEntityItem().stackSize);
item.setDead();
playSound("random.pop", 1.0F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
playSound(SoundEvents.ENTITY_ITEM_PICKUP, 1.0F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
break;
}
@@ -291,7 +296,7 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
item.setDead();
}
playSound("random.pop", 1.0F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
playSound(SoundEvents.ENTITY_ITEM_PICKUP, 1.0F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
break;
}
@@ -517,16 +522,12 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
public double getEnergy()
{
try {
return Double.parseDouble(dataWatcher.getWatchableObjectString(16));
} catch(Exception e) {
return 0;
}
return (float)dataManager.get(ELECTRICITY);
}
public void setEnergy(double energy)
{
dataWatcher.updateObject(16, Double.toString(Math.max(Math.min(energy, MAX_ELECTRICITY), 0)));
dataManager.set(ELECTRICITY, (float)Math.max(Math.min(energy, MAX_ELECTRICITY), 0));
}
public EntityPlayer getOwner()
@@ -536,32 +537,32 @@ public class EntityRobit extends EntityCreature implements IInventory, ISustaine
public String getOwnerName()
{
return dataWatcher.getWatchableObjectString(17);
return dataManager.get(OWNER);
}
public void setOwner(String username)
{
dataWatcher.updateObject(17, username);
dataManager.set(OWNER, username);
}
public boolean getFollowing()
{
return dataWatcher.getWatchableObjectByte(18) == 1;
return dataManager.get(FOLLOW);
}
public void setFollowing(boolean follow)
{
dataWatcher.updateObject(18, follow ? (byte)1 : (byte)0);
dataManager.set(FOLLOW, follow);
}
public boolean getDropPickup()
{
return dataWatcher.getWatchableObjectByte(20) == 1;
return dataManager.get(DROP_PICKUP);
}
public void setDropPickup(boolean pickup)
{
dataWatcher.updateObject(20, pickup ? (byte)1 : (byte)0);
dataManager.set(DROP_PICKUP, pickup);
}
@Override
@@ -162,7 +162,7 @@ public class FrequencyManager
if(dataHandler == null)
{
dataHandler = (FrequencyDataHandler)world.getPerWorldStorage().loadData(FrequencyDataHandler.class, name);
dataHandler = (FrequencyDataHandler)world.getPerWorldStorage().getOrLoadData(FrequencyDataHandler.class, name);
if(dataHandler == null)
{
@@ -182,7 +182,7 @@ public class FrequencyManager
FrequencyManager manager = new FrequencyManager(freqClass, n);
String name = manager.getName();
FrequencyDataHandler handler = (FrequencyDataHandler)world.getPerWorldStorage().loadData(FrequencyDataHandler.class, name);
FrequencyDataHandler handler = (FrequencyDataHandler)world.getPerWorldStorage().getOrLoadData(FrequencyDataHandler.class, name);
if(handler == null)
{
@@ -241,7 +241,7 @@ public class FrequencyManager
{
Coord4D coord = iter.next();
if(coord.dimensionId == world.provider.getDimensionId())
if(coord.dimensionId == world.provider.getDimension())
{
if(!coord.exists(world))
{
@@ -369,7 +369,7 @@ public class FrequencyManager
}
@Override
public void writeToNBT(NBTTagCompound nbtTags)
public NBTTagCompound writeToNBT(NBTTagCompound nbtTags)
{
nbtTags.setString("frequencyClass", manager.frequencyClass.getName());
@@ -388,6 +388,8 @@ public class FrequencyManager
}
nbtTags.setTag("freqList", list);
return nbtTags;
}
}
}
@@ -22,6 +22,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.UseHoeEvent;
@@ -156,7 +157,7 @@ public class ItemAtomicDisassembler extends ItemEnergized
if(!world.isRemote && entityplayer.isSneaking())
{
toggleMode(itemstack);
entityplayer.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.modeToggle") + " " + EnumColor.INDIGO + getModeName(itemstack) + EnumColor.AQUA + " (" + getEfficiency(itemstack) + ")"));
entityplayer.addChatMessage(new TextComponentString(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.modeToggle") + " " + EnumColor.INDIGO + getModeName(itemstack) + EnumColor.AQUA + " (" + getEfficiency(itemstack) + ")"));
}
return itemstack;
@@ -48,6 +48,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@@ -55,8 +56,10 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
@@ -155,7 +158,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
{
BaseTier tier = type == MachineType.BASIC_FACTORY ? BaseTier.BASIC : (type == MachineType.ADVANCED_FACTORY ? BaseTier.ADVANCED : BaseTier.ELITE);
if(StatCollector.canTranslate("tile." + tier.getSimpleName() + RecipeType.values()[getRecipeType(itemstack)].getUnlocalizedName() + "Factory"))
if(I18n.canTranslate("tile." + tier.getSimpleName() + RecipeType.values()[getRecipeType(itemstack)].getUnlocalizedName() + "Factory"))
{
return LangUtils.localize("tile." + tier.getSimpleName() + RecipeType.values()[getRecipeType(itemstack)].getUnlocalizedName() + "Factory");
}
@@ -442,7 +445,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
return false;
}
else {
Material material = world.getBlockState(pos).getBlock().getMaterial();
Material material = world.getBlockState(pos).getMaterial();
boolean flag = !material.isSolid();
if(!world.isAirBlock(pos) && !flag)
@@ -452,7 +455,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
else {
if(world.provider.doesWaterVaporize() && getFluidStack(itemstack).getFluid() == FluidRegistry.WATER)
{
world.playSoundEffect(pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
world.playSound(null, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
for(int l = 0; l < 8; l++)
{
@@ -6,6 +6,7 @@ import net.minecraft.block.Block;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.translation.I18n;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -33,7 +34,7 @@ public class ItemBlockPlastic extends ItemBlock
EnumColor colour = EnumColor.DYES[dyeColour.getDyeDamage()];
String colourName;
if(StatCollector.canTranslate(getUnlocalizedName(stack) + "." + colour.dyeName))
if(I18n.canTranslate(getUnlocalizedName(stack) + "." + colour.dyeName))
{
return LangUtils.localize(getUnlocalizedName(stack) + "." + colour.dyeName);
}
@@ -81,7 +81,7 @@ public class MultiblockManager<T extends SynchronizedData<T>>
for(Coord4D obj : entry.getValue().locations)
{
if(obj.dimensionId == world.provider.getDimensionId() && obj.exists(world))
if(obj.dimensionId == world.provider.getDimension() && obj.exists(world))
{
TileEntity tileEntity = obj.getTileEntity(world);
@@ -160,7 +160,7 @@ public abstract class UpdateProtocol<T extends SynchronizedData<T>>
else {
if(!isAir(origX+x, origY+y, origZ+z))
{
innerNodes.add(new Coord4D(origX+x, origY+y, origZ+z, pointer.getWorld().provider.getDimensionId()));
innerNodes.add(new Coord4D(origX+x, origY+y, origZ+z, pointer.getWorld().provider.getDimension()));
}
}
@@ -149,7 +149,7 @@ public class PacketDigitalMinerGui implements IMessageHandler<DigitalMinerGuiMes
playerMP.openContainer = container;
playerMP.openContainer.windowId = window;
playerMP.openContainer.onCraftGuiOpened(playerMP);
playerMP.openContainer.addListener(playerMP);
if(guiType == 0)
{
@@ -30,7 +30,7 @@ public class PacketFlamethrowerData implements IMessageHandler<FlamethrowerDataM
if(!player.worldObj.isRemote)
{
Mekanism.packetHandler.sendToDimension(new FlamethrowerDataMessage(FlamethrowerPacket.UPDATE, message.username, message.value), player.worldObj.provider.getDimensionId());
Mekanism.packetHandler.sendToDimension(new FlamethrowerDataMessage(FlamethrowerPacket.UPDATE, message.username, message.value), player.worldObj.provider.getDimension());
}
}
else if(message.packetType == FlamethrowerPacket.MODE)
@@ -7,6 +7,7 @@ import mekanism.common.item.ItemJetpack;
import mekanism.common.item.ItemJetpack.JetpackMode;
import mekanism.common.network.PacketJetpackData.JetpackDataMessage;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
@@ -31,12 +32,12 @@ public class PacketJetpackData implements IMessageHandler<JetpackDataMessage, IM
if(!player.worldObj.isRemote)
{
Mekanism.packetHandler.sendToDimension(new JetpackDataMessage(JetpackPacket.UPDATE, message.username, message.value), player.worldObj.provider.getDimensionId());
Mekanism.packetHandler.sendToDimension(new JetpackDataMessage(JetpackPacket.UPDATE, message.username, message.value), player.worldObj.provider.getDimension());
}
}
else if(message.packetType == JetpackPacket.MODE)
{
ItemStack stack = player.getEquipmentInSlot(3);
ItemStack stack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
if(stack != null && stack.getItem() instanceof ItemJetpack)
{
@@ -136,7 +136,7 @@ public class PacketLogisticalSorterGui implements IMessageHandler<LogisticalSort
playerMP.openContainer = container;
playerMP.openContainer.windowId = window;
playerMP.openContainer.onCraftGuiOpened(playerMP);
playerMP.openContainer.addListener(playerMP);
}
@SideOnly(Side.CLIENT)
@@ -132,7 +132,7 @@ public class PacketOredictionificatorGui implements IMessageHandler<Oredictionif
playerMP.openContainer = container;
playerMP.openContainer.windowId = window;
playerMP.openContainer.onCraftGuiOpened(playerMP);
playerMP.openContainer.addListener(playerMP);
if(guiType == 0)
{
@@ -6,6 +6,7 @@ import mekanism.common.PacketHandler;
import mekanism.common.item.ItemScubaTank;
import mekanism.common.network.PacketScubaTankData.ScubaTankDataMessage;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
@@ -30,12 +31,12 @@ public class PacketScubaTankData implements IMessageHandler<ScubaTankDataMessage
if(!player.worldObj.isRemote)
{
Mekanism.packetHandler.sendToDimension(new ScubaTankDataMessage(ScubaTankPacket.UPDATE, message.username, message.value), player.worldObj.provider.getDimensionId());
Mekanism.packetHandler.sendToDimension(new ScubaTankDataMessage(ScubaTankPacket.UPDATE, message.username, message.value), player.worldObj.provider.getDimension());
}
}
else if(message.packetType == ScubaTankPacket.MODE)
{
ItemStack stack = player.getEquipmentInSlot(3);
ItemStack stack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
if(stack != null && stack.getItem() instanceof ItemScubaTank)
{
@@ -89,7 +89,7 @@ public class PacketSimpleGui implements IMessageHandler<SimpleGuiMessage, IMessa
playerMP.openContainer = handlers.get(handler).getServerGui(id, playerMP, world, obj.getPos());
playerMP.openContainer.windowId = window;
playerMP.openContainer.onCraftGuiOpened(playerMP);
playerMP.openContainer.addListener(playerMP);
}
@SideOnly(Side.CLIENT)
@@ -357,11 +357,13 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
}
@Override
public void writeToNBT(NBTTagCompound nbtTags)
public NBTTagCompound writeToNBT(NBTTagCompound nbtTags)
{
super.writeToNBT(nbtTags);
nbtTags.setTag("gasTank", gasTank.write(new NBTTagCompound()));
return nbtTags;
}
/**
@@ -144,13 +144,15 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
}
@Override
public void writeToNBT(NBTTagCompound nbtTags)
public NBTTagCompound writeToNBT(NBTTagCompound nbtTags)
{
super.writeToNBT(nbtTags);
nbtTags.setInteger("operatingTicks", operatingTicks);
nbtTags.setBoolean("isActive", isActive);
nbtTags.setInteger("controlType", controlType.ordinal());
return nbtTags;
}
@Override
@@ -22,6 +22,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.TransporterUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
@@ -29,6 +30,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.fml.common.FMLCommonHandler;
@@ -231,7 +233,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
}
@Override
public void writeToNBT(NBTTagCompound nbtTags)
public NBTTagCompound writeToNBT(NBTTagCompound nbtTags)
{
super.writeToNBT(nbtTags);
@@ -253,6 +255,8 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
{
nbtTags.setTag("itemType", itemType.writeToNBT(new NBTTagCompound()));
}
return nbtTags;
}
@Override
@@ -610,7 +614,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
public boolean onSneakRightClick(EntityPlayer player, EnumFacing side)
{
setActive(!getActive());
worldObj.playSoundEffect(getPos().getX(), getPos().getY(), getPos().getZ(), "random.click", 0.3F, 1);
worldObj.playSound(null, getPos().getX(), getPos().getY(), getPos().getZ(), SoundEvents.UI_BUTTON_CLICK, SoundCategory.BLOCKS, 0.3F, 1);
return true;
}
@@ -173,11 +173,13 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
}
@Override
public void writeToNBT(NBTTagCompound nbtTags)
public NBTTagCompound writeToNBT(NBTTagCompound nbtTags)
{
super.writeToNBT(nbtTags);
nbtTags.setBoolean("isActive", isActive);
return nbtTags;
}
@Override
@@ -273,7 +273,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
}
@Override
public void writeToNBT(NBTTagCompound nbtTags)
public NBTTagCompound writeToNBT(NBTTagCompound nbtTags)
{
super.writeToNBT(nbtTags);
@@ -284,6 +284,8 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
nbtTags.setTag("rightTank", inputTank.write(new NBTTagCompound()));
nbtTags.setBoolean("sideDataStored", true);
return nbtTags;
}
@Override
@@ -348,7 +348,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
}
@Override
public void writeToNBT(NBTTagCompound nbtTags)
public NBTTagCompound writeToNBT(NBTTagCompound nbtTags)
{
super.writeToNBT(nbtTags);
@@ -357,6 +357,8 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
nbtTags.setInteger("operatingTicks", operatingTicks);
nbtTags.setTag("injectTank", injectTank.write(new NBTTagCompound()));
nbtTags.setTag("gasTank", outputTank.write(new NBTTagCompound()));
return nbtTags;
}
@Override
@@ -321,7 +321,7 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
}
@Override
public void writeToNBT(NBTTagCompound nbtTags)
public NBTTagCompound writeToNBT(NBTTagCompound nbtTags)
{
super.writeToNBT(nbtTags);
@@ -331,6 +331,8 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
nbtTags.setTag("leftTank", leftTank.write(new NBTTagCompound()));
nbtTags.setTag("rightTank", rightTank.write(new NBTTagCompound()));
nbtTags.setTag("centerTank", centerTank.write(new NBTTagCompound()));
return nbtTags;
}
@Override
Loaded 100 of 152 files, more files were not shown because too many files have changed in this diff. Show more