use of net.minecraft.world.ChunkPosition in project PneumaticCraft by MineMaarten.
the class TileEntityKeroseneLamp method readFromNBT.
@Override
public void readFromNBT(NBTTagCompound tag) {
super.readFromNBT(tag);
managingLights.clear();
NBTTagList lights = tag.getTagList("lights", 10);
for (int i = 0; i < lights.tagCount(); i++) {
NBTTagCompound t = lights.getCompoundTagAt(i);
managingLights.add(new ChunkPosition(t.getInteger("x"), t.getInteger("y"), t.getInteger("z")));
}
tank.readFromNBT(tag.getCompoundTag("tank"));
redstoneMode = tag.getByte("redstoneMode");
targetRange = tag.getByte("targetRange");
range = tag.getByte("range");
sideConnected = ForgeDirection.getOrientation(tag.getByte("sideConnected"));
readInventoryFromNBT(tag, inventory);
}
use of net.minecraft.world.ChunkPosition in project PneumaticCraft by MineMaarten.
the class TileEntityProgrammer method previewArea.
public boolean previewArea(int widgetX, int widgetY) {
for (IProgWidget w : progWidgets) {
if (w.getX() == widgetX && w.getY() == widgetY && w instanceof IAreaProvider) {
Set<ChunkPosition> area = new HashSet<ChunkPosition>();
((IAreaProvider) w).getArea(area);
AreaShowManager.getInstance().showArea(area, 0x00FF00, this);
}
}
return true;
}
use of net.minecraft.world.ChunkPosition in project SecurityCraft by Geforce132.
the class BlockEMPedWire method func_150177_e.
private void func_150177_e(World p_150177_1_, int p_150177_2_, int p_150177_3_, int p_150177_4_) {
this.func_150175_a(p_150177_1_, p_150177_2_, p_150177_3_, p_150177_4_, p_150177_2_, p_150177_3_, p_150177_4_);
ArrayList arraylist = new ArrayList(this.field_150179_b);
this.field_150179_b.clear();
for (int l = 0; l < arraylist.size(); ++l) {
ChunkPosition chunkposition = (ChunkPosition) arraylist.get(l);
p_150177_1_.notifyBlocksOfNeighborChange(chunkposition.chunkPosX, chunkposition.chunkPosY, chunkposition.chunkPosZ, this);
}
}
use of net.minecraft.world.ChunkPosition in project SecurityCraft by Geforce132.
the class BlockEMPedWire method func_150175_a.
private void func_150175_a(World p_150175_1_, int p_150175_2_, int p_150175_3_, int p_150175_4_, int p_150175_5_, int p_150175_6_, int p_150175_7_) {
int k1 = p_150175_1_.getBlockMetadata(p_150175_2_, p_150175_3_, p_150175_4_);
byte b0 = 0;
int i3 = this.func_150178_a(p_150175_1_, p_150175_5_, p_150175_6_, p_150175_7_, b0);
this.field_150181_a = false;
int l1 = p_150175_1_.getStrongestIndirectPower(p_150175_2_, p_150175_3_, p_150175_4_);
this.field_150181_a = true;
if (l1 > 0 && l1 > i3 - 1) {
i3 = l1;
}
int i2 = 0;
for (int j2 = 0; j2 < 4; ++j2) {
int k2 = p_150175_2_;
int l2 = p_150175_4_;
if (j2 == 0) {
k2 = p_150175_2_ - 1;
}
if (j2 == 1) {
++k2;
}
if (j2 == 2) {
l2 = p_150175_4_ - 1;
}
if (j2 == 3) {
++l2;
}
if (k2 != p_150175_5_ || l2 != p_150175_7_) {
i2 = this.func_150178_a(p_150175_1_, k2, p_150175_3_, l2, i2);
}
if (p_150175_1_.getBlock(k2, p_150175_3_, l2).isNormalCube() && !p_150175_1_.getBlock(p_150175_2_, p_150175_3_ + 1, p_150175_4_).isNormalCube()) {
if ((k2 != p_150175_5_ || l2 != p_150175_7_) && p_150175_3_ >= p_150175_6_) {
i2 = this.func_150178_a(p_150175_1_, k2, p_150175_3_ + 1, l2, i2);
}
} else if (!p_150175_1_.getBlock(k2, p_150175_3_, l2).isNormalCube() && (k2 != p_150175_5_ || l2 != p_150175_7_) && p_150175_3_ <= p_150175_6_) {
i2 = this.func_150178_a(p_150175_1_, k2, p_150175_3_ - 1, l2, i2);
}
}
if (i2 > i3) {
i3 = i2 - 1;
} else if (i3 > 0) {
--i3;
} else {
i3 = 0;
}
if (l1 > i3 - 1) {
i3 = l1;
}
if (k1 != i3) {
p_150175_1_.setBlockMetadataWithNotify(p_150175_2_, p_150175_3_, p_150175_4_, i3, 2);
this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_, p_150175_4_));
this.field_150179_b.add(new ChunkPosition(p_150175_2_ - 1, p_150175_3_, p_150175_4_));
this.field_150179_b.add(new ChunkPosition(p_150175_2_ + 1, p_150175_3_, p_150175_4_));
this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_ - 1, p_150175_4_));
this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_ + 1, p_150175_4_));
this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_, p_150175_4_ - 1));
this.field_150179_b.add(new ChunkPosition(p_150175_2_, p_150175_3_, p_150175_4_ + 1));
}
}
Aggregations