• Recently Browsing

    No registered users viewing this page.

  • Posts

    • So you are bypassing the nice typesystem that Java gives you, for... convenience. This is a pretty bad antipattern.   https://wiki.c2.com/?StringlyTyped
    • Because I wanted the ability to add custom values when setting them. For example, I wouldn't have to go into the capability and add a new variable, I can just say "Set the variable 'Working' to 'true'." And if its trying to get a variable that hasn't been set yet, it'll return 0 or "" depending on what kind of variable I set it as, (Notice the "string" argument.)   Its sort of mimicking the stuff you can do with getPersistentData() on an entity. TLDR; Convenience. ¯\_(ツ)_/¯
    • I cannot for the love of me figure out how the new objectregister system works. Been scratching my head at this for a week.   The above error hi-lites: JemPickaxe::new in the 3rd method.   public class JemPickaxes {     public static final JemRegistry<Item> PICKAXE = new JemRegistry<>(ForgeRegistries.ITEMS, JemCore.MOD_ID);          public static void init()     {         PICKAXE.register(FMLJavaModLoadingContext.get().getModEventBus());     }          public static RegistryObject<Item> OBSIDIAN = PICKAXE.register("obsidian_pickaxe", JemPickaxe::new);;      /**public static <OBSIDIAN extends PickaxeItem> OBSIDIAN PickaxeProperties(String item, IItemTier tier, int damage, float speed, Properties properties)     *{     *    PickaxeProperties("obsidian_pickaxe", ItemTier.NETHERITE, 1, -2.8F, new Item.Properties().group(JemPickaxe.TOOLS));     *     *    return JemPickaxes.OBSIDIAN = PickaxeProperties("obsidian_pickaxe", ItemTier.NETHERITE, 1, -2.8F, properties);     *}     *     *public static RegistryObject<Item> TEST()     *{     *    return PICKAXE.register("test_pickaxe", JemPickaxe::new);     *}     */ }   This is what my JemPickaxe class looks like: public class JemPickaxe extends PickaxeItem { public static final ItemGroup TOOLS = new ItemGroup("tools") { @Override public ItemStack createIcon() { return new ItemStack(JemPickaxes.OBSIDIAN.get()); } }; public JemPickaxe(IItemTier tier, int attackDamage, float attackSpeedIn) { super(tier, attackDamage, attackSpeedIn, new Item.Properties().group(TOOLS)); //JemPickaxe.PickaxeProperties(tier, attackDamage, attackSpeedIn, new Item.Properties().group(TOOLS)); } /**public static void PickaxeProperties(String string, ItemTier netherite, int i, float f, Properties group) { * *} * * * public static void OBSIDIAN(IItemTier tier, int attackDamage, float attackSpeedIn) { * super(ItemTier.NETHERITE, 1, -2.8F, new Item.Properties().group(TOOLS)); * JemPickaxe.PickaxeProperties(ItemTier.NETHERITE, 1, -2.8F, new Item.Properties().group(TOOLS)); * } */ }  
    • Okay so it is a normal capability. Then why are you not just making normal fields in it that you put values in?
    • Got it. Moved it to the client event class. Everything seems to be working.   It is a Forge capability, with an interface, class, provider, and storage, along with a AttachCapabilitiesEvent<Entity> called in a class to attach it to PlayerEntity's. Sorry if that wasn't clear in my last post. Unless you're talking about a capability that is already in Forge?
  • Topics

  • Who's Online (See full list)