Why are we still here, Part II

- Fixed basins dropping outputs when no spoutput is present
- Lowered overfeeding threshold for blaze cakes
- Brass tunnels no longer distribute in directions against their mounted belt
- Fixed capability issues on millstones
- Fixed incompatibility with The One Probe
This commit is contained in:
simibubi 2020-12-29 20:45:21 +01:00
parent 788f92705d
commit d5ac8cb3b9
6 changed files with 25 additions and 5 deletions

View file

@ -29,6 +29,8 @@ public class CrafterCTBehaviour extends ConnectedTextureBehaviour {
if (input1 == null || input2 == null) if (input1 == null || input2 == null)
return false; return false;
if (input1.data.isEmpty() || input2.data.isEmpty())
return false;
if (pos.add(input1.data.get(0)) if (pos.add(input1.data.get(0))
.equals(otherPos.add(input2.data.get(0)))) .equals(otherPos.add(input2.data.get(0))))
return true; return true;

View file

@ -17,7 +17,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.CapabilityItemHandler; import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.wrapper.CombinedInvWrapper; import net.minecraftforge.items.wrapper.CombinedInvWrapper;
@ -27,6 +27,7 @@ public class MillstoneTileEntity extends KineticTileEntity {
public ItemStackHandler inputInv; public ItemStackHandler inputInv;
public ItemStackHandler outputInv; public ItemStackHandler outputInv;
public LazyOptional<IItemHandler> capability;
public int timer; public int timer;
private MillingRecipe lastRecipe; private MillingRecipe lastRecipe;
@ -34,6 +35,7 @@ public class MillstoneTileEntity extends KineticTileEntity {
super(type); super(type);
inputInv = new ItemStackHandler(1); inputInv = new ItemStackHandler(1);
outputInv = new ItemStackHandler(9); outputInv = new ItemStackHandler(9);
capability = LazyOptional.of(MillstoneInventoryHandler::new);
} }
@Override @Override
@ -81,6 +83,12 @@ public class MillstoneTileEntity extends KineticTileEntity {
sendData(); sendData();
} }
@Override
public void remove() {
super.remove();
capability.invalidate();
}
private void process() { private void process() {
RecipeWrapper inventoryIn = new RecipeWrapper(inputInv); RecipeWrapper inventoryIn = new RecipeWrapper(inputInv);
@ -138,9 +146,8 @@ public class MillstoneTileEntity extends KineticTileEntity {
@Override @Override
public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) {
if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) if (isItemHandlerCap(cap))
return LazyOptional.of(MillstoneInventoryHandler::new) return capability.cast();
.cast();
return super.getCapability(cap, side); return super.getCapability(cap, side);
} }

View file

@ -99,6 +99,13 @@ public class CapabilityMinecartController implements ICapabilitySerializable<Com
for (AbstractMinecartEntity cart : queued) { for (AbstractMinecartEntity cart : queued) {
UUID uniqueID = cart.getUniqueID(); UUID uniqueID = cart.getUniqueID();
if (world.isRemote && carts.containsKey(uniqueID)) {
MinecartController minecartController = carts.get(uniqueID);
if (minecartController.isPresent() && minecartController.cart().getEntityId() != cart.getEntityId())
continue; // Away with you, Fake Entities!
}
cartsWithCoupling.remove(uniqueID); cartsWithCoupling.remove(uniqueID);
LazyOptional<MinecartController> capability = cart.getCapability(MINECART_CONTROLLER_CAPABILITY); LazyOptional<MinecartController> capability = cart.getCapability(MINECART_CONTROLLER_CAPABILITY);

View file

@ -435,7 +435,7 @@ public class BasinTileEntity extends SmartTileEntity {
if (targetInv == null && !outputItems.isEmpty()) if (targetInv == null && !outputItems.isEmpty())
return false; return false;
for (ItemStack itemStack : outputItems) { for (ItemStack itemStack : outputItems) {
if (simulate) { if (simulate || direction == Direction.DOWN) {
if (!ItemHandlerHelper.insertItemStacked(targetInv, itemStack.copy(), simulate) if (!ItemHandlerHelper.insertItemStacked(targetInv, itemStack.copy(), simulate)
.isEmpty()) .isEmpty())
return false; return false;

View file

@ -120,6 +120,8 @@ public class BlazeBurnerTileEntity extends SmartTileEntity {
return false; return false;
if (newFuel.ordinal() < activeFuel.ordinal()) if (newFuel.ordinal() < activeFuel.ordinal())
return false; return false;
if (activeFuel == FuelType.SPECIAL && remainingBurnTime > 20)
return false;
if (newFuel == activeFuel) { if (newFuel == activeFuel) {
if (remainingBurnTime + newBurnTime > maxHeatCapacity && !forceOverflow) if (remainingBurnTime + newBurnTime > maxHeatCapacity && !forceOverflow)

View file

@ -414,6 +414,8 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity {
for (Direction direction : Iterate.horizontalDirections) { for (Direction direction : Iterate.horizontalDirections) {
if (direction == movementFacing && below.getSpeed() == 0) if (direction == movementFacing && below.getSpeed() == 0)
continue; continue;
if (direction == movementFacing.getOpposite())
continue;
if (tunnelTE.flaps.containsKey(direction) || tunnelTE.hasValidOutputFunnel(direction)) { if (tunnelTE.flaps.containsKey(direction) || tunnelTE.hasValidOutputFunnel(direction)) {
BlockPos offset = tunnelTE.pos.down() BlockPos offset = tunnelTE.pos.down()
.offset(direction); .offset(direction);