mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-26 08:56:54 +00:00
Add additional method stubs to the TurtlePlayer
Forge's default fake player implementation doesn't override all methods which use the connection. As it is not set, we get an NPE and thus crash the server. We simply stub those methods out ourselves to prevent such an issue.
This commit is contained in:
parent
914df8b0c7
commit
e2e6946c92
@ -11,10 +11,16 @@ import dan200.computercraft.api.turtle.ITurtleAccess;
|
||||
import dan200.computercraft.shared.util.InventoryUtil;
|
||||
import dan200.computercraft.shared.util.WorldUtil;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.IMerchant;
|
||||
import net.minecraft.entity.passive.AbstractHorse;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntitySign;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IInteractionObject;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.util.FakePlayer;
|
||||
@ -73,6 +79,12 @@ public class TurtlePlayer extends FakePlayer
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vec3d getPositionVector()
|
||||
{
|
||||
return new Vec3d( posX, posY, posZ );
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getEyeHeight()
|
||||
{
|
||||
@ -85,6 +97,63 @@ public class TurtlePlayer extends FakePlayer
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendEnterCombat()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendEndCombat()
|
||||
{
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public SleepResult trySleep( @Nonnull BlockPos bedLocation )
|
||||
{
|
||||
return SleepResult.OTHER_PROBLEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openEditSign( TileEntitySign signTile )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayGui( IInteractionObject guiOwner )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayGUIChest( IInventory chestInventory )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayVillagerTradeGui( IMerchant villager )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openGuiHorseInventory( AbstractHorse horse, IInventory inventoryIn )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openBook( ItemStack stack, @Nonnull EnumHand hand )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateHeldItem()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onItemUseFinish()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mountEntityAndWakeUp()
|
||||
{
|
||||
@ -94,9 +163,4 @@ public class TurtlePlayer extends FakePlayer
|
||||
public void dismountEntity( @Nonnull Entity entity )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openEditSign( TileEntitySign signTile )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user