mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-12 10:20:28 +00:00
Add back several more methods for Plethora
While Plethora has been updated to no longer require these, it's probably worth keeping them around a little longer, as people may not upgrade them in sync.
This commit is contained in:
parent
a777801e15
commit
101b3500cc
@ -7,6 +7,7 @@
|
||||
package dan200.computercraft.shared.computer.blocks;
|
||||
|
||||
import dan200.computercraft.shared.computer.core.ComputerFamily;
|
||||
import dan200.computercraft.shared.computer.core.IComputer;
|
||||
|
||||
public interface IComputerTile
|
||||
{
|
||||
@ -19,4 +20,7 @@ public interface IComputerTile
|
||||
void setLabel( String label );
|
||||
|
||||
ComputerFamily getFamily();
|
||||
|
||||
@Deprecated
|
||||
IComputer getComputer();
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import dan200.computercraft.shared.common.IDirectionalTile;
|
||||
import dan200.computercraft.shared.common.TileGeneric;
|
||||
import dan200.computercraft.shared.computer.core.ClientComputer;
|
||||
import dan200.computercraft.shared.computer.core.ComputerFamily;
|
||||
import dan200.computercraft.shared.computer.core.IComputer;
|
||||
import dan200.computercraft.shared.computer.core.ServerComputer;
|
||||
import dan200.computercraft.shared.util.DirectionUtil;
|
||||
import dan200.computercraft.shared.util.RedstoneUtil;
|
||||
@ -407,6 +408,13 @@ public abstract class TileComputerBase extends TileGeneric implements IComputerT
|
||||
return ComputerFamily.Normal;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public IComputer getComputer()
|
||||
{
|
||||
return getWorld().isRemote ? getClientComputer() : getServerComputer();
|
||||
}
|
||||
|
||||
public ServerComputer createServerComputer()
|
||||
{
|
||||
if( getWorld().isRemote ) return null;
|
||||
|
@ -64,6 +64,13 @@ public class ClientComputer extends ClientTerminal implements IComputer
|
||||
return m_instanceID;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public String getLabel()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOn()
|
||||
{
|
||||
|
@ -13,6 +13,9 @@ public interface IComputer extends ITerminal
|
||||
{
|
||||
int getInstanceID();
|
||||
|
||||
@Deprecated
|
||||
String getLabel();
|
||||
|
||||
boolean isOn();
|
||||
|
||||
boolean isCursorDisplayed();
|
||||
|
@ -231,6 +231,8 @@ public class ServerComputer extends ServerTerminal implements IComputer, IComput
|
||||
return m_computer.getID();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings( "deprecation" )
|
||||
public String getLabel()
|
||||
{
|
||||
return m_computer.getLabel();
|
||||
|
@ -63,4 +63,10 @@ public class DirectionUtil
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static float toYawAngle( EnumFacing dir )
|
||||
{
|
||||
return dir.getHorizontalAngle();
|
||||
}
|
||||
}
|
||||
|
@ -15,6 +15,12 @@ import net.minecraft.world.World;
|
||||
|
||||
public class RedstoneUtil
|
||||
{
|
||||
@Deprecated
|
||||
public static int getRedstoneOutput( World world, BlockPos pos, EnumFacing side )
|
||||
{
|
||||
return world.getRedstonePower( pos, side );
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static int getBundledRedstoneOutput( World world, BlockPos pos, EnumFacing side )
|
||||
{
|
||||
|
@ -25,8 +25,15 @@ import java.util.List;
|
||||
|
||||
public class WorldUtil
|
||||
{
|
||||
@SuppressWarnings( "Guava" )
|
||||
private static final Predicate<Entity> CAN_COLLIDE = x -> x != null && !x.isDead && x.canBeCollidedWith();
|
||||
|
||||
@Deprecated
|
||||
public static boolean isBlockInWorld( World world, BlockPos pos )
|
||||
{
|
||||
return world.isValid( pos );
|
||||
}
|
||||
|
||||
public static boolean isLiquidBlock( World world, BlockPos pos )
|
||||
{
|
||||
return world.getBlockState( pos ).getMaterial().isLiquid();
|
||||
|
Loading…
Reference in New Issue
Block a user