Skip to content

Instantly share code, notes, and snippets.

@eggohito
Last active January 22, 2025 10:55
Show Gist options
  • Save eggohito/510eb0cf7d36d40f906ac1fcef74ee96 to your computer and use it in GitHub Desktop.
Save eggohito/510eb0cf7d36d40f906ac1fcef74ee96 to your computer and use it in GitHub Desktop.

TODO

  • Depluralize the names of the directories used by Apoli/Origins to be consistent with vanilla. Affects the following directories:
    • powers --> <apoli/origins>/power
    • global_powers --> <apoli/origins>/global_power
    • origins --> origins/origin
    • origin_layers --> origins/origin_layer
    • badges --> origins/badge
  • Require sprites of HUD renders to be placed within the assets/.../textures/gui/sprites directory by implementing support to GUI sprite atlas.
  • Refactor recipe serializers and change how power recipes function and are defined; either keep the old format, or separate the recipe from the power. (Done in 1.13.0 alpha 9)

As you may know, there have been a lot of major changes from 1.20.2, to 1.20.5/6 and 1.21; which resulted in some power/action/condition/data types that cannot be re-implemented. This is due to the work-arounds being either too unreliable/too hacky, too much of a pain to maintain in the long run, or just outright impossible to do, therefore, we've decided to remove and re-structure stuff to accommodate for the changes.

