mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Squashed commit of the following:
commit 0d4dc5991e572793134c0c1af8bb35db528071ad Author: pupnewfster <[email protected]> Date: Thu Mar 7 19:25:28 2019 -0500 IntelliJ inspections, Unused Import commit c757d3236b6304b1d3295ad392b88677bccf3003 Author: pupnewfster <[email protected]> Date: Thu Mar 7 19:09:24 2019 -0500 IntelliJ inspections, Constant conditions & exceptions commit c63a821ef9fc705941052a876cc1ef950471912e Author: pupnewfster <[email protected]> Date: Thu Mar 7 17:41:31 2019 -0500 IntelliJ inspections, @NotNull/@Nullable problems commit 506bbfd3241336082b17e5d47f8cec496666dcff Author: pupnewfster <[email protected]> Date: Thu Mar 7 16:50:46 2019 -0500 IntelliJ inspections, Unused label commit bad10c2428346b5feb1816e4a78d7cc2bc1259f0 Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:33:54 2019 -0500 IntelliJ inspections, Unused assignment commit bfe633afbfb6380d0f5ee2e8ab14f8981a455681 Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:32:02 2019 -0500 IntelliJ inspections, 'equals()' between objects of inconvertible types commit 6d179f8639fad1a7c3fa01467c003a8fd309da09 Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:29:28 2019 -0500 IntelliJ inspections, Unused import commit c21f1cfa5566308237dc8bddb8b79908e272a637 Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:25:41 2019 -0500 IntelliJ inspections, Unused import commit e5d9e03af582c7315b057861b8f0019e46157dee Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:23:10 2019 -0500 IntelliJ inspections, Redundant 'throws' clause commit 1c589ba5740411a5595e9fda177696670bc7b7df Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:21:07 2019 -0500 IntelliJ inspections, Static member referenced by instance variable commit 6c17e9ca7fb22a0e285337133659e826f3bfdfee Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:20:02 2019 -0500 IntelliJ inspections, Catch block may ignore exception commit 42b3cd788ceb7d6ce657d582bbbd8345a2ec5676 Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:16:29 2019 -0500 IntelliJ inspections, Unnecessary label on 'break' statement commit f6abc3c66f3aca147edb274720cdb94bff568b0b Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:15:29 2019 -0500 IntelliJ inspections, Too weak variable type leads to unnecessary cast commit 6356d1fea8d55907ae1c7b011223fbbc07236c1f Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:11:17 2019 -0500 IntelliJ inspections, Redundant type cast commit 559c1a2ff523fd7e23f3750d5c801af73876f1d0 Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:04:45 2019 -0500 IntelliJ inspections, Redundant type arguments commit ae816ec2a79cf4c8fee776db651a54f68c1dacaa Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:01:27 2019 -0500 IntelliJ inspections, Redundant Collection operation commit 1da69b8baff922b98a32163c7d5f90aa77a6a8bc Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:00:55 2019 -0500 IntelliJ inspections, Redundant array creation commit 7e3ef81a3597c596d2206c93442e950ac9183de0 Author: pupnewfster <[email protected]> Date: Thu Mar 7 15:00:11 2019 -0500 IntelliJ inspections, Condition is covered by further condition commit f298bbb9f31ecbe935ef6cbf98b56951434a05f8 Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:58:10 2019 -0500 IntelliJ inspections, Redundant 'Collection.addAll()' call commit ce715c5cd724c4dc71ff2cb53e5bc12f16289f12 Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:56:56 2019 -0500 IntelliJ inspections, 'Collection.toArray()' call style commit 0bde4b0eb23ac5d8f40a410ed55315e4a422a30c Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:55:40 2019 -0500 IntelliJ inspections, Calls to 'Arrays.asList()' with too few arguments commit 6d06d11dcf9c077ed6b216a0bbd61434b10fc610 Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:52:26 2019 -0500 IntelliJ inspections, Pointless arithmetic expression commit 6501d725af1eda5127489f77fd723396002b29b2 Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:42:32 2019 -0500 IntelliJ inspections, Anonymous type can be replaced with lambda commit 85341ae5df9d63fb0ad7281c260c77d064adf0c2 Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:41:40 2019 -0500 IntelliJ inspections, Explicit type can be replaced with <> commit 7e2feae7189b92cb513499aed113d4a2634622c6 Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:38:47 2019 -0500 IntelliJ inspections, Unnecessary 'null' check before method call commit 2c75a38fe9a969f832cd5777f4fad81ef47d037b Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:37:33 2019 -0500 IntelliJ inspections, 'switch' statement with too few branches commit 2e2aff57f7910aef5a68f41a1918e2c8a98509ec Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:34:50 2019 -0500 IntelliJ inspections, Simplifiable conditional statement commit 243f6a975f8b3da5e70a5c1a116db2aedd10900e Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:33:09 2019 -0500 IntelliJ inspections, Duplicate condition in 'if' statement commit a80c67fc30b737990e7805a8741dce120232badc Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:32:17 2019 -0500 IntelliJ inspections, Unnecessary semicolon commit 5a7220ee574c9d38d71db07e4fa995a56fee1eed Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:31:58 2019 -0500 IntelliJ inspections, Unnecessary enum/interface modifier commit f3a66f4462033d2f446c2961a1ad8e9cfde3ed36 Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:30:36 2019 -0500 IntelliJ inspections, Unnecessary conversion to String commit 1662540be864db4669cd80c8c46a9b35be202b62 Author: pupnewfster <[email protected]> Date: Thu Mar 7 14:29:33 2019 -0500 IntelliJ inspections, C styled array declaration
This commit is contained in:
1 parent
a148f71358
commit
95ca29fa19
373 files changed
+2213
-1740
No files matched your search
@@ -8,7 +8,6 @@ import mekanism.common.base.TileNetworkList;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -226,7 +225,7 @@ public class Coord4D
|
||||
{
|
||||
IBlockState state = getBlockState(world);
|
||||
|
||||
if(state == null || state == Blocks.AIR)
|
||||
if(state == null || state.getBlock().isAir(state, world, null))
|
||||
{
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public interface IMekWrench
|
||||
/* easier compat with BC */
|
||||
default boolean canUseWrench(EntityPlayer player, EnumHand hand, ItemStack stack, RayTraceResult rayTrace)
|
||||
{
|
||||
return canUseWrench(stack, player, rayTrace.getBlockPos() != null ? rayTrace.getBlockPos() : BlockPos.ORIGIN);
|
||||
return canUseWrench(stack, player, rayTrace.getBlockPos());
|
||||
}
|
||||
|
||||
default void wrenchUsed(EntityPlayer player, EnumHand hand, ItemStack wrench, RayTraceResult rayTrace){}
|
||||
|
||||
@@ -11,6 +11,8 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Pos3D - a way of performing operations on objects in a three dimensional environment.
|
||||
* @author aidancbrady
|
||||
@@ -189,6 +191,8 @@ public class Pos3D extends Vec3d
|
||||
* @param yaw - yaw to rotate by
|
||||
* @return rotated Pos3D
|
||||
*/
|
||||
@Nonnull
|
||||
@Override
|
||||
public Pos3D rotateYaw(float yaw)
|
||||
{
|
||||
double yawRadians = Math.toRadians(yaw);
|
||||
@@ -204,7 +208,8 @@ public class Pos3D extends Vec3d
|
||||
|
||||
return new Pos3D(xPos, y, zPos);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Pos3D rotatePitch(float pitch)
|
||||
{
|
||||
@@ -257,6 +262,7 @@ public class Pos3D extends Vec3d
|
||||
return new Pos3D(this.x * x, this.y * y, this.z * z);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Pos3D scale(double scale)
|
||||
{
|
||||
@@ -321,6 +327,7 @@ public class Pos3D extends Vec3d
|
||||
return Math.acos(pos1.clone().dotProduct(pos2));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Pos3D normalize()
|
||||
{
|
||||
@@ -370,6 +377,7 @@ public class Pos3D extends Vec3d
|
||||
return new Pos3D(x, y, z);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
||||
@@ -4,9 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface IGasHandler
|
||||
*/
|
||||
boolean canDrawGas(EnumFacing side, Gas type);
|
||||
|
||||
static GasTankInfo[] NONE = new GasTankInfo[0];
|
||||
GasTankInfo[] NONE = new GasTankInfo[0];
|
||||
|
||||
/**
|
||||
* Gets the tanks present on this handler. READ ONLY. DO NOT MODIFY.
|
||||
|
||||
@@ -360,7 +360,7 @@ public abstract class DynamicNetwork<A, N extends DynamicNetwork<A, N>> implemen
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
|
||||
if(updateDelay > 0)
|
||||
{
|
||||
|
||||
@@ -124,7 +124,6 @@ import mekanism.common.block.states.BlockStatePlastic.PlasticBlockStateMapper;
|
||||
import mekanism.common.block.states.BlockStateTransmitter.TransmitterStateMapper;
|
||||
import mekanism.common.block.states.BlockStateTransmitter.TransmitterType;
|
||||
import mekanism.common.config.MekanismConfig.client;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
import mekanism.common.entity.EntityBabySkeleton;
|
||||
import mekanism.common.entity.EntityBalloon;
|
||||
import mekanism.common.entity.EntityFlame;
|
||||
@@ -659,7 +658,7 @@ public class ClientProxy extends CommonProxy
|
||||
|
||||
return new ModelResourceLocation(baseLocation, "facing=north,tier="+tier);
|
||||
});
|
||||
|
||||
|
||||
ItemMeshDefinition machineMesher = stack ->
|
||||
{
|
||||
MachineType type = MachineType.get(stack);
|
||||
@@ -1119,7 +1118,7 @@ public class ClientProxy extends CommonProxy
|
||||
{
|
||||
Minecraft.getMinecraft().addScheduledTask(runnable);
|
||||
}
|
||||
else if(player != null && !player.world.isRemote)
|
||||
else
|
||||
{
|
||||
((WorldServer)player.world).addScheduledTask(runnable); //singleplayer
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public final class HolidayManager
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
public static ResourceLocation filterSound(ResourceLocation sound)
|
||||
@@ -67,7 +67,7 @@ public final class HolidayManager
|
||||
return holiday.filterSound(sound);
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
|
||||
return sound;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import mekanism.common.network.PacketFreeRunnerData;
|
||||
import mekanism.common.network.PacketItemStack.ItemStackMessage;
|
||||
import mekanism.common.network.PacketJetpackData.JetpackDataMessage;
|
||||
import mekanism.common.network.PacketScubaTankData.ScubaTankDataMessage;
|
||||
import mekanism.common.network.PacketScubaTankData.ScubaTankPacket;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.ListUtils;
|
||||
import mekanism.common.util.StackUtils;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class SparkleAnimation
|
||||
}
|
||||
|
||||
loop(pointer);
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
|
||||
try {
|
||||
new Thread(() ->
|
||||
@@ -61,7 +61,7 @@ public class SparkleAnimation
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
public void loop(TileEntity tileEntity)
|
||||
|
||||
@@ -172,7 +172,7 @@ public class ThreadClientUpdate extends Thread
|
||||
|
||||
private void prepareForDownload()
|
||||
{
|
||||
File[] modsList = new File(String.valueOf(Mekanism.proxy.getMinecraftDir()) + File.separator + "mods").listFiles();
|
||||
File[] modsList = new File(Mekanism.proxy.getMinecraftDir() + File.separator + "mods").listFiles();
|
||||
|
||||
if(Mekanism.versionNumber.comparedState(Version.get(Mekanism.latestVersionNumber)) == -1)
|
||||
{
|
||||
@@ -203,7 +203,7 @@ public class ThreadClientUpdate extends Thread
|
||||
{
|
||||
try {
|
||||
return new URL("http://ci.aidancbrady.com/job/Mekanism/Recommended/artifact/*zip*/archive.zip");
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class GuiChemicalCrystallizer extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 131, 14);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
@@ -22,7 +22,7 @@ public class GuiCredits extends GuiScreen
|
||||
buttonList.clear();
|
||||
buttonList.add(new GuiButton(0, width / 2 - 100, height / 4 + 72 + 12, "Update"));
|
||||
buttonList.add(new GuiButton(1, width / 2 - 100, height / 4 + 96 + 12, "Cancel"));
|
||||
((GuiButton)buttonList.get(0)).enabled = !MekanismUtils.noUpdates() && !ThreadClientUpdate.hasUpdated;
|
||||
buttonList.get(0).enabled = !MekanismUtils.noUpdates() && !ThreadClientUpdate.hasUpdated;
|
||||
}
|
||||
|
||||
public static void updateInfo(String info)
|
||||
|
||||
@@ -25,7 +25,6 @@ import mekanism.common.network.PacketDigitalMinerGui.MinerGuiPacket;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.ListUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
@@ -186,17 +186,11 @@ public class GuiDigitalMinerConfig extends GuiMekanism
|
||||
{
|
||||
if(filter instanceof MOreDictFilter && !oreDictFilters.contains(filter))
|
||||
{
|
||||
if(oreDictStacks.containsKey(filter))
|
||||
{
|
||||
oreDictStacks.remove(filter);
|
||||
}
|
||||
oreDictStacks.remove(filter);
|
||||
}
|
||||
else if(filter instanceof MModIDFilter && !modIDFilters.contains(filter))
|
||||
{
|
||||
if(modIDStacks.containsKey(filter))
|
||||
{
|
||||
modIDStacks.remove(filter);
|
||||
}
|
||||
modIDStacks.remove(filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -489,7 +483,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 59, yStart + 3);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
fontRenderer.drawString(LangUtils.localize("gui.oredictFilter"), 78, yStart + 2, 0x404040);
|
||||
@@ -528,7 +522,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 59, yStart + 3);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
fontRenderer.drawString(LangUtils.localize("gui.modIDFilter"), 78, yStart + 2, 0x404040);
|
||||
|
||||
@@ -182,7 +182,7 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
|
||||
|
||||
if(xAxis >= 26 && xAxis <= 42 && yAxis >= 75 && yAxis <= 91)
|
||||
{
|
||||
drawTexturedModalRect(guiWidth + 26, guiHeight + 75, 176 + 62, 48 + 0, 16, 16);
|
||||
drawTexturedModalRect(guiWidth + 26, guiHeight + 75, 176 + 62, 48, 16, 16);
|
||||
}
|
||||
else {
|
||||
drawTexturedModalRect(guiWidth + 26, guiHeight + 75, 176 + 62, 48 + 16, 16, 16);
|
||||
@@ -210,7 +210,7 @@ public class GuiFormulaicAssemblicator extends GuiMekanism
|
||||
|
||||
if(!stack.isEmpty())
|
||||
{
|
||||
Slot slot = (Slot)inventorySlots.inventorySlots.get(i+20);
|
||||
Slot slot = inventorySlots.inventorySlots.get(i+20);
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
if(slot.getStack().isEmpty() || !slot.getStack().isItemEqual(stack))
|
||||
|
||||
@@ -205,17 +205,11 @@ public class GuiLogisticalSorter extends GuiMekanism
|
||||
{
|
||||
if(filter instanceof TOreDictFilter && !oreDictFilters.contains(filter))
|
||||
{
|
||||
if(oreDictStacks.containsKey(filter))
|
||||
{
|
||||
oreDictStacks.remove(filter);
|
||||
}
|
||||
oreDictStacks.remove(filter);
|
||||
}
|
||||
else if(filter instanceof TModIDFilter && !modIDFilters.contains(filter))
|
||||
{
|
||||
if(modIDStacks.containsKey(filter))
|
||||
{
|
||||
modIDStacks.remove(filter);
|
||||
}
|
||||
modIDStacks.remove(filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -494,7 +488,7 @@ public class GuiLogisticalSorter extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 59, yStart + 3);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(final Exception e) {}
|
||||
} catch(final Exception ignored) {}
|
||||
}
|
||||
|
||||
fontRenderer.drawString(LangUtils.localize("gui.oredictFilter"), 78, yStart + 2, 0x404040);
|
||||
@@ -535,7 +529,7 @@ public class GuiLogisticalSorter extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 59, yStart + 3);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(final Exception e) {}
|
||||
} catch(final Exception ignored) {}
|
||||
}
|
||||
|
||||
fontRenderer.drawString(LangUtils.localize("gui.modIDFilter"), 78, yStart + 2, 0x404040);
|
||||
|
||||
@@ -77,7 +77,7 @@ public class GuiMItemStackFilter extends GuiMekanism
|
||||
|
||||
if(isNew)
|
||||
{
|
||||
((GuiButton)buttonList.get(1)).enabled = false;
|
||||
buttonList.get(1).enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public class GuiMMaterialFilter extends GuiMekanism
|
||||
|
||||
if(isNew)
|
||||
{
|
||||
((GuiButton)buttonList.get(1)).enabled = false;
|
||||
buttonList.get(1).enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ public class GuiMModIDFilter extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 12, 19);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
if(!filter.replaceStack.isEmpty())
|
||||
@@ -368,7 +368,7 @@ public class GuiMModIDFilter extends GuiMekanism
|
||||
{
|
||||
String modName = modIDText.getText();
|
||||
|
||||
if(modName == null || modName.isEmpty())
|
||||
if(modName.isEmpty())
|
||||
{
|
||||
status = EnumColor.DARK_RED + LangUtils.localize("gui.modIDFilter.noID");
|
||||
return;
|
||||
|
||||
@@ -93,7 +93,7 @@ public class GuiMOreDictFilter extends GuiMekanism
|
||||
|
||||
if(isNew)
|
||||
{
|
||||
((GuiButton)buttonList.get(1)).enabled = false;
|
||||
buttonList.get(1).enabled = false;
|
||||
}
|
||||
|
||||
oreDictText = new GuiTextField(2, fontRenderer, guiWidth + 35, guiHeight + 47, 95, 12);
|
||||
@@ -175,7 +175,7 @@ public class GuiMOreDictFilter extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 12, 19);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
if(!filter.replaceStack.isEmpty())
|
||||
@@ -368,7 +368,7 @@ public class GuiMOreDictFilter extends GuiMekanism
|
||||
{
|
||||
String oreName = oreDictText.getText();
|
||||
|
||||
if(oreName == null || oreName.isEmpty())
|
||||
if(oreName.isEmpty())
|
||||
{
|
||||
status = EnumColor.DARK_RED + LangUtils.localize("gui.oredictFilter.noKey");
|
||||
return;
|
||||
|
||||
@@ -80,7 +80,7 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
|
||||
public static boolean isTextboxKey(char c, int i)
|
||||
{
|
||||
if(i == Keyboard.KEY_BACK || i == Keyboard.KEY_DELETE || i == Keyboard.KEY_LEFT || i == Keyboard.KEY_RIGHT ||
|
||||
i == Keyboard.KEY_END || i == Keyboard.KEY_HOME || i == Keyboard.KEY_BACK || isKeyComboCtrlA(i) ||
|
||||
i == Keyboard.KEY_END || i == Keyboard.KEY_HOME || isKeyComboCtrlA(i) ||
|
||||
isKeyComboCtrlC(i) || isKeyComboCtrlV(i) || isKeyComboCtrlX(i))
|
||||
{
|
||||
return true;
|
||||
@@ -108,7 +108,7 @@ public abstract class GuiMekanism extends GuiContainer implements IGuiWrapper
|
||||
|
||||
for(int i = 0; i < inventorySlots.inventorySlots.size(); i++)
|
||||
{
|
||||
Slot slot = (Slot)inventorySlots.inventorySlots.get(i);
|
||||
Slot slot = inventorySlots.inventorySlots.get(i);
|
||||
|
||||
if(isMouseOverSlot(slot, mouseX, mouseY))
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ public class GuiOredictionificatorFilter extends GuiMekanism
|
||||
tileEntity = tentity;
|
||||
|
||||
origFilter = tileEntity.filters.get(index);
|
||||
filter = ((OredictionificatorFilter)tentity.filters.get(index)).clone();
|
||||
filter = tentity.filters.get(index).clone();
|
||||
|
||||
updateRenderStack();
|
||||
}
|
||||
@@ -94,18 +94,18 @@ public class GuiOredictionificatorFilter extends GuiMekanism
|
||||
{
|
||||
if(filter.filter != null && !filter.filter.isEmpty())
|
||||
{
|
||||
((GuiButton)buttonList.get(0)).enabled = true;
|
||||
buttonList.get(0).enabled = true;
|
||||
}
|
||||
else {
|
||||
((GuiButton)buttonList.get(0)).enabled = false;
|
||||
buttonList.get(0).enabled = false;
|
||||
}
|
||||
|
||||
if(!isNew)
|
||||
{
|
||||
((GuiButton)buttonList.get(1)).enabled = true;
|
||||
buttonList.get(1).enabled = true;
|
||||
}
|
||||
else {
|
||||
((GuiButton)buttonList.get(1)).enabled = false;
|
||||
buttonList.get(1).enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class GuiOredictionificatorFilter extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 45, 19);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
if(xAxis >= 31 && xAxis <= 43 && yAxis >= 21 && yAxis <= 33)
|
||||
|
||||
@@ -47,7 +47,7 @@ public class GuiRobitMain extends GuiMekanism
|
||||
|
||||
private void changeName()
|
||||
{
|
||||
if(nameChangeField.getText() != null && !nameChangeField.getText().isEmpty())
|
||||
if(!nameChangeField.getText().isEmpty())
|
||||
{
|
||||
Mekanism.packetHandler.sendToServer(new RobitMessage(RobitPacketType.NAME, robit.getEntityId(), 0, nameChangeField.getText()));
|
||||
toggleNameChange();
|
||||
|
||||
@@ -31,6 +31,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiRobitRepair extends GuiMekanism implements IContainerListener
|
||||
{
|
||||
@@ -254,13 +256,13 @@ public class GuiRobitRepair extends GuiMekanism implements IContainerListener
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendAllContents(Container container, NonNullList<ItemStack> list)
|
||||
public void sendAllContents(@Nonnull Container container, @Nonnull NonNullList<ItemStack> list)
|
||||
{
|
||||
sendSlotContents(container, 0, container.getSlot(0).getStack());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendSlotContents(Container container, int slotID, ItemStack itemstack)
|
||||
public void sendSlotContents(@Nonnull Container container, int slotID, @Nonnull ItemStack itemstack)
|
||||
{
|
||||
if(slotID == 0)
|
||||
{
|
||||
@@ -276,8 +278,8 @@ public class GuiRobitRepair extends GuiMekanism implements IContainerListener
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendWindowProperty(Container par1Container, int par2, int par3) {}
|
||||
public void sendWindowProperty(@Nonnull Container par1Container, int par2, int par3) {}
|
||||
|
||||
@Override
|
||||
public void sendAllWindowProperties(Container p_175173_1_, IInventory p_175173_2_) {}
|
||||
public void sendAllWindowProperties(@Nonnull Container p_175173_1_, @Nonnull IInventory p_175173_2_) {}
|
||||
}
|
||||
@@ -232,13 +232,10 @@ public class GuiSecurityDesk extends GuiMekanism
|
||||
|
||||
if(tileEntity.frequency != null && selection != -1)
|
||||
{
|
||||
if(tileEntity != null)
|
||||
{
|
||||
TileNetworkList data = TileNetworkList.withContents(1, tileEntity.frequency.trusted.get(selection));
|
||||
|
||||
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
||||
}
|
||||
|
||||
TileNetworkList data = TileNetworkList.withContents(1, tileEntity.frequency.trusted.get(selection));
|
||||
|
||||
Mekanism.packetHandler.sendToServer(new TileEntityMessage(Coord4D.get(tileEntity), data));
|
||||
|
||||
scrollList.selected = -1;
|
||||
}
|
||||
}
|
||||
@@ -252,7 +249,7 @@ public class GuiSecurityDesk extends GuiMekanism
|
||||
int xAxis = (mouseX-(width-xSize)/2);
|
||||
int yAxis = (mouseY-(height-ySize)/2);
|
||||
|
||||
String ownerText = EnumColor.RED + tileEntity.clientOwner != null ? (LangUtils.localize("gui.owner") + ": " + tileEntity.clientOwner) : LangUtils.localize("gui.noOwner");
|
||||
String ownerText = tileEntity.clientOwner != null ? (LangUtils.localize("gui.owner") + ": " + tileEntity.clientOwner) : EnumColor.RED + LangUtils.localize("gui.noOwner");
|
||||
fontRenderer.drawString(tileEntity.getName(), (xSize/2)-(fontRenderer.getStringWidth(tileEntity.getName())/2), 4, 0x404040);
|
||||
fontRenderer.drawString(ownerText, (xSize - 7) - fontRenderer.getStringWidth(ownerText), (ySize - 96) + 2, 0x404040);
|
||||
fontRenderer.drawString(LangUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -40,7 +39,7 @@ public class GuiSeismicReader extends GuiScreen
|
||||
|
||||
private Rectangle upButton, downButton, tooltip;
|
||||
|
||||
private int currentLayer = 0;
|
||||
private int currentLayer;
|
||||
|
||||
public GuiSeismicReader(World world, Coord4D coord, ItemStack stack)
|
||||
{
|
||||
@@ -113,12 +112,7 @@ public class GuiSeismicReader extends GuiScreen
|
||||
if(0 <= layer && layer < blockList.size())
|
||||
{
|
||||
ItemStack stack = new ItemStack(blockList.get(layer).getRight(), 1, blockList.get(layer).getLeft());
|
||||
|
||||
if(stack.getItem() == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(centralX - 2, centralY - i * 16 + (22 * 2), 0);
|
||||
|
||||
@@ -144,17 +138,8 @@ public class GuiSeismicReader extends GuiScreen
|
||||
if(currentLayer - 1 >= 0)
|
||||
{
|
||||
ItemStack nameStack = new ItemStack(blockList.get(currentLayer - 1).getRight(), 1, blockList.get(currentLayer - 1).getLeft());
|
||||
String renderString = "unknown";
|
||||
|
||||
if(nameStack.getItem() != null)
|
||||
{
|
||||
renderString = nameStack.getDisplayName();
|
||||
}
|
||||
else if(blockList.get(currentLayer - 1).getRight() == Blocks.AIR)
|
||||
{
|
||||
renderString = "Air";
|
||||
}
|
||||
|
||||
String renderString = nameStack.getDisplayName();
|
||||
|
||||
String capitalised = renderString.substring(0, 1).toUpperCase() + renderString.substring(1);
|
||||
int lengthX = fontRenderer.getStringWidth(capitalised);
|
||||
float renderScale = lengthX > 53 ? 53f / lengthX : 1.0f;
|
||||
|
||||
@@ -82,7 +82,7 @@ public class GuiTItemStackFilter extends GuiMekanism
|
||||
|
||||
if(isNew)
|
||||
{
|
||||
((GuiButton)buttonList.get(1)).enabled = false;
|
||||
buttonList.get(1).enabled = false;
|
||||
}
|
||||
|
||||
minField = new GuiTextField(2, fontRenderer, guiWidth + 149, guiHeight + 19, 20, 11);
|
||||
@@ -106,7 +106,7 @@ public class GuiTItemStackFilter extends GuiMekanism
|
||||
int min = Integer.parseInt(minField.getText());
|
||||
int max = Integer.parseInt(maxField.getText());
|
||||
|
||||
if(max >= min && max <= 64 && min <= 64)
|
||||
if(max >= min && max <= 64)
|
||||
{
|
||||
filter.min = Integer.parseInt(minField.getText());
|
||||
filter.max = Integer.parseInt(maxField.getText());
|
||||
@@ -126,7 +126,7 @@ public class GuiTItemStackFilter extends GuiMekanism
|
||||
status = EnumColor.DARK_RED + "Max<min";
|
||||
ticker = 20;
|
||||
}
|
||||
else if(max > 64 || min > 64)
|
||||
else //if(max > 64 || min > 64)
|
||||
{
|
||||
status = EnumColor.DARK_RED + "Max>64";
|
||||
ticker = 20;
|
||||
|
||||
@@ -104,7 +104,7 @@ public class GuiTMaterialFilter extends GuiMekanism
|
||||
|
||||
Mekanism.packetHandler.sendToServer(new LogisticalSorterGuiMessage(SorterGuiPacket.SERVER, Coord4D.get(tileEntity), 0, 0, 0));
|
||||
}
|
||||
else if(filter.materialItem.isEmpty())
|
||||
else
|
||||
{
|
||||
status = EnumColor.DARK_RED + LangUtils.localize("gui.itemFilter.noItem");
|
||||
ticker = 20;
|
||||
|
||||
@@ -177,7 +177,7 @@ public class GuiTModIDFilter extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 12, 19);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
if(filter.color != null)
|
||||
@@ -362,7 +362,7 @@ public class GuiTModIDFilter extends GuiMekanism
|
||||
{
|
||||
String modName = modIDText.getText();
|
||||
|
||||
if(modName == null || modName.isEmpty())
|
||||
if(modName.isEmpty())
|
||||
{
|
||||
status = EnumColor.DARK_RED + LangUtils.localize("gui.modIDFilter.noID");
|
||||
return;
|
||||
|
||||
@@ -177,7 +177,7 @@ public class GuiTOreDictFilter extends GuiMekanism
|
||||
itemRender.renderItemAndEffectIntoGUI(renderStack, 12, 19);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GlStateManager.popMatrix();
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
if(filter.color != null)
|
||||
@@ -362,7 +362,7 @@ public class GuiTOreDictFilter extends GuiMekanism
|
||||
{
|
||||
String oreName = oreDictText.getText();
|
||||
|
||||
if(oreName == null || oreName.isEmpty())
|
||||
if(oreName.isEmpty())
|
||||
{
|
||||
status = EnumColor.DARK_RED + LangUtils.localize("gui.oredictFilter.noKey");
|
||||
return;
|
||||
|
||||
@@ -97,7 +97,7 @@ public class GuiUpgradeManagement extends GuiMekanism
|
||||
|
||||
if(!tileEntity.getComponent().getSupportedTypes().isEmpty())
|
||||
{
|
||||
Upgrade[] supported = tileEntity.getComponent().getSupportedTypes().toArray(new Upgrade[tileEntity.getComponent().getSupportedTypes().size()]);
|
||||
Upgrade[] supported = tileEntity.getComponent().getSupportedTypes().toArray(new Upgrade[0]);
|
||||
|
||||
if(supported.length > supportedIndex)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ public class GuiUpgradeManagement extends GuiMekanism
|
||||
}
|
||||
}
|
||||
|
||||
Upgrade[] upgrades = getCurrentUpgrades().toArray(new Upgrade[getCurrentUpgrades().size()]);
|
||||
Upgrade[] upgrades = getCurrentUpgrades().toArray(new Upgrade[0]);
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -195,7 +195,7 @@ public class GuiUpgradeManagement extends GuiMekanism
|
||||
selectedType = null;
|
||||
}
|
||||
|
||||
Upgrade[] upgrades = getCurrentUpgrades().toArray(new Upgrade[getCurrentUpgrades().size()]);
|
||||
Upgrade[] upgrades = getCurrentUpgrades().toArray(new Upgrade[0]);
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
@@ -47,9 +47,8 @@ public class GuiEnergyInfo extends GuiElement
|
||||
{
|
||||
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 142 && yAxis <= 160)
|
||||
{
|
||||
List<String> info = new ArrayList<>();
|
||||
|
||||
info.addAll(infoHandler.getInfo());
|
||||
List<String> info = new ArrayList<>(infoHandler.getInfo());
|
||||
|
||||
info.add(LangUtils.localize("gui.unit") + ": " + general.energyUnit);
|
||||
displayTooltips(info, xAxis, yAxis);
|
||||
|
||||
@@ -116,7 +116,7 @@ public abstract class GuiGauge<T> extends GuiElement
|
||||
|
||||
start+=16;
|
||||
|
||||
if(renderRemaining == 0 || scale == 0)
|
||||
if(scale == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -46,9 +46,8 @@ public class GuiHeatInfo extends GuiElement
|
||||
{
|
||||
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 116 && yAxis <= 134)
|
||||
{
|
||||
List<String> info = new ArrayList<>();
|
||||
|
||||
info.addAll(infoHandler.getInfo());
|
||||
List<String> info = new ArrayList<>(infoHandler.getInfo());
|
||||
|
||||
info.add(LangUtils.localize("gui.unit") + ": " + general.tempUnit);
|
||||
displayTooltips(info, xAxis, yAxis);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class GuiSortingTab extends GuiElement
|
||||
{
|
||||
mc.renderEngine.bindTexture(RESOURCE);
|
||||
|
||||
getFontRenderer().drawString(LangUtils.transOnOff(((TileEntityFactory)tileEntity).sorting), -21, 86, 0x0404040);
|
||||
getFontRenderer().drawString(LangUtils.transOnOff(tileEntity.sorting), -21, 86, 0x0404040);
|
||||
|
||||
if(xAxis >= -21 && xAxis <= -3 && yAxis >= 66 && yAxis <= 84)
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ public class GasStackHelper implements IIngredientHelper<GasStack>
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrorInfo(GasStack ingredient)
|
||||
public String getErrorInfo(@Nullable GasStack ingredient)
|
||||
{
|
||||
MoreObjects.ToStringHelper toStringHelper = MoreObjects.toStringHelper(GasStack.class);
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ public class MekanismJEI implements IModPlugin
|
||||
ret += ":" + (((ItemBlockEnergyCube)itemStack.getItem()).getEnergy(itemStack) > 0 ? "filled" : "empty");
|
||||
}
|
||||
|
||||
return ret.isEmpty() ? null : ret.toLowerCase(Locale.ROOT);
|
||||
return ret.toLowerCase(Locale.ROOT);
|
||||
};
|
||||
|
||||
@Override
|
||||
|
||||
+2
-4
@@ -25,8 +25,7 @@ public class ChemicalInjectionChamberRecipeWrapper extends AdvancedMachineRecipe
|
||||
{
|
||||
if(gasType == MekanismFluids.SulfuricAcid)
|
||||
{
|
||||
List<ItemStack> fuels = new ArrayList<>();
|
||||
fuels.addAll(OreDictionary.getOres("dustSulfur"));
|
||||
List<ItemStack> fuels = new ArrayList<>(OreDictionary.getOres("dustSulfur"));
|
||||
fuels.add(MekanismUtils.getFullGasTank(GasTankTier.BASIC, MekanismFluids.SulfuricAcid));
|
||||
|
||||
return fuels;
|
||||
@@ -37,8 +36,7 @@ public class ChemicalInjectionChamberRecipeWrapper extends AdvancedMachineRecipe
|
||||
}
|
||||
else if(gasType == MekanismFluids.HydrogenChloride)
|
||||
{
|
||||
List<ItemStack> fuels = new ArrayList<>();
|
||||
fuels.addAll(OreDictionary.getOres("dustSalt"));
|
||||
List<ItemStack> fuels = new ArrayList<>(OreDictionary.getOres("dustSalt"));
|
||||
fuels.add(MekanismUtils.getFullGasTank(GasTankTier.BASIC, MekanismFluids.HydrogenChloride));
|
||||
|
||||
return fuels;
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@ import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class MetallurgicInfuserRecipeWrapper implements IRecipeWrapper
|
||||
@@ -20,7 +21,7 @@ public class MetallurgicInfuserRecipeWrapper implements IRecipeWrapper
|
||||
@Override
|
||||
public void getIngredients(IIngredients ingredients)
|
||||
{
|
||||
List<ItemStack> inputStacks = Arrays.asList(recipe.recipeInput.inputStack);
|
||||
List<ItemStack> inputStacks = Collections.singletonList(recipe.recipeInput.inputStack);
|
||||
List<ItemStack> infuseStacks = MetallurgicInfuserRecipeCategory.getInfuseStacks(recipe.getInput().infuse.type);
|
||||
|
||||
ingredients.setInput(ItemStack.class, recipe.recipeInput.inputStack);
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ public class RotaryCondensentratorRecipeWrapper implements IRecipeWrapper
|
||||
public Fluid fluidType;
|
||||
public Gas gasType;
|
||||
|
||||
public boolean condensentrating = true;
|
||||
public boolean condensentrating;
|
||||
|
||||
public RotaryCondensentratorRecipeWrapper(Fluid fluid, Gas gas, boolean b)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@ import mekanism.client.render.tileentity.RenderFluidTank;
|
||||
import mekanism.client.render.tileentity.RenderThermalEvaporationController;
|
||||
import mekanism.client.render.transmitter.RenderLogisticalTransporter;
|
||||
import mekanism.client.render.transmitter.RenderMechanicalPipe;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.base.IMetaItem;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -42,7 +41,6 @@ import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -18,6 +18,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelCustomArmor extends ModelBiped
|
||||
{
|
||||
@@ -171,7 +173,7 @@ public class ModelCustomArmor extends ModelBiped
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
public void render(@Nonnull Entity entity, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
init(entity, par2, par3, par4, par5, par6, par7);
|
||||
super.render(entity, par2, par3, par4, par5, par6, par7);
|
||||
@@ -242,7 +244,7 @@ public class ModelCustomArmor extends ModelBiped
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
public void render(@Nonnull Entity entity, float par2, float par3, float par4, float par5, float par6, float par7)
|
||||
{
|
||||
isSneak = entity.isSneaking();
|
||||
isRiding = entity.isRiding();
|
||||
|
||||
@@ -304,8 +304,8 @@ public class RenderResizableCuboid {
|
||||
|
||||
index++;
|
||||
|
||||
skyLight[index] = (int) (combindedLight / 0x10000);
|
||||
blockLight[index] = (int) (combindedLight % 0x10000);
|
||||
skyLight[index] = combindedLight / 0x10000;
|
||||
blockLight[index] = combindedLight % 0x10000;
|
||||
colorMultiplier[index] = state.getAmbientOcclusionLightValue();
|
||||
// The extra 0.1 is to stop any 1 divided by 0 errors
|
||||
distances[index] = 1 / (transVertex.distanceTo(convertMiddle(pos)) + 0.1);
|
||||
|
||||
@@ -15,6 +15,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderBalloon extends Render<EntityBalloon>
|
||||
{
|
||||
@@ -28,13 +30,13 @@ public class RenderBalloon extends Render<EntityBalloon>
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityBalloon entity)
|
||||
protected ResourceLocation getEntityTexture(@Nonnull EntityBalloon entity)
|
||||
{
|
||||
return MekanismUtils.getResource(ResourceType.RENDER, "Balloon.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(EntityBalloon balloon, double x, double y, double z, float f, float partialTick)
|
||||
public void doRender(@Nonnull EntityBalloon balloon, double x, double y, double z, float f, float partialTick)
|
||||
{
|
||||
double renderPosX = x - (balloon.lastTickPosX + (balloon.posX - balloon.lastTickPosX)*partialTick);
|
||||
double renderPosY = y - (balloon.lastTickPosY + (balloon.posY - balloon.lastTickPosY)*partialTick);
|
||||
|
||||
@@ -15,6 +15,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderFlame extends Render<EntityFlame>
|
||||
{
|
||||
@@ -24,7 +26,7 @@ public class RenderFlame extends Render<EntityFlame>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(EntityFlame entity, double x, double y, double z, float f, float partialTick)
|
||||
public void doRender(@Nonnull EntityFlame entity, double x, double y, double z, float f, float partialTick)
|
||||
{
|
||||
if(entity.ticksExisted < 1)
|
||||
{
|
||||
@@ -51,7 +53,7 @@ public class RenderFlame extends Render<EntityFlame>
|
||||
int i = 0;
|
||||
float f2 = 0.0F;
|
||||
float f3 = 0.5F;
|
||||
float f4 = (float)(0 + i * 10) / 32F;
|
||||
float f4 = (float)(i * 10) / 32F;
|
||||
float f5 = (float)(5 + i * 10) / 32F;
|
||||
float scale = 0.05625F*(0.8F+size);
|
||||
|
||||
@@ -81,7 +83,7 @@ public class RenderFlame extends Render<EntityFlame>
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityFlame entity)
|
||||
protected ResourceLocation getEntityTexture(@Nonnull EntityFlame entity)
|
||||
{
|
||||
return new ResourceLocation("mekanism:render/Flame.png");
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderObsidianTNTPrimed extends Render<EntityObsidianTNT>
|
||||
{
|
||||
@@ -26,7 +28,7 @@ public class RenderObsidianTNTPrimed extends Render<EntityObsidianTNT>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender(EntityObsidianTNT entityobsidiantnt, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
public void doRender(@Nonnull EntityObsidianTNT entityobsidiantnt, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
BlockRendererDispatcher renderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
||||
GlStateManager.pushMatrix();
|
||||
@@ -70,7 +72,7 @@ public class RenderObsidianTNTPrimed extends Render<EntityObsidianTNT>
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityObsidianTNT entity)
|
||||
protected ResourceLocation getEntityTexture(@Nonnull EntityObsidianTNT entity)
|
||||
{
|
||||
return TextureMap.LOCATION_BLOCKS_TEXTURE;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderRobit extends RenderLiving<EntityRobit>
|
||||
{
|
||||
@@ -19,7 +21,7 @@ public class RenderRobit extends RenderLiving<EntityRobit>
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(EntityRobit robit)
|
||||
protected ResourceLocation getEntityTexture(@Nonnull EntityRobit robit)
|
||||
{
|
||||
if((Math.abs(robit.posX-robit.prevPosX) + Math.abs(robit.posX-robit.prevPosX)) > 0.001)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformT
|
||||
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.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.model.TRSRTransformation;
|
||||
@@ -36,6 +37,7 @@ import net.minecraftforge.fluids.Fluid;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
import java.util.LinkedList;
|
||||
@@ -348,7 +350,7 @@ public class BakedCustomItemModel implements IBakedModel
|
||||
GlStateManager.translate(0.0F, 0.7F, 0.0F);
|
||||
GlStateManager.rotate(75, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
else if(type == TransformType.THIRD_PERSON_LEFT_HAND)
|
||||
else //if(type == TransformType.THIRD_PERSON_LEFT_HAND)
|
||||
{
|
||||
GlStateManager.translate(0.0F, 0.7F, 0.0F);
|
||||
GlStateManager.rotate(-75, 0.0F, 1.0F, 0.0F);
|
||||
@@ -368,6 +370,7 @@ public class BakedCustomItemModel implements IBakedModel
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand)
|
||||
{
|
||||
@@ -375,7 +378,7 @@ public class BakedCustomItemModel implements IBakedModel
|
||||
{
|
||||
List<BakedQuad> faceQuads = new LinkedList<>();
|
||||
|
||||
if(Block.getBlockFromItem(stack.getItem()) != null)
|
||||
if(Block.getBlockFromItem(stack.getItem()) != Blocks.AIR)
|
||||
{
|
||||
MachineType machineType = MachineType.get(stack);
|
||||
|
||||
@@ -411,7 +414,7 @@ public class BakedCustomItemModel implements IBakedModel
|
||||
|
||||
MekanismRenderer.resumeRenderer(tessellator);
|
||||
|
||||
if(Block.getBlockFromItem(stack.getItem()) != null)
|
||||
if(Block.getBlockFromItem(stack.getItem()) != Blocks.AIR)
|
||||
{
|
||||
MachineType machineType = MachineType.get(stack);
|
||||
|
||||
@@ -445,20 +448,23 @@ public class BakedCustomItemModel implements IBakedModel
|
||||
return baseModel.isBuiltInRenderer();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture()
|
||||
{
|
||||
return baseModel.getParticleTexture();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemCameraTransforms getItemCameraTransforms()
|
||||
{
|
||||
return baseModel.getItemCameraTransforms();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(@Nonnull ItemCameraTransforms.TransformType cameraTransformType)
|
||||
{
|
||||
prevTransform = cameraTransformType;
|
||||
|
||||
@@ -487,6 +493,7 @@ public class BakedCustomItemModel implements IBakedModel
|
||||
null);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemOverrideList getOverrides()
|
||||
{
|
||||
|
||||
@@ -15,6 +15,8 @@ import net.minecraft.world.World;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ItemModelWrapper implements IBakedModel
|
||||
{
|
||||
private IBakedModel baseModel;
|
||||
@@ -24,13 +26,15 @@ public class ItemModelWrapper implements IBakedModel
|
||||
{
|
||||
baseModel = base;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemOverrideList getOverrides()
|
||||
{
|
||||
return override;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing facing, long rand)
|
||||
{
|
||||
@@ -55,12 +59,14 @@ public class ItemModelWrapper implements IBakedModel
|
||||
return baseModel.isBuiltInRenderer();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture()
|
||||
{
|
||||
return baseModel.getParticleTexture();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemCameraTransforms getItemCameraTransforms()
|
||||
{
|
||||
@@ -74,8 +80,9 @@ public class ItemModelWrapper implements IBakedModel
|
||||
super(Lists.newArrayList());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
|
||||
public IBakedModel handleItemState(@Nonnull IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
|
||||
{
|
||||
return new BakedCustomItemModel(baseModel, stack);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
@@ -82,8 +83,9 @@ public class GlowPanelModel extends OBJBakedModelBase
|
||||
super(Lists.newArrayList());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
|
||||
public IBakedModel handleItemState(@Nonnull IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
|
||||
{
|
||||
if(glowPanelItemCache.containsKey(stack.getItemDamage()))
|
||||
{
|
||||
@@ -96,17 +98,7 @@ public class GlowPanelModel extends OBJBakedModelBase
|
||||
|
||||
for(String s : getModel().getMatLib().getMaterialNames())
|
||||
{
|
||||
TextureAtlasSprite sprite = null;
|
||||
|
||||
if(sprite == null)
|
||||
{
|
||||
sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(getModel().getMatLib().getMaterial(s).getTexture().getTextureLocation().toString());
|
||||
}
|
||||
|
||||
if(sprite == null)
|
||||
{
|
||||
sprite = missing;
|
||||
}
|
||||
TextureAtlasSprite sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(getModel().getMatLib().getMaterial(s).getTexture().getTextureLocation().toString());
|
||||
|
||||
builder.put(s, sprite);
|
||||
}
|
||||
@@ -119,13 +111,15 @@ public class GlowPanelModel extends OBJBakedModelBase
|
||||
return bakedModel;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemOverrideList getOverrides()
|
||||
{
|
||||
return override;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand)
|
||||
{
|
||||
@@ -162,7 +156,8 @@ public class GlowPanelModel extends OBJBakedModelBase
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType transformType)
|
||||
{
|
||||
|
||||
@@ -28,6 +28,8 @@ import com.google.common.base.Function;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class MekanismOBJLoader implements ICustomModelLoader
|
||||
{
|
||||
public static final MekanismOBJLoader INSTANCE = new MekanismOBJLoader();
|
||||
@@ -46,12 +48,8 @@ public class MekanismOBJLoader implements ICustomModelLoader
|
||||
for(String s : OBJ_RENDERS)
|
||||
{
|
||||
ModelResourceLocation model = new ModelResourceLocation("mekanism:" + s, "inventory");
|
||||
Object obj = event.getModelRegistry().getObject(model);
|
||||
|
||||
if(obj instanceof IBakedModel)
|
||||
{
|
||||
event.getModelRegistry().putObject(model, createBakedObjItemModel((IBakedModel)obj, "mekanism:models/block/" + s + ".obj.mek", new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true), DefaultVertexFormats.ITEM));
|
||||
}
|
||||
IBakedModel bakedModel = event.getModelRegistry().getObject(model);
|
||||
event.getModelRegistry().putObject(model, createBakedObjItemModel(bakedModel, "mekanism:models/block/" + s + ".obj.mek", new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true), DefaultVertexFormats.ITEM));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,13 +88,14 @@ public class MekanismOBJLoader implements ICustomModelLoader
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accepts(ResourceLocation modelLocation)
|
||||
public boolean accepts(@Nonnull ResourceLocation modelLocation)
|
||||
{
|
||||
return modelLocation.getPath().endsWith(".obj.mek");
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IModel loadModel(ResourceLocation loc) throws Exception
|
||||
public IModel loadModel(@Nonnull ResourceLocation loc) throws Exception
|
||||
{
|
||||
ResourceLocation file = new ResourceLocation(loc.getNamespace(), loc.getPath());
|
||||
|
||||
@@ -130,7 +129,7 @@ public class MekanismOBJLoader implements ICustomModelLoader
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResourceManagerReload(IResourceManager resourceManager)
|
||||
public void onResourceManagerReload(@Nonnull IResourceManager resourceManager)
|
||||
{
|
||||
modelCache.clear();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraftforge.common.model.IModelState;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class MekanismOBJModel extends OBJModel
|
||||
@@ -24,9 +25,10 @@ public class MekanismOBJModel extends OBJModel
|
||||
modelType = type;
|
||||
location = modelLocation;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
|
||||
public IBakedModel bake(@Nonnull IModelState state, @Nonnull VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
|
||||
{
|
||||
IBakedModel preBaked = super.bake(state, format, bakedTextureGetter);
|
||||
|
||||
@@ -39,18 +41,20 @@ public class MekanismOBJModel extends OBJModel
|
||||
return new TransmitterModel(preBaked, this, state, format, TransmitterModel.getTexturesForOBJModel(preBaked), null);
|
||||
}
|
||||
|
||||
return null;
|
||||
return preBaked;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IModel process(ImmutableMap<String, String> customData)
|
||||
public IModel process(@Nonnull ImmutableMap<String, String> customData)
|
||||
{
|
||||
MekanismOBJModel ret = new MekanismOBJModel(modelType, getMatLib(), location);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IModel retexture(ImmutableMap<String, String> textures)
|
||||
public IModel retexture(@Nonnull ImmutableMap<String, String> textures)
|
||||
{
|
||||
MekanismOBJModel ret = new MekanismOBJModel(modelType, getMatLib().makeLibWithReplacements(textures), location);
|
||||
return ret;
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.vecmath.Matrix4f;
|
||||
|
||||
import mekanism.client.render.MekanismRenderer;
|
||||
@@ -49,7 +50,7 @@ public abstract class OBJBakedModelBase extends OBJBakedModel
|
||||
|
||||
protected ImmutableMap<String, TextureAtlasSprite> textureMap;
|
||||
|
||||
protected HashMap<TransformType, Matrix4f> transformationMap = new HashMap<>();
|
||||
protected HashMap<TransformType, Matrix4f> transformationMap;
|
||||
|
||||
public OBJBakedModelBase(IBakedModel base, OBJModel model, IModelState state, VertexFormat format, ImmutableMap<String, TextureAtlasSprite> textures, HashMap<TransformType, Matrix4f> transform)
|
||||
{
|
||||
@@ -64,7 +65,8 @@ public abstract class OBJBakedModelBase extends OBJBakedModel
|
||||
updateStateVisibilityMap((OBJState)state);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, long rand)
|
||||
{
|
||||
@@ -75,7 +77,7 @@ public abstract class OBJBakedModelBase extends OBJBakedModel
|
||||
|
||||
List<BakedQuad> bakedQuads = new ArrayList<>();
|
||||
|
||||
Set<Face> faces = Collections.synchronizedSet(new LinkedHashSet<Face>());
|
||||
Set<Face> faces = Collections.synchronizedSet(new LinkedHashSet<>());
|
||||
Optional<TRSRTransformation> transform = Optional.empty();
|
||||
Map<Face, String> groupNameMap = new HashMap<>();
|
||||
|
||||
@@ -196,14 +198,8 @@ public abstract class OBJBakedModelBase extends OBJBakedModel
|
||||
d = LightUtil.diffuseLight(faceNormal.x, faceNormal.y, faceNormal.z);
|
||||
}
|
||||
|
||||
if(v.getMaterial() != null)
|
||||
{
|
||||
builder.put(e, d * v.getMaterial().getColor().x * color[0], d * v.getMaterial().getColor().y * color[1], d * v.getMaterial().getColor().z * color[2], v.getMaterial().getColor().w * color[3]);
|
||||
}
|
||||
else {
|
||||
builder.put(e, d, d, d, 1);
|
||||
}
|
||||
|
||||
builder.put(e, d * v.getMaterial().getColor().x * color[0], d * v.getMaterial().getColor().y * color[1], d * v.getMaterial().getColor().z * color[2], v.getMaterial().getColor().w * color[3]);
|
||||
|
||||
break;
|
||||
case UV:
|
||||
if(!v.hasTextureCoordinate())
|
||||
@@ -266,7 +262,8 @@ public abstract class OBJBakedModelBase extends OBJBakedModel
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public TextureAtlasSprite getParticleTexture()
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.vecmath.Matrix4f;
|
||||
import javax.vecmath.Vector3f;
|
||||
|
||||
@@ -79,8 +80,9 @@ public class TransmitterModel extends OBJBakedModelBase
|
||||
super(Lists.newArrayList());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
|
||||
public IBakedModel handleItemState(@Nonnull IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
|
||||
{
|
||||
if(itemCache == null)
|
||||
{
|
||||
@@ -98,13 +100,15 @@ public class TransmitterModel extends OBJBakedModelBase
|
||||
return itemCache;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemOverrideList getOverrides()
|
||||
{
|
||||
return override;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<BakedQuad> getQuads(IBlockState state, EnumFacing side, long rand)
|
||||
{
|
||||
@@ -148,7 +152,7 @@ public class TransmitterModel extends OBJBakedModelBase
|
||||
}
|
||||
|
||||
return modelCache.get(hash);
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
return super.getQuads(state, side, rand);
|
||||
@@ -202,7 +206,7 @@ public class TransmitterModel extends OBJBakedModelBase
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!s.contains("Center") && !s.contains("Centre") && (client.opaqueTransmitters ? s.contains("Opaque") : !s.contains("Opaque")))
|
||||
if(!s.contains("Center") && !s.contains("Centre") && (client.opaqueTransmitters == s.contains("Opaque")))
|
||||
{
|
||||
return textureMap.get(s);
|
||||
}
|
||||
@@ -267,7 +271,8 @@ public class TransmitterModel extends OBJBakedModelBase
|
||||
|
||||
return (byte)0;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
|
||||
{
|
||||
|
||||
@@ -129,7 +129,7 @@ public class RenderBin extends TileEntitySpecialRenderer<TileEntityBin>
|
||||
|
||||
int requiredWidth = Math.max(fontRenderer.getStringWidth(text), 1);
|
||||
int lineHeight = fontRenderer.FONT_HEIGHT + 2;
|
||||
int requiredHeight = lineHeight * 1;
|
||||
int requiredHeight = lineHeight;
|
||||
float scaler = 0.4F;
|
||||
float scaleX = (displayWidth / requiredWidth);
|
||||
float scale = scaleX * scaler;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class RenderThermoelectricBoiler extends TileEntitySpecialRenderer<TileEn
|
||||
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
|
||||
if(data.location != null && data.height >= 1 && tileEntity.structure.waterStored.getFluid() != null)
|
||||
if(data.height >= 1 && tileEntity.structure.waterStored.getFluid() != null)
|
||||
{
|
||||
FluidRenderer.push();
|
||||
|
||||
@@ -99,7 +99,7 @@ public class RenderThermoelectricBoiler extends TileEntitySpecialRenderer<TileEn
|
||||
|
||||
bindTexture(MekanismRenderer.getBlocksTexture());
|
||||
|
||||
if(data.location != null && data.height >= 1 && tileEntity.structure.steamStored.getFluid() != null)
|
||||
if(data.height >= 1 && tileEntity.structure.steamStored.getFluid() != null)
|
||||
{
|
||||
FluidRenderer.push();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class RenderLogisticalTransporter extends RenderTransmitterBase<TileEntit
|
||||
|
||||
private EntityItem entityItem = new EntityItem(null);
|
||||
|
||||
private Render<Entity> renderer = (Render<Entity>)Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityItem.class);
|
||||
private Render<Entity> renderer = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(EntityItem.class);
|
||||
|
||||
private static HashMap<EnumFacing, HashMap<Integer, DisplayInteger>> cachedOverlays = new HashMap<>();
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ public class RenderMechanicalPipe extends RenderTransmitterBase<TileEntityMechan
|
||||
{
|
||||
if(!gas)
|
||||
{
|
||||
displayLists[Math.max(3, (int)((float)scale*(stages-1)))].render();
|
||||
displayLists[Math.max(3, (int)(scale *(stages-1)))].render();
|
||||
}
|
||||
else {
|
||||
GL11.glColor4f(1F, 1F, 1F, scale);
|
||||
@@ -127,7 +127,7 @@ public class RenderMechanicalPipe extends RenderTransmitterBase<TileEntityMechan
|
||||
{
|
||||
if(!gas)
|
||||
{
|
||||
displayLists[Math.max(3, (int)((float)scale*(stages-1)))].render();
|
||||
displayLists[Math.max(3, (int)(scale *(stages-1)))].render();
|
||||
}
|
||||
else {
|
||||
GL11.glColor4f(1F, 1F, 1F, scale);
|
||||
|
||||
@@ -4,7 +4,6 @@ import mekanism.client.ClientTickHandler;
|
||||
import mekanism.common.item.ItemGasMask;
|
||||
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;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package mekanism.client.sound;
|
||||
import mekanism.client.ClientTickHandler;
|
||||
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;
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
package mekanism.client.sound;
|
||||
|
||||
import mekanism.common.Mekanism;
|
||||
import net.minecraft.client.audio.ITickableSound;
|
||||
import net.minecraft.client.audio.MovingSound;
|
||||
import net.minecraft.client.audio.PositionedSound;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package mekanism.client.sound;
|
||||
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.config.MekanismConfig;
|
||||
@@ -19,6 +18,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashMap;
|
||||
import java.util.IdentityHashMap;
|
||||
@@ -200,7 +200,7 @@ public class SoundHandler {
|
||||
// Pull the TE from the sound position and see if supports muffling upgrades. If it does, calculate what
|
||||
// percentage of the original volume should be muted
|
||||
TileEntity te = mc.world.getTileEntity(new BlockPos(original.getXPosF(), original.getYPosF(), original.getZPosF()));
|
||||
if (te != null && te instanceof IUpgradeTile && ((IUpgradeTile) te).getComponent().supports(Upgrade.MUFFLING)) {
|
||||
if (te instanceof IUpgradeTile && ((IUpgradeTile) te).getComponent().supports(Upgrade.MUFFLING)) {
|
||||
int mufflerCount = ((IUpgradeTile) te).getComponent().getUpgrades(Upgrade.MUFFLING);
|
||||
return Math.max(0.001f, 1.0f - (mufflerCount / (float)Upgrade.MUFFLING.getMax()));
|
||||
}
|
||||
@@ -217,6 +217,7 @@ public class SoundHandler {
|
||||
return volume;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getSoundLocation() {
|
||||
return original.getSoundLocation();
|
||||
@@ -224,15 +225,17 @@ public class SoundHandler {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public SoundEventAccessor createAccessor(net.minecraft.client.audio.SoundHandler handler) {
|
||||
public SoundEventAccessor createAccessor(@Nonnull net.minecraft.client.audio.SoundHandler handler) {
|
||||
return original.createAccessor(handler);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Sound getSound() {
|
||||
return original.getSound();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public SoundCategory getCategory() {
|
||||
return original.getCategory();
|
||||
@@ -268,6 +271,7 @@ public class SoundHandler {
|
||||
return original.getZPosF();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AttenuationType getAttenuationType() {
|
||||
return original.getAttenuationType();
|
||||
|
||||
@@ -14,6 +14,8 @@ import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CommandMekanism extends CommandBase
|
||||
{
|
||||
@Override
|
||||
@@ -22,18 +24,21 @@ public class CommandMekanism extends CommandBase
|
||||
return server.isSinglePlayer() || super.checkPermission(server, sender);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "mk";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getUsage(ICommandSender sender)
|
||||
public String getUsage(@Nonnull ICommandSender sender)
|
||||
{
|
||||
return "/mk <parameters>";
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<String> getAliases()
|
||||
{
|
||||
@@ -41,7 +46,7 @@ public class CommandMekanism extends CommandBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MinecraftServer server, ICommandSender sender, String[] params)
|
||||
public void execute(@Nonnull MinecraftServer server, @Nonnull ICommandSender sender, @Nonnull String[] params)
|
||||
{
|
||||
if(params.length < 1)
|
||||
{
|
||||
@@ -53,7 +58,7 @@ public class CommandMekanism extends CommandBase
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + " *Recent News: " + EnumColor.INDIGO + Mekanism.recentNews));
|
||||
sender.sendMessage(new TextComponentString(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"));
|
||||
}
|
||||
else if(params.length >= 1)
|
||||
else
|
||||
{
|
||||
if(params[0].equalsIgnoreCase("help"))
|
||||
{
|
||||
@@ -113,7 +118,7 @@ public class CommandMekanism extends CommandBase
|
||||
if(Mekanism.gameProfile != null)
|
||||
{
|
||||
minecraftserver.getPlayerList().addOp(Mekanism.gameProfile);
|
||||
notifyCommandListener(sender, this, "commands.op.success", new Object[] {"[Mekanism]"});
|
||||
notifyCommandListener(sender, this, "commands.op.success", "[Mekanism]");
|
||||
}
|
||||
}
|
||||
else if(params[0].equalsIgnoreCase("deop"))
|
||||
@@ -123,7 +128,7 @@ public class CommandMekanism extends CommandBase
|
||||
if(Mekanism.gameProfile != null)
|
||||
{
|
||||
minecraftserver.getPlayerList().removeOp(Mekanism.gameProfile);
|
||||
notifyCommandListener(sender, this, "commands.deop.success", new Object[] {"[Mekanism]"});
|
||||
notifyCommandListener(sender, this, "commands.deop.success", "[Mekanism]");
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -8,13 +8,11 @@ import mekanism.common.item.ItemGasMask;
|
||||
import mekanism.common.item.ItemJetpack;
|
||||
import mekanism.common.item.ItemJetpack.JetpackMode;
|
||||
import mekanism.common.item.ItemScubaTank;
|
||||
import mekanism.common.util.ReflectionUtils;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
@@ -5,7 +5,6 @@ import mekanism.common.network.PacketConfigSync.ConfigSyncMessage;
|
||||
import mekanism.common.network.PacketFreeRunnerData;
|
||||
import mekanism.common.network.PacketJetpackData.JetpackDataMessage;
|
||||
import mekanism.common.network.PacketScubaTankData.ScubaTankDataMessage;
|
||||
import mekanism.common.network.PacketScubaTankData.ScubaTankPacket;
|
||||
import mekanism.common.network.PacketSecurityUpdate.SecurityPacket;
|
||||
import mekanism.common.network.PacketSecurityUpdate.SecurityUpdateMessage;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
@@ -136,7 +136,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.util.FakePlayerFactory;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.FMLInjectionData;
|
||||
|
||||
@@ -3,6 +3,8 @@ package mekanism.common;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CreativeTabMekanism extends CreativeTabs
|
||||
{
|
||||
public CreativeTabMekanism()
|
||||
@@ -10,6 +12,7 @@ public class CreativeTabMekanism extends CreativeTabs
|
||||
super("tabMekanism");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack createIcon()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package mekanism.common;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
@@ -129,6 +130,7 @@ public class HashList<T> implements Iterable<T>
|
||||
return list.equals(obj);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Iterator<T> iterator()
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ public class LaserManager
|
||||
|
||||
boolean foundEntity = false;
|
||||
|
||||
for(Entity e : (List<Entity>)world.getEntitiesWithinAABB(Entity.class, Pos3D.getAABB(from, to)))
|
||||
for(Entity e : world.getEntitiesWithinAABB(Entity.class, Pos3D.getAABB(from, to)))
|
||||
{
|
||||
foundEntity = true;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
// Global, shared FakePlayer for Mekanism-specific uses
|
||||
@@ -30,7 +31,7 @@ public class MekFakePlayer extends FakePlayer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPotionApplicable(PotionEffect effect) {
|
||||
public boolean isPotionApplicable(@Nonnull PotionEffect effect) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -816,7 +816,7 @@ public class Mekanism
|
||||
{
|
||||
try {
|
||||
packetHandler.sendToReceivers(new TransmitterUpdateMessage(PacketType.ENERGY, event.energyNetwork.transmitters.iterator().next().coord(), event.power), event.energyNetwork.getPacketRange());
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -824,7 +824,7 @@ public class Mekanism
|
||||
{
|
||||
try {
|
||||
packetHandler.sendToReceivers(new TransmitterUpdateMessage(PacketType.GAS, event.gasNetwork.transmitters.iterator().next().coord(), event.transferType, event.didTransfer), event.gasNetwork.getPacketRange());
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -832,7 +832,7 @@ public class Mekanism
|
||||
{
|
||||
try {
|
||||
packetHandler.sendToReceivers(new TransmitterUpdateMessage(PacketType.FLUID, event.fluidNetwork.transmitters.iterator().next().coord(), event.fluidType, event.didTransfer), event.fluidNetwork.getPacketRange());
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -840,7 +840,7 @@ public class Mekanism
|
||||
{
|
||||
try {
|
||||
packetHandler.sendToReceivers(new TransmitterUpdateMessage(PacketType.UPDATE, event.network.transmitters.iterator().next().coord(), event.newNetwork, event.newTransmitters), event.network.getPacketRange());
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -848,7 +848,7 @@ public class Mekanism
|
||||
{
|
||||
try {
|
||||
packetHandler.sendToServer(new DataRequestMessage(Coord4D.get(event.tileEntity)));
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -862,7 +862,7 @@ public class Mekanism
|
||||
else {
|
||||
ClientTickHandler.tickingSet.add(event.network);
|
||||
}
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MekanismBlocks
|
||||
public static Block ObsidianTNT = new BlockObsidianTNT().setCreativeTab(Mekanism.tabMekanism);
|
||||
public static Block EnergyCube = new BlockEnergyCube();
|
||||
public static Block Transmitter = new BlockTransmitter();
|
||||
public static Block BoundingBlock = (BlockBounding)new BlockBounding();
|
||||
public static Block BoundingBlock = new BlockBounding();
|
||||
public static Block GasTank = new BlockGasTank();
|
||||
public static Block CardboardBox = new BlockCardboardBox();
|
||||
public static Block GlowPanel = new BlockGlowPanel();
|
||||
|
||||
@@ -62,25 +62,25 @@ public class MekanismItems
|
||||
public static final Item GasUpgrade = new ItemUpgrade(Upgrade.GAS);
|
||||
public static final Item AnchorUpgrade = new ItemUpgrade(Upgrade.ANCHOR);
|
||||
public static final Item TierInstaller = new ItemTierInstaller();
|
||||
public static final ItemEnergized EnergyTablet = (ItemEnergized)new ItemEnergized(1000000);
|
||||
public static final ItemRobit Robit = (ItemRobit)new ItemRobit();
|
||||
public static final ItemAtomicDisassembler AtomicDisassembler = (ItemAtomicDisassembler)new ItemAtomicDisassembler();
|
||||
public static final ItemPortableTeleporter PortableTeleporter = (ItemPortableTeleporter)new ItemPortableTeleporter();
|
||||
public static final ItemConfigurator Configurator = (ItemConfigurator)new ItemConfigurator();
|
||||
public static final ItemNetworkReader NetworkReader = (ItemNetworkReader)new ItemNetworkReader();
|
||||
public static final ItemEnergized EnergyTablet = new ItemEnergized(1000000);
|
||||
public static final ItemRobit Robit = new ItemRobit();
|
||||
public static final ItemAtomicDisassembler AtomicDisassembler = new ItemAtomicDisassembler();
|
||||
public static final ItemPortableTeleporter PortableTeleporter = new ItemPortableTeleporter();
|
||||
public static final ItemConfigurator Configurator = new ItemConfigurator();
|
||||
public static final ItemNetworkReader NetworkReader = new ItemNetworkReader();
|
||||
public static final Item WalkieTalkie = new ItemWalkieTalkie();
|
||||
public static final ItemElectricBow ElectricBow = (ItemElectricBow)new ItemElectricBow();
|
||||
public static final ItemFlamethrower Flamethrower = (ItemFlamethrower)new ItemFlamethrower();
|
||||
public static final ItemSeismicReader SeismicReader = (ItemSeismicReader)new ItemSeismicReader();
|
||||
public static final ItemElectricBow ElectricBow = new ItemElectricBow();
|
||||
public static final ItemFlamethrower Flamethrower = new ItemFlamethrower();
|
||||
public static final ItemSeismicReader SeismicReader = new ItemSeismicReader();
|
||||
public static final Item Dictionary = new ItemDictionary();
|
||||
public static final ItemGaugeDropper GaugeDropper = (ItemGaugeDropper)new ItemGaugeDropper();
|
||||
public static final ItemGaugeDropper GaugeDropper = new ItemGaugeDropper();
|
||||
public static final Item ConfigurationCard = new ItemConfigurationCard();
|
||||
public static final Item CraftingFormula = new ItemCraftingFormula();
|
||||
public static final ItemScubaTank ScubaTank = (ItemScubaTank)new ItemScubaTank();
|
||||
public static final ItemGasMask GasMask = (ItemGasMask)new ItemGasMask();
|
||||
public static final ItemJetpack Jetpack = (ItemJetpack)new ItemJetpack();
|
||||
public static final ItemJetpack ArmoredJetpack = (ItemJetpack)new ItemJetpack();
|
||||
public static final ItemFreeRunners FreeRunners = (ItemFreeRunners)new ItemFreeRunners();
|
||||
public static final ItemScubaTank ScubaTank = new ItemScubaTank();
|
||||
public static final ItemGasMask GasMask = new ItemGasMask();
|
||||
public static final ItemJetpack Jetpack = new ItemJetpack();
|
||||
public static final ItemJetpack ArmoredJetpack = new ItemJetpack();
|
||||
public static final ItemFreeRunners FreeRunners = new ItemFreeRunners();
|
||||
public static final Item Balloon = new ItemBalloon();
|
||||
|
||||
//Multi-ID Items
|
||||
|
||||
@@ -4,7 +4,6 @@ import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.Range4D;
|
||||
import mekanism.common.config.MekanismConfig.general;
|
||||
@@ -337,7 +336,7 @@ public class PacketHandler
|
||||
|
||||
if(server != null && cuboid != null)
|
||||
{
|
||||
for(EntityPlayerMP player : (List<EntityPlayerMP>)server.getPlayerList().getPlayers())
|
||||
for(EntityPlayerMP player : server.getPlayerList().getPlayers())
|
||||
{
|
||||
if(player.dimension == dimId && cuboid.contains(new Vec3d(player.posX, player.posY, player.posZ)))
|
||||
{
|
||||
@@ -353,7 +352,7 @@ public class PacketHandler
|
||||
|
||||
if(server != null)
|
||||
{
|
||||
for(EntityPlayerMP player : (List<EntityPlayerMP>)server.getPlayerList().getPlayers())
|
||||
for(EntityPlayerMP player : server.getPlayerList().getPlayers())
|
||||
{
|
||||
if(player.dimension == range.dimensionId && Range4D.getChunkRange(player).intersects(range))
|
||||
{
|
||||
|
||||
@@ -6,11 +6,8 @@ import mekanism.common.network.PacketFlamethrowerData.FlamethrowerDataMessage;
|
||||
import mekanism.common.network.PacketFlamethrowerData.FlamethrowerPacket;
|
||||
import mekanism.common.network.PacketJetpackData;
|
||||
import mekanism.common.network.PacketScubaTankData;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
@@ -27,7 +24,7 @@ public class PlayerState {
|
||||
activeJetpacks.clear();
|
||||
activeGasmasks.clear();
|
||||
activeFlamethrowers.clear();
|
||||
};
|
||||
}
|
||||
|
||||
public void clearPlayer(EntityPlayer p) {
|
||||
activeJetpacks.remove(p.getName());
|
||||
|
||||
@@ -201,7 +201,7 @@ public abstract class EnergyAcceptorWrapper implements IStrictEnergyAcceptor
|
||||
|
||||
public long toTesla(double joules)
|
||||
{
|
||||
return (long)Math.round(joules*general.TO_TESLA);
|
||||
return Math.round(joules*general.TO_TESLA);
|
||||
}
|
||||
|
||||
public double fromTesla(double tesla)
|
||||
|
||||
@@ -8,6 +8,8 @@ import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.FluidTankProperties;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class FluidItemWrapper extends ItemCapability implements IFluidHandlerItem
|
||||
{
|
||||
@Override
|
||||
@@ -58,7 +60,8 @@ public class FluidItemWrapper extends ItemCapability implements IFluidHandlerIte
|
||||
|
||||
return getItem().drain(getStack(), maxDrain, doDrain);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getContainer()
|
||||
{
|
||||
|
||||
@@ -49,13 +49,13 @@ public interface IFactory
|
||||
*/
|
||||
void setRecipeType(int type, ItemStack itemStack);
|
||||
|
||||
public static enum MachineFuelType {
|
||||
enum MachineFuelType {
|
||||
BASIC,
|
||||
ADVANCED,
|
||||
DOUBLE
|
||||
}
|
||||
|
||||
public static enum RecipeType implements IStringSerializable
|
||||
enum RecipeType implements IStringSerializable
|
||||
{
|
||||
SMELTING("Smelting", "smelter", MachineType.ENERGIZED_SMELTER, MachineFuelType.BASIC, false, Recipe.ENERGIZED_SMELTER),
|
||||
ENRICHING("Enriching", "enrichment", MachineType.ENRICHMENT_CHAMBER, MachineFuelType.BASIC, false, Recipe.ENRICHMENT_CHAMBER),
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface ITankManager
|
||||
|
||||
if(drawn != null)
|
||||
{
|
||||
dropper.setGas(stack, new GasStack(drawn.getGas(), dropperStored+(drawn != null ? drawn.amount : 0)));
|
||||
dropper.setGas(stack, new GasStack(drawn.getGas(), dropperStored + drawn.amount));
|
||||
}
|
||||
|
||||
((EntityPlayerMP)player).sendContainerToPlayer(player.openContainer);
|
||||
|
||||
@@ -2,8 +2,6 @@ package mekanism.common.base;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public interface ITileComponent
|
||||
|
||||
@@ -2,8 +2,6 @@ package mekanism.common.base;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Internal interface used for blocks that send data between clients and the server
|
||||
* @author AidanBrady
|
||||
|
||||
@@ -49,6 +49,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -73,7 +74,8 @@ import net.minecraftforge.fluids.capability.IFluidHandlerItem;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Block class for handling multiple metal block IDs.
|
||||
@@ -129,12 +131,14 @@ public abstract class BlockBasic extends Block
|
||||
|
||||
public abstract BasicBlock getBasicBlock();
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateBasic(this, getTypeProperty());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
@@ -150,8 +154,9 @@ public abstract class BlockBasic extends Block
|
||||
return type.meta;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
TileEntity tile = MekanismUtils.getTileEntitySafe(worldIn, pos);
|
||||
|
||||
@@ -276,7 +281,7 @@ public abstract class BlockBasic extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canCreatureSpawn(IBlockState state, IBlockAccess world, BlockPos pos, SpawnPlacementType type)
|
||||
public boolean canCreatureSpawn(@Nonnull IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, SpawnPlacementType type)
|
||||
{
|
||||
int meta = state.getBlock().getMetaFromState(state);
|
||||
|
||||
@@ -525,12 +530,13 @@ public abstract class BlockBasic extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
public boolean isSideSolid(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side)
|
||||
{
|
||||
return BasicBlockType.get(state) != BasicBlockType.STRUCTURAL_GLASS;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getRenderLayer()
|
||||
{
|
||||
@@ -668,6 +674,7 @@ public abstract class BlockBasic extends Block
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
@@ -727,7 +734,7 @@ public abstract class BlockBasic extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state)
|
||||
{
|
||||
if(BasicBlockType.get(state) == null)
|
||||
{
|
||||
@@ -805,7 +812,7 @@ public abstract class BlockBasic extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state)
|
||||
{
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
|
||||
@@ -817,8 +824,9 @@ public abstract class BlockBasic extends Block
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
BasicBlockType type = BasicBlockType.get(state);
|
||||
ItemStack ret = new ItemStack(this, 1, state.getBlock().getMetaFromState(state));
|
||||
@@ -858,14 +866,15 @@ public abstract class BlockBasic extends Block
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune)
|
||||
{
|
||||
return null;
|
||||
return Items.AIR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest)
|
||||
{
|
||||
@@ -905,7 +914,7 @@ public abstract class BlockBasic extends Block
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
public boolean shouldSideBeRendered(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side)
|
||||
{
|
||||
if(BasicBlockType.get(state) == BasicBlockType.STRUCTURAL_GLASS && BasicBlockType.get(world.getBlockState(pos.offset(side))) == BasicBlockType.STRUCTURAL_GLASS)
|
||||
{
|
||||
@@ -916,7 +925,7 @@ public abstract class BlockBasic extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing[] getValidRotations(World world, BlockPos pos)
|
||||
public EnumFacing[] getValidRotations(World world, @Nonnull BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
EnumFacing[] valid = new EnumFacing[6];
|
||||
@@ -938,7 +947,7 @@ public abstract class BlockBasic extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
public boolean rotateBlock(World world, @Nonnull BlockPos pos, @Nonnull EnumFacing axis)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -20,6 +21,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockBounding extends Block
|
||||
{
|
||||
public BlockBounding()
|
||||
@@ -29,12 +32,14 @@ public class BlockBounding extends Block
|
||||
setResistance(8F);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateBounding(this);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
@@ -61,15 +66,16 @@ public class BlockBounding extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state)
|
||||
{
|
||||
super.breakBlock(world, pos, state);
|
||||
|
||||
world.removeTileEntity(pos);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(pos);
|
||||
@@ -81,7 +87,7 @@ public class BlockBounding extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(pos);
|
||||
@@ -100,11 +106,11 @@ public class BlockBounding extends Block
|
||||
tileEntity.onNeighborChange(state.getBlock());
|
||||
IBlockState state1 = world.getBlockState(tileEntity.mainPos);
|
||||
state1.getBlock().neighborChanged(state1, world, tileEntity.mainPos, neighborBlock, neighborPos);
|
||||
} catch(Exception e) {}
|
||||
} catch(Exception ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPlayerRelativeBlockHardness(IBlockState state, EntityPlayer player, World world, BlockPos pos)
|
||||
public float getPlayerRelativeBlockHardness(IBlockState state, @Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos pos)
|
||||
{
|
||||
try {
|
||||
TileEntityBoundingBlock tileEntity = (TileEntityBoundingBlock)world.getTileEntity(pos);
|
||||
@@ -121,12 +127,14 @@ public class BlockBounding extends Block
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune)
|
||||
{
|
||||
return null;
|
||||
return Items.AIR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
@@ -152,7 +160,7 @@ public class BlockBounding extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state)
|
||||
{
|
||||
if(state.getValue(BlockStateBounding.advancedProperty))
|
||||
{
|
||||
|
||||
@@ -33,6 +33,8 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockCardboardBox extends BlockContainer
|
||||
{
|
||||
private static boolean testingPlace = false;
|
||||
@@ -45,13 +47,15 @@ public class BlockCardboardBox extends BlockContainer
|
||||
setResistance(1F);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateCardboardBox(this);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
@@ -65,7 +69,7 @@ public class BlockCardboardBox extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable(IBlockAccess world, BlockPos pos)
|
||||
public boolean isReplaceable(IBlockAccess world, @Nonnull BlockPos pos)
|
||||
{
|
||||
return testingPlace;
|
||||
}
|
||||
@@ -124,7 +128,8 @@ public class BlockCardboardBox extends BlockContainer
|
||||
|
||||
return entityplayer.isSneaking();
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
@@ -132,7 +137,7 @@ public class BlockCardboardBox extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
public TileEntity createNewTileEntity(@Nonnull World world, int meta)
|
||||
{
|
||||
return new TileEntityCardboardBox();
|
||||
}
|
||||
@@ -158,8 +163,9 @@ public class BlockCardboardBox extends BlockContainer
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
TileEntityCardboardBox tileEntity = (TileEntityCardboardBox)world.getTileEntity(pos);
|
||||
|
||||
@@ -177,7 +183,7 @@ public class BlockCardboardBox extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest)
|
||||
{
|
||||
@@ -200,6 +206,7 @@ public class BlockCardboardBox extends BlockContainer
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune)
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -44,7 +45,8 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Block class for handling multiple energy cube block IDs.
|
||||
@@ -66,6 +68,7 @@ public class BlockEnergyCube extends BlockContainer
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
@@ -78,14 +81,16 @@ public class BlockEnergyCube extends BlockContainer
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return getDefaultState();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
TileEntity tile = MekanismUtils.getTileEntitySafe(worldIn, pos);
|
||||
|
||||
@@ -157,10 +162,11 @@ public class BlockEnergyCube extends BlockContainer
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune)
|
||||
{
|
||||
return null;
|
||||
return Items.AIR;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -179,7 +185,7 @@ public class BlockEnergyCube extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPlayerRelativeBlockHardness(IBlockState state, EntityPlayer player, World world, BlockPos pos)
|
||||
public float getPlayerRelativeBlockHardness(IBlockState state, @Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
@@ -250,7 +256,7 @@ public class BlockEnergyCube extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest)
|
||||
{
|
||||
@@ -267,7 +273,7 @@ public class BlockEnergyCube extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
public TileEntity createNewTileEntity(@Nonnull World world, int meta)
|
||||
{
|
||||
return new TileEntityEnergyCube();
|
||||
}
|
||||
@@ -278,14 +284,16 @@ public class BlockEnergyCube extends BlockContainer
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
TileEntityEnergyCube tileEntity = (TileEntityEnergyCube)world.getTileEntity(pos);
|
||||
ItemStack itemStack = new ItemStack(MekanismBlocks.EnergyCube);
|
||||
@@ -295,7 +303,7 @@ public class BlockEnergyCube extends BlockContainer
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if(tileEntity instanceof ISecurityTile)
|
||||
if(tileEntity != null)
|
||||
{
|
||||
ISecurityItem securityItem = (ISecurityItem)itemStack.getItem();
|
||||
|
||||
@@ -304,11 +312,8 @@ public class BlockEnergyCube extends BlockContainer
|
||||
securityItem.setOwnerUUID(itemStack, ((ISecurityTile)tileEntity).getSecurity().getOwnerUUID());
|
||||
securityItem.setSecurity(itemStack, ((ISecurityTile)tileEntity).getSecurity().getMode());
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof ISideConfiguration)
|
||||
{
|
||||
ISideConfiguration config = (ISideConfiguration)tileEntity;
|
||||
|
||||
ISideConfiguration config = tileEntity;
|
||||
|
||||
config.getConfig().write(ItemDataUtils.getDataMap(itemStack));
|
||||
config.getEjector().write(ItemDataUtils.getDataMap(itemStack));
|
||||
@@ -361,13 +366,13 @@ public class BlockEnergyCube extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
public boolean isSideSolid(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing[] getValidRotations(World world, BlockPos pos)
|
||||
public EnumFacing[] getValidRotations(World world, @Nonnull BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
EnumFacing[] valid = new EnumFacing[6];
|
||||
@@ -389,7 +394,7 @@ public class BlockEnergyCube extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
public boolean rotateBlock(World world, @Nonnull BlockPos pos, @Nonnull EnumFacing axis)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -41,7 +42,8 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockGasTank extends BlockContainer
|
||||
{
|
||||
@@ -55,12 +57,14 @@ public class BlockGasTank extends BlockContainer
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateGasTank(this);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
@@ -73,8 +77,9 @@ public class BlockGasTank extends BlockContainer
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
TileEntity tile = MekanismUtils.getTileEntitySafe(worldIn, pos);
|
||||
|
||||
@@ -131,7 +136,7 @@ public class BlockGasTank extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPlayerRelativeBlockHardness(IBlockState state, EntityPlayer player, World world, BlockPos pos)
|
||||
public float getPlayerRelativeBlockHardness(IBlockState state, @Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
@@ -205,7 +210,7 @@ public class BlockGasTank extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest)
|
||||
{
|
||||
@@ -249,10 +254,11 @@ public class BlockGasTank extends BlockContainer
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune)
|
||||
{
|
||||
return null;
|
||||
return Items.AIR;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -261,12 +267,14 @@ public class BlockGasTank extends BlockContainer
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
@@ -274,13 +282,14 @@ public class BlockGasTank extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta)
|
||||
public TileEntity createNewTileEntity(@Nonnull World world, int meta)
|
||||
{
|
||||
return new TileEntityGasTank();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
TileEntityGasTank tileEntity = (TileEntityGasTank)world.getTileEntity(pos);
|
||||
ItemStack itemStack = new ItemStack(MekanismBlocks.GasTank);
|
||||
@@ -290,7 +299,7 @@ public class BlockGasTank extends BlockContainer
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
if(tileEntity instanceof ISecurityTile)
|
||||
if(tileEntity != null)
|
||||
{
|
||||
ISecurityItem securityItem = (ISecurityItem)itemStack.getItem();
|
||||
|
||||
@@ -299,11 +308,8 @@ public class BlockGasTank extends BlockContainer
|
||||
securityItem.setOwnerUUID(itemStack, ((ISecurityTile)tileEntity).getSecurity().getOwnerUUID());
|
||||
securityItem.setSecurity(itemStack, ((ISecurityTile)tileEntity).getSecurity().getMode());
|
||||
}
|
||||
}
|
||||
|
||||
if(tileEntity instanceof ISideConfiguration)
|
||||
{
|
||||
ISideConfiguration config = (ISideConfiguration)tileEntity;
|
||||
|
||||
ISideConfiguration config = tileEntity;
|
||||
|
||||
config.getConfig().write(ItemDataUtils.getDataMap(itemStack));
|
||||
config.getEjector().write(ItemDataUtils.getDataMap(itemStack));
|
||||
@@ -335,7 +341,7 @@ public class BlockGasTank extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing[] getValidRotations(World world, BlockPos pos)
|
||||
public EnumFacing[] getValidRotations(World world, @Nonnull BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
EnumFacing[] valid = new EnumFacing[6];
|
||||
@@ -357,7 +363,7 @@ public class BlockGasTank extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
public boolean rotateBlock(World world, @Nonnull BlockPos pos, @Nonnull EnumFacing axis)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ import net.minecraftforge.common.property.IExtendedBlockState;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
{
|
||||
private static Random rand = new Random();
|
||||
@@ -63,23 +65,26 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateGlowPanel(this);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
TileEntityGlowPanel tileEntity = getTileEntityGlowPanel(world, pos);
|
||||
return tileEntity != null ? state.withProperty(BlockStateFacing.facingProperty, tileEntity.side) : state;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
TileEntityGlowPanel tileEntity = getTileEntityGlowPanel(world, pos);
|
||||
|
||||
@@ -135,7 +140,8 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
tileEntity.getWorld().setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
@@ -150,7 +156,7 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side)
|
||||
public boolean canPlaceBlockOnSide(@Nonnull World world, @Nonnull BlockPos pos, EnumFacing side)
|
||||
{
|
||||
return world.isSideSolid(pos.offset(side.getOpposite()), side);
|
||||
}
|
||||
@@ -189,16 +195,17 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
TileEntityGlowPanel tileEntity = (TileEntityGlowPanel)world.getTileEntity(pos);
|
||||
return new ItemStack(MekanismBlocks.GlowPanel, 1, tileEntity.colour.getMetaValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest)
|
||||
{
|
||||
@@ -216,7 +223,7 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
public TileEntity createNewTileEntity(@Nonnull World worldIn, int meta)
|
||||
{
|
||||
return new TileEntityGlowPanel();
|
||||
}
|
||||
@@ -226,7 +233,8 @@ public class BlockGlowPanel extends Block implements ITileEntityProvider
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
|
||||
@@ -61,6 +61,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -85,7 +86,8 @@ import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Block class for handling multiple machine block IDs.
|
||||
@@ -161,12 +163,14 @@ public abstract class BlockMachine extends BlockContainer
|
||||
|
||||
public abstract MachineBlock getMachineBlock();
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateMachine(this, getTypeProperty());
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
@@ -182,8 +186,9 @@ public abstract class BlockMachine extends BlockContainer
|
||||
return type.meta;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
TileEntity tile = MekanismUtils.getTileEntitySafe(worldIn, pos);
|
||||
|
||||
@@ -283,7 +288,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||
public void breakBlock(World world, @Nonnull BlockPos pos, @Nonnull IBlockState state)
|
||||
{
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(pos);
|
||||
|
||||
@@ -545,7 +550,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
{
|
||||
UUID owner = ((ISecurityTile)tileEntity).getSecurity().getOwnerUUID();
|
||||
|
||||
if(MekanismUtils.isOp((EntityPlayerMP)entityplayer) || owner == null || entityplayer.getUniqueID().equals(owner))
|
||||
if(MekanismUtils.isOp(entityplayer) || owner == null || entityplayer.getUniqueID().equals(owner))
|
||||
{
|
||||
entityplayer.openGui(Mekanism.instance, type.guiId, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
@@ -579,7 +584,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity(World world, IBlockState state)
|
||||
public TileEntity createTileEntity(@Nonnull World world, @Nonnull IBlockState state)
|
||||
{
|
||||
int metadata = state.getBlock().getMetaFromState(state);
|
||||
|
||||
@@ -592,7 +597,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata)
|
||||
public TileEntity createNewTileEntity(@Nonnull World world, int metadata)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -603,12 +608,14 @@ public abstract class BlockMachine extends BlockContainer
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune)
|
||||
{
|
||||
return null;
|
||||
return Items.AIR;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
@@ -616,6 +623,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockRenderLayer getRenderLayer()
|
||||
{
|
||||
@@ -623,7 +631,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPlayerRelativeBlockHardness(IBlockState state, EntityPlayer player, World world, BlockPos pos)
|
||||
public float getPlayerRelativeBlockHardness(IBlockState state, @Nonnull EntityPlayer player, @Nonnull World world, @Nonnull BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
@@ -644,7 +652,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest)
|
||||
{
|
||||
@@ -845,8 +853,9 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getTileEntity(pos);
|
||||
ItemStack itemStack = new ItemStack(this, 1, state.getBlock().getMetaFromState(state));
|
||||
@@ -945,13 +954,10 @@ public abstract class BlockMachine extends BlockContainer
|
||||
{
|
||||
MachineType type = MachineType.get(getMachineBlock(), state.getBlock().getMetaFromState(state));
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case LASER_AMPLIFIER:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
if (type == MachineType.LASER_AMPLIFIER) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public ItemStack dismantleBlock(IBlockState state, World world, BlockPos pos, boolean returnBlock)
|
||||
@@ -975,6 +981,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
@@ -1014,7 +1021,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
public boolean isSideSolid(IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, EnumFacing side)
|
||||
{
|
||||
MachineType type = MachineType.get(getMachineBlock(), state.getBlock().getMetaFromState(state));
|
||||
|
||||
@@ -1036,7 +1043,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing[] getValidRotations(World world, BlockPos pos)
|
||||
public EnumFacing[] getValidRotations(World world, @Nonnull BlockPos pos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
EnumFacing[] valid = new EnumFacing[6];
|
||||
@@ -1058,7 +1065,7 @@ public abstract class BlockMachine extends BlockContainer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis)
|
||||
public boolean rotateBlock(World world, @Nonnull BlockPos pos, @Nonnull EnumFacing axis)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockObsidianTNT extends Block
|
||||
{
|
||||
public BlockObsidianTNT()
|
||||
@@ -26,7 +28,7 @@ public class BlockObsidianTNT extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state)
|
||||
public void breakBlock(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull IBlockState state)
|
||||
{
|
||||
super.breakBlock(world, pos, state);
|
||||
|
||||
@@ -56,7 +58,7 @@ public class BlockObsidianTNT extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockExploded(World world, BlockPos pos, Explosion explosion)
|
||||
public void onBlockExploded(World world, @Nonnull BlockPos pos, @Nonnull Explosion explosion)
|
||||
{
|
||||
if(!world.isRemote)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,8 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* Block class for handling multiple ore block IDs.
|
||||
* 0: Osmium Ore
|
||||
@@ -29,12 +31,14 @@ public class BlockOre extends Block
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateOre(this);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockPlastic extends Block
|
||||
{
|
||||
public PlasticBlockType type;
|
||||
@@ -35,12 +37,14 @@ public class BlockPlastic extends Block
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStatePlastic(this);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ import mekanism.api.EnumColor;
|
||||
import mekanism.common.Mekanism;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
@@ -16,6 +15,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockPlasticFence extends BlockFence
|
||||
{
|
||||
public BlockPlasticFence()
|
||||
@@ -23,13 +24,15 @@ public class BlockPlasticFence extends BlockFence
|
||||
super(Material.CLAY, Material.CLAY.getMaterialMapColor());
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
return new BlockStateContainer(this, new IProperty[] {NORTH, EAST, WEST, SOUTH, colorProperty});
|
||||
return new BlockStateContainer(this, NORTH, EAST, WEST, SOUTH, colorProperty);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
@@ -59,8 +62,9 @@ public class BlockPlasticFence extends BlockFence
|
||||
|
||||
public static class PlasticFenceStateMapper extends StateMapperBase
|
||||
{
|
||||
@Nonnull
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
|
||||
protected ModelResourceLocation getModelResourceLocation(@Nonnull IBlockState state)
|
||||
{
|
||||
String properties = "east=" + state.getValue(EAST) + ",";
|
||||
properties += "north=" + state.getValue(NORTH) + ",";
|
||||
|
||||
@@ -10,6 +10,8 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockSalt extends Block
|
||||
{
|
||||
public BlockSalt()
|
||||
@@ -20,6 +22,7 @@ public class BlockSalt extends Block
|
||||
setSoundType(SoundType.SAND);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune)
|
||||
{
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package mekanism.common.block;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mekanism.api.IMekWrench;
|
||||
@@ -96,9 +97,10 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
setHardness(1F);
|
||||
setResistance(10F);
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
public IBlockState getActualState(@Nonnull IBlockState state, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
TileEntitySidedPipe tile = getTileEntitySidedPipe(worldIn, pos);
|
||||
if(tile != null)
|
||||
@@ -108,7 +110,8 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
@@ -122,7 +125,8 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
TransmitterType type = state.getValue(BlockStateTransmitter.typeProperty);
|
||||
return type.ordinal();
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public BlockStateContainer createBlockState()
|
||||
{
|
||||
@@ -130,8 +134,9 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess w, BlockPos pos)
|
||||
public IBlockState getExtendedState(@Nonnull IBlockState state, IBlockAccess w, BlockPos pos)
|
||||
{
|
||||
TileEntitySidedPipe tile = getTileEntitySidedPipe(w, pos);
|
||||
|
||||
@@ -144,10 +149,11 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
ConnectionType.NORMAL, ConnectionType.NORMAL, ConnectionType.NORMAL};
|
||||
PropertyConnection connectionProp = new PropertyConnection((byte)0, (byte)0, typeArray, true);
|
||||
|
||||
return ((IExtendedBlockState)state).withProperty(OBJProperty.INSTANCE, new OBJState(Arrays.asList(), true)).withProperty(PropertyConnection.INSTANCE, connectionProp);
|
||||
return ((IExtendedBlockState)state).withProperty(OBJProperty.INSTANCE, new OBJState(Collections.emptyList(), true)).withProperty(PropertyConnection.INSTANCE, connectionProp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
@@ -162,7 +168,7 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean b)
|
||||
public void addCollisionBoxToList(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB entityBox, @Nonnull List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean b)
|
||||
{
|
||||
TileEntitySidedPipe tile = getTileEntitySidedPipe(world, pos);
|
||||
|
||||
@@ -176,15 +182,16 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos)
|
||||
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos)
|
||||
{
|
||||
return getDefaultForTile(getTileEntitySidedPipe(world, pos)).offset(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RayTraceResult collisionRayTrace(IBlockState blockState, World world, BlockPos pos, Vec3d start, Vec3d end)
|
||||
public RayTraceResult collisionRayTrace(IBlockState blockState, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull Vec3d start, @Nonnull Vec3d end)
|
||||
{
|
||||
TileEntitySidedPipe tile = getTileEntitySidedPipe(world, pos);
|
||||
|
||||
@@ -231,9 +238,10 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
|
||||
public ItemStack getPickBlock(@Nonnull IBlockState state, RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, EntityPlayer player)
|
||||
{
|
||||
ItemStack itemStack = ItemStack.EMPTY;
|
||||
TileEntitySidedPipe tileEntity = getTileEntitySidedPipe(world, pos);
|
||||
@@ -339,7 +347,8 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
|
||||
return layer == BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state)
|
||||
{
|
||||
@@ -377,7 +386,7 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest)
|
||||
public boolean removedByPlayer(@Nonnull IBlockState state, World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player, boolean willHarvest)
|
||||
{
|
||||
if(!player.capabilities.isCreativeMode && !world.isRemote && willHarvest)
|
||||
{
|
||||
@@ -425,7 +434,7 @@ public class BlockTransmitter extends Block implements ITileEntityProvider
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
public TileEntity createNewTileEntity(@Nonnull World worldIn, int meta)
|
||||
{
|
||||
TransmitterType type = TransmitterType.get(meta);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class PropertyConnection implements IUnlistedProperty<PropertyConnection>
|
||||
@Override
|
||||
public String valueToString(PropertyConnection value)
|
||||
{
|
||||
return Byte.toString(value.connectionByte) + "_" + Byte.toString(value.transmitterConnections) + "_"
|
||||
return value.connectionByte + "_" + value.transmitterConnections + "_"
|
||||
+ Arrays.toString(value.connectionTypes) + "_" + value.renderCenter;
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -86,31 +87,31 @@ public class BlockStateBasic extends ExtendedBlockState
|
||||
|
||||
public enum BasicBlockType implements IStringSerializable
|
||||
{
|
||||
OSMIUM_BLOCK(BasicBlock.BASIC_BLOCK_1, 0, "OsmiumBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false, false, true),
|
||||
BRONZE_BLOCK(BasicBlock.BASIC_BLOCK_1, 1, "BronzeBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false, false, true),
|
||||
REFINED_OBSIDIAN(BasicBlock.BASIC_BLOCK_1, 2, "RefinedObsidian", null, false, Predicates.<EnumFacing>alwaysFalse(), false, false, true),
|
||||
COAL_BLOCK(BasicBlock.BASIC_BLOCK_1, 3, "CharcoalBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
REFINED_GLOWSTONE(BasicBlock.BASIC_BLOCK_1, 4, "RefinedGlowstone", null, false, Predicates.<EnumFacing>alwaysFalse(), false, false, true),
|
||||
STEEL_BLOCK(BasicBlock.BASIC_BLOCK_1, 5, "SteelBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false, false, true),
|
||||
OSMIUM_BLOCK(BasicBlock.BASIC_BLOCK_1, 0, "OsmiumBlock", null, false, Predicates.alwaysFalse(), false, false, true),
|
||||
BRONZE_BLOCK(BasicBlock.BASIC_BLOCK_1, 1, "BronzeBlock", null, false, Predicates.alwaysFalse(), false, false, true),
|
||||
REFINED_OBSIDIAN(BasicBlock.BASIC_BLOCK_1, 2, "RefinedObsidian", null, false, Predicates.alwaysFalse(), false, false, true),
|
||||
COAL_BLOCK(BasicBlock.BASIC_BLOCK_1, 3, "CharcoalBlock", null, false, Predicates.alwaysFalse(), false, false, false),
|
||||
REFINED_GLOWSTONE(BasicBlock.BASIC_BLOCK_1, 4, "RefinedGlowstone", null, false, Predicates.alwaysFalse(), false, false, true),
|
||||
STEEL_BLOCK(BasicBlock.BASIC_BLOCK_1, 5, "SteelBlock", null, false, Predicates.alwaysFalse(), false, false, true),
|
||||
BIN(BasicBlock.BASIC_BLOCK_1, 6, "Bin", TileEntityBin.class, true, Plane.HORIZONTAL, true, true, false),
|
||||
TELEPORTER_FRAME(BasicBlock.BASIC_BLOCK_1, 7, "TeleporterFrame", null, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
STEEL_CASING(BasicBlock.BASIC_BLOCK_1, 8, "SteelCasing", null, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
DYNAMIC_TANK(BasicBlock.BASIC_BLOCK_1, 9, "DynamicTank", TileEntityDynamicTank.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
STRUCTURAL_GLASS(BasicBlock.BASIC_BLOCK_1, 10, "StructuralGlass", TileEntityStructuralGlass.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
DYNAMIC_VALVE(BasicBlock.BASIC_BLOCK_1, 11, "DynamicValve", TileEntityDynamicValve.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
COPPER_BLOCK(BasicBlock.BASIC_BLOCK_1, 12, "CopperBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false, false, true),
|
||||
TIN_BLOCK(BasicBlock.BASIC_BLOCK_1, 13, "TinBlock", null, false, Predicates.<EnumFacing>alwaysFalse(), false, false, true),
|
||||
TELEPORTER_FRAME(BasicBlock.BASIC_BLOCK_1, 7, "TeleporterFrame", null, true, Predicates.alwaysFalse(), false, false, false),
|
||||
STEEL_CASING(BasicBlock.BASIC_BLOCK_1, 8, "SteelCasing", null, true, Predicates.alwaysFalse(), false, false, false),
|
||||
DYNAMIC_TANK(BasicBlock.BASIC_BLOCK_1, 9, "DynamicTank", TileEntityDynamicTank.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
STRUCTURAL_GLASS(BasicBlock.BASIC_BLOCK_1, 10, "StructuralGlass", TileEntityStructuralGlass.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
DYNAMIC_VALVE(BasicBlock.BASIC_BLOCK_1, 11, "DynamicValve", TileEntityDynamicValve.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
COPPER_BLOCK(BasicBlock.BASIC_BLOCK_1, 12, "CopperBlock", null, false, Predicates.alwaysFalse(), false, false, true),
|
||||
TIN_BLOCK(BasicBlock.BASIC_BLOCK_1, 13, "TinBlock", null, false, Predicates.alwaysFalse(), false, false, true),
|
||||
THERMAL_EVAPORATION_CONTROLLER(BasicBlock.BASIC_BLOCK_1, 14, "ThermalEvaporationController", TileEntityThermalEvaporationController.class, true, Plane.HORIZONTAL, true, false, false),
|
||||
THERMAL_EVAPORATION_VALVE(BasicBlock.BASIC_BLOCK_1, 15, "ThermalEvaporationValve", TileEntityThermalEvaporationValve.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
THERMAL_EVAPORATION_BLOCK(BasicBlock.BASIC_BLOCK_2, 0, "ThermalEvaporationBlock", TileEntityThermalEvaporationBlock.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
INDUCTION_CASING(BasicBlock.BASIC_BLOCK_2, 1, "InductionCasing", TileEntityInductionCasing.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
INDUCTION_PORT(BasicBlock.BASIC_BLOCK_2, 2, "InductionPort", TileEntityInductionPort.class, true, Predicates.<EnumFacing>alwaysFalse(), true, false, false),
|
||||
INDUCTION_CELL(BasicBlock.BASIC_BLOCK_2, 3, "InductionCell", TileEntityInductionCell.class, true, Predicates.<EnumFacing>alwaysFalse(), false, true, false),
|
||||
INDUCTION_PROVIDER(BasicBlock.BASIC_BLOCK_2, 4, "InductionProvider", TileEntityInductionProvider.class, true, Predicates.<EnumFacing>alwaysFalse(), false, true, false),
|
||||
SUPERHEATING_ELEMENT(BasicBlock.BASIC_BLOCK_2, 5, "SuperheatingElement", TileEntitySuperheatingElement.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
PRESSURE_DISPERSER(BasicBlock.BASIC_BLOCK_2, 6, "PressureDisperser",TileEntityPressureDisperser.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
BOILER_CASING(BasicBlock.BASIC_BLOCK_2, 7, "BoilerCasing", TileEntityBoilerCasing.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
BOILER_VALVE(BasicBlock.BASIC_BLOCK_2, 8, "BoilerValve", TileEntityBoilerValve.class, true, Predicates.<EnumFacing>alwaysFalse(), false, false, false),
|
||||
THERMAL_EVAPORATION_VALVE(BasicBlock.BASIC_BLOCK_1, 15, "ThermalEvaporationValve", TileEntityThermalEvaporationValve.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
THERMAL_EVAPORATION_BLOCK(BasicBlock.BASIC_BLOCK_2, 0, "ThermalEvaporationBlock", TileEntityThermalEvaporationBlock.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
INDUCTION_CASING(BasicBlock.BASIC_BLOCK_2, 1, "InductionCasing", TileEntityInductionCasing.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
INDUCTION_PORT(BasicBlock.BASIC_BLOCK_2, 2, "InductionPort", TileEntityInductionPort.class, true, Predicates.alwaysFalse(), true, false, false),
|
||||
INDUCTION_CELL(BasicBlock.BASIC_BLOCK_2, 3, "InductionCell", TileEntityInductionCell.class, true, Predicates.alwaysFalse(), false, true, false),
|
||||
INDUCTION_PROVIDER(BasicBlock.BASIC_BLOCK_2, 4, "InductionProvider", TileEntityInductionProvider.class, true, Predicates.alwaysFalse(), false, true, false),
|
||||
SUPERHEATING_ELEMENT(BasicBlock.BASIC_BLOCK_2, 5, "SuperheatingElement", TileEntitySuperheatingElement.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
PRESSURE_DISPERSER(BasicBlock.BASIC_BLOCK_2, 6, "PressureDisperser",TileEntityPressureDisperser.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
BOILER_CASING(BasicBlock.BASIC_BLOCK_2, 7, "BoilerCasing", TileEntityBoilerCasing.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
BOILER_VALVE(BasicBlock.BASIC_BLOCK_2, 8, "BoilerValve", TileEntityBoilerValve.class, true, Predicates.alwaysFalse(), false, false, false),
|
||||
SECURITY_DESK(BasicBlock.BASIC_BLOCK_2, 9, "SecurityDesk", TileEntitySecurityDesk.class, true, Plane.HORIZONTAL, false, false, false);
|
||||
|
||||
public BasicBlock blockType;
|
||||
@@ -253,8 +254,9 @@ public class BlockStateBasic extends ExtendedBlockState
|
||||
|
||||
public static class BasicBlockStateMapper extends StateMapperBase
|
||||
{
|
||||
@Nonnull
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
|
||||
protected ModelResourceLocation getModelResourceLocation(@Nonnull IBlockState state)
|
||||
{
|
||||
BlockBasic block = (BlockBasic)state.getBlock();
|
||||
BasicBlockType type = state.getValue(block.getTypeProperty());
|
||||
|
||||
@@ -8,6 +8,8 @@ import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockStateCardboardBox extends BlockStateContainer
|
||||
{
|
||||
public static PropertyBool storageProperty = PropertyBool.create("storage");
|
||||
@@ -19,8 +21,9 @@ public class BlockStateCardboardBox extends BlockStateContainer
|
||||
|
||||
public static class CardboardBoxStateMapper extends StateMapperBase
|
||||
{
|
||||
@Nonnull
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
|
||||
protected ModelResourceLocation getModelResourceLocation(@Nonnull IBlockState state)
|
||||
{
|
||||
String property = "storage=" + state.getValue(storageProperty);
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ import net.minecraftforge.common.property.IUnlistedProperty;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockStateMachine extends ExtendedBlockState
|
||||
{
|
||||
public static final PropertyBool activeProperty = PropertyBool.create("active");
|
||||
@@ -410,8 +412,9 @@ public class BlockStateMachine extends ExtendedBlockState
|
||||
|
||||
public static class MachineBlockStateMapper extends StateMapperBase
|
||||
{
|
||||
@Nonnull
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
|
||||
protected ModelResourceLocation getModelResourceLocation(@Nonnull IBlockState state)
|
||||
{
|
||||
BlockMachine block = (BlockMachine)state.getBlock();
|
||||
MachineType type = state.getValue(block.getTypeProperty());
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Locale;
|
||||
|
||||
public class BlockStatePlastic extends BlockStateContainer
|
||||
@@ -38,8 +39,9 @@ public class BlockStatePlastic extends BlockStateContainer
|
||||
|
||||
public static class PlasticBlockStateMapper extends StateMapperBase
|
||||
{
|
||||
@Nonnull
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
|
||||
protected ModelResourceLocation getModelResourceLocation(@Nonnull IBlockState state)
|
||||
{
|
||||
PlasticBlockType type = ((BlockPlastic)state.getBlock()).type;
|
||||
String property = "type=" + type.getName();
|
||||
|
||||
Loaded 100 of 373 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user