Skip to content

Commit 16326e9

Browse files
committed
update
1 parent add8b63 commit 16326e9

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: checkout repository
1717
uses: actions/checkout@v4
1818
- name: validate gradle wrapper
19-
uses: gradle/actions/wrapper-validation@v3
19+
uses: gradle/actions/wrapper-validation@v4
2020
- name: setup jdk ${{ matrix.java }}
2121
uses: actions/setup-java@v4
2222
with:

src/main/java/zh/qiushui/mod/qca/mixin/rule/crafterLimitation/MixinCrafterBlock.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
import zh.qiushui.mod.qca.QcaSettings;
2727
import zh.qiushui.mod.qca.api.parse.ItemPredicateParser;
2828
import zh.qiushui.mod.qca.api.section.AllSection;
29-
import zh.qiushui.mod.qca.api.section.AnySection;
3029
import zh.qiushui.mod.qca.api.section.ItemSection;
30+
import zh.qiushui.mod.qca.api.section.AnySection;
3131
import zh.qiushui.mod.qca.api.section.Section;
3232
import zh.qiushui.mod.qca.rule.util.EntityUtil;
3333

@@ -41,7 +41,7 @@ public abstract class MixinCrafterBlock {
4141
@Final
4242
private static EnumProperty<Orientation> ORIENTATION;
4343
@Unique
44-
private Section section = null;
44+
private Section limitation = null;
4545

4646
@Inject(
4747
method = "scheduledTick",
@@ -53,7 +53,7 @@ public abstract class MixinCrafterBlock {
5353
+ "Lnet/minecraft/util/math/BlockPos;)V")
5454
)
5555
@SuppressWarnings("LoggingSimilarMessage")
56-
private void qca$updateRestriction(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo ci) {
56+
private void qca$updateLimitation(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo ci) {
5757
if (!QcaSettings.canLimit(QcaSettings.crafterLimitation)) return;
5858
List<Section> sections = new ArrayList<>();
5959
if (QcaSettings.canLimitByItemFrame(QcaSettings.crafterLimitation)) {
@@ -76,27 +76,27 @@ public abstract class MixinCrafterBlock {
7676
}
7777

7878
if (sections.isEmpty()) {
79-
this.section = null;
79+
this.limitation = null;
8080
if (QcaSettings.qcaDebugLog) {
8181
QcaExtension.LOGGER.debug("A crafter located at {} reset its restrictor.", pos);
8282
}
8383
return;
8484
}
8585
if (sections.size() > 1) {
86-
this.section = new AllSection(sections);
86+
this.limitation = new AllSection(sections);
8787
}
88-
this.section = sections.getFirst();
88+
this.limitation = sections.getFirst();
8989
if (QcaSettings.qcaDebugLog) {
90-
QcaExtension.LOGGER.debug("A crafter located at {} updated its limit source {}.", pos, this.section);
90+
QcaExtension.LOGGER.debug("A crafter located at {} updated its limit source {}.", pos, this.limitation);
9191
}
9292
}
9393

9494
@ModifyExpressionValue(
9595
method = "craft",
9696
at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isEmpty()Z", ordinal = 0))
97-
private boolean qca$restrictResult(boolean isEmpty, @Local(ordinal = 0) ItemStack stack) {
97+
private boolean qca$limitResult(boolean isEmpty, @Local(ordinal = 0) ItemStack stack) {
9898
if (!QcaSettings.canLimit(QcaSettings.crafterLimitation)) return isEmpty;
99-
boolean matched = this.section.test(stack);
99+
boolean matched = this.limitation.test(stack);
100100
if (QcaSettings.qcaDebugLog) {
101101
QcaExtension.LOGGER.debug(
102102
"A crafter just limited. Input: {}, Result: {}",

src/main/java/zh/qiushui/mod/qca/mixin/rule/easyHopperLimitation/MixinHopperBlockEntity.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public abstract class MixinHopperBlockEntity extends LockableContainerBlockEntit
4141
@Unique
4242
private Text customNameCache = null;
4343
@Unique
44-
private Section section = null;
44+
private Section limitation = null;
4545

4646
protected MixinHopperBlockEntity(BlockEntityType<?> blockEntityType, BlockPos blockPos, BlockState blockState) {
4747
super(blockEntityType, blockPos, blockState);
@@ -58,17 +58,17 @@ protected MixinHopperBlockEntity(BlockEntityType<?> blockEntityType, BlockPos bl
5858
}
5959

6060
@Override
61-
public Section qca$getSection() {
62-
return this.section;
61+
public Section qca$getLimitation() {
62+
return this.limitation;
6363
}
6464

6565
@Override
66-
public void qca$setSection(Section section) {
67-
this.section = section;
66+
public void qca$setLimitation(Section limitation) {
67+
this.limitation = limitation;
6868
}
6969

7070
@Inject(method = "serverTick", at = @At("TAIL"))
71-
private static void qca$updateRestrictionOnTick(
71+
private static void qca$updateLimitationOnTick(
7272
World world, BlockPos pos, BlockState state, HopperBlockEntity hopper, CallbackInfo ci
7373
) {
7474
if (!QcaSettings.canLimit(QcaSettings.easyHopperLimitation)) return;
@@ -100,9 +100,9 @@ protected MixinHopperBlockEntity(BlockEntityType<?> blockEntityType, BlockPos bl
100100
});
101101
}
102102
if (sections.size() > 1) {
103-
hopper.qca$setSection(new AllSection(sections));
103+
hopper.qca$setLimitation(new AllSection(sections));
104104
} else if (sections.size() == 1) {
105-
hopper.qca$setSection(sections.getFirst());
105+
hopper.qca$setLimitation(sections.getFirst());
106106
}
107107
}
108108

@@ -114,10 +114,10 @@ protected MixinHopperBlockEntity(BlockEntityType<?> blockEntityType, BlockPos bl
114114
+ "canTransferTo(Lnet/minecraft/inventory/Inventory;"
115115
+ "ILnet/minecraft/item/ItemStack;)Z"
116116
))
117-
private static boolean qca$restrictExtract(
117+
private static boolean qca$limitExtract(
118118
Inventory instance, Inventory inventory, int i, ItemStack stack, Operation<Boolean> original
119119
) {
120-
return original.call(instance, inventory, i, stack) && qca$restrict(inventory, stack);
120+
return original.call(instance, inventory, i, stack) && qca$limit(inventory, stack);
121121
}
122122

123123
@WrapOperation(
@@ -127,14 +127,14 @@ protected MixinHopperBlockEntity(BlockEntityType<?> blockEntityType, BlockPos bl
127127
target = "Lnet/minecraft/inventory/Inventory;"
128128
+ "isValid(ILnet/minecraft/item/ItemStack;)Z"
129129
))
130-
private static boolean qca$restrictInsert(Inventory instance, int i, ItemStack stack, Operation<Boolean> original) {
131-
return original.call(instance, i, stack) && qca$restrict(instance, stack);
130+
private static boolean qca$limitInsert(Inventory instance, int i, ItemStack stack, Operation<Boolean> original) {
131+
return original.call(instance, i, stack) && qca$limit(instance, stack);
132132
}
133133

134134
@Unique
135-
private static boolean qca$restrict(Inventory inventory, ItemStack stack) {
135+
private static boolean qca$limit(Inventory inventory, ItemStack stack) {
136136
return !QcaSettings.canLimit(QcaSettings.easyHopperLimitation)
137137
|| !(inventory instanceof HopperBlockEntity hopper)
138-
|| hopper.qca$getSection().test(stack);
138+
|| hopper.qca$getLimitation().test(stack);
139139
}
140140
}

src/main/java/zh/qiushui/mod/qca/rule/util/easyHopperLimitation/HopperCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ public interface HopperCache {
1111
default void qca$setCache(Text cache) {
1212
}
1313

14-
default Section qca$getSection() {
14+
default Section qca$getLimitation() {
1515
return null;
1616
}
1717

18-
default void qca$setSection(Section section) {
18+
default void qca$setLimitation(Section section) {
1919
}
2020
}

0 commit comments

Comments
 (0)