Skip to content

Commit

Permalink
Remove unused stack param
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Nov 24, 2024
1 parent 8f08477 commit 6e771fc
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static Set<ModuleTarget> getTargets(ItemStack stack, boolean checkBlockName) {
for (int i = 0; i < targets.size() && result.size() < max; i++) {
var target = targets.get(i);
if (checkBlockName) {
var newTarget = updateTargetBlockName(stack, target);
var newTarget = updateTargetBlockName(target);
if (newTarget != target) update = true;
target = newTarget;
}
Expand All @@ -78,7 +78,7 @@ static Set<ModuleTarget> getTargets(ItemStack stack, boolean checkBlockName) {
}

if (update) {
stack.set(ModDataComponents.MODULE_TARGET_LIST, new ModuleTargetList(List.copyOf(result)));
setTargets(stack, result);
}

return result;
Expand All @@ -101,7 +101,7 @@ static boolean canSelectTarget(UseOnContext context) {
return NeoForge.EVENT_BUS.post(new AddModuleTargetEvent((ModuleItem) module, context, ((ITargetedModule) module).isValidTarget(context))).isValid();
}

private static ModuleTarget updateTargetBlockName(ItemStack stack, ModuleTarget target) {
private static ModuleTarget updateTargetBlockName(ModuleTarget target) {
ServerLevel level = MiscUtil.getWorldForGlobalPos(target.gPos);
BlockPos pos = target.gPos.pos();
if (level != null && level.getChunkSource().hasChunk(pos.getX() >> 4, pos.getZ() >> 4)) {
Expand Down

0 comments on commit 6e771fc

Please sign in to comment.