- Fixed smart chutes not filtering properly
- Fixed chutes not treating smart chutes like chutes
- Removed code leftovers
- Removed datagen cache from gitignore
This commit is contained in:
simibubi 2021-02-06 22:41:20 +01:00
parent 2315625c4b
commit 6981848f8a
4 changed files with 6 additions and 43 deletions

1
.gitignore vendored
View file

@ -40,4 +40,3 @@ local.properties
# PDT-specific # PDT-specific
.buildpath .buildpath
src/generated/resources/.cache/cache

View file

@ -379,29 +379,6 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
.isHorizontal()) .isHorizontal())
return false; return false;
// BlockState stateBelow = world.getBlockState(pos.down());
// if (stateBelow.getBlock() instanceof FunnelBlock) {
// if (stateBelow.has(BrassFunnelBlock.POWERED) && stateBelow.get(BrassFunnelBlock.POWERED))
// return false;
// if (stateBelow.get(BrassFunnelBlock.FACING) != Direction.UP)
// return false;
// ItemStack remainder = FunnelBlock.tryInsert(world, pos.down(), item, simulate);
// if (!simulate)
// setItem(remainder);
// return remainder.isEmpty();
// }
//
// DirectBeltInputBehaviour directInput =
// TileEntityBehaviour.get(world, pos.down(), DirectBeltInputBehaviour.TYPE);
// if (directInput != null) {
// if (!directInput.canInsertFromSide(Direction.UP))
// return false;
// ItemStack remainder = directInput.handleInsertion(item, Direction.UP, simulate);
// if (!simulate)
// setItem(remainder);
// return remainder.isEmpty();
// }
if (Block.hasSolidSideOnTop(world, pos.down())) if (Block.hasSolidSideOnTop(world, pos.down()))
return false; return false;
@ -420,17 +397,6 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
private boolean handleUpwardOutput(boolean simulate) { private boolean handleUpwardOutput(boolean simulate) {
BlockState stateAbove = world.getBlockState(pos.up()); BlockState stateAbove = world.getBlockState(pos.up());
// if (stateAbove.getBlock() instanceof FunnelBlock) {
// boolean powered = stateAbove.has(BrassFunnelBlock.POWERED) && stateAbove.get(BrassFunnelBlock.POWERED);
// if (!powered && stateAbove.get(BrassFunnelBlock.FACING) == Direction.DOWN) {
// ItemStack remainder = FunnelBlock.tryInsert(world, pos.up(), item, simulate);
// if (remainder.isEmpty()) {
// if (!simulate)
// setItem(remainder);
// return true;
// }
// }
// }
if (world == null) if (world == null)
return false; return false;
@ -501,9 +467,12 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
if (world == null) if (world == null)
return LazyOptional.empty(); return LazyOptional.empty();
TileEntity te = world.getTileEntity(pos); TileEntity te = world.getTileEntity(pos);
if (te == null if (te == null)
|| (te instanceof ChuteTileEntity) && (side != Direction.DOWN || !(te instanceof SmartChuteTileEntity)))
return LazyOptional.empty(); return LazyOptional.empty();
if (te instanceof ChuteTileEntity) {
if (side != Direction.DOWN || !(te instanceof SmartChuteTileEntity) || getItemMotion() > 0)
return LazyOptional.empty();
}
return te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite()); return te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite());
} }

View file

@ -21,7 +21,7 @@ public class SmartChuteTileEntity extends ChuteTileEntity {
@Override @Override
protected boolean canAcceptItem(ItemStack stack) { protected boolean canAcceptItem(ItemStack stack) {
return super.canAcceptItem(stack) && canCollectItemsFromBelow(); return super.canAcceptItem(stack) && canCollectItemsFromBelow() && filtering.test(stack);
} }
@Override @Override

View file

@ -9,7 +9,6 @@ import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import com.simibubi.create.content.schematics.SchematicWorld; import com.simibubi.create.content.schematics.SchematicWorld;
import com.simibubi.create.content.schematics.item.SchematicItem; import com.simibubi.create.content.schematics.item.SchematicItem;
import com.simibubi.create.foundation.utility.Debug;
import com.simibubi.create.foundation.utility.WorldAttached; import com.simibubi.create.foundation.utility.WorldAttached;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -63,10 +62,6 @@ public class SchematicInstances {
PlacementSettings settings = SchematicItem.getSettings(schematic); PlacementSettings settings = SchematicItem.getSettings(schematic);
activeTemplate.addBlocksToWorld(world, anchor, settings); activeTemplate.addBlocksToWorld(world, anchor, settings);
Debug.debugChat("Loading Schematic Instance of " + schematic.getTag()
.getString("File") + ". Total active instances: " + (loadedSchematics.get(wrapped).size() + 1));
return world; return world;
} }