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