parent
cc6fc2324c
commit
4e89f290a4
5 changed files with 21 additions and 19 deletions
|
@ -268,7 +268,7 @@ public class BuildCraftSilicon extends BuildCraftMod {
|
|||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void processRequests(FMLInterModComms.IMCEvent event) {
|
||||
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
|
||||
InterModComms.processIMC(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,16 +20,7 @@ public final class ThreadSafeUtils {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will NOT load a chunk - it will only get one.
|
||||
* Chunk loading is not fully threadsafe. Therefore, this function is
|
||||
* also useful for faster chunk lookups.
|
||||
* @param world
|
||||
* @param x
|
||||
* @param z
|
||||
* @return
|
||||
*/
|
||||
public static Chunk getChunk(World world, int x, int z) {
|
||||
private static Chunk getChunkHacky(World world, int x, int z) {
|
||||
Chunk chunk;
|
||||
chunk = lastChunk.get();
|
||||
|
||||
|
@ -45,7 +36,8 @@ public final class ThreadSafeUtils {
|
|||
|
||||
IChunkProvider provider = world.getChunkProvider();
|
||||
// These probably won't guarantee full thread safety, but it's our best bets.
|
||||
if (provider instanceof ChunkProviderServer) {
|
||||
if (!Utils.CAULDRON_DETECTED && provider instanceof ChunkProviderServer) {
|
||||
// Slight optimization
|
||||
chunk = (Chunk) ((ChunkProviderServer) provider).loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(x, z));
|
||||
} else {
|
||||
chunk = provider.chunkExists(x, z) ? provider.provideChunk(x, z) : null;
|
||||
|
|
|
@ -622,8 +622,12 @@ public class BlockGenericPipe extends BlockBuildCraft implements IColorRemovable
|
|||
}
|
||||
|
||||
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
|
||||
if (rayTraceResult != null) {
|
||||
ForgeDirection hitSide = rayTraceResult.hitPart == Part.Pipe ? rayTraceResult.sideHit : ForgeDirection.UNKNOWN;
|
||||
return pipe.blockActivated(player, hitSide);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else if (currentItem.getItem() instanceof IMapLocation) {
|
||||
// We want to be able to record pipe locations
|
||||
return false;
|
||||
|
@ -671,10 +675,12 @@ public class BlockGenericPipe extends BlockBuildCraft implements IColorRemovable
|
|||
return true;
|
||||
}
|
||||
|
||||
if (rayTraceResult != null) {
|
||||
ForgeDirection hitSide = rayTraceResult.hitPart == Part.Pipe ? rayTraceResult.sideHit : ForgeDirection.UNKNOWN;
|
||||
return pipe.blockActivated(player, hitSide);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ import buildcraft.transport.utils.TransportUtils;
|
|||
|
||||
public class PipeItemsStripes extends Pipe<PipeTransportItems> implements IEnergyHandler, IStripesPipe {
|
||||
private ForgeDirection actionDir = ForgeDirection.UNKNOWN;
|
||||
private float currentSpeed;
|
||||
|
||||
public PipeItemsStripes(Item item) {
|
||||
super(new PipeTransportItems(), item);
|
||||
|
@ -67,6 +68,7 @@ public class PipeItemsStripes extends Pipe<PipeTransportItems> implements IEnerg
|
|||
if (direction == ForgeDirection.UNKNOWN) {
|
||||
direction = event.direction;
|
||||
}
|
||||
currentSpeed = event.item.getSpeed();
|
||||
|
||||
Position p = new Position(container.xCoord, container.yCoord,
|
||||
container.zCoord, direction);
|
||||
|
@ -162,6 +164,8 @@ public class PipeItemsStripes extends Pipe<PipeTransportItems> implements IEnerg
|
|||
pos.moveBackwards(0.25D);
|
||||
|
||||
TravelingItem newItem = TravelingItem.make(pos.x, pos.y, pos.z, itemStack);
|
||||
newItem.setSpeed(Math.min(0.01F, currentSpeed - 0.005F));
|
||||
|
||||
transport.injectItem(newItem, direction);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue