Fixed IC2 integration, minor cleanup
This commit is contained in:
parent
29749ca510
commit
17d4acf389
5 changed files with 13 additions and 8 deletions
|
@ -36,6 +36,7 @@ import mekanism.common.TileEntityPurificationChamber;
|
|||
import mekanism.common.TileEntityTeleporter;
|
||||
import mekanism.common.TileEntityTheoreticalElementizer;
|
||||
import mekanism.common.TileEntityUniversalCable;
|
||||
import net.minecraft.client.audio.SoundManager;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -83,7 +84,7 @@ public class ClientProxy extends CommonProxy
|
|||
@Override
|
||||
public void registerSound(TileEntity tileEntity)
|
||||
{
|
||||
if(Mekanism.enableSounds && FMLClientHandler.instance().getClient().sndManager.sndSystem != null)
|
||||
if(Mekanism.enableSounds && SoundManager.sndSystem != null)
|
||||
{
|
||||
synchronized(Mekanism.audioHandler.sounds)
|
||||
{
|
||||
|
@ -95,7 +96,7 @@ public class ClientProxy extends CommonProxy
|
|||
@Override
|
||||
public void unregisterSound(TileEntity tileEntity)
|
||||
{
|
||||
if(Mekanism.enableSounds && FMLClientHandler.instance().getClient().sndManager.sndSystem != null)
|
||||
if(Mekanism.enableSounds && SoundManager.sndSystem != null)
|
||||
{
|
||||
synchronized(Mekanism.audioHandler.sounds)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,6 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ public final class CableUtils
|
|||
* @param ignored - ignored acceptors
|
||||
* @return rejected energy
|
||||
*/
|
||||
public static double emitEnergyFromAllSides(double amount, TileEntity pointer, ArrayList ignored)
|
||||
public static double emitEnergyFromAllSides(double amount, TileEntity pointer, ArrayList<TileEntity> ignored)
|
||||
{
|
||||
if(pointer != null)
|
||||
{
|
||||
|
@ -219,12 +219,17 @@ public final class CableUtils
|
|||
{
|
||||
TileEntity sideTile = Object3D.get(pointer).getFromSide(side).getTileEntity(pointer.worldObj);
|
||||
|
||||
if(sideTile instanceof IUniversalCable)
|
||||
if(sideTile instanceof IUniversalCable && !ignored.contains(sideTile))
|
||||
{
|
||||
networks.add(((IUniversalCable)sideTile).getNetwork());
|
||||
}
|
||||
}
|
||||
|
||||
if(networks.size() == 0)
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
|
||||
double remaining = amount%networks.size();
|
||||
double splitEnergy = (amount-remaining)/networks.size();
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class IC2EnergyHandler
|
|||
{
|
||||
IEnergySource source = (IEnergySource)tileEntity;
|
||||
|
||||
if(!source.emitsEnergyTo(tile, MekanismUtils.toIC2Direction(orientation.getOpposite())))
|
||||
if(!source.emitsEnergyTo(tile, MekanismUtils.toIC2Direction(orientation)))
|
||||
{
|
||||
ignoredTiles.add(tile);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
|||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if(!initialized && worldObj != null)
|
||||
if(!initialized && worldObj != null && !worldObj.isRemote)
|
||||
{
|
||||
if(Mekanism.hooks.IC2Loaded)
|
||||
{
|
||||
|
@ -146,7 +146,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
|
|||
{
|
||||
ElectricityNetworkHelper.invalidate(this);
|
||||
|
||||
if(initialized)
|
||||
if(initialized && !worldObj.isRemote)
|
||||
{
|
||||
if(Mekanism.hooks.IC2Loaded)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue