diff options
| author | shedaniel <daniel@shedaniel.me> | 2023-05-29 23:17:20 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2023-05-29 23:17:20 +0800 |
| commit | 1e869aeac83d1627a6cae32a3b53b7d17bd3d7b8 (patch) | |
| tree | 9ff780b6f52c8a6c216698242e8604568dc1df92 /forge/src/main/java/me/shedaniel/rei | |
| parent | 48ed02b1ed057d2b7502cca575f640a595959cf5 (diff) | |
| download | RoughlyEnoughItems-feature/6.7.tar.gz RoughlyEnoughItems-feature/6.7.tar.bz2 RoughlyEnoughItems-feature/6.7.zip | |
Fix compile errorsfeature/6.7
Diffstat (limited to 'forge/src/main/java/me/shedaniel/rei')
8 files changed, 55 insertions, 56 deletions
diff --git a/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java b/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java index 47a29e871..9d31f41d3 100644 --- a/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java +++ b/forge/src/main/java/me/shedaniel/rei/forge/PluginDetectorImpl.java @@ -212,10 +212,10 @@ public class PluginDetectorImpl implements PluginDetector { } private static <P extends me.shedaniel.rei.api.common.plugins.REIPlugin<P>> REIPluginProvider<P> wrapAndFilter(REIPluginProvider<?> provider, Class<P> clazz) { - return new REIPluginProvider<>() { + return new REIPluginProvider<P>() { @Override public Collection<P> provide() { - return new AbstractCollection<>() { + return new AbstractCollection<P>() { @Override public Iterator<P> iterator() { return Iterables.filter(provider.provide(), clazz).iterator(); diff --git a/forge/src/main/java/me/shedaniel/rei/forge/REIPlugin.java b/forge/src/main/java/me/shedaniel/rei/forge/REIPlugin.java index ffd28510f..323d98a30 100644 --- a/forge/src/main/java/me/shedaniel/rei/forge/REIPlugin.java +++ b/forge/src/main/java/me/shedaniel/rei/forge/REIPlugin.java @@ -32,7 +32,7 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) -@Deprecated(forRemoval = true) +@Deprecated public @interface REIPlugin { Dist[] value() default {Dist.CLIENT, Dist.DEDICATED_SERVER}; } diff --git a/forge/src/main/java/me/shedaniel/rei/forge/REIPluginLoader.java b/forge/src/main/java/me/shedaniel/rei/forge/REIPluginLoader.java index f06b18139..bbf3cb2cd 100644 --- a/forge/src/main/java/me/shedaniel/rei/forge/REIPluginLoader.java +++ b/forge/src/main/java/me/shedaniel/rei/forge/REIPluginLoader.java @@ -32,7 +32,7 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) -@Deprecated(forRemoval = true) +@Deprecated public @interface REIPluginLoader { Dist[] value() default {Dist.CLIENT, Dist.DEDICATED_SERVER}; }
\ No newline at end of file diff --git a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinPacketEncoder.java b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinPacketEncoder.java index 6db4a0404..f556a9b9f 100644 --- a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinPacketEncoder.java +++ b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinPacketEncoder.java @@ -23,9 +23,9 @@ package me.shedaniel.rei.mixin.forge; -import dev.architectury.utils.GameInstance; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; +import me.shedaniel.architectury.utils.GameInstance; import net.minecraft.ChatFormatting; import net.minecraft.Util; import net.minecraft.network.PacketEncoder; diff --git a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagBuilder.java b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagBuilder.java index cd56e553c..87617098f 100644 --- a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagBuilder.java +++ b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagBuilder.java @@ -47,44 +47,44 @@ import java.util.function.Function; public class MixinTagBuilder<T> { @Shadow @Final private List<Tag.BuilderEntry> entries; - @Inject(method = "build", at = @At("RETURN")) - private void load(Function<ResourceLocation, Tag<T>> tagResolver, Function<ResourceLocation, T> valueResolver, CallbackInfoReturnable<Either<Collection<Tag.BuilderEntry>, Tag<T>>> cir) { - Tag<T> tag = cir.getReturnValue().right().orElse(null); - if (tag != null) { - String currentTagDirectory = TagNodes.CURRENT_TAG_DIR.get(); - if (currentTagDirectory == null) return; - ResourceKey<? extends Registry<?>> resourceKey = TagNodes.TAG_DIR_MAP.get(currentTagDirectory); - if (resourceKey == null) return; - Map<Tag<?>, TagNodes.RawTagData> dataMap = TagNodes.RAW_TAG_DATA_MAP.get(currentTagDirectory); - if (dataMap == null) return; - List<ResourceLocation> otherElements = new ArrayList<>(); - List<ResourceLocation> otherTags = new ArrayList<>(); - - for (Tag.BuilderEntry builderEntry : this.entries) { - if (builderEntry.entry() instanceof Tag.OptionalTagEntry tagEntry) { - Tag<T> apply = tagResolver.apply(tagEntry.id); - if (apply != null) { - otherTags.add(tagEntry.id); - } - } else if (builderEntry.entry() instanceof Tag.TagEntry tagEntry) { - Tag<T> apply = tagResolver.apply(tagEntry.id); - if (apply != null) { - otherTags.add(tagEntry.id); - } - } else if (builderEntry.entry() instanceof Tag.OptionalElementEntry tagEntry) { - T apply = valueResolver.apply(tagEntry.id); - if (apply != null) { - otherElements.add(tagEntry.id); - } - } else if (builderEntry.entry() instanceof Tag.ElementEntry tagEntry) { - T apply = valueResolver.apply(tagEntry.id); - if (apply != null) { - otherElements.add(tagEntry.id); - } - } - } - - dataMap.put(tag, new TagNodes.RawTagData(CollectionUtils.distinctToList(otherElements), CollectionUtils.distinctToList(otherTags))); - } - } +// @Inject(method = "build", at = @At("RETURN")) +// private void load(Function<ResourceLocation, Tag<T>> tagResolver, Function<ResourceLocation, T> valueResolver, CallbackInfoReturnable<Either<Collection<Tag.BuilderEntry>, Tag<T>>> cir) { +// Tag<T> tag = cir.getReturnValue().right().orElse(null); +// if (tag != null) { +// String currentTagDirectory = TagNodes.CURRENT_TAG_DIR.get(); +// if (currentTagDirectory == null) return; +// ResourceKey<? extends Registry<?>> resourceKey = TagNodes.TAG_DIR_MAP.get(currentTagDirectory); +// if (resourceKey == null) return; +// Map<Tag<?>, TagNodes.RawTagData> dataMap = TagNodes.RAW_TAG_DATA_MAP.get(currentTagDirectory); +// if (dataMap == null) return; +// List<ResourceLocation> otherElements = new ArrayList<>(); +// List<ResourceLocation> otherTags = new ArrayList<>(); +// +// for (Tag.BuilderEntry builderEntry : this.entries) { +// if (builderEntry.getEntry() instanceof Tag.OptionalTagEntry tagEntry) { +// Tag<T> apply = tagResolver.apply(tagEntry.id); +// if (apply != null) { +// otherTags.add(tagEntry.id); +// } +// } else if (builderEntry.getEntry() instanceof Tag.TagEntry tagEntry) { +// Tag<T> apply = tagResolver.apply(tagEntry.id); +// if (apply != null) { +// otherTags.add(tagEntry.id); +// } +// } else if (builderEntry.getEntry() instanceof Tag.OptionalElementEntry tagEntry) { +// T apply = valueResolver.apply(tagEntry.id); +// if (apply != null) { +// otherElements.add(tagEntry.id); +// } +// } else if (builderEntry.getEntry() instanceof Tag.ElementEntry tagEntry) { +// T apply = valueResolver.apply(tagEntry.id); +// if (apply != null) { +// otherElements.add(tagEntry.id); +// } +// } +// } +// +// dataMap.put(tag, new TagNodes.RawTagData(CollectionUtils.distinctToList(otherElements), CollectionUtils.distinctToList(otherTags))); +// } +// } } diff --git a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagLoader.java b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagLoader.java index 80fb34f77..ae9ce1162 100644 --- a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagLoader.java +++ b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagLoader.java @@ -62,7 +62,7 @@ public class MixinTagLoader<T> { } ResourceKey<? extends Registry<?>> resourceKey = TagNodes.TAG_DIR_MAP.get(directory); if (resourceKey == null) return; - TagNodes.TAG_DATA_MAP.put(resourceKey, new HashMap<>()); +// TagNodes.TAG_DATA_MAP.put(resourceKey, new HashMap<>()); Map<ResourceLocation, TagNodes.TagData> tagDataMap = TagNodes.TAG_DATA_MAP.get(resourceKey); if (tagDataMap == null) return; Registry<T> registry = ((Registry<Registry<T>>) Registry.REGISTRY).get((ResourceKey<Registry<T>>) resourceKey); diff --git a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagManager.java b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagManager.java index 833b885d9..7dda1642b 100644 --- a/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagManager.java +++ b/forge/src/main/java/me/shedaniel/rei/mixin/forge/MixinTagManager.java @@ -39,9 +39,9 @@ import java.util.concurrent.Executor; @Mixin(TagManager.class) public abstract class MixinTagManager<T> { - @Inject(method = "createLoader", at = @At("HEAD")) - private void load(ResourceManager resourceManager, Executor executor, RegistryAccess.RegistryEntry<T> registryEntry, CallbackInfoReturnable<CompletableFuture<TagManager.LoadResult<T>>> cir) { - ResourceKey<? extends Registry<T>> resourceKey = registryEntry.key(); - TagNodes.TAG_DIR_MAP.put(TagManager.getTagDir(resourceKey), resourceKey); - } +// @Inject(method = "createLoader", at = @At("HEAD")) +// private void load(ResourceManager resourceManager, Executor executor, RegistryAccess.RegistryEntry<T> registryEntry, CallbackInfoReturnable<CompletableFuture<TagManager.LoadResult<T>>> cir) { +// ResourceKey<? extends Registry<T>> resourceKey = registryEntry.key(); +// TagNodes.TAG_DIR_MAP.put(TagManager.getTagDir(resourceKey), resourceKey); +// } } diff --git a/forge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java b/forge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java index 2ee143b91..5d36a1f7f 100644 --- a/forge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java +++ b/forge/src/main/java/me/shedaniel/rei/plugin/client/forge/DefaultClientPluginImpl.java @@ -27,7 +27,6 @@ import com.google.common.collect.Sets; import me.shedaniel.rei.api.client.registry.display.DisplayRegistry; import me.shedaniel.rei.plugin.client.BuiltinClientPlugin; import me.shedaniel.rei.plugin.client.DefaultClientPlugin; -import net.minecraft.core.Holder; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.alchemy.Potion; @@ -60,9 +59,9 @@ public class DefaultClientPluginImpl extends DefaultClientPlugin { Set<Potion> potions = Sets.newLinkedHashSet(); for (Ingredient container : PotionBrewing.ALLOWED_CONTAINERS) { for (PotionBrewing.Mix<Potion> mix : PotionBrewing.POTION_MIXES) { - IRegistryDelegate<Potion> from = mix.field_185198_a; + IRegistryDelegate<Potion> from = mix.from; Ingredient ingredient = mix.ingredient; - IRegistryDelegate<Potion> to = mix.field_185200_c; + IRegistryDelegate<Potion> to = mix.to; Ingredient base = Ingredient.of(Arrays.stream(container.getItems()) .map(ItemStack::copy) .map(stack -> PotionUtils.setPotion(stack, from.get()))); @@ -77,9 +76,9 @@ public class DefaultClientPluginImpl extends DefaultClientPlugin { } for (Potion potion : potions) { for (PotionBrewing.Mix<Item> mix : PotionBrewing.CONTAINER_MIXES) { - IRegistryDelegate<Item> from = mix.field_185198_a; + IRegistryDelegate<Item> from = mix.from; Ingredient ingredient = mix.ingredient; - IRegistryDelegate<Item> to = mix.field_185200_c; + IRegistryDelegate<Item> to = mix.to; Ingredient base = Ingredient.of(PotionUtils.setPotion(new ItemStack(from.get()), potion)); ItemStack output = PotionUtils.setPotion(new ItemStack(to.get()), potion); clientPlugin.registerBrewingRecipe(base, ingredient, output); |
