Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public InteractionHand getOtherHand() {
/**
* Get all the item stacks this env can use.
*/
protected abstract List<ItemStack> getUsableStacks(StackDiscoveryMode mode);
public abstract List<ItemStack> getUsableStacks(StackDiscoveryMode mode);

protected List<ItemStack> getUsableStacksForPlayer(StackDiscoveryMode mode, @Nullable InteractionHand castingHand
, ServerPlayer caster) {
Expand Down Expand Up @@ -444,7 +444,7 @@ protected List<ItemStack> getUsableStacksForPlayer(StackDiscoveryMode mode, @Nul
/**
* Get the primary/secondary item stacks this env can use (i.e. main hand and offhand for the player).
*/
protected abstract List<HeldItemInfo> getPrimaryStacks();
public abstract List<HeldItemInfo> getPrimaryStacks();

protected List<HeldItemInfo> getPrimaryStacksForPlayer(InteractionHand castingHand, ServerPlayer caster) {
var primaryItem = caster.getItemInHand(castingHand);
Expand Down Expand Up @@ -597,7 +597,7 @@ public boolean replaceItemForPlayer(Predicate<ItemStack> stackOk, ItemStack repl
/**
* The order/mode stacks should be discovered in
*/
protected enum StackDiscoveryMode {
public enum StackDiscoveryMode {
/**
* When finding items to pick (hotbar)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ public InteractionHand getCastingHand() {

@Override
// TODO: Could do something like get items in inventories adjacent to the circle?
protected List<ItemStack> getUsableStacks(StackDiscoveryMode mode) {
public List<ItemStack> getUsableStacks(StackDiscoveryMode mode) {
if (this.getCaster() != null)
return getUsableStacksForPlayer(mode, null, this.getCaster());
return new ArrayList<>();
}

@Override
// TODO: Adjacent inv!
protected List<HeldItemInfo> getPrimaryStacks() {
public List<HeldItemInfo> getPrimaryStacks() {
if (this.getCaster() != null)
return getPrimaryStacksForPlayer(InteractionHand.OFF_HAND, this.getCaster());
return List.of();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ public void postExecution(CastResult result) {
}

@Override
protected List<ItemStack> getUsableStacks(StackDiscoveryMode mode) {
public List<ItemStack> getUsableStacks(StackDiscoveryMode mode) {
return getUsableStacksForPlayer(mode, castingHand, caster);
}

@Override
protected List<HeldItemInfo> getPrimaryStacks() {
public List<HeldItemInfo> getPrimaryStacks() {
return getPrimaryStacksForPlayer(this.castingHand, this.caster);
}

Expand Down
Loading