(Make sure to check this list for updates, I'll be updating this frequently throughout the development of the 1.21 port!)

  • alpha 5

    Removals

    • [apoli] Removed any fields/types related to harvests levels (e.g: harvest_level item condition type) since items no longer have a harvest level property.
    • [apoli] Removed any fields/types related to entity groups (e.g: entity_group entity condition/power type) since entity groups have been removed in vanilla in favor of using entity type tags.
    • [apoli] Removed Reach Entity Attributes as a dependency since vanilla now provides similar attributes related to reach:
      • minecraft:player.entity_interaction_range (equivalent to reach-entity-attributes:attack_range)
      • minecraft:player.block_interaction_range (equivalent to reach-entity-attributes:reach)

    Changes

    • [calio] Item stacks now has components field instead of tag field, which accepts an object with key-value pairs that specifies which components will be added/removed (if prefixed with !) to/from the item stack.

      From:

      {
          "type": "origins:give",
          "stack": {
              "item": "minecraft:egg",
              "tag": "{display: {Name: '{\"text\": \"Golden Egg\"}'}, golden_egg: true}"
          }
      }

      To:

      {
          "type": "origins:give",
          "stack": {
              "item": "minecraft:egg",
              "components": {
                  "minecraft:custom_name": "{\"text\": \"Golden Egg\"}",
                  "minecraft:custom_data": {
                      "golden_egg": true
                  }
              }
          }
      }

    • [apoli] Attributed attribute modifiers now has an id field instead of the unused name field; the field is required (meaning it must be defined!) as it's used to determine the attributed attribute modifier's source, whereas previously, it used a randomly generated UUID.

      Attributed attribute modifier operations have also been renamed from addition, multiply_base and multiply_total to add_value, add_multiplied_base and add_multiplied_total respectively.


      From:

      {
          "name": "Additional movement speed",
          "attribute": "minecraft:generic.movement_speed",
          "operation": "addition",
          "value": 0.015
      }

      To:

      {
          "id": "example:additional_movement_speed",
          "attribute": "minecraft:generic.movement_speed",
          "operation": "add_value",
          "value": 0.015
      }

    • [apoli] The spawn_effect_cloud entity action type now has an effect_component field instead of the effect(s) fields. It specifies the area effect cloud's base potion effect (potion, optional), custom color (custom_color, optional), or bonus status effects (custom_effects, optional.)

      From:

      {
          "type": "origins:spawn_effect_cloud",
          "radius": 16.0,
          "effects": [
              {
                  "effect": "minecraft:slowness",
                  "amplifier": 1,
                  "duration": 200
              },
              {
                  "effect": "minecraft:poison",
                  "amplifier": 0,
                  "duration": 100
              }
          ]
      }

      To:

      {
          "type": "origins:spawn_effect_cloud",
          "radius": 16.0,
          "effect_component": {
              "custom_effects": [
                  {
                      "id": "minecraft:slowness",
                      "amplifier": 1,
                      "duration": 200
                  },
                  {
                      "id": "minecraft:poison",
                      "amplifier": 0,
                      "duration": 100
                  }
              ]
          }
      }

    • [apoli] The Powers item NBT has been converted into an `apoli:powers` item component. It also now supports an attribute modifier slot (e.g: any, mainhand, offhand, hand, feet, legs, chest, head, armor, or body) instead of an equipment slot for consistency with attribute modifiers.

      From:

      give @s minecraft:leather_leggings{Powers: [{Slot: "legs", Power: "example:fancy_pants_power", Hidden: false, Negative: false}]}

      To:

      give @s minecraft:leather_leggings[apoli:powers=[{slot: "legs", power: "example:fancy_pants_power", hidden: false, negative: false}]]

    • [apoli] The Targets item NBT has been converted into an origins:origin item component. It also now works for any item that doesn't have any use actions (previously, it only worked for the Orb of Origin item.)

      From:

      give @s origins:orb_of_origin{Targets: [{Origin: "origins:arachnid", Layer: "origins:origin"}]}

      To:

      give @s minecraft:stick[origins:origin=[{origin: "origins:arachnid", layer: "origins:origin"}]]

    • [apoli] The modify_enchantment_level has been changed to accommodate for data-driven enchantments.
    • [apoli] The merge_nbt item action type has been changed to merge custom NBT to the minecraft:custom_data item component, and has been renamed to merge_custom_data accordingly. (It behaves similarly to the minecraft:set_custom_data item modifier type.)
    • [apoli] The nbt item condition type has been changed to check for custom NBTs from the minecraft:custom_data item component, and has been renamed to custom_data accordingly.
    • [apoli] The fireproof item condition type has been renamed to fire_resistant to match the name of the minecraft:fire_resistant item component.
  • alpha 6

    Additions

    • [apoli#215] Added a modify_type_tag power type, which modifies whether an entity is considered included in the specified entity type tag; a replacement for the previously removed entity_group power type.

    Removals

    • [apoli] Removed the meat item condition type since the food component of items no longer has a meat property. The usage of the meat property is now controlled by the minecraft:meat item tag, which is also referenced in the minecraft:wolf_food item tag. You can use the ingredient item condition type to check if an item stack is in either item tags.
    • [apoli] Removed the category biome condition type since it has been deprecated for quite some time (since 1.18.2.) Use the in_tag biome condition type instead.
    • [apoli] Removed the material block condition type since it has been deprecated for quite some time (since 1.20.) Use block tags to classify blocks in their own groups/materials and use the in_tag block condition type instead.
    • [apoli] Removed any fields/types that use the legacy damage source data type since it has been deprecated for quite some time (since 1.19.4.) Use damage types and vanilla damage type tags to control the properties of a damage source.
    • [apoli] Removed the client and server boolean fields from the add_velocity entity/bi-entity action types since its usage is redundant. Use the side meta action type instead.
    • [apoli] The following aliases have been removed:
      • nbt ID path alias for custom_data item condition type.
      • merge_nbt ID path alias for merge_custom_data item action type.
      • action_on_set ID path alias for action_on_entity_set entity action type.
      • add_to_set ID path alias for add_to_entity_set entity action type.
      • remove_from_set ID path alias for remove_from_entity_set bi-entity action type.
      • in_set ID path alias for in_entity_set bi-entity condition type.
      • set_size ID path alias for entity_set_size entity condition type.
      • is_damageable ID path alias for damageable item condition type.
      • is_equippable ID path alias for equippable item condition type.
      • fireproof ID path alias for fire_resistant item condition type.
      • addition alias for apoli:add_base_early attribute modifier operation.
      • multiply_base alias for apoli:multiply_base_additive attribute modifier operation.
      • multiply_total alias for apoli:multiply_total_multiplicative attribute modifier operation.
    • [apoli] [For addon developers] Removed PowerTypeRegistry in favor of integrating its functionality to PowerManager (formerly known as PowerTypes.)

    Changes

    • [calio] The effect and is_ambient fields of status effect instances has been renamed to id and ambient respectively to be consistent with vanilla.

      From:

      {
          "effect": "minecraft:speed",
          "duration": 200,
          "amplifier": 2,
          "is_ambient": true
      }

      To:

      {
          "id": "minecraft:speed",
          "duration": 200,
          "amplifier": 2,
          "ambient": true
      }

    • [calio] The item and amount fields of item stacks has been renamed to id and count respectively to be consistent with vanilla.

      From:

      {
          "item": "minecraft:dirt",
          "amount": 64
      }

      To:

      {
          "id": "minecraft:dirt",
          "count": 64
      }

    • [calio] There have been many changes to the fields of food components to be consistent with vanilla; the hunger and always_edible fields has been renamed to nutrition and can_always_eat respectively, and the snack boolean field has been replaced with the eat_seconds float field, with a default value of 1.6.

      From:

      {
          "hunger": 4,
          "saturation": 0.04,
          "always_edible": true,
          "snack": true,
          "effect": {
              "effect": {
                  "effect": "minecraft:jump_boost",
                  "duration": 100,
                  "amplifier": 2
              },
              "probability": 1.0
          }
      }

      To:

      {
          "nutrition": 4,
          "saturation": 0.04,
          "can_always_eat": true,
          "eat_seconds": 0.8,     //  This is equivalent to setting 'snack' to true
          "effect": {
              "effect": {
                  "id": "minecraft:jump_boost",
                  "duration": 200,
                  "amplifier": 2
              },
              "probability": 1.0
          }
      }

    • [calio] Ingredients (ones mostly used in powers) now support Fabric's custom ingredients to provide more flexibility to users. This means custom ingredients, like fabric:components, can now be used to check for item components as long as the format for custom ingredients is followed.

      Examples:

      {
          "fabric:type": "fabric:components",
          "base": {
              "item": "minecraft:egg"         //  Determines the base ingredient to check for. In this case, it checks if the item is an egg
          },
          "components": {
              "minecraft:custom_data": {
                  "golden_egg": true          //  Check if the item has the '{golden_egg: 1b}' NBT in its custom data component
              }
          }
      }
      {
          "fabric:type": "fabric:any",     // Meta custom ingredients has to be used to check for multiple types of ingredients, custom or vanilla
          "ingredients": [
      	    {
                  "tag": "minecraft:meat" //  Vanilla ingredient that checks if the item is in the 'minecraft:meat' item tag
              },
      	    {
                  "fabric:type": "fabric:components",
                  "base": {
                      "tag": "example:valid_items"    //  Custom ingredient that checks if the item is in the 'example:valid_items' item tag...
                  },
                  "components": {
                      "minecraft:custom_data": {
                          "example:meat": true        //  ...and if it has the '{"example:meat": 1b}' NBT in its 'minecraft:custom_data' item component
                      }
                  }
              }
          ]
      }

    • [calio] Tag-likes now accept either a string (as it was), or a tag entry, the format often seen in tag files in data packs.

      From:

      {
          "entity_types": [
              "minecraft:creeper",
              "modid:mob_name"        //  Can't mark this as optional; will cause an error if the mod that adds the entity type is not loaded
          ]
      }

      To:

      {
          "entity_types": [
              "minecraft:creeper",
              {
                  "id": "modid:mob_name", // Can now mark this as optional; will NOT cause an error if the mod that adds the mob is not loaded
                  "required": false
              }
          ]
      }

    • [calio] [For addon developers] SerializableDataType<T> now extends StrictCodec<T>, which is Calio's version of Codec<T> for parsing types without wrapping it in a DataResult<T>, which is used for Calio's custom error handling. More changes have been made to accommodate for this change (and some quality of life additions):
      • SerializableData#add (and its overload methods) now accept a Codec<T>. If the provided codec is not an instance of SerializableDataType<T>, the provided codec will be wrapped with StrictCodec#of(Codec<T>) and will be synced to the client by encoding/decoding the type to/from NBT.
      • A recursive data type can be created via SerializableData#recursive or using the constructor for RecursiveSerializableDataType. If the inner data type is needed, RecursiveSerializableDataType#get can be called to get it via type-casting. Be careful with using this, as it may cause a class cast exception crashes if not used properly.
      • A lazy data type can be created via SerializableDataType#lazy. This uses RecursiveSerializableDataType, so the above is applicable to this as well.
    • [calio] [For addon developers] New methods has been added to SerializableData:
      • SerializableData#addSupplied for providing a Supplier<T> as a default value; this can be useful in certain cases where the default value must be lazily accessed in case it depends on another type that might not have been initialized at the time the serializable data has been initialized.
      • SerializableData#postProcessor for processing the SerializableData$Instance after its decoded; this can be useful in cases such as making a field incompatible with another field by checking if both fields are present and throwing an exception if so.
    • [apoli] The value field of the attributed attribute modifiers has been renamed to amount to be consistent with vanilla.

      From:

      {
          "id": "example:more_block_reach",
          "attribute": "minecraft:player.block_interaction_range",
          "operation": "add_value",
          "value": 4
      }

      To:

      {
          "id": "example:more_block_reach",
          "attribute": "minecraft:player.block_interaction_range",
          "operation": "add_value",
          "amount": 4
      }

    • [apoli] There have been changes on the fields of the attribute modifiers; its value field has been renamed to amount to be consistent with the attributed attribute modifiers; the amount field is also now optional, and its checked if none of the amount or resource fields are present, at which an error will be thrown if so.

      From:

      {
          "value": 0,
          "operation": "set_total"
      }

      To:

      {
          "amount": 0,
          "operation": "set_total"
      }

    • [apoli] The action field of the chance meta action type has been renamed to success_action to be consistent with its fail_action field.

      From:

      {
          "action": {
              "type": "apoli:execute_command",
              "command": "say Success!"
          },
          "fail_action": {
              "type": "apoli:execute_command",
              "command": "say Failed!"
          },
          "chance": 0.5
      }

      To:

      {
          "success_action": {
              "type": "apoli:execute_command",
              "command": "say Success!"
          },
          "fail_action": {
              "type": "apoli:execute_command",
              "command": "say Failed!"
          },
          "chance": 0.5
      }

    • [apoli] The replacable block condition type has been renamed to replaceable.
    • [apoli] The item modifier/condition types related to item powers (e.g: add_power, remove_power, power_count, etc.) has been changed/re-implemented to accommodate for the new item power component.
    • [apoli] The textures used in a power that uses the overlay power type have to be moved to the assets/.../textures/overlay/sprites directory of a resource pack. The ID will be relative to the directory (meaning you need to omit textures/overlay/sprites), such as:
      • assets/example/textures/overlay/sprites/wacky_view.png will be referenced as example:wacky_view
      • assets/example/textures/overlay/sprites/mirai/beautiful_star.png will be referenced as example:mirai/beautiful_star
    • [apoli] The consuming_time_modifier(s) field(s) of the edible_item power type has been moved to the modify_food power type and renamed to eat_ticks_modifier(s) for consistency.
    • [apoli] [For addon developers] The names of PowerType and Power has been switched to be consistent with the terminologies used in data packs/the wiki.
    • [apoli] [For addon developers] Biome condition types now operate on a Pair<BlockPos, RegistryEntry<Biome>> (previously RegistryEntry<Biome>.)
    • [apoli] [For addon developers] PowerHolderComponent can now be partially synced. The following are the only ones that can be partially synced currently:
      • PowerHolderComponent$PacketHandlers#GRANT_POWERS for granting and syncing powers; for simplicity, you can use the following helper methods:
        • PowerHolderComponent#grantPower(Entity holder, Power power, Identifier source, boolean sync) for granting (and optionally syncing) a single power with the defined source.
        • PowerHolderComponent#grantPower(Entity holder, Map<Identifier, List<Power> powersBySource, boolean sync) for granting (and optionally syncing) multiple powers in bulk with the defined sources.
      • PowerHolderComponent$PacketHandlers#REVOKE_POWERS for revoking and syncing powers; for simplicity, you can use the following helper methods:
        • PowerHolderComponent#revokePower(Entity holder, Power power, Identifier source, boolean sync) for revoking (and optionally syncing) a single power from the defined source.
        • PowerHolderComponent#revokePower(Entity holder, Map<Identifier, List<Power>> powersBySources, boolean sync) for revoking (and optionally syncing) multiple powers in bulk from the defined sources.
      • PowerHolderComponent$PacketHandlers#REVOKE_ALL_POWERS for revoking and syncing powers from sources; for simplicity, you can use the following helper methods:
        • PowerHolderComponent#revokeAllPowers(Entity entity, Identifier source, boolean sync) for revoking (and optionally syncing) powers from the defined source.
        • PowerHolderComponent#revokeAllPowers(Entity entity, Collection<Identifier> sources, boolean sync) for revoking (and optionally syncing) powers from the defined sources.
    • [apoli] [For addon developers] GlobalPowerSetLoader has been renamed to GlobalPowerSetManager.
    • [origins] [For addon developers] OriginLayers has been renamed to OriginLayerManager.
  • alpha 7

    Additions

    • [calio] Added SerializableDataTypes#NBT_ELEMENT for encoding/decoding general NBT elements.

    Changes

    • [origins] The icon field of origins now only accepts an object.

      From:

      {
          "icon": "minecraft:paper"
      }

      To:

      {
          "icon": {
              "id": "minecraft:paper"
          }
      }

    Fixes

    • [calio] Fixed registry key data types ignoring the defined exemptions; subsequently, this also fixed issues (again) such as vanilla dimension registry keys (e.g: minecraft:overworld, minecraft:the_nether, minecraft:the_end) not being recognized on the first time the world has been loaded.
    • [calio] Fixed wrapping of inputs/outputs in StrictListCodec<T>.
    • [apoli] Fixed sub-powers being decoded first before its Fabric resource conditions are evaluated (it should be evaluating the resource condition first.)
    • [apoli] Fixed some action/condition types using the wrong IDs. This affected the following types:
      • modify_status_effect_duration power type (it used modify_status_effect_amplifier.)
      • riding_action entity action type (it used passenger_action.)
      • air entity condition type (it used food_level.)
    • [apoli] Fixed fire_projectile entity action/power types having inconsistent implementations.
    • [apoli] Fixed if_else meta action type causing a crash if the optional else_action field is not present.
    • [apoli] Fixed advancement entity condition type not working properly.
    • [apoli] Fixed target_action bi-entity action type executing on the 'actor' in a bi-entity context.
    • [apoli] Fixed how the biome entity condition type is evaluated.
    • [apoli] Fixed attacker damage condition type not accounting for when the attacker is non-existent like it used to.
    • [apoli] Fixed damage entity action type accepting an optional damage type when it should be required.
    • [origins] Fixed carnivores unable to consume Ominous Bottles.
    • [origins] Fixed temporary cobweb having an item when it shouldn't (the item was only accessible with commands.)

    Changes

    • [calio] SerializableDataTypes#NBT has been renamed to SerializableDataTypes#NBT_COMPOUND.
    • [apoli] The modify_type_tag power type can now account for tags that may include the tag specified in the power.
    • [apoli] The damage entity/bi-entity action types now requires any of the amount, modifier or modifiers fields to be defined.
    • [apoli] The NBT structure of powers in entities has been changed for clarity and consistency with new NBTs in certain vanilla entities.

       - The Factory NBT has been renamed to type.
       - The Type NBT has been renamed to id.
       - The Sources NBT has been renamed to sources.
       - The Data NBT has been renamed to data.


      From:

      {cardinal_components: {"apoli:powers": {Powers: [{Type: "example:power", Factory: "apoli:resource", Sources: ["apoli:command"], Data: 50}]}}}

      To:

      {cardinal_components: {"apoli:powers": {powers: [{id: "example:power", type: "apoli:resource", sources: ["apoli:command"], data: 50}]}}}

    • [apoli] The /power revokeall <targets> <source> sub-command has been changed to /power revoke <targets> all <source>.

      From:

      /power revokeall @s example:epic_power/source

      To:

      /power revoke @s all example:epic_power/source
  • alpha 9

    Additions

    • [calio] [For addon developers] Added helper methods for wrapping data types in an optional:
      • SerializableDataType#optional for strictly wrapping the type in an optional.
      • SerializableDataType#lenientOptional for leniently wrapping the type in an optional, where it returns Optional#empty if it errors.
      • SerializableDataType#lenientOptional(Consumer<String>) for the same as the above method, but with a handler for when it errors.
    • [calio] [For addon developers] Added new data types related to recipes:
      • SerializableDataTypes#RECIPE_SERIALIZER for recipe serializers.
      • SerializableDataTypes#RECIPE_ENTRY for recipe entries.

    Changes

    • [calio] [For addon developers] Removed StrictCodec<T> in favor of simplicity.
    • [calio] [For addon developers] Data types no longer extend Codec<T>. To decode/encode an object, you can use any of the following methods:
      • SerializableDataType#codec to query the data type's Codec<T>.
      • SerializableDataType#read(DynamicOps<I>, I) to decode a DataResult<T> from I using DynamicOps<I>, where T being the data type's type and I being the type to decode T from.
      • SerializableDataType#write(DynamicOps<I>, T) to encode a DataResult<I> using DynamicOps<I> where T being the data type's type and I being the type to encode T into.
    • [apoli#247] Crafting recipes defined in powers are now visible in the recipe book.
    • [apoli] Fields that accept an action type can now accept an array as a shorthand for using the and meta action type.

      From:

      "entity_action": {
      	"type": "origins:and",
      	"actions": [
      		{
      			"type": "origins:execute_command",
      			"command": "say egg :)"
      		},
      		{
      			"type": "origins:give",
      			"stack": {
      				"id": "minecraft:egg"
      			}
      		}
      	]
      }

      To:

      "entity_action": [
      	{
      		"type": "origins:execute_command",
      		"command": "say egg :)"
      	},
      	{
      		"type": "origins:give",
      		"stack": {
      			"id": "minecraft:egg"
      		}
      	}
      ]

    • [apoli] Renamed the following meta condition types for consistency with vanilla:
      • chance --> random_chance
      • and --> all_of
      • or --> any_of
    • [apoli] The slot parameters of has_power and power_count item condition types are now optional.
    • [apoli] The apoli:powers item component will no longer error when a non-existent power is defined.
    • [apoli] Power names/descriptions can now be translated with the respective power.<namespace>.<path>.name/description translation keys, even when not using the translate JSON text component.
    • [origins] Origin names/descriptions can now be translated with the respective origin.<namespace>.<path>.name/description translation keys, even when not using the translate JSON text component.
    • [origins] Origin layer names can now be translated with the layer.<namespace>.<path>.name translation key, even when not using the translate JSON text component.
    • [origins] [For addon developers] Removed OriginRegistry in favor of integrating its functionality to OriginManager.

    Fixes

    • [calio] Fixed eat_seconds parameter of food components (aka. encoded/decoded via the SerializableDataType#FOOD_COMPONENT data type) accepting a non-zero positive floating point value instead of non-negative floating point value.
    • [calio] Fixed ingredients (aka. decoded/encoded via the SerializableDataTypes#INGREDIENT data type) unable to be sent to the client.
    • [calio] Fixed enum data types (aka. data types using SerializableDataType#enumValue) being case-sensitive when checking for matching additional values.
    • [apoli] Fixed crash caused by encoding global power sets.
    • [apoli] Fixed some aspects of global power sets (e.g: order) being replaced when merging.
    • [apoli] Fixed minor issue with printing JSON as text where JSON keys with null values are being printed (affects the /power dump command.)
    • [apoli] Fixed determining logic in the game_event_listener power type used for determining whether a game event should be accepted.
    • [apoli] Fixed on_block entity condition type incorrectly evaluating a block at the wrong position.
    • [apoli] Fixed crash caused by the modify_projectile_damage power type.
    • [apoli] Fixed spawn_particles entity action type miscalculating its spread.
    • [apoli] Fixed default translatable text (aka. the ApoliDataTypes#DEFAULT_TRANSLATABLE_TEXT data type) not being translatable by default.
    • [origins] Attempt to fix crash(?) with Merling's Water Breathing power (e.g: when drying out.)
    • [origins] Fixed some aspects of origin layers (e.g: name, order, gui_title, etc.) being replaced when merging.
  • alpha 10

    Additions

    • [calio] [For addon developers] Added SerializableDataType#validateValue method for validating the operand type
    • [apoli] Added legacy aliases for meta condition types;
      • and --> all_of
      • or --> any_of
      • chance --> random_chance

    Changes

    • [calio] [For addon developers] Deprecated SimpleDataObjectFactory in favor of using DataObjectFactory directly via DataObjectFactory#simple
    • [calio] [For addon developers] Renamed SerializableDataTypeList class to ListSerializableDataType
    • [calio] [For addon developers] Renamed FunctionedFieldImpl class to FunctionedDefaultFieldImpl
    • [calio] [For addon developers] Renamed OptionalFieldImpl class to DefaultedFieldImpl
    • [calio] [For addon developers] Renamed Field#path method to Field#name
    • [calio] [For addon developers] Tweaked field presence check logic in SerializableData$Instance to ensure that the default value of fields are only checked if the field doesn't have a defined value
    • [calio] [For addon developers] Separated setting of defaulted and functioned default fields of SerializableData$Instance (when decoding) to avoid nullability issues with functioned default fields relying on defaulted fields
    • [apoli] Made the *_inventory action/condition types use slot ranges (e.g: hotbar.*, armor.*, etc.)
    • [apoli] Made the keep_inventory power type use slot ranges (e.g: enderchest.*, inventory.*, etc.)
    • [apoli] Renamed the simple power type to dummy (and added its old name as an alias)
    • [apoli] Renamed the active_self power type to action_on_key_press (and added its old name as an alias)
    • [apoli] Renamed some meta condition types (and added their old name as an alias)
      • and --> sequence
      • chance --> random_chance
    • [apoli] [For addon developers] Added PowerUtil, a utility class for modifying/querying resource values, and validating if a power type is considered a resource
    • [apoli] [For addon developers] Made container type an interface. There's also a new registry, ApoliRegistries#CONTAINER_TYPE, where addons can register their container types to be used by the inventory power type. Currently, there are two types of container type:
      • Preset container type, which re-uses a screen handler/screen of a pre-existing container
      • Dynamic container type, which has definable rows, columns, title alignment, and texture via data; also has its own screen handler/screen (currently incomplete and unsupported)
    • [apoli#254] [For addon developers] Overhauled power/action/condition (types);
      • Power/action/condition types no longer use type factories, but type configurations (that has its ID (via TypeConfiguration#id), and its TypedDataObjectFactory (via TypeConfiguration#dataFactory), which is an extension to Calio's DataObjectFactory that contains a CompoundSerializableDataType)
      • Power/action/condition types now use a similar structure for consistency
      • Actions/conditions now have their own classes (e.g: EntityAction instead of Consumer<Entity> or ActionTypeFactory.Instance)

    Fixes

    • [apoli] Fixed the amount field of modifiers being prioritized over the resource field (it should be the other way around)
    • [apoli] Fixed /power remove command and revoking powers in general
    • [apoli] Fixed NullPointerException issue (crash) when checking for power types in entities
    • [apoli] Fixed action_on_item_pickup power type not properly executing its actions
    • [apoli] Fixed inventory power type giving ghost items when the power is lost
    • [apoli] Fixed in_entity_set bi-entity condition type causing a crash when either the actor or target do not exist
    • [origins] Fixed origin layers (aside from the base origin layer) not being visible when viewing
  • alpha 12

    Additions

    • [apoli] Added new generic container types (with the _AxB suffix, where A is the amount of columns and B is the amount of rows.)
      • generic_9x1
      • generic_9x2
      • generic_9x4
      • generic_9x5

    Changes

    • [apoli] Renamed the key field in keybinding references to id (and added its old name as an alias.)
    • [apoli] Renamed some container types to match its corresponding screen handlers (and added its old names as aliases);
      • double_chest --> generic_9x6
      • chest --> generic_9x3
      • dropper/dispenser --> generic_3x3
    • [apoli] Block actions now only execute on the server to prevent desync with the client.
    • [apoli] Item actions now only execute on the server to prevent desync with the client.
    • [apoli] The on_block entity condition type now checks the block currently being stepped on, instead of the block underneath the entity (e.g: carpet on soul sand --> carpet will be the block being stepped on.)
    • [apoli] {For addon developers} Fixed and tweaked power keybinding references;
      • Renamed Active$Key class to KeyBindingReference and moved it into the io.github.apace100.apoli.util.keybinding package.
      • Fixed issue with triggering active power types with server-sided conditions.
    • [apoli] {For addon developers} Refactored action/condition types and context;
      • Action/condition types no longer have the execute(...)/test(...) methods respectively. To implement action/condition logic, override the accept(ActionContext)/test(ConditionContext) methods respectively, and access the action/condition context directly instead.

        From:

        import net.minecraft.entity.Entity;
        
        @Override
        public void execute(Entity actor, Entity target) {
        	//  ...rest of the stuff here
        }

        To:

        import io.github.apace100.apoli.action.context.BiEntityActionContext;
        import net.minecraft.entity.Entity;
        
        @Override
        public void accept(BiEntityActionContext context) {
        
        	Entity actor = context.actor();
        	Entity target = context.target();
        	
        	//  ...rest of the stuff here
        
        }
      • Renamed TypeActionContext and TypeConditionContext to ActionContext and ConditionContext respectively.
      • Added shouldExecute(ActionContext) for action types to evaluate the action context before proceeding with the action logic.

        e.g:

        import io.github.apace100.apoli.action.context.EntityActionContext;
        
        @Override
        public boolean shouldExecute(EntityActionContext context) {
            //	return true; // Pass through by default
            return context.entity() != null;    //  Only execute the entity action type if there's an entity
        }
      • Added shouldTest(ConditionContext) for condition types to evaluate the condition context before proceeding with the condition logic.

        e.g:

        import io.github.apace100.apoli.condition.context.BlockConditionContext;
        
        @Override
        public boolean shouldTest(BlockConditionContext context) {
        	//	return true; // Pass through by default
        	return !context.world().isClient();    //  Only test the block condition type on the server
        }
      • Added BiEntityRequirement enum used in bi-entity action/condition types to determine whether BOTH, EITHER, or DEFAULT (no requirement) actor/target entities are required.
      • Added getRequirement() in bi-entity action/condition types to indicate its requirement.

        e.g:

        import io.github.apace100.apoli.util.requirement.BiEntityRequirement;
        
        @Override
        public BiEntityRequirement getRequirement() {
            //	return BiEntityRequirement.DEFAULT; //  Default value
            return BiEntityRequirement.BOTH;    //  Indicates that this bi-entity action/condition requires both the actor and target entities to be present
        }

    Fixes

    • [calio] Fixed logic for checking the boundaries of positive floating point number data types.
    • [apoli] Fixed syncing powers in LAN servers.
    • [apoli] Fixed origin position of the raycast entity action/condition types.
    • [apoli] Fixed how the command in command_along_ray is executed in the raycast entity action type.
    • [apoli] Fixed default value of the comparison field of the passenger entity condition type.
    • [apoli] Fixed actor/target context in passenger_action entity action type.
    • [apoli] Fixed field order, and encoding issue with particle-related power/action types.
    • [apoli] Fixed the stacking_status_effect power type not decreasing its stacks properly.
    • [apoli] Fixed the spawn_entity entity action type not properly recognizing the action in its bientity_action field as a bi-entity action.
    • [apoli] Fixed issues with the starting_equipment power type;
      • Fixed the power type unable to be encoded properly (e.g: with /power dump or when syncing the power to the client.)
      • Fixed the power type preventing the server from reloading (or causing a client crash.)
    • [apoli] Fixed issues with the game_event_listener power type;
      • Fixed class-casting crash issue when a new instance of the power type is created.
      • Fixed the power type unable to listen to game events.
    • [origins] Fixed syncing badges/origins/origin layers in LAN servers.
    • [origins] Fixed origins:origin item component not consuming the item when setting origin(s).
@OffBrandCrinjatura
Copy link

how do i rename these things in the TODO list? Like where even are these directories? Are they just names of the folders in the zip file?

@eggohito
Copy link
Author

eggohito commented Nov 28, 2024

how do i rename these things in the TODO list? Like where even are these directories? Are they just names of the folders in the zip file?

the TO DO list is for me to do; it hasn't been implemented to the mod yet. but once they are implemented, you'll have to rename the affected directories (e.g: powers to power) and move it to any of the apoli or origins sub-folders (at least, that's the plan.) also, these directories should be placed in the data/<namespace> directory of a data pack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment