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