mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 08:54:12 +00:00
Fixup faucets
This commit is contained in:
1 parent
a1b8d62dcb
commit
15a9af60c8
2 files changed
+38
-17
No files matched your search
@@ -2,16 +2,6 @@ package tconstruct.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.CastingBasinLogic;
|
||||
import tconstruct.blocks.logic.CastingTableLogic;
|
||||
import tconstruct.blocks.logic.FaucetLogic;
|
||||
import tconstruct.client.block.SearedRender;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.event.SmelteryEvent;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import mantle.blocks.abstracts.InventoryBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -25,6 +15,18 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.blocks.logic.CastingBasinLogic;
|
||||
import tconstruct.blocks.logic.CastingTableLogic;
|
||||
import tconstruct.blocks.logic.FaucetLogic;
|
||||
import tconstruct.client.block.SearedRender;
|
||||
import tconstruct.library.TConstructRegistry;
|
||||
import tconstruct.library.event.SmelteryEvent;
|
||||
import tconstruct.library.tools.AbilityHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SearedBlock extends InventoryBlock
|
||||
{
|
||||
@@ -361,16 +363,35 @@ public class SearedBlock extends InventoryBlock
|
||||
return world.getBlockMetadata(x, y, z) == 1;
|
||||
}
|
||||
|
||||
private boolean wasPowered = false;
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange (World world, int x, int y, int z, Block neighborBlockID)
|
||||
{
|
||||
if (world.isBlockIndirectlyGettingPowered(x, y, z) && world.getBlockMetadata(x, y, z) == 1)
|
||||
if (world.getBlockMetadata(x, y, z) == 1)
|
||||
{
|
||||
FaucetLogic logic = (FaucetLogic) world.getTileEntity(x, y, z);
|
||||
logic.setActive(true);
|
||||
boolean isPowered = world.isBlockIndirectlyGettingPowered(x, y, z);
|
||||
if (!wasPowered && isPowered)
|
||||
{
|
||||
FaucetLogic logic = (FaucetLogic) world.getTileEntity(x, y, z);
|
||||
logic.setActive(true);
|
||||
}
|
||||
wasPowered = isPowered;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockOnSide (World world, int x, int y, int z, int side)
|
||||
{
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side ^ 1);
|
||||
TileEntity tile = world.getTileEntity(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
if (tile instanceof IFluidHandler)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity (World world, int metadata)
|
||||
{
|
||||
|
||||
@@ -103,13 +103,13 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
|
||||
@Override
|
||||
public void setDirection (int side)
|
||||
{
|
||||
//direction = (byte) side;
|
||||
direction = (byte) side;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDirection (float yaw, float pitch, EntityLivingBase player)
|
||||
{
|
||||
int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3;
|
||||
/*int facing = MathHelper.floor_double((double) (yaw / 360) + 0.5D) & 3;
|
||||
switch (facing)
|
||||
{
|
||||
case 0:
|
||||
@@ -127,7 +127,7 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
|
||||
case 3:
|
||||
direction = 4;
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -244,4 +244,4 @@ public class FaucetLogic extends TileEntity implements IFacingLogic, IActiveLogi
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user