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:
Christian 2012-10-01 23:56:26 -04:00
parent 890c4d45e9
commit e8571a8e53
3 changed files with 22 additions and 22 deletions

View file

@ -1,8 +1,8 @@
/**
/**
* Copyright (c) SpaceToad, 2011
* 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
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
@ -136,7 +136,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
}
if (done) {
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
sendNetworkUpdate();
}
}
@ -177,7 +177,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
}
if (worldObj != null) {
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
}
if (currentPattern == null) {
@ -309,7 +309,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
super.handleDescriptionPacket(packet);
currentPattern = FillerManager.registry.getPattern(currentPatternId);
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
if (!initialized && box.isInitialized()) {
box.createLasers(worldObj, LaserKind.Stripes);
@ -323,7 +323,7 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
super.handleUpdatePacket(packet);
currentPattern = FillerManager.registry.getPattern(currentPatternId);
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
if (!initialized && box.isInitialized()) {
box.createLasers(worldObj, LaserKind.Stripes);
@ -393,11 +393,11 @@ public class TileFiller extends TileBuildCraft implements ISpecialInventory, IPo
/* ISPECIALINVENTORY */
@Override
public int addItem(ItemStack stack, boolean doAdd, Orientations from) {
ITransactor transactor = new TransactorSimple(this);
ItemStack added = transactor.add(stack, from, doAdd);
return added.stackSize;
}
@Override

View file

@ -1,8 +1,8 @@
/**
/**
* Copyright (c) SpaceToad, 2011
* 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
* 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.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,
IOverrideDefaultTriggers, IPipeConnection, IBuilderInventory {
@ -132,7 +132,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
progressPart = 0;
}
} else if (isRedstonePowered && engine.isActive()) {
Position pos = new Position(xCoord, yCoord, zCoord, engine.orientation);
pos.moveForwards(1.0);
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);
} else
setActive(false);
} else
setActive(false);
@ -158,11 +158,11 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
private void setActive(boolean isActive) {
if(this.isActive == isActive)
return;
this.isActive = isActive;
sendNetworkUpdate();
}
private void createEngineIfNeeded() {
if (engine == null) {
int kind = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
@ -189,8 +189,8 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
engine.orientation = o;
}
orientation = o.ordinal();
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlockId(xCoord, yCoord, zCoord));
break;
}
}
@ -466,7 +466,7 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
public LiquidStack drain(int tankIndex, int maxDrain, boolean doDrain) {
return null;
}
@Override
public LiquidTank[] getTanks() {
if (engine == null) {

View file

@ -371,7 +371,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
initialize(BlockGenericPipe.createPipe(packet.getPipeId()));
}
renderState = packet.getRenderState();
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
}
return;
}
@ -613,7 +613,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
}
break;
}
worldObj.markBlockAsNeedsUpdate(xCoord, yCoord, zCoord);
worldObj.markBlockNeedsUpdate(xCoord, yCoord, zCoord);
}
@Override