v5.0.4 Beta #1
*Fixed console spam. *Bumped version to 5.0.4. *Fixed Smelting Factory not accepting electricity from wires. *Made OreDict handling code function more efficiently. *Fixed a few bugs in Smelting Factory container. *Added shift-click support for upgrades in Metallurgic Infuser. *Fixed sound identifiers.
This commit is contained in:
parent
573c21d8ad
commit
c96d591e11
9 changed files with 67 additions and 39 deletions
|
@ -65,9 +65,7 @@ public class SoundHandler
|
||||||
{
|
{
|
||||||
synchronized(sounds)
|
synchronized(sounds)
|
||||||
{
|
{
|
||||||
String s = getIdentifier();
|
return new Sound(getIdentifier(), path, world, x, y, z);
|
||||||
System.out.println(s);
|
|
||||||
return new Sound(s, path, world, x, y, z);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ package mekanism.common;
|
||||||
import ic2.api.IElectricItem;
|
import ic2.api.IElectricItem;
|
||||||
import mekanism.api.Infusion;
|
import mekanism.api.Infusion;
|
||||||
import mekanism.api.InfusionType;
|
import mekanism.api.InfusionType;
|
||||||
|
import mekanism.api.ItemMachineUpgrade;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
|
@ -68,23 +69,20 @@ public class ContainerMetallurgicInfuser extends Container
|
||||||
|
|
||||||
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3 && slotID != 4)
|
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3 && slotID != 4)
|
||||||
{
|
{
|
||||||
boolean isTin = false;
|
if(MekanismUtils.oreDictCheck(slotStack, "dustTin") && (tileEntity.type == InfusionType.TIN || tileEntity.type == InfusionType.NONE))
|
||||||
|
|
||||||
for(ItemStack ore : OreDictionary.getOres("dustTin"))
|
|
||||||
{
|
|
||||||
if(ore.isItemEqual(slotStack))
|
|
||||||
{
|
|
||||||
isTin = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isTin && (tileEntity.type == InfusionType.TIN || tileEntity.type == InfusionType.NONE))
|
|
||||||
{
|
{
|
||||||
if(!mergeItemStack(slotStack, 1, 2, false))
|
if(!mergeItemStack(slotStack, 1, 2, false))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||||
|
{
|
||||||
|
if(!mergeItemStack(slotStack, 0, 1, false))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(slotStack.isItemEqual(new ItemStack(Mekanism.CompressedCarbon)) && (tileEntity.type == InfusionType.COAL || tileEntity.type == InfusionType.NONE))
|
else if(slotStack.isItemEqual(new ItemStack(Mekanism.CompressedCarbon)) && (tileEntity.type == InfusionType.COAL || tileEntity.type == InfusionType.NONE))
|
||||||
{
|
{
|
||||||
if(!mergeItemStack(slotStack, 1, 2, false))
|
if(!mergeItemStack(slotStack, 1, 2, false))
|
||||||
|
|
|
@ -156,12 +156,6 @@ public class ContainerSmeltingFactory extends Container
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if(!mergeItemStack(slotStack, tileEntity.inventory.length, inventorySlots.size(), true))
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
* @author AidanBrady
|
* @author AidanBrady
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Mod(modid = "Mekanism", name = "Mekanism", version = "5.0.3")
|
@Mod(modid = "Mekanism", name = "Mekanism", version = "5.0.4")
|
||||||
@NetworkMod(channels = {"Mekanism"}, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
|
@NetworkMod(channels = {"Mekanism"}, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
|
||||||
public class Mekanism
|
public class Mekanism
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,7 @@ public class Mekanism
|
||||||
public static Configuration configuration;
|
public static Configuration configuration;
|
||||||
|
|
||||||
/** Mekanism version number */
|
/** Mekanism version number */
|
||||||
public static Version versionNumber = new Version(5, 0, 3);
|
public static Version versionNumber = new Version(5, 0, 4);
|
||||||
|
|
||||||
/** Mekanism creative tab */
|
/** Mekanism creative tab */
|
||||||
public static CreativeTabMekanism tabMekanism = new CreativeTabMekanism();
|
public static CreativeTabMekanism tabMekanism = new CreativeTabMekanism();
|
||||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
import cpw.mods.fml.server.FMLServerHandler;
|
import cpw.mods.fml.server.FMLServerHandler;
|
||||||
|
|
||||||
|
@ -251,4 +252,20 @@ public final class MekanismUtils
|
||||||
{
|
{
|
||||||
return getLeft(orientation).getOpposite();
|
return getLeft(orientation).getOpposite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean oreDictCheck(ItemStack check, String oreDict)
|
||||||
|
{
|
||||||
|
boolean hasResource = false;
|
||||||
|
|
||||||
|
for(ItemStack ore : OreDictionary.getOres(oreDict))
|
||||||
|
{
|
||||||
|
|
||||||
|
if(ore.isItemEqual(check))
|
||||||
|
{
|
||||||
|
hasResource = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hasResource;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,12 +198,9 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else if(MekanismUtils.oreDictCheck(inventory[1], "dustTin"))
|
||||||
|
{
|
||||||
if(type == InfusionType.NONE || type == InfusionType.TIN)
|
if(type == InfusionType.NONE || type == InfusionType.TIN)
|
||||||
{
|
|
||||||
for(ItemStack itemStack : OreDictionary.getOres("dustTin"))
|
|
||||||
{
|
|
||||||
if(inventory[1] != null && inventory[1].isItemEqual(itemStack))
|
|
||||||
{
|
{
|
||||||
infuseStored += 100;
|
infuseStored += 100;
|
||||||
inventory[1].stackSize--;
|
inventory[1].stackSize--;
|
||||||
|
@ -216,8 +213,6 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(canOperate() && (operatingTicks+1) < currentTicksRequired)
|
if(canOperate() && (operatingTicks+1) < currentTicksRequired)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,9 +19,11 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraftforge.common.ForgeDirection;
|
import net.minecraftforge.common.ForgeDirection;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import universalelectricity.core.electricity.ElectricityConnections;
|
import universalelectricity.core.electricity.ElectricityConnections;
|
||||||
|
import universalelectricity.core.implement.IConductor;
|
||||||
import universalelectricity.core.implement.IItemElectric;
|
import universalelectricity.core.implement.IItemElectric;
|
||||||
import universalelectricity.core.implement.IJouleStorage;
|
import universalelectricity.core.implement.IJouleStorage;
|
||||||
import universalelectricity.core.implement.IVoltage;
|
import universalelectricity.core.implement.IVoltage;
|
||||||
|
import universalelectricity.core.vector.Vector3;
|
||||||
|
|
||||||
import com.google.common.io.ByteArrayDataInput;
|
import com.google.common.io.ByteArrayDataInput;
|
||||||
|
|
||||||
|
@ -78,6 +80,30 @@ public class TileEntitySmeltingFactory extends TileEntityElectricBlock implement
|
||||||
|
|
||||||
boolean testActive = false;
|
boolean testActive = false;
|
||||||
|
|
||||||
|
if(!worldObj.isRemote)
|
||||||
|
{
|
||||||
|
for(ForgeDirection direction : ForgeDirection.values())
|
||||||
|
{
|
||||||
|
TileEntity tileEntity = Vector3.getTileEntityFromSide(worldObj, new Vector3(this), direction);
|
||||||
|
if(tileEntity != null)
|
||||||
|
{
|
||||||
|
if(tileEntity instanceof IConductor)
|
||||||
|
{
|
||||||
|
if(electricityStored < currentMaxElectricity)
|
||||||
|
{
|
||||||
|
double electricityNeeded = currentMaxElectricity - electricityStored;
|
||||||
|
((IConductor)tileEntity).getNetwork().startRequesting(this, electricityNeeded, electricityNeeded >= getVoltage() ? getVoltage() : electricityNeeded);
|
||||||
|
setJoules(electricityStored + ((IConductor)tileEntity).getNetwork().consumeElectricity(this).getWatts());
|
||||||
|
}
|
||||||
|
else if(electricityStored >= currentMaxElectricity)
|
||||||
|
{
|
||||||
|
((IConductor)tileEntity).getNetwork().stopRequesting(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(int i : progress)
|
for(int i : progress)
|
||||||
{
|
{
|
||||||
if(i > 0)
|
if(i > 0)
|
||||||
|
|
|
@ -19,7 +19,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
|
|
||||||
@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.0.3", dependencies = "required-after:Mekanism")
|
@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.0.4", dependencies = "required-after:Mekanism")
|
||||||
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
||||||
public class MekanismGenerators
|
public class MekanismGenerators
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ import cpw.mods.fml.common.network.NetworkMod;
|
||||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||||
|
|
||||||
@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.0.3", dependencies = "required-after:Mekanism")
|
@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.0.4", dependencies = "required-after:Mekanism")
|
||||||
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
|
||||||
public class MekanismTools
|
public class MekanismTools
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue