超级样板问题修复
This commit is contained in:
parent
5a375b5588
commit
6abe36247d
|
|
@ -6,6 +6,10 @@ import net.minecraft.world.item.Item;
|
||||||
|
|
||||||
public class PatternCorePlusBlock extends BlockAssemblerMatrixBase<PatternCorePlusBlockEntity> {
|
public class PatternCorePlusBlock extends BlockAssemblerMatrixBase<PatternCorePlusBlockEntity> {
|
||||||
|
|
||||||
|
public PatternCorePlusBlock() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
public PatternCorePlusBlock(Properties props) {
|
public PatternCorePlusBlock(Properties props) {
|
||||||
super(props);
|
super(props);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import appeng.crafting.pattern.EncodedPatternItem;
|
||||||
import appeng.helpers.patternprovider.PatternContainer;
|
import appeng.helpers.patternprovider.PatternContainer;
|
||||||
import appeng.util.inv.AppEngInternalInventory;
|
import appeng.util.inv.AppEngInternalInventory;
|
||||||
import appeng.util.inv.FilteredInternalInventory;
|
import appeng.util.inv.FilteredInternalInventory;
|
||||||
import appeng.util.inv.InternalInventoryHost;
|
|
||||||
import appeng.util.inv.filter.AEItemFilters;
|
import appeng.util.inv.filter.AEItemFilters;
|
||||||
import appeng.util.inv.filter.IAEItemFilter;
|
import appeng.util.inv.filter.IAEItemFilter;
|
||||||
import com.extendedae_plus.init.ModBlockEntities;
|
import com.extendedae_plus.init.ModBlockEntities;
|
||||||
|
|
@ -42,12 +41,14 @@ public class PatternCorePlusBlockEntity extends TileAssemblerMatrixPattern {
|
||||||
public static final int INV_SIZE = 72;
|
public static final int INV_SIZE = 72;
|
||||||
|
|
||||||
private final AppEngInternalInventory patternInventory;
|
private final AppEngInternalInventory patternInventory;
|
||||||
|
private final FilteredInternalInventory insertOnlyInventory;
|
||||||
private final List<IPatternDetails> patterns = new ArrayList<>();
|
private final List<IPatternDetails> patterns = new ArrayList<>();
|
||||||
|
|
||||||
public PatternCorePlusBlockEntity(BlockPos pos, BlockState blockState) {
|
public PatternCorePlusBlockEntity(BlockPos pos, BlockState blockState) {
|
||||||
super(pos, blockState);
|
super(pos, blockState);
|
||||||
this.patternInventory = new AppEngInternalInventory(this, INV_SIZE, 1);
|
this.patternInventory = new AppEngInternalInventory(this, INV_SIZE, 1);
|
||||||
this.patternInventory.setFilter(new Filter(this::getLevel));
|
this.patternInventory.setFilter(new Filter(this::getLevel));
|
||||||
|
this.insertOnlyInventory = new FilteredInternalInventory(this.patternInventory, AEItemFilters.INSERT_ONLY);
|
||||||
this.getMainNode().addService(ICraftingProvider.class, this);
|
this.getMainNode().addService(ICraftingProvider.class, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -72,6 +73,11 @@ public class PatternCorePlusBlockEntity extends TileAssemblerMatrixPattern {
|
||||||
return this.patternInventory;
|
return this.patternInventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public InternalInventory getInsertOnlyInventory() {
|
||||||
|
return this.insertOnlyInventory;
|
||||||
|
}
|
||||||
|
|
||||||
public long getLocateID() {
|
public long getLocateID() {
|
||||||
return this.worldPosition.asLong();
|
return this.worldPosition.asLong();
|
||||||
}
|
}
|
||||||
|
|
@ -106,6 +112,11 @@ public class PatternCorePlusBlockEntity extends TileAssemblerMatrixPattern {
|
||||||
cluster.addPattern(this);
|
cluster.addPattern(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onChangeInventory(InternalInventory inv, int slot) {
|
||||||
|
this.saveChanges();
|
||||||
|
this.updatePatterns();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveChangedInventory(AppEngInternalInventory inv) {
|
public void saveChangedInventory(AppEngInternalInventory inv) {
|
||||||
this.saveChanges();
|
this.saveChanges();
|
||||||
|
|
@ -118,12 +129,6 @@ public class PatternCorePlusBlockEntity extends TileAssemblerMatrixPattern {
|
||||||
this.updatePatterns();
|
this.updatePatterns();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onChangeInventory(AppEngInternalInventory inv, int slot) {
|
|
||||||
this.saveChanges();
|
|
||||||
this.updatePatterns();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<IPatternDetails> getAvailablePatterns() {
|
public List<IPatternDetails> getAvailablePatterns() {
|
||||||
return this.patterns;
|
return this.patterns;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user