generated from tilera/1710mod
fix: biometric identifier
This commit is contained in:
parent
4c1b25736b
commit
b9b8794c62
|
@ -28,7 +28,7 @@ sourceSets {
|
|||
api {}
|
||||
}
|
||||
|
||||
version = "1.0.2"
|
||||
version = "1.0.3"
|
||||
group = "universalelectricity"
|
||||
archivesBaseName = "mffs"
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraft.nbt.NBTBase;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
||||
|
@ -42,6 +43,15 @@ public abstract class TileEntityInventory
|
|||
// return objects;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
this.writeToNBT(nbt);
|
||||
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager arg0,
|
||||
S35PacketUpdateTileEntity arg1) {
|
||||
|
|
|
@ -18,6 +18,7 @@ import mffs.tileentity.TileEntityForceField;
|
|||
import micdoodle8.mods.galacticraft.api.block.IPartialSealableBlock;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -114,14 +115,20 @@ public class BlockForceField
|
|||
public AxisAlignedBB getCollisionBoundingBoxFromPool(final World world,
|
||||
final int x, final int y,
|
||||
final int z) {
|
||||
if (this.getProjector((IBlockAccess)world, x, y, z) != null) {
|
||||
if (world.isRemote) {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if (player.isSneaking()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (this.getProjector((IBlockAccess)world, x, y, z) != null && !world.isRemote) {
|
||||
final IBiometricIdentifier BiometricIdentifier =
|
||||
this.getProjector((IBlockAccess)world, x, y, z)
|
||||
.getBiometricIdentifier();
|
||||
final List entities = world.getEntitiesWithinAABB(
|
||||
EntityPlayer.class, AxisAlignedBB.getBoundingBox(
|
||||
(double)x, (double)y, (double)z,
|
||||
(double)(x + 1), y + 0.9, (double)(z + 1)));
|
||||
(double)(x), (double)y, (double)(z),
|
||||
(double)(x + 1), y + 1, (double)(z + 1)));
|
||||
for (final EntityPlayer entityPlayer : (List<EntityPlayer>)entities) {
|
||||
if (entityPlayer != null && entityPlayer.isSneaking()) {
|
||||
if (entityPlayer.capabilities.isCreativeMode) {
|
||||
|
|
|
@ -23,6 +23,7 @@ public class GuiBiometricIdentifier extends GuiBase {
|
|||
final TileEntityBiometricIdentifier tileEntity) {
|
||||
super(new ContainerBiometricIdentifier(player, tileEntity), tileEntity);
|
||||
this.tileEntity = tileEntity;
|
||||
tileEntity.canUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -141,7 +142,11 @@ public class GuiBiometricIdentifier extends GuiBase {
|
|||
|
||||
@Override
|
||||
protected void actionPerformed(final GuiButton guiButton) {
|
||||
ModularForceFieldSystem.channel.sendToServer(new PacketTile(
|
||||
PacketTile.Type.TOGGLE_MODE, new Vector3(this.tileEntity), new NBTTagCompound()));
|
||||
super.actionPerformed(guiButton);
|
||||
if (guiButton.id > 0) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("buttonId", guiButton.id - 1);
|
||||
ModularForceFieldSystem.channel.sendToServer(new PacketTile(PacketTile.Type.TOGGLE_MODE, new Vector3(this.tileEntity), nbt));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue