apace100 / apoli

MIT License
40 stars 46 forks source link

Pug's additions to Apoli #4

Closed MerchantPug closed 3 years ago

MerchantPug commented 3 years ago

Feel free to pick and choose what gets into the mod

Inverted Cooldown Bars

This change allows for bars that start as filled and empty over time. It also shouldn't break existing datapacks as inverted defaults to false.

This was already possible using resources but it is not possible with cooldowns, this makes it possible with cooldowns.

"hud_render": {
    "should_render": true,
    "bar_index": 0,
    "inverted": true
}

Elytra Flight Textures

This change allows the elytra flight power to have a texture specified. When specified the elytra's texture changes. By default it is null. A null value makes the power display the default elytra texture.

{
  "type": "apoli:elytra_flight",
  "render_elytra": true,
  "texture_location": "apoli:textures/entity/vex_elytra.png"
}

Elytra Flight texture working

RGB Color Fields for EntityGlowPower

This change allows the entity glow power to have RGB values separated from teams. It works by swapping out the color values of the glow render but only when the entity is glowing from said power.

{
  "type": "apoli:entity_glow",
  "entity_condition": {
    "type": "apoli:and",
    "conditions": [
      {
        "type": "apoli:in_block_anywhere",
        "block_condition": {
          "type": "apoli:block",
          "block": "minecraft:cobweb"
        }
      },
      {
        "type": "apoli:entity_group",
        "group": "arthropod",
        "inverted": true
      }
    ]
  },
  "use_teams": false,
  "red": 1.0,
  "green": 0.0,
  "blue": 0.0
}

Working as intended Multiple instances of the power

By setting use_teams to false (defaulted to true for compatibility reasons) you can set the red, green and blue fields to values. (Realistically you only want to go between 0.0 and 1.0 otherwise some unintended things happen (doesn't crash so it's fine)) After these values are set your entity glows that color.

Self Entity Glow

Basically the same as apoli:entity_glow with the changes above but it affects the entity with the power as opposed to rendering other entities that meet the condition. It also supports the entity_condition and bientity_condition fields so you can control who sees the self entity glow.

{
  "type": "apoli:self_glow",
  "use_teams": false,
  "red": 0.56862745098,
  "green": 0.89019607843,
  "blue": 0.65098039215,
  "condition": {
    "type": "apoli:in_rain"
  }
}

This is fair and balanced

{
  "type": "apoli:self_glow",
  "bientity_condition": {
    "type": "apoli:can_see"
  },
  "use_teams": false,
  "red": 1.0,
  "green": 0.0,
  "blue": 0.0
}

can_see bientity condition can_see bientity condition

Toggleable field for apoli:shader

Adds a field that when set to false it makes it so the specified shader is unable to be toggled via the F4 key.

{
  "type": "apoli:shader",
  "shader": "minecraft:shaders/post/spider.json",
  "toggleable": false
}
MerchantPug commented 3 years ago

Feel free to change the name from inverted, I was just using it because it was a familiar term.

MerchantPug commented 3 years ago

Idk how to specify only one commit to PR so this'll have to do.

Feel free to pick and choose what you want in Apoli.

Alluysl commented 3 years ago

To be coherent with resource bars, shouldn't the elytra texture path field be named sprite_location?

MerchantPug commented 3 years ago

I wouldn't call it a sprite location because it's not really a sprite, it's a texture

Alluysl commented 3 years ago

Fair 🤔

MerchantPug commented 3 years ago

TODO - Swap getInverted() to isInverted()