Fix up a bunch of "markBlockAsNeedsUpdate" to markBlockNeedsUpdate" and fixed engine to notify neighbours
This fixes the engine being a bit derpy when being rotated
This commit is contained in:
parent
890c4d45e9
commit
e8571a8e53
3 changed files with 22 additions and 22 deletions
|
@ -1,8 +1,8 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) SpaceToad, 2011
|
* Copyright (c) SpaceToad, 2011
|
||||||
* http://www.mod-buildcraft.com
|
* http://www.mod-buildcraft.com
|
||||||
*
|
*
|
||||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
|
@ -136,7 +136,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
|
||||||
}
|
}
|
||||||
|
|
||||||
if (done) {
|
if (done) {
|
||||||
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
|
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
|
||||||
sendNetworkUpdate();
|
sendNetworkUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
|
||||||
}
|
}
|
||||||
|
|
||||||
if (worldObj != null) {
|
if (worldObj != null) {
|
||||||
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
|
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentPattern == null) {
|
if (currentPattern == null) {
|
||||||
|
@ -309,7 +309,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
|
||||||
super.handleDescriptionPacket(packet);
|
super.handleDescriptionPacket(packet);
|
||||||
|
|
||||||
currentPattern = FillerManager.registry.getPattern(currentPatternId);
|
currentPattern = FillerManager.registry.getPattern(currentPatternId);
|
||||||
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
|
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
|
||||||
|
|
||||||
if (!initialized && box.isInitialized()) {
|
if (!initialized && box.isInitialized()) {
|
||||||
box.createLasers(worldObj, LaserKind.Stripes);
|
box.createLasers(worldObj, LaserKind.Stripes);
|
||||||
|
@ -323,7 +323,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
|
||||||
super.handleUpdatePacket(packet);
|
super.handleUpdatePacket(packet);
|
||||||
|
|
||||||
currentPattern = FillerManager.registry.getPattern(currentPatternId);
|
currentPattern = FillerManager.registry.getPattern(currentPatternId);
|
||||||
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
|
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
|
||||||
|
|
||||||
if (!initialized && box.isInitialized()) {
|
if (!initialized && box.isInitialized()) {
|
||||||
box.createLasers(worldObj, LaserKind.Stripes);
|
box.createLasers(worldObj, LaserKind.Stripes);
|
||||||
|
@ -393,11 +393,11 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
|
||||||
/* ISPECIALINVENTORY */
|
/* ISPECIALINVENTORY */
|
||||||
@Override
|
@Override
|
||||||
public int addItem(ItemStack stack, boolean doAdd, Orientations from) {
|
public int addItem(ItemStack stack, boolean doAdd, Orientations from) {
|
||||||
|
|
||||||
ITransactor transactor = new TransactorSimple(this);
|
ITransactor transactor = new TransactorSimple(this);
|
||||||
ItemStack added = transactor.add(stack, from, doAdd);
|
ItemStack added = transactor.add(stack, from, doAdd);
|
||||||
return added.stackSize;
|
return added.stackSize;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) SpaceToad, 2011
|
* Copyright (c) SpaceToad, 2011
|
||||||
* http://www.mod-buildcraft.com
|
* http://www.mod-buildcraft.com
|
||||||
*
|
*
|
||||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
|
@ -38,7 +38,7 @@ import net.minecraft.src.NBTTagCompound;
|
||||||
import net.minecraft.src.Packet;
|
import net.minecraft.src.Packet;
|
||||||
import net.minecraft.src.TileEntity;
|
import net.minecraft.src.TileEntity;
|
||||||
|
|
||||||
//TODO: All Engines need to take func_48081_b into account
|
//TODO: All Engines need to take func_48081_b into account
|
||||||
|
|
||||||
public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInventory, ITankContainer, IEngineProvider,
|
public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInventory, ITankContainer, IEngineProvider,
|
||||||
IOverrideDefaultTriggers, IPipeConnection, IBuilderInventory {
|
IOverrideDefaultTriggers, IPipeConnection, IBuilderInventory {
|
||||||
|
@ -132,7 +132,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
|
||||||
progressPart = 0;
|
progressPart = 0;
|
||||||
}
|
}
|
||||||
} else if (isRedstonePowered && engine.isActive()) {
|
} else if (isRedstonePowered && engine.isActive()) {
|
||||||
|
|
||||||
Position pos = new Position(xCoord, yCoord, zCoord, engine.orientation);
|
Position pos = new Position(xCoord, yCoord, zCoord, engine.orientation);
|
||||||
pos.moveForwards(1.0);
|
pos.moveForwards(1.0);
|
||||||
TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
|
TileEntity tile = worldObj.getBlockTileEntity((int) pos.x, (int) pos.y, (int) pos.z);
|
||||||
|
@ -148,7 +148,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
|
||||||
setActive(false);
|
setActive(false);
|
||||||
} else
|
} else
|
||||||
setActive(false);
|
setActive(false);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
setActive(false);
|
setActive(false);
|
||||||
|
|
||||||
|
@ -158,11 +158,11 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
|
||||||
private void setActive(boolean isActive) {
|
private void setActive(boolean isActive) {
|
||||||
if(this.isActive == isActive)
|
if(this.isActive == isActive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.isActive = isActive;
|
this.isActive = isActive;
|
||||||
sendNetworkUpdate();
|
sendNetworkUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createEngineIfNeeded() {
|
private void createEngineIfNeeded() {
|
||||||
if (engine == null) {
|
if (engine == null) {
|
||||||
int kind = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
int kind = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||||
|
@ -189,8 +189,8 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
|
||||||
engine.orientation = o;
|
engine.orientation = o;
|
||||||
}
|
}
|
||||||
orientation = o.ordinal();
|
orientation = o.ordinal();
|
||||||
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
|
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
|
||||||
|
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlockId(xCoord, yCoord, zCoord));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -466,7 +466,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
|
||||||
public LiquidStack drain(int tankIndex, int maxDrain, boolean doDrain) {
|
public LiquidStack drain(int tankIndex, int maxDrain, boolean doDrain) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LiquidTank[] getTanks() {
|
public LiquidTank[] getTanks() {
|
||||||
if (engine == null) {
|
if (engine == null) {
|
||||||
|
|
|
@ -371,7 +371,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
|
||||||
initialize(BlockGenericPipe.createPipe(packet.getPipeId()));
|
initialize(BlockGenericPipe.createPipe(packet.getPipeId()));
|
||||||
}
|
}
|
||||||
renderState = packet.getRenderState();
|
renderState = packet.getRenderState();
|
||||||
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
|
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -613,7 +613,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
|
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue