mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 20:45:10 +01:00
Schematic item requirement fix
- ISpecialXItemRequirement no longer provides a default implementation
This commit is contained in:
parent
c20129ecc2
commit
a6b35f2a8d
@ -4,8 +4,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public interface ISpecialBlockEntityItemRequirement {
|
||||
|
||||
default ItemRequirement getRequiredItems(BlockState state) {
|
||||
return ItemRequirement.INVALID;
|
||||
}
|
||||
public ItemRequirement getRequiredItems(BlockState state);
|
||||
|
||||
}
|
||||
|
@ -5,8 +5,6 @@ import net.minecraft.world.level.block.state.BlockState;
|
||||
|
||||
public interface ISpecialBlockItemRequirement {
|
||||
|
||||
default ItemRequirement getRequiredItems(BlockState state, BlockEntity te) {
|
||||
return ItemRequirement.INVALID;
|
||||
}
|
||||
public ItemRequirement getRequiredItems(BlockState state, BlockEntity te);
|
||||
|
||||
}
|
||||
|
@ -2,8 +2,6 @@ package com.simibubi.create.content.schematics;
|
||||
|
||||
public interface ISpecialEntityItemRequirement {
|
||||
|
||||
default ItemRequirement getRequiredItems() {
|
||||
return ItemRequirement.INVALID;
|
||||
}
|
||||
public ItemRequirement getRequiredItems();
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.simibubi.create.api.event.TileEntityBehaviourEvent;
|
||||
import com.simibubi.create.content.schematics.ISpecialBlockEntityItemRequirement;
|
||||
import com.simibubi.create.content.schematics.ItemRequirement;
|
||||
import com.simibubi.create.foundation.advancement.AdvancementBehaviour;
|
||||
import com.simibubi.create.foundation.advancement.CreateAdvancement;
|
||||
@ -25,7 +26,7 @@ import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
|
||||
public abstract class SmartTileEntity extends CachedRenderBBTileEntity implements IPartialSafeNBT, IInteractionChecker {
|
||||
public abstract class SmartTileEntity extends CachedRenderBBTileEntity implements IPartialSafeNBT, IInteractionChecker, ISpecialBlockEntityItemRequirement {
|
||||
|
||||
private final Map<BehaviourType<?>, TileEntityBehaviour> behaviours = new HashMap<>();
|
||||
private boolean initialized = false;
|
||||
@ -176,7 +177,7 @@ public abstract class SmartTileEntity extends CachedRenderBBTileEntity implement
|
||||
behaviour.initialize();
|
||||
}
|
||||
|
||||
public ItemRequirement getRequiredItems() {
|
||||
public ItemRequirement getRequiredItems(BlockState state) {
|
||||
return behaviours.values()
|
||||
.stream()
|
||||
.reduce(ItemRequirement.NONE, (r, b) -> r.union(b.getRequiredItems()), (r, r1) -> r.union(r1));
|
||||
|
Loading…
Reference in New Issue
Block a user