mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Merge branch '1.9.4' into 1.10
* 1.9.4: Better Structural Glass recipe Fixed Portable Teleporter issue, fixed compounded Factory localization, add upgrades support to Solar Neutron Activator
This commit is contained in:
commit
32241b9121
6 files changed
+78
-49
No files matched your search
@@ -12,6 +12,7 @@ import mekanism.client.gui.element.GuiSecurityTab;
|
||||
import mekanism.client.gui.element.GuiSlot;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.element.GuiSlot.SlotType;
|
||||
import mekanism.client.gui.element.GuiUpgradeTab;
|
||||
import mekanism.common.inventory.container.ContainerSolarNeutronActivator;
|
||||
import mekanism.common.tile.TileEntitySolarNeutronActivator;
|
||||
import mekanism.common.util.LangUtils;
|
||||
@@ -35,6 +36,7 @@ public class GuiSolarNeutronActivator extends GuiMekanism
|
||||
|
||||
guiElements.add(new GuiSecurityTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
guiElements.add(new GuiUpgradeTab(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 4, 55).with(SlotOverlay.MINUS));
|
||||
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 154, 55).with(SlotOverlay.PLUS));
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import mcmultipart.MCMultiPartMod;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.api.MekanismAPI;
|
||||
@@ -378,7 +379,7 @@ public class Mekanism
|
||||
" I ", "IBI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('B'), Items.BUCKET
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 4, 10),
|
||||
" I ", "IGI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('G'), "blockGlass"
|
||||
" I ", "IGI", " I ", Character.valueOf('I'), "ingotSteel", Character.valueOf('G'), "blockGlass"
|
||||
));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedMekanismRecipe(new ItemStack(MekanismBlocks.BasicBlock, 2, 11),
|
||||
" I ", "ICI", " I ", Character.valueOf('I'), new ItemStack(MekanismBlocks.BasicBlock, 1, 9), Character.valueOf('C'), MekanismUtils.getControlCircuit(BaseTier.BASIC)
|
||||
@@ -1479,7 +1480,7 @@ public class Mekanism
|
||||
MekanismAPI.addBoxBlacklist(Blocks.ACACIA_DOOR, OreDictionary.WILDCARD_VALUE);
|
||||
MekanismAPI.addBoxBlacklist(Blocks.DARK_OAK_DOOR, OreDictionary.WILDCARD_VALUE);
|
||||
MekanismAPI.addBoxBlacklist(Blocks.IRON_DOOR, OreDictionary.WILDCARD_VALUE);
|
||||
//MekanismAPI.addBoxBlacklist(MultipartProxy.block(), OreDictionary.WILDCARD_VALUE); TODO
|
||||
MekanismAPI.addBoxBlacklist(MCMultiPartMod.multipart, OreDictionary.WILDCARD_VALUE);
|
||||
|
||||
BoxBlacklistParser.load();
|
||||
}
|
||||
|
||||
@@ -109,31 +109,34 @@ public class PacketPortableTeleporter implements IMessageHandler<PortableTelepor
|
||||
|
||||
Coord4D coords = found.getClosestCoords(new Coord4D(player));
|
||||
|
||||
World teleWorld = FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(coords.dimensionId);
|
||||
TileEntityTeleporter teleporter = (TileEntityTeleporter)coords.getTileEntity(teleWorld);
|
||||
|
||||
if(teleporter != null)
|
||||
if(coords != null)
|
||||
{
|
||||
try {
|
||||
teleporter.didTeleport.add(player.getPersistentID());
|
||||
teleporter.teleDelay = 5;
|
||||
|
||||
item.setEnergy(itemstack, item.getEnergy(itemstack) - item.calculateEnergyCost(player, coords));
|
||||
|
||||
if(player instanceof EntityPlayerMP)
|
||||
{
|
||||
ReflectionUtils.setPrivateValue(((EntityPlayerMP)player).connection, 0, NetHandlerPlayServer.class, ObfuscatedNames.NetHandlerPlayServer_floatingTickCount);
|
||||
}
|
||||
|
||||
player.closeScreen();
|
||||
|
||||
Mekanism.packetHandler.sendToAllAround(new PortalFXMessage(new Coord4D(player)), coords.getTargetPoint(40D));
|
||||
TileEntityTeleporter.teleportPlayerTo((EntityPlayerMP)player, coords, teleporter);
|
||||
TileEntityTeleporter.alignPlayer((EntityPlayerMP)player, coords);
|
||||
|
||||
world.playSound(player, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1.0F, 1.0F);
|
||||
Mekanism.packetHandler.sendToReceivers(new PortalFXMessage(coords), new Range4D(coords));
|
||||
} catch(Exception e) {}
|
||||
World teleWorld = FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(coords.dimensionId);
|
||||
TileEntityTeleporter teleporter = (TileEntityTeleporter)coords.getTileEntity(teleWorld);
|
||||
|
||||
if(teleporter != null)
|
||||
{
|
||||
try {
|
||||
teleporter.didTeleport.add(player.getPersistentID());
|
||||
teleporter.teleDelay = 5;
|
||||
|
||||
item.setEnergy(itemstack, item.getEnergy(itemstack) - item.calculateEnergyCost(player, coords));
|
||||
|
||||
if(player instanceof EntityPlayerMP)
|
||||
{
|
||||
ReflectionUtils.setPrivateValue(((EntityPlayerMP)player).connection, 0, NetHandlerPlayServer.class, ObfuscatedNames.NetHandlerPlayServer_floatingTickCount);
|
||||
}
|
||||
|
||||
player.closeScreen();
|
||||
|
||||
Mekanism.packetHandler.sendToAllAround(new PortalFXMessage(new Coord4D(player)), coords.getTargetPoint(40D));
|
||||
TileEntityTeleporter.teleportPlayerTo((EntityPlayerMP)player, coords, teleporter);
|
||||
TileEntityTeleporter.alignPlayer((EntityPlayerMP)player, coords);
|
||||
|
||||
world.playSound(player, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMEN_TELEPORT, SoundCategory.PLAYERS, 1.0F, 1.0F);
|
||||
Mekanism.packetHandler.sendToReceivers(new PortalFXMessage(coords), new Range4D(coords));
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -28,11 +28,11 @@ public class SolarNeutronRecipe extends MachineRecipe<GasInput, GasOutput, Solar
|
||||
return getInput().useGas(inputTank, false, 1) && getOutput().applyOutputs(outputTank, false, 1);
|
||||
}
|
||||
|
||||
public void operate(GasTank inputTank, GasTank outputTank)
|
||||
public void operate(GasTank inputTank, GasTank outputTank, int scale)
|
||||
{
|
||||
if(getInput().useGas(inputTank, true, 1))
|
||||
if(getInput().useGas(inputTank, true, scale))
|
||||
{
|
||||
getOutput().applyOutputs(outputTank, true, 1);
|
||||
getOutput().applyOutputs(outputTank, true, scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,12 +57,14 @@ import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ChargeUtils;
|
||||
import mekanism.common.util.InventoryUtils;
|
||||
import mekanism.common.util.ItemDataUtils;
|
||||
import mekanism.common.util.LangUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.StatUtils;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -921,6 +923,11 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
if(I18n.canTranslate("tile." + tier.getBaseTier().getName() + recipeType.getUnlocalizedName() + "Factory"))
|
||||
{
|
||||
return LangUtils.localize("tile." + tier.getBaseTier().getName() + recipeType.getUnlocalizedName() + "Factory");
|
||||
}
|
||||
|
||||
return tier.getBaseTier().getLocalizedName() + " " + recipeType.getLocalizedName() + " " + super.getName();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package mekanism.common.tile;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.MekanismConfig.general;
|
||||
@@ -15,11 +16,14 @@ import mekanism.api.gas.GasTransmission;
|
||||
import mekanism.api.gas.IGasHandler;
|
||||
import mekanism.api.gas.ITubeConnection;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.Upgrade;
|
||||
import mekanism.common.Upgrade.IUpgradeInfoHandler;
|
||||
import mekanism.common.base.IActiveState;
|
||||
import mekanism.common.base.IBoundingBlock;
|
||||
import mekanism.common.base.IRedstoneControl;
|
||||
import mekanism.common.base.ISustainedData;
|
||||
import mekanism.common.base.ITankManager;
|
||||
import mekanism.common.base.IUpgradeTile;
|
||||
import mekanism.common.capabilities.Capabilities;
|
||||
import mekanism.common.network.PacketTileEntity.TileEntityMessage;
|
||||
import mekanism.common.recipe.RecipeHandler;
|
||||
@@ -27,6 +31,7 @@ import mekanism.common.recipe.inputs.GasInput;
|
||||
import mekanism.common.recipe.machines.SolarNeutronRecipe;
|
||||
import mekanism.common.security.ISecurityTile;
|
||||
import mekanism.common.tile.component.TileComponentSecurity;
|
||||
import mekanism.common.tile.component.TileComponentUpgrade;
|
||||
import mekanism.common.util.ItemDataUtils;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -40,13 +45,12 @@ import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock implements IRedstoneControl, IBoundingBlock, IGasHandler, ITubeConnection, IActiveState, ISustainedData, ITankManager, ISecurityTile
|
||||
public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock implements IRedstoneControl, IBoundingBlock, IGasHandler, ITubeConnection, IActiveState, ISustainedData, ITankManager, ISecurityTile, IUpgradeTile, IUpgradeInfoHandler
|
||||
{
|
||||
public GasTank inputTank = new GasTank(MAX_GAS);
|
||||
public GasTank outputTank = new GasTank(MAX_GAS);
|
||||
|
||||
public static final int MAX_GAS = 10000;
|
||||
public static final int TICKS_REQUIRED = 5;
|
||||
|
||||
public int updateDelay;
|
||||
|
||||
@@ -56,19 +60,19 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
|
||||
public int gasOutput = 256;
|
||||
|
||||
public int recipeTicks = 0;
|
||||
|
||||
public SolarNeutronRecipe cachedRecipe;
|
||||
|
||||
/** This machine's current RedstoneControl type. */
|
||||
public RedstoneControl controlType = RedstoneControl.DISABLED;
|
||||
|
||||
public TileComponentUpgrade upgradeComponent = new TileComponentUpgrade(this, 3);
|
||||
public TileComponentSecurity securityComponent = new TileComponentSecurity(this);
|
||||
|
||||
public TileEntitySolarNeutronActivator()
|
||||
{
|
||||
super("SolarNeutronActivator");
|
||||
inventory = new ItemStack[3];
|
||||
upgradeComponent.setSupported(Upgrade.ENERGY, false);
|
||||
inventory = new ItemStack[4];
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,18 +119,10 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
{
|
||||
setActive(true);
|
||||
|
||||
if(recipeTicks == TICKS_REQUIRED)
|
||||
{
|
||||
operate(recipe);
|
||||
recipeTicks = 0;
|
||||
}
|
||||
else {
|
||||
recipeTicks++;
|
||||
}
|
||||
int operations = operate(recipe);
|
||||
}
|
||||
else {
|
||||
setActive(false);
|
||||
recipeTicks = 0;
|
||||
}
|
||||
|
||||
if(outputTank.getGas() != null)
|
||||
@@ -146,6 +142,14 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
}
|
||||
}
|
||||
|
||||
public int getUpgradedUsage()
|
||||
{
|
||||
int possibleProcess = (int)Math.pow(2, upgradeComponent.getUpgrades(Upgrade.SPEED));
|
||||
possibleProcess = Math.min(Math.min(inputTank.getStored(), outputTank.getNeeded()), possibleProcess);
|
||||
|
||||
return possibleProcess;
|
||||
}
|
||||
|
||||
public boolean isDesert()
|
||||
{
|
||||
return worldObj.provider.getBiomeForCoords(getPos()) instanceof BiomeDesert;
|
||||
@@ -173,9 +177,13 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
return recipe != null && recipe.canOperate(inputTank, outputTank);
|
||||
}
|
||||
|
||||
public void operate(SolarNeutronRecipe recipe)
|
||||
public int operate(SolarNeutronRecipe recipe)
|
||||
{
|
||||
recipe.operate(inputTank, outputTank);
|
||||
int operations = getUpgradedUsage();
|
||||
|
||||
recipe.operate(inputTank, outputTank, operations);
|
||||
|
||||
return operations;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -186,7 +194,6 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
|
||||
{
|
||||
isActive = dataStream.readBoolean();
|
||||
recipeTicks = dataStream.readInt();
|
||||
controlType = RedstoneControl.values()[dataStream.readInt()];
|
||||
|
||||
if(dataStream.readBoolean())
|
||||
@@ -220,7 +227,6 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
super.getNetworkedData(data);
|
||||
|
||||
data.add(isActive);
|
||||
data.add(recipeTicks);
|
||||
data.add(controlType.ordinal());
|
||||
|
||||
if(inputTank.getGas() != null)
|
||||
@@ -252,7 +258,6 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
super.readFromNBT(nbtTags);
|
||||
|
||||
isActive = nbtTags.getBoolean("isActive");
|
||||
recipeTicks = nbtTags.getInteger("recipeTicks");
|
||||
controlType = RedstoneControl.values()[nbtTags.getInteger("controlType")];
|
||||
|
||||
inputTank.read(nbtTags.getCompoundTag("inputTank"));
|
||||
@@ -265,7 +270,6 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
super.writeToNBT(nbtTags);
|
||||
|
||||
nbtTags.setBoolean("isActive", isActive);
|
||||
nbtTags.setInteger("recipeTicks", recipeTicks);
|
||||
nbtTags.setInteger("controlType", controlType.ordinal());
|
||||
|
||||
nbtTags.setTag("inputTank", inputTank.write(new NBTTagCompound()));
|
||||
@@ -435,6 +439,18 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
||||
return securityComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileComponentUpgrade getComponent()
|
||||
{
|
||||
return upgradeComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getInfo(Upgrade upgrade)
|
||||
{
|
||||
return upgrade == Upgrade.SPEED ? upgrade.getExpScaledInfo(this) : upgrade.getMultScaledInfo(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getRenderBoundingBox()
|
||||
|
||||
Reference in new issue
Block a user