Skip to content

Commit

Permalink
eklipse™
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadows-of-Fire committed Dec 9, 2023
1 parent 669f13b commit cbec310
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ public static <T> BlockCapability<T, Void> createVoid(ResourceLocation name, Cla
}

// INTERNAL

// Requires explicitly-typed constructor due to ECJ inference failure.
private static final CapabilityRegistry<BlockCapability<?, ?>> registry = new CapabilityRegistry<BlockCapability<?, ?>>(BlockCapability::new);

private BlockCapability(ResourceLocation name, Class<T> typeClass, Class<C> contextClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public static <T> EntityCapability<T, Void> createVoid(ResourceLocation name, Cl
}

// INTERNAL

// Requires explicitly-typed constructor due to ECJ inference failure.
private static final CapabilityRegistry<EntityCapability<?, ?>> registry = new CapabilityRegistry<EntityCapability<?, ?>>(EntityCapability::new);

private EntityCapability(ResourceLocation name, Class<T> typeClass, Class<C> contextClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public static <T> ItemCapability<T, Void> createVoid(ResourceLocation name, Clas
}

// INTERNAL

// Requires explicitly-typed constructor due to ECJ inference failure.
private static final CapabilityRegistry<ItemCapability<?, ?>> registry = new CapabilityRegistry<ItemCapability<?, ?>>(ItemCapability::new);

private ItemCapability(ResourceLocation name, Class<T> typeClass, Class<C> contextClass) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/neoforged/neoforge/common/NeoForgeMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ public class NeoForgeMod {
private static final DeferredRegister<Codec<? extends StructureModifier>> STRUCTURE_MODIFIER_SERIALIZERS = DeferredRegister.create(NeoForgeRegistries.Keys.STRUCTURE_MODIFIER_SERIALIZERS, "neoforge");
private static final DeferredRegister<HolderSetType> HOLDER_SET_TYPES = DeferredRegister.create(NeoForgeRegistries.Keys.HOLDER_SET_TYPES, "neoforge");

@SuppressWarnings({ "unchecked", "rawtypes" })
private static final DeferredHolder<ArgumentTypeInfo<?, ?>, EnumArgument.Info> ENUM_COMMAND_ARGUMENT_TYPE = COMMAND_ARGUMENT_TYPES.register("enum", () -> ArgumentTypeInfos.registerByClass(EnumArgument.class, new EnumArgument.Info()));
@SuppressWarnings({ "unchecked", "rawtypes" }) // Uses Holder instead of DeferredHolder as the type due to weirdness between ECJ and javac.
private static final Holder<ArgumentTypeInfo<?, ?>> ENUM_COMMAND_ARGUMENT_TYPE = COMMAND_ARGUMENT_TYPES.register("enum", () -> ArgumentTypeInfos.registerByClass(EnumArgument.class, new EnumArgument.Info()));
private static final DeferredHolder<ArgumentTypeInfo<?, ?>, SingletonArgumentInfo<ModIdArgument>> MODID_COMMAND_ARGUMENT_TYPE = COMMAND_ARGUMENT_TYPES.register("modid", () -> ArgumentTypeInfos.registerByClass(ModIdArgument.class,
SingletonArgumentInfo.contextFree(ModIdArgument::modIdArgument)));

Expand Down

0 comments on commit cbec310

Please sign in to comment.