mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
Tweaked the Playerface System a bit, generally working beside from Items going into the Armor slots when they shouldn't
This commit is contained in:
parent
1b3cf54155
commit
a9bcf90fec
4 changed files with 8 additions and 3 deletions
|
@ -70,6 +70,7 @@ public class BlockPhantom extends BlockContainerBase implements INameableItem{
|
|||
TileEntityPhantomPlayerface phantom = (TileEntityPhantomPlayerface)tile;
|
||||
if(player.isSneaking()){
|
||||
phantom.boundPlayerUUID = player.getUniqueID().toString();
|
||||
player.addChatComponentMessage(new ChatComponentText("Bound to "+player.getDisplayName()));
|
||||
}
|
||||
}
|
||||
else if(tile instanceof IPhantomTile){
|
||||
|
|
|
@ -60,6 +60,7 @@ public class TileEntityBase extends TileEntity{
|
|||
GameRegistry.registerTileEntity(TileEntityEnervator.class, ModUtil.MOD_ID_LOWER + ":tileEntityEnervator");
|
||||
GameRegistry.registerTileEntity(TileEntityXPSolidifier.class, ModUtil.MOD_ID_LOWER+":tileEntityXPSolidifier");
|
||||
GameRegistry.registerTileEntity(TileEntityOreMagnet.class, ModUtil.MOD_ID_LOWER+":tileEntityOreMagnet");
|
||||
GameRegistry.registerTileEntity(TileEntityPhantomPlayerface.class, ModUtil.MOD_ID_LOWER+":tileEntityPhantomPlayerface");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package ellpeck.actuallyadditions.tile;
|
||||
|
||||
import ellpeck.actuallyadditions.util.WorldUtil;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class TileEntityPhantomPlayerface extends TileEntityInventoryBase{
|
||||
|
||||
|
@ -18,8 +20,9 @@ public class TileEntityPhantomPlayerface extends TileEntityInventoryBase{
|
|||
|
||||
@Override
|
||||
public void updateEntity(){
|
||||
if(!this.boundPlayerBefore.equals(this.boundPlayerUUID)){
|
||||
if(!Objects.equals(this.boundPlayerUUID, this.boundPlayerBefore)){
|
||||
this.boundPlayerBefore = this.boundPlayerUUID;
|
||||
WorldUtil.updateTileAndTilesAround(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +31,7 @@ public class TileEntityPhantomPlayerface extends TileEntityInventoryBase{
|
|||
if(!worldObj.isRemote && this.boundPlayerUUID != null){
|
||||
List<EntityPlayer> list = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
|
||||
for(EntityPlayer player : list){
|
||||
if(!player.getUniqueID().toString().equals(this.boundPlayerUUID)){
|
||||
if(player.getUniqueID().toString().equals(this.boundPlayerUUID)){
|
||||
return player.inventory;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
|
|||
this.boundPosition = null;
|
||||
}
|
||||
|
||||
if((this.boundPosition != null && (this.boundBlockBefore != this.boundPosition.getBlock() || !this.boundPosition.isEqual(boundPosBefore))) || this.range != this.rangeBefore){
|
||||
if(this.boundPosition != this.boundPosBefore || (this.boundPosition != null && this.boundPosition.getBlock() != this.boundBlockBefore) || this.rangeBefore != this.range){
|
||||
this.rangeBefore = this.range;
|
||||
this.boundPosBefore = this.boundPosition;
|
||||
this.boundBlockBefore = this.boundPosition == null ? null : this.boundPosition.getBlock();
|
||||
|
|
Loading…
Reference in a new issue