mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2024-11-24 03:27:19 -05:00
Use access widener instead of accessor
This commit is contained in:
parent
3473abfd87
commit
4de7fe39e5
6 changed files with 9 additions and 19 deletions
|
@ -30,6 +30,10 @@ dependencies {
|
||||||
modCompileOnly libs.sodium
|
modCompileOnly libs.sodium
|
||||||
}
|
}
|
||||||
|
|
||||||
|
loom {
|
||||||
|
accessWidenerPath.set file("src/main/resources/cauldron-dyeing.accesswidener")
|
||||||
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property 'version', project.version
|
inputs.property 'version', project.version
|
||||||
filteringCharset 'UTF-8'
|
filteringCharset 'UTF-8'
|
||||||
|
|
|
@ -53,8 +53,7 @@ public interface CauldronBehaviorMixin {
|
||||||
|
|
||||||
@Inject(method = "registerBehavior", at = @At("TAIL"))
|
@Inject(method = "registerBehavior", at = @At("TAIL"))
|
||||||
private static void cauldron_dyeing$injectRegisterBehavior(CallbackInfo ci) {
|
private static void cauldron_dyeing$injectRegisterBehavior(CallbackInfo ci) {
|
||||||
var dyeMap = DyeItemAccessor.getDyeMap();
|
for (Map.Entry<DyeColor, DyeItem> dyeItem : DyeItem.DYES.entrySet()) {
|
||||||
for (Map.Entry<DyeColor, DyeItem> dyeItem : dyeMap.entrySet()) {
|
|
||||||
CauldronBehavior.WATER_CAULDRON_BEHAVIOR.put(dyeItem.getValue(), CauldronBehaviorExtended.DYE_WATER);
|
CauldronBehavior.WATER_CAULDRON_BEHAVIOR.put(dyeItem.getValue(), CauldronBehaviorExtended.DYE_WATER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
package me.tibinonest.mods.cauldron_dyeing.mixin;
|
|
||||||
|
|
||||||
import net.minecraft.item.DyeItem;
|
|
||||||
import net.minecraft.util.DyeColor;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Mixin(DyeItem.class)
|
|
||||||
public interface DyeItemAccessor {
|
|
||||||
@Accessor("DYES")
|
|
||||||
static Map<DyeColor, DyeItem> getDyeMap() {
|
|
||||||
throw new AssertionError();
|
|
||||||
}
|
|
||||||
}
|
|
3
src/main/resources/cauldron-dyeing.accesswidener
Normal file
3
src/main/resources/cauldron-dyeing.accesswidener
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
accessWidener v1 named
|
||||||
|
|
||||||
|
accessible field net/minecraft/item/DyeItem DYES Ljava/util/Map;
|
|
@ -4,7 +4,6 @@
|
||||||
"compatibilityLevel": "JAVA_17",
|
"compatibilityLevel": "JAVA_17",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"CauldronBehaviorMixin",
|
"CauldronBehaviorMixin",
|
||||||
"DyeItemAccessor",
|
|
||||||
"LeveledCauldronBlockMixin"
|
"LeveledCauldronBlockMixin"
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
"me.tibinonest.mods.cauldron_dyeing.CauldronDyeing"
|
"me.tibinonest.mods.cauldron_dyeing.CauldronDyeing"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"accessWidener": "cauldron-dyeing.accesswidener",
|
||||||
"mixins": [
|
"mixins": [
|
||||||
"cauldron-dyeing.mixins.json"
|
"cauldron-dyeing.mixins.json"
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue