mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 14:24:35 +00:00
Merge pull request #4709 from josephcsible/type-safety
Fix several generics type-safety issues
This commit is contained in:
commit
70f7692598
36 files changed
+77
-80
No files matched your search
@@ -14,6 +14,7 @@ import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiIngredientGroup;
|
||||
import mezz.jei.api.gui.ITickTimer;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
@@ -27,7 +28,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class BaseRecipeCategory implements IRecipeCategory, IGuiWrapper
|
||||
public abstract class BaseRecipeCategory implements IRecipeCategory<IRecipeWrapper>, IGuiWrapper
|
||||
{
|
||||
private static final GuiDummy gui = new GuiDummy();
|
||||
|
||||
@@ -145,7 +146,7 @@ public abstract class BaseRecipeCategory implements IRecipeCategory, IGuiWrapper
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getTooltipStrings(int mouseX, int mouseY)
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class GuiElementHandler implements IAdvancedGuiHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public List getGuiExtraAreas(GuiContainer gui)
|
||||
public List<Rectangle> getGuiExtraAreas(GuiContainer gui)
|
||||
{
|
||||
if(gui instanceof GuiMekanism)
|
||||
{
|
||||
|
||||
@@ -318,7 +318,7 @@ public class MekanismJEI implements IModPlugin
|
||||
registry.addRecipeCatalyst(type.getStack(), "mekanism." + type.getName());
|
||||
}
|
||||
|
||||
private void addRecipes(IModRegistry registry, Recipe type, Class recipe, Class<? extends IRecipeWrapper> wrapper, String recipeCategoryUid)
|
||||
private void addRecipes(IModRegistry registry, Recipe type, Class<?> recipe, Class<? extends IRecipeWrapper> wrapper, String recipeCategoryUid)
|
||||
{
|
||||
List<IRecipeWrapper> recipes = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ public class PacketHandler
|
||||
}
|
||||
else if(data instanceof ArrayList)
|
||||
{
|
||||
encode(((ArrayList)data).toArray(), output);
|
||||
encode(((ArrayList<?>)data).toArray(), output);
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException("Un-encodable data passed to encode(): " + data + ", full data: " + Arrays.toString(dataValues));
|
||||
|
||||
@@ -700,7 +700,7 @@ public final class Tier
|
||||
return;
|
||||
}
|
||||
|
||||
for(Class c : Tier.class.getDeclaredClasses())
|
||||
for(Class<?> c : Tier.class.getDeclaredClasses())
|
||||
{
|
||||
if(c.isEnum())
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ public class FluidItemWrapper extends ItemCapability implements IFluidHandlerIte
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProcess(Capability cap)
|
||||
public boolean canProcess(Capability<?> cap)
|
||||
{
|
||||
return cap == CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY;
|
||||
}
|
||||
|
||||
@@ -208,7 +208,7 @@ public abstract class BlockBasic extends Block
|
||||
|
||||
if(tileEntity instanceof IMultiblock)
|
||||
{
|
||||
((IMultiblock)tileEntity).doUpdate();
|
||||
((IMultiblock<?>)tileEntity).doUpdate();
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityBasicBlock)
|
||||
@@ -315,7 +315,7 @@ public abstract class BlockBasic extends Block
|
||||
case 2:
|
||||
case 7:
|
||||
case 8:
|
||||
TileEntityMultiblock tileEntity = (TileEntityMultiblock) MekanismUtils.getTileEntitySafe(world, pos);
|
||||
TileEntityMultiblock<?> tileEntity = (TileEntityMultiblock<?>) MekanismUtils.getTileEntitySafe(world, pos);
|
||||
|
||||
if(tileEntity != null)
|
||||
{
|
||||
@@ -506,7 +506,7 @@ public abstract class BlockBasic extends Block
|
||||
return true;
|
||||
}
|
||||
|
||||
return ((IMultiblock)world.getTileEntity(pos)).onActivate(entityplayer, hand, stack);
|
||||
return ((IMultiblock<?>)world.getTileEntity(pos)).onActivate(entityplayer, hand, stack);
|
||||
}
|
||||
else if(tile instanceof IStructuralMultiblock)
|
||||
{
|
||||
@@ -791,7 +791,7 @@ public abstract class BlockBasic extends Block
|
||||
|
||||
if(tileEntity instanceof IMultiblock)
|
||||
{
|
||||
((IMultiblock)tileEntity).doUpdate();
|
||||
((IMultiblock<?>)tileEntity).doUpdate();
|
||||
}
|
||||
|
||||
if(tileEntity instanceof IStructuralMultiblock)
|
||||
|
||||
@@ -29,9 +29,9 @@ public class PropertyColor implements IUnlistedProperty<PropertyColor>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getType()
|
||||
public Class<PropertyColor> getType()
|
||||
{
|
||||
return getClass();
|
||||
return PropertyColor.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,4 +39,4 @@ public class PropertyColor implements IUnlistedProperty<PropertyColor>
|
||||
{
|
||||
return color.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,9 +37,9 @@ public class PropertyConnection implements IUnlistedProperty<PropertyConnection>
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class getType()
|
||||
public Class<PropertyConnection> getType()
|
||||
{
|
||||
return getClass();
|
||||
return PropertyConnection.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,17 +12,17 @@ public class BlockStateFacing extends BlockStateContainer
|
||||
{
|
||||
public static final PropertyDirection facingProperty = PropertyDirection.create("facing");
|
||||
|
||||
public BlockStateFacing(Block block, PropertyEnum typeProperty, PropertyBool activeProperty, PropertyEnum<BaseTier> tierProperty, PropertyEnum<RecipeType> recipeProperty)
|
||||
public BlockStateFacing(Block block, PropertyEnum<?> typeProperty, PropertyBool activeProperty, PropertyEnum<BaseTier> tierProperty, PropertyEnum<RecipeType> recipeProperty)
|
||||
{
|
||||
super(block, facingProperty, typeProperty, activeProperty, tierProperty, recipeProperty);
|
||||
}
|
||||
|
||||
public BlockStateFacing(Block block, PropertyEnum typeProperty, PropertyBool activeProperty)
|
||||
public BlockStateFacing(Block block, PropertyEnum<?> typeProperty, PropertyBool activeProperty)
|
||||
{
|
||||
super(block, facingProperty, typeProperty, activeProperty);
|
||||
}
|
||||
|
||||
public BlockStateFacing(Block block, PropertyEnum typeProperty)
|
||||
public BlockStateFacing(Block block, PropertyEnum<?> typeProperty)
|
||||
{
|
||||
super(block, facingProperty, typeProperty);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class BlockStateMachine extends ExtendedBlockState
|
||||
public static final PropertyEnum<BaseTier> tierProperty = PropertyEnum.create("tier", BaseTier.class);
|
||||
public static final PropertyEnum<RecipeType> recipeProperty = PropertyEnum.create("recipe", RecipeType.class);
|
||||
|
||||
public BlockStateMachine(BlockMachine block, PropertyEnum typeProperty)
|
||||
public BlockStateMachine(BlockMachine block, PropertyEnum<?> typeProperty)
|
||||
{
|
||||
super(block, new IProperty[] {BlockStateFacing.facingProperty, typeProperty, activeProperty, tierProperty, recipeProperty}, new IUnlistedProperty[] {});
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class DefaultStorageHelper
|
||||
public NBTBase writeNBT(Capability<T> capability, T instance, EnumFacing side)
|
||||
{
|
||||
if(instance instanceof INBTSerializable)
|
||||
return ((INBTSerializable)instance).serializeNBT();
|
||||
return ((INBTSerializable<?>)instance).serializeNBT();
|
||||
return new NBTTagCompound();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class DefaultStorageHelper
|
||||
{
|
||||
if(instance instanceof INBTSerializable)
|
||||
{
|
||||
Class<? extends NBTBase> nbtClass = ((INBTSerializable)instance).serializeNBT().getClass();
|
||||
Class<? extends NBTBase> nbtClass = ((INBTSerializable<?>)instance).serializeNBT().getClass();
|
||||
|
||||
if(nbtClass.isInstance(nbt))
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ItemCapabilityWrapper implements ICapabilityProvider
|
||||
{
|
||||
private ItemCapabilityWrapper wrapper;
|
||||
|
||||
public abstract boolean canProcess(Capability capability);
|
||||
public abstract boolean canProcess(Capability<?> capability);
|
||||
|
||||
public ItemStack getStack()
|
||||
{
|
||||
|
||||
@@ -63,14 +63,14 @@ public class RobitAIPickup extends EntityAIBase
|
||||
return true;
|
||||
}
|
||||
|
||||
List items = theRobit.world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(theRobit.posX-10, theRobit.posY-10, theRobit.posZ-10, theRobit.posX+10, theRobit.posY+10, theRobit.posZ+10));
|
||||
Iterator iter = items.iterator();
|
||||
List<EntityItem> items = theRobit.world.getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(theRobit.posX-10, theRobit.posY-10, theRobit.posZ-10, theRobit.posX+10, theRobit.posY+10, theRobit.posZ+10));
|
||||
Iterator<EntityItem> iter = items.iterator();
|
||||
//Cached for slight performance
|
||||
double closestDistance = -1;
|
||||
|
||||
while(iter.hasNext())
|
||||
{
|
||||
EntityItem entity = (EntityItem)iter.next();
|
||||
EntityItem entity = iter.next();
|
||||
|
||||
double distance = theRobit.getDistanceToEntity(entity);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class FrequencyManager
|
||||
|
||||
private Class<? extends Frequency> frequencyClass;
|
||||
|
||||
public FrequencyManager(Class c, String n)
|
||||
public FrequencyManager(Class<? extends Frequency> c, String n)
|
||||
{
|
||||
frequencyClass = c;
|
||||
name = n;
|
||||
@@ -47,7 +47,7 @@ public class FrequencyManager
|
||||
managers.add(this);
|
||||
}
|
||||
|
||||
public FrequencyManager(Class c, String n, UUID uuid)
|
||||
public FrequencyManager(Class<? extends Frequency> c, String n, UUID uuid)
|
||||
{
|
||||
this(c, n);
|
||||
|
||||
@@ -347,7 +347,7 @@ public class FrequencyManager
|
||||
{
|
||||
NBTTagCompound compound = list.getCompoundTagAt(i);
|
||||
|
||||
Constructor c = Class.forName(frequencyClass).getConstructor(new Class[] {NBTTagCompound.class});
|
||||
Constructor<?> c = Class.forName(frequencyClass).getConstructor(new Class[] {NBTTagCompound.class});
|
||||
Frequency freq = (Frequency)c.newInstance(compound);
|
||||
|
||||
loadedFrequencies.add(freq);
|
||||
|
||||
@@ -10,7 +10,7 @@ import net.minecraftforge.energy.IEnergyStorage;
|
||||
public class ForgeEnergyItemWrapper extends ItemCapability implements IEnergyStorage
|
||||
{
|
||||
@Override
|
||||
public boolean canProcess(Capability capability)
|
||||
public boolean canProcess(Capability<?> capability)
|
||||
{
|
||||
return capability == CapabilityEnergy.ENERGY;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import net.minecraftforge.fml.common.Optional.Method;
|
||||
public class TeslaItemWrapper extends ItemCapability implements ITeslaHolder, ITeslaConsumer, ITeslaProducer
|
||||
{
|
||||
@Override
|
||||
public boolean canProcess(Capability capability)
|
||||
public boolean canProcess(Capability<?> capability)
|
||||
{
|
||||
return capability == Capabilities.TESLA_HOLDER_CAPABILITY ||
|
||||
capability == Capabilities.TESLA_CONSUMER_CAPABILITY && getItem().canReceive(getStack()) ||
|
||||
|
||||
@@ -15,7 +15,7 @@ import net.minecraft.world.World;
|
||||
|
||||
public class MultiblockManager<T extends SynchronizedData<T>>
|
||||
{
|
||||
private static Set<MultiblockManager> managers = new HashSet<>();
|
||||
private static Set<MultiblockManager<?>> managers = new HashSet<>();
|
||||
|
||||
public String name;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MultiblockManager<T extends SynchronizedData<T>>
|
||||
|
||||
public static void tick(World world)
|
||||
{
|
||||
for(MultiblockManager manager : managers)
|
||||
for(MultiblockManager<?> manager : managers)
|
||||
{
|
||||
manager.tickSelf(world);
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class MultiblockManager<T extends SynchronizedData<T>>
|
||||
|
||||
public static void reset()
|
||||
{
|
||||
for(MultiblockManager manager : managers)
|
||||
for(MultiblockManager<?> manager : managers)
|
||||
{
|
||||
manager.inventories.clear();
|
||||
}
|
||||
|
||||
@@ -467,7 +467,7 @@ public abstract class UpdateProtocol<T extends SynchronizedData<T>>
|
||||
|
||||
if(tile instanceof TileEntityMultiblock)
|
||||
{
|
||||
((TileEntityMultiblock)tile).structure = null;
|
||||
((TileEntityMultiblock<?>)tile).structure = null;
|
||||
}
|
||||
else if(tile instanceof IStructuralMultiblock)
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ public class PacketDataRequest implements IMessageHandler<DataRequestMessage, IM
|
||||
{
|
||||
if(tileEntity instanceof TileEntityMultiblock)
|
||||
{
|
||||
((TileEntityMultiblock)tileEntity).sendStructure = true;
|
||||
((TileEntityMultiblock<?>)tileEntity).sendStructure = true;
|
||||
}
|
||||
|
||||
if(CapabilityUtils.hasCapability(tileEntity, Capabilities.GRID_TRANSMITTER_CAPABILITY, null))
|
||||
|
||||
@@ -512,8 +512,8 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
|
||||
|| super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
private CapabilityWrapperManager teslaManager = new CapabilityWrapperManager(IEnergyWrapper.class, TeslaIntegration.class);
|
||||
private CapabilityWrapperManager forgeEnergyManager = new CapabilityWrapperManager(IEnergyWrapper.class, ForgeEnergyIntegration.class);
|
||||
private CapabilityWrapperManager<IEnergyWrapper, TeslaIntegration> teslaManager = new CapabilityWrapperManager<>(IEnergyWrapper.class, TeslaIntegration.class);
|
||||
private CapabilityWrapperManager<IEnergyWrapper, ForgeEnergyIntegration> forgeEnergyManager = new CapabilityWrapperManager<>(IEnergyWrapper.class, ForgeEnergyIntegration.class);
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class TileEntityMultiblock<T extends SynchronizedData<T>> extend
|
||||
public boolean isRendering;
|
||||
|
||||
/** This multiblock segment's cached data */
|
||||
public MultiblockCache cachedData = getNewCache();
|
||||
public MultiblockCache<T> cachedData = getNewCache();
|
||||
|
||||
/** This multiblock segment's cached inventory ID */
|
||||
public String cachedID = null;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class TileEntityStructuralGlass extends TileEntity implements IStructural
|
||||
|
||||
if(masterTile instanceof IMultiblock)
|
||||
{
|
||||
return ((IMultiblock)masterTile).onActivate(player, hand, stack);
|
||||
return ((IMultiblock<?>)masterTile).onActivate(player, hand, stack);
|
||||
}
|
||||
else {
|
||||
master = null;
|
||||
@@ -44,14 +44,14 @@ public class TileEntityStructuralGlass extends TileEntity implements IStructural
|
||||
|
||||
if(masterTile instanceof IMultiblock)
|
||||
{
|
||||
((IMultiblock)masterTile).doUpdate();
|
||||
((IMultiblock<?>)masterTile).doUpdate();
|
||||
}
|
||||
else {
|
||||
master = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
IMultiblock multiblock = new ControllerFinder().find();
|
||||
IMultiblock<?> multiblock = new ControllerFinder().find();
|
||||
|
||||
if(multiblock != null)
|
||||
{
|
||||
@@ -74,7 +74,7 @@ public class TileEntityStructuralGlass extends TileEntity implements IStructural
|
||||
|
||||
public class ControllerFinder
|
||||
{
|
||||
public IMultiblock found;
|
||||
public IMultiblock<?> found;
|
||||
|
||||
public Set<Coord4D> iterated = new HashSet<>();
|
||||
|
||||
@@ -96,7 +96,7 @@ public class TileEntityStructuralGlass extends TileEntity implements IStructural
|
||||
{
|
||||
if(tile instanceof IMultiblock)
|
||||
{
|
||||
found = (IMultiblock)tile;
|
||||
found = (IMultiblock<?>)tile;
|
||||
return;
|
||||
}
|
||||
else if(tile instanceof IStructuralMultiblock)
|
||||
@@ -107,7 +107,7 @@ public class TileEntityStructuralGlass extends TileEntity implements IStructural
|
||||
}
|
||||
}
|
||||
|
||||
public IMultiblock find()
|
||||
public IMultiblock<?> find()
|
||||
{
|
||||
loop(Coord4D.get(TileEntityStructuralGlass.this));
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ public abstract class TileEntityContainerBlock extends TileEntityBasicBlock impl
|
||||
return capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY || super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
private CapabilityWrapperManager itemManager = new CapabilityWrapperManager(ISidedInventory.class, ItemHandlerWrapper.class);
|
||||
private CapabilityWrapperManager<ISidedInventory, ItemHandlerWrapper> itemManager = new CapabilityWrapperManager<>(ISidedInventory.class, ItemHandlerWrapper.class);
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
|
||||
|
||||
@@ -429,8 +429,8 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
||||
|| super.hasCapability(capability, facing);
|
||||
}
|
||||
|
||||
private CapabilityWrapperManager teslaManager = new CapabilityWrapperManager(IEnergyWrapper.class, TeslaIntegration.class);
|
||||
private CapabilityWrapperManager forgeEnergyManager = new CapabilityWrapperManager(IEnergyWrapper.class, ForgeEnergyIntegration.class);
|
||||
private CapabilityWrapperManager<IEnergyWrapper, TeslaIntegration> teslaManager = new CapabilityWrapperManager<>(IEnergyWrapper.class, TeslaIntegration.class);
|
||||
private CapabilityWrapperManager<IEnergyWrapper, ForgeEnergyIntegration> forgeEnergyManager = new CapabilityWrapperManager<>(IEnergyWrapper.class, ForgeEnergyIntegration.class);
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing)
|
||||
|
||||
@@ -335,7 +335,7 @@ public class TileEntityMechanicalPipe extends TileEntityTransmitter<IFluidHandle
|
||||
return capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY || super.hasCapability(capability, side);
|
||||
}
|
||||
|
||||
public CapabilityWrapperManager manager = new CapabilityWrapperManager(IFluidHandlerWrapper.class, FluidHandlerWrapper.class);
|
||||
public CapabilityWrapperManager<IFluidHandlerWrapper, FluidHandlerWrapper> manager = new CapabilityWrapperManager<>(IFluidHandlerWrapper.class, FluidHandlerWrapper.class);
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing side)
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class MinerUtils
|
||||
|
||||
if(silk && block.canSilkHarvest(world, obj.getPos(), state, null))
|
||||
{
|
||||
List<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
List<ItemStack> ret = new ArrayList<>();
|
||||
if (getSilkTouchDrop != null)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -12,7 +12,7 @@ public final class ReflectionUtils
|
||||
* @param fields - possible names of field to iterate through
|
||||
* @return value as an Object, cast as necessary
|
||||
*/
|
||||
public static Object getPrivateValue(Object obj, Class c, String[] fields)
|
||||
public static <T> Object getPrivateValue(T obj, Class<? super T> c, String[] fields)
|
||||
{
|
||||
for(String field : fields)
|
||||
{
|
||||
@@ -35,7 +35,7 @@ public final class ReflectionUtils
|
||||
* @param c - Class the operation will be performed on
|
||||
* @param fields - possible names of field to iterate through
|
||||
*/
|
||||
public static void setPrivateValue(Object obj, Object value, Class c, String[] fields)
|
||||
public static <T> void setPrivateValue(T obj, Object value, Class<? super T> c, String[] fields)
|
||||
{
|
||||
for(String field : fields)
|
||||
{
|
||||
@@ -56,7 +56,7 @@ public final class ReflectionUtils
|
||||
* @param params - the Types inserted as parameters into the method
|
||||
* @return private method
|
||||
*/
|
||||
public static Method getPrivateMethod(Class c, String[] methods, Class... params)
|
||||
public static Method getPrivateMethod(Class<?> c, String[] methods, Class<?>... params)
|
||||
{
|
||||
for(String method : methods)
|
||||
{
|
||||
|
||||
@@ -48,26 +48,22 @@ public class VoiceConnection extends Thread
|
||||
while(username == null && retryCount <= 100)
|
||||
{
|
||||
try {
|
||||
List l = Collections.synchronizedList(new ArrayList<>(server.getPlayerList().getPlayers()));
|
||||
List<EntityPlayerMP> l = Collections.synchronizedList(new ArrayList<>(server.getPlayerList().getPlayers()));
|
||||
|
||||
for(Object obj : l)
|
||||
for(EntityPlayerMP playerMP : l)
|
||||
{
|
||||
if(obj instanceof EntityPlayerMP)
|
||||
{
|
||||
EntityPlayerMP playerMP = (EntityPlayerMP)obj;
|
||||
String playerIP = playerMP.getPlayerIP();
|
||||
String playerIP = playerMP.getPlayerIP();
|
||||
|
||||
if(!server.isDedicatedServer() && playerIP.equals("local") && !Mekanism.voiceManager.foundLocal)
|
||||
{
|
||||
Mekanism.voiceManager.foundLocal = true;
|
||||
username = playerMP.getName();
|
||||
break;
|
||||
}
|
||||
else if(playerIP.equals(socket.getInetAddress().getHostAddress()))
|
||||
{
|
||||
username = playerMP.getName();
|
||||
break;
|
||||
}
|
||||
if(!server.isDedicatedServer() && playerIP.equals("local") && !Mekanism.voiceManager.foundLocal)
|
||||
{
|
||||
Mekanism.voiceManager.foundLocal = true;
|
||||
username = playerMP.getName();
|
||||
break;
|
||||
}
|
||||
else if(playerIP.equals(socket.getInetAddress().getHostAddress()))
|
||||
{
|
||||
username = playerMP.getName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GuiReactorController extends GuiMekanism
|
||||
{
|
||||
guiElements.add(new GuiEnergyInfo(() -> tileEntity.isFormed() ? ListUtils.asList(
|
||||
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
|
||||
LangUtils.localize("gui.producing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getReactor().getPassiveGeneration(false, true)) + "/t") : new ArrayList(), this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
LangUtils.localize("gui.producing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getReactor().getPassiveGeneration(false, true)) + "/t") : new ArrayList<>(), this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 79, 38));
|
||||
guiElements.add(new GuiHeatTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
guiElements.add(new GuiFuelTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
|
||||
@@ -45,7 +45,7 @@ public class GuiReactorFuel extends GuiMekanism
|
||||
tileEntity = tentity;
|
||||
guiElements.add(new GuiEnergyInfo(() -> tileEntity.isFormed() ? ListUtils.asList(
|
||||
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
|
||||
LangUtils.localize("gui.producing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getReactor().getPassiveGeneration(false, true)) + "/t") : new ArrayList(), this, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png")));
|
||||
LangUtils.localize("gui.producing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getReactor().getPassiveGeneration(false, true)) + "/t") : new ArrayList<>(), this, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png")));
|
||||
guiElements.add(new GuiGasGauge(() -> tentity.deuteriumTank, Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png"), 25, 64));
|
||||
guiElements.add(new GuiGasGauge(() -> tentity.fuelTank, Type.STANDARD, this, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png"), 79, 50));
|
||||
guiElements.add(new GuiGasGauge(() -> tentity.tritiumTank, Type.SMALL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png"), 133, 64));
|
||||
|
||||
@@ -48,7 +48,7 @@ public class GuiReactorHeat extends GuiMekanism
|
||||
tileEntity = tentity;
|
||||
guiElements.add(new GuiEnergyInfo(() -> tileEntity.isFormed() ? ListUtils.asList(
|
||||
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
|
||||
LangUtils.localize("gui.producing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getReactor().getPassiveGeneration(false, true)) + "/t") : new ArrayList(), this, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png")));
|
||||
LangUtils.localize("gui.producing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getReactor().getPassiveGeneration(false, true)) + "/t") : new ArrayList<>(), this, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png")));
|
||||
guiElements.add(new GuiNumberGauge(new INumberInfoHandler()
|
||||
{
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ public class GuiReactorStats extends GuiMekanism
|
||||
tileEntity = tentity;
|
||||
guiElements.add(new GuiEnergyInfo(() -> tileEntity.isFormed() ? ListUtils.asList(
|
||||
LangUtils.localize("gui.storing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy(), tileEntity.getMaxEnergy()),
|
||||
LangUtils.localize("gui.producing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getReactor().getPassiveGeneration(false, true)) + "/t") : new ArrayList(), this, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png")));
|
||||
LangUtils.localize("gui.producing") + ": " + MekanismUtils.getEnergyDisplay(tileEntity.getReactor().getPassiveGeneration(false, true)) + "/t") : new ArrayList<>(), this, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png")));
|
||||
guiElements.add(new GuiHeatTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png")));
|
||||
guiElements.add(new GuiFuelTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiTall.png")));
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public abstract class BlockGenerator extends BlockContainer
|
||||
|
||||
if(tileEntity instanceof IMultiblock)
|
||||
{
|
||||
((IMultiblock)tileEntity).doUpdate();
|
||||
((IMultiblock<?>)tileEntity).doUpdate();
|
||||
}
|
||||
|
||||
if(tileEntity instanceof TileEntityBasicBlock)
|
||||
@@ -206,7 +206,7 @@ public abstract class BlockGenerator extends BlockContainer
|
||||
|
||||
if(!world.isRemote && tileEntity instanceof IMultiblock)
|
||||
{
|
||||
((IMultiblock)tileEntity).doUpdate();
|
||||
((IMultiblock<?>)tileEntity).doUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ public abstract class BlockGenerator extends BlockContainer
|
||||
|
||||
if(metadata == GeneratorType.TURBINE_CASING.meta || metadata == GeneratorType.TURBINE_VALVE.meta || metadata == GeneratorType.TURBINE_VENT.meta)
|
||||
{
|
||||
return ((IMultiblock)tileEntity).onActivate(entityplayer, hand, stack);
|
||||
return ((IMultiblock<?>)tileEntity).onActivate(entityplayer, hand, stack);
|
||||
}
|
||||
|
||||
if(metadata == GeneratorType.TURBINE_ROTOR.meta)
|
||||
|
||||
@@ -47,7 +47,7 @@ public class BlockStateGenerator extends ExtendedBlockState
|
||||
{
|
||||
public static final PropertyBool activeProperty = PropertyBool.create("active");
|
||||
|
||||
public BlockStateGenerator(BlockGenerator block, PropertyEnum typeProperty)
|
||||
public BlockStateGenerator(BlockGenerator block, PropertyEnum<?> typeProperty)
|
||||
{
|
||||
super(block, new IProperty[] {BlockStateFacing.facingProperty, typeProperty, activeProperty}, new IUnlistedProperty[] {});
|
||||
}
|
||||
|
||||
@@ -476,8 +476,8 @@ public class TileEntityTurbineValve extends TileEntityTurbineCasing implements I
|
||||
return super.hasCapability(capability, side);
|
||||
}
|
||||
|
||||
private CapabilityWrapperManager teslaManager = new CapabilityWrapperManager(IEnergyWrapper.class, TeslaIntegration.class);
|
||||
private CapabilityWrapperManager forgeEnergyManager = new CapabilityWrapperManager(IEnergyWrapper.class, ForgeEnergyIntegration.class);
|
||||
private CapabilityWrapperManager<IEnergyWrapper, TeslaIntegration> teslaManager = new CapabilityWrapperManager<>(IEnergyWrapper.class, TeslaIntegration.class);
|
||||
private CapabilityWrapperManager<IEnergyWrapper, ForgeEnergyIntegration> forgeEnergyManager = new CapabilityWrapperManager<>(IEnergyWrapper.class, ForgeEnergyIntegration.class);
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing side)
|
||||
|
||||
Reference in new issue
Block a user