Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potions / Status Effects #558

Merged
merged 80 commits into from
Dec 29, 2023
Merged

Potions / Status Effects #558

merged 80 commits into from
Dec 29, 2023

Conversation

SelfMadeSystem
Copy link
Contributor

@SelfMadeSystem SelfMadeSystem commented Oct 12, 2023

Objective

  • Potion effects aren't supported by valence yet.
  • You can send a packet to tell the client about a potion effect, but the server still has no idea what they are
Example code
pub fn add_potion_effect(mut clients: Query<&mut Client>, mut events: EventReader<SneakEvent>) {
    for event in events.iter() {
        if event.state == SneakState::Start {
            if let Ok(mut client) = clients.get_mut(event.client) {
                client.write_packet(&EntityStatusEffectS2c {
                    entity_id: VarInt(0),
                    effect_id: VarInt(22),
                    amplifier: 0,
                    duration: VarInt(600),
                    flags: entity_status_effect_s2c::Flags::new()
                        .with_show_particles(true)
                        .with_show_icon(true),
                    factor_codec: None,
                });
            }
        }
    }
}
  • Closes Potion Effects #401
  • Also, when the potion effect expires, we need to tell the client that their potion effect is no longer. Right now, with sending a packet, the effect doesn't get removed when it goes down to 00:00.

Solution

I want to add the necessary components and stuff to facilitate potion effects.

Note: I'm still somewhat new to rust and very new to bevy, so please lmk if I can improve anything or if I should do anything differently. Thanks!

To do:

  • Extractor
  • ActiveStatusEffects component to handle the actual status effect applied to the mc entity
  • Add ActiveStatusEffects component to all entities.
  • Make a plugin to handle potion effects
    • Decrease tick count
    • Remove effect (& tell client) when tick count is 0
    • Make the effects do stuff
      • Particles
      • Tell client
  • Add tests
  • Add example
    • Add examples on how to implement potion effects (speed, instant health, etc.)
  • Extract stuff to make it easier to implement potions. See Add more potion effect stuff to extractor #593

Playground

Current playground
use valence::client::despawn_disconnected_clients;
use valence::entity::active_status_effects::{ActiveStatusEffect, ActiveStatusEffects};
use valence::entity::status_effects::StatusEffect;
use valence::log::LogPlugin;
use valence::network::ConnectionMode;
use valence::prelude::*;

#[allow(unused_imports)]
use crate::extras::*;

const SPAWN_Y: i32 = 64;

pub fn build_app(app: &mut App) {
    app.insert_resource(NetworkSettings {
        connection_mode: ConnectionMode::Offline,
        ..Default::default()
    })
    .add_plugins(DefaultPlugins.build().disable::<LogPlugin>())
    .add_systems(Startup, setup)
    .add_systems(EventLoopUpdate, add_potion_effect)
    .add_systems(Update, (init_clients, despawn_disconnected_clients))
    .run();
}

fn setup(
    mut commands: Commands,
    server: Res<Server>,
    biomes: Res<BiomeRegistry>,
    dimensions: Res<DimensionTypeRegistry>,
) {
    let mut layer = LayerBundle::new(ident!("overworld"), &dimensions, &biomes, &server);

    for z in -5..5 {
        for x in -5..5 {
            layer.chunk.insert_chunk([x, z], UnloadedChunk::new());
        }
    }

    for z in -25..25 {
        for x in -25..25 {
            layer
                .chunk
                .set_block([x, SPAWN_Y, z], BlockState::GRASS_BLOCK);
        }
    }

    commands.spawn(layer);
}

fn init_clients(
    mut clients: Query<
        (
            &mut EntityLayerId,
            &mut VisibleChunkLayer,
            &mut VisibleEntityLayers,
            &mut Position,
            &mut GameMode,
        ),
        Added<Client>,
    >,
    layers: Query<Entity, (With<ChunkLayer>, With<EntityLayer>)>,
) {
    for (
        mut layer_id,
        mut visible_chunk_layer,
        mut visible_entity_layers,
        mut pos,
        mut game_mode,
    ) in &mut clients
    {
        let layer = layers.single();

        layer_id.0 = layer;
        visible_chunk_layer.0 = layer;
        visible_entity_layers.0.insert(layer);
        pos.set([0.0, SPAWN_Y as f64 + 1.0, 0.0]);
        *game_mode = GameMode::Survival;
    }
}

pub fn add_potion_effect(
    mut clients: Query<&mut ActiveStatusEffects>,
    mut events: EventReader<SneakEvent>,
) {
    for event in events.iter() {
        if event.state == SneakState::Start {
            if let Ok(mut status) = clients.get_mut(event.client) {
                status.add(
                    ActiveStatusEffect::from_effect(StatusEffect::Wither)
                        .with_amplifier(2)
                        .with_duration(200),
                );
            }
        }
    }
}

@SelfMadeSystem SelfMadeSystem marked this pull request as ready for review December 26, 2023 22:37
@SelfMadeSystem
Copy link
Contributor Author

SelfMadeSystem commented Dec 26, 2023

ok I did a few things, including:

  • Adding StatusEffectAdded event
  • Adding StatusEffectRemoved event
  • Adding example implementations of potion status effects

Do check if I'm doing that correct kuz I'm not all that familiar with bevy still yet

Comment on lines 163 to 171
const SPEED_UUID: Uuid = parse_uuid_const(b"91AEAA56-376B-4498-935B-2F7F68070635");
const SLOW_UUID: Uuid = parse_uuid_const(b"7107DE5E-7CE8-4030-940E-514C1F160890");
const HASTE_UUID: Uuid = parse_uuid_const(b"AF8B6E3F-3328-4C0A-AA36-5BA2BB9DBEF3");
const MINING_FATIGUE_UUID: Uuid = parse_uuid_const(b"55FCED67-E92A-486E-9800-B47F202C4386");
const STRENGTH_UUID: Uuid = parse_uuid_const(b"648D7064-6A60-4F59-8ABE-C2C23A6DD7A9");
const WEAKNESS_UUID: Uuid = parse_uuid_const(b"22653B89-116E-49DC-9B6B-9971489B5BE5");
const HEALTH_BOOST_UUID: Uuid = parse_uuid_const(b"5D6F0BA2-1186-46AC-B896-C61C5CEE99CC");
const LUCK_UUID: Uuid = parse_uuid_const(b"03C3C89D-7037-4B42-869F-B146BCB64D2E");
const UNLUCK_UUID: Uuid = parse_uuid_const(b"CC5AF142-2BD2-4215-B636-2605AED11727");
Copy link
Contributor

@qualterz qualterz Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to extract these constants from Minecraft and generate them in Valence?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think about it, I could actually (+ a bit more that might make it easier to implement). I don't have the time to do that now, but I'll do that when I can

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll make another PR for that I think (lmk if you think I shouldn't)

@SelfMadeSystem SelfMadeSystem marked this pull request as draft December 27, 2023 13:15
Copy link

It looks like this pull request changed the workspace structure. Please replace assets/depgraph.svg with the following text:

depgraph.svg (Don't forget the trailing newline)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
 -->
<!-- Title: %3 Pages: 1 -->
<svg width="1644pt" height="620pt"
 viewBox="0.00 0.00 1643.50 620.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 616)">
<title>%3</title>
<polygon fill="white" stroke="transparent" points="-4,4 -4,-616 1639.5,-616 1639.5,4 -4,4"/>
<!-- 0 -->
<g id="node1" class="node">
<title>0</title>
<polygon fill="none" stroke="black" points="653,-612 558,-612 558,-576 653,-576 653,-612"/>
<text text-anchor="middle" x="605.5" y="-590.3" font-family="Times,serif" font-size="14.00">java_string</text>
</g>
<!-- 1 -->
<g id="node2" class="node">
<title>1</title>
<polygon fill="none" stroke="black" points="173,-468 0,-468 0,-432 173,-432 173,-468"/>
<text text-anchor="middle" x="86.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_advancement</text>
</g>
<!-- 2 -->
<g id="node3" class="node">
<title>2</title>
<polygon fill="none" stroke="black" points="862,-396 739,-396 739,-360 862,-360 862,-396"/>
<text text-anchor="middle" x="800.5" y="-374.3" font-family="Times,serif" font-size="14.00">valence_server</text>
</g>
<!-- 1&#45;&gt;2 -->
<g id="edge1" class="edge">
<title>1&#45;&gt;2</title>
<path fill="none" stroke="black" d="M173.05,-433.3C176.24,-432.84 179.4,-432.41 182.5,-432 379.42,-406.17 613.37,-390.05 728.78,-383.06"/>
<polygon fill="black" stroke="black" points="729.13,-386.54 738.9,-382.45 728.71,-379.55 729.13,-386.54"/>
</g>
<!-- 3 -->
<g id="node4" class="node">
<title>3</title>
<polygon fill="none" stroke="black" points="788,-324 669,-324 669,-288 788,-288 788,-324"/>
<text text-anchor="middle" x="728.5" y="-302.3" font-family="Times,serif" font-size="14.00">valence_entity</text>
</g>
<!-- 2&#45;&gt;3 -->
<g id="edge2" class="edge">
<title>2&#45;&gt;3</title>
<path fill="none" stroke="black" d="M782.7,-359.7C773.9,-351.14 763.12,-340.66 753.5,-331.3"/>
<polygon fill="black" stroke="black" points="755.7,-328.57 746.09,-324.1 750.82,-333.58 755.7,-328.57"/>
</g>
<!-- 12 -->
<g id="node5" class="node">
<title>12</title>
<polygon fill="none" stroke="black" points="940.5,-324 806.5,-324 806.5,-288 940.5,-288 940.5,-324"/>
<text text-anchor="middle" x="873.5" y="-302.3" font-family="Times,serif" font-size="14.00">valence_registry</text>
</g>
<!-- 2&#45;&gt;12 -->
<g id="edge3" class="edge">
<title>2&#45;&gt;12</title>
<path fill="none" stroke="black" d="M818.54,-359.7C827.56,-351.05 838.62,-340.45 848.44,-331.03"/>
<polygon fill="black" stroke="black" points="850.87,-333.55 855.66,-324.1 846.02,-328.5 850.87,-333.55"/>
</g>
<!-- 11 -->
<g id="node6" class="node">
<title>11</title>
<polygon fill="none" stroke="black" points="895.5,-252 705.5,-252 705.5,-216 895.5,-216 895.5,-252"/>
<text text-anchor="middle" x="800.5" y="-230.3" font-family="Times,serif" font-size="14.00">valence_server_common</text>
</g>
<!-- 3&#45;&gt;11 -->
<g id="edge4" class="edge">
<title>3&#45;&gt;11</title>
<path fill="none" stroke="black" d="M746.3,-287.7C755.1,-279.14 765.88,-268.66 775.5,-259.3"/>
<polygon fill="black" stroke="black" points="778.18,-261.58 782.91,-252.1 773.3,-256.57 778.18,-261.58"/>
</g>
<!-- 12&#45;&gt;11 -->
<g id="edge12" class="edge">
<title>12&#45;&gt;11</title>
<path fill="none" stroke="black" d="M855.46,-287.7C846.44,-279.05 835.38,-268.45 825.56,-259.03"/>
<polygon fill="black" stroke="black" points="827.98,-256.5 818.34,-252.1 823.13,-261.55 827.98,-256.5"/>
</g>
<!-- 9 -->
<g id="node12" class="node">
<title>9</title>
<polygon fill="none" stroke="black" points="717.5,-180 581.5,-180 581.5,-144 717.5,-144 717.5,-180"/>
<text text-anchor="middle" x="649.5" y="-158.3" font-family="Times,serif" font-size="14.00">valence_protocol</text>
</g>
<!-- 11&#45;&gt;9 -->
<g id="edge11" class="edge">
<title>11&#45;&gt;9</title>
<path fill="none" stroke="black" d="M763.56,-215.88C743.01,-206.35 717.25,-194.41 695.41,-184.28"/>
<polygon fill="black" stroke="black" points="696.86,-181.1 686.32,-180.07 693.92,-187.45 696.86,-181.1"/>
</g>
<!-- 4 -->
<g id="node7" class="node">
<title>4</title>
<polygon fill="none" stroke="black" points="651.5,-108 501.5,-108 501.5,-72 651.5,-72 651.5,-108"/>
<text text-anchor="middle" x="576.5" y="-86.3" font-family="Times,serif" font-size="14.00">valence_generated</text>
</g>
<!-- 5 -->
<g id="node8" class="node">
<title>5</title>
<polygon fill="none" stroke="black" points="709.5,-36 595.5,-36 595.5,0 709.5,0 709.5,-36"/>
<text text-anchor="middle" x="652.5" y="-14.3" font-family="Times,serif" font-size="14.00">valence_ident</text>
</g>
<!-- 4&#45;&gt;5 -->
<g id="edge5" class="edge">
<title>4&#45;&gt;5</title>
<path fill="none" stroke="black" d="M595.29,-71.7C604.67,-63.05 616.18,-52.45 626.41,-43.03"/>
<polygon fill="black" stroke="black" points="628.95,-45.45 633.93,-36.1 624.2,-40.3 628.95,-45.45"/>
</g>
<!-- 6 -->
<g id="node9" class="node">
<title>6</title>
<polygon fill="none" stroke="black" points="577.5,-36 463.5,-36 463.5,0 577.5,0 577.5,-36"/>
<text text-anchor="middle" x="520.5" y="-14.3" font-family="Times,serif" font-size="14.00">valence_math</text>
</g>
<!-- 4&#45;&gt;6 -->
<g id="edge6" class="edge">
<title>4&#45;&gt;6</title>
<path fill="none" stroke="black" d="M562.66,-71.7C556.01,-63.39 547.92,-53.28 540.61,-44.14"/>
<polygon fill="black" stroke="black" points="543.16,-41.73 534.18,-36.1 537.7,-46.1 543.16,-41.73"/>
</g>
<!-- 7 -->
<g id="node10" class="node">
<title>7</title>
<polygon fill="none" stroke="black" points="1084.5,-612 932.5,-612 932.5,-576 1084.5,-576 1084.5,-612"/>
<text text-anchor="middle" x="1008.5" y="-590.3" font-family="Times,serif" font-size="14.00">valence_build_utils</text>
</g>
<!-- 8 -->
<g id="node11" class="node">
<title>8</title>
<polygon fill="none" stroke="black" points="829,-36 728,-36 728,0 829,0 829,-36"/>
<text text-anchor="middle" x="778.5" y="-14.3" font-family="Times,serif" font-size="14.00">valence_nbt</text>
</g>
<!-- 9&#45;&gt;4 -->
<g id="edge7" class="edge">
<title>9&#45;&gt;4</title>
<path fill="none" stroke="black" d="M631.46,-143.7C622.44,-135.05 611.38,-124.45 601.56,-115.03"/>
<polygon fill="black" stroke="black" points="603.98,-112.5 594.34,-108.1 599.13,-117.55 603.98,-112.5"/>
</g>
<!-- 10 -->
<g id="node13" class="node">
<title>10</title>
<polygon fill="none" stroke="black" points="775.5,-108 669.5,-108 669.5,-72 775.5,-72 775.5,-108"/>
<text text-anchor="middle" x="722.5" y="-86.3" font-family="Times,serif" font-size="14.00">valence_text</text>
</g>
<!-- 9&#45;&gt;10 -->
<g id="edge8" class="edge">
<title>9&#45;&gt;10</title>
<path fill="none" stroke="black" d="M667.54,-143.7C676.56,-135.05 687.62,-124.45 697.44,-115.03"/>
<polygon fill="black" stroke="black" points="699.87,-117.55 704.66,-108.1 695.02,-112.5 699.87,-117.55"/>
</g>
<!-- 10&#45;&gt;5 -->
<g id="edge9" class="edge">
<title>10&#45;&gt;5</title>
<path fill="none" stroke="black" d="M705.2,-71.7C696.64,-63.14 686.16,-52.66 676.8,-43.3"/>
<polygon fill="black" stroke="black" points="679.15,-40.7 669.6,-36.1 674.2,-45.65 679.15,-40.7"/>
</g>
<!-- 10&#45;&gt;8 -->
<g id="edge10" class="edge">
<title>10&#45;&gt;8</title>
<path fill="none" stroke="black" d="M736.34,-71.7C742.99,-63.39 751.08,-53.28 758.39,-44.14"/>
<polygon fill="black" stroke="black" points="761.3,-46.1 764.82,-36.1 755.84,-41.73 761.3,-46.1"/>
</g>
<!-- 13 -->
<g id="node14" class="node">
<title>13</title>
<polygon fill="none" stroke="black" points="303.5,-468 191.5,-468 191.5,-432 303.5,-432 303.5,-468"/>
<text text-anchor="middle" x="247.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_anvil</text>
</g>
<!-- 13&#45;&gt;2 -->
<g id="edge13" class="edge">
<title>13&#45;&gt;2</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M303.76,-433.74C306.7,-433.11 309.63,-432.53 312.5,-432 459.07,-405.03 633.12,-390.17 728.7,-383.47"/>
<polygon fill="black" stroke="black" points="729.1,-386.95 738.83,-382.77 728.62,-379.97 729.1,-386.95"/>
</g>
<!-- 14 -->
<g id="node15" class="node">
<title>14</title>
<polygon fill="none" stroke="black" points="461.5,-468 321.5,-468 321.5,-432 461.5,-432 461.5,-468"/>
<text text-anchor="middle" x="391.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_boss_bar</text>
</g>
<!-- 14&#45;&gt;2 -->
<g id="edge14" class="edge">
<title>14&#45;&gt;2</title>
<path fill="none" stroke="black" d="M461.67,-433.7C464.65,-433.11 467.6,-432.54 470.5,-432 559.19,-415.35 661.91,-399.37 728.88,-389.39"/>
<polygon fill="black" stroke="black" points="729.53,-392.83 738.9,-387.9 728.5,-385.91 729.53,-392.83"/>
</g>
<!-- 15 -->
<g id="node16" class="node">
<title>15</title>
<polygon fill="none" stroke="black" points="625.5,-468 479.5,-468 479.5,-432 625.5,-432 625.5,-468"/>
<text text-anchor="middle" x="552.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_command</text>
</g>
<!-- 15&#45;&gt;2 -->
<g id="edge15" class="edge">
<title>15&#45;&gt;2</title>
<path fill="none" stroke="black" d="M612.85,-431.97C648.25,-421.97 693.16,-409.3 730.16,-398.85"/>
<polygon fill="black" stroke="black" points="731.21,-402.2 739.88,-396.11 729.3,-395.46 731.21,-402.2"/>
</g>
<!-- 16 -->
<g id="node17" class="node">
<title>16</title>
<polygon fill="none" stroke="black" points="789.5,-468 643.5,-468 643.5,-432 789.5,-432 789.5,-468"/>
<text text-anchor="middle" x="716.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_inventory</text>
</g>
<!-- 16&#45;&gt;2 -->
<g id="edge16" class="edge">
<title>16&#45;&gt;2</title>
<path fill="none" stroke="black" d="M737.26,-431.7C747.74,-422.97 760.61,-412.24 772,-402.75"/>
<polygon fill="black" stroke="black" points="774.53,-405.19 779.97,-396.1 770.05,-399.82 774.53,-405.19"/>
</g>
<!-- 17 -->
<g id="node18" class="node">
<title>17</title>
<polygon fill="none" stroke="black" points="1621.5,-396 1513.5,-396 1513.5,-360 1621.5,-360 1621.5,-396"/>
<text text-anchor="middle" x="1567.5" y="-374.3" font-family="Times,serif" font-size="14.00">valence_lang</text>
</g>
<!-- 18 -->
<g id="node19" class="node">
<title>18</title>
<polygon fill="none" stroke="black" points="1635.5,-468 1499.5,-468 1499.5,-432 1635.5,-432 1635.5,-468"/>
<text text-anchor="middle" x="1567.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_network</text>
</g>
<!-- 18&#45;&gt;2 -->
<g id="edge17" class="edge">
<title>18&#45;&gt;2</title>
<path fill="none" stroke="black" d="M1499.16,-433.39C1496.24,-432.89 1493.34,-432.42 1490.5,-432 1266.53,-398.84 998.39,-385.78 872.49,-381.2"/>
<polygon fill="black" stroke="black" points="872.33,-377.69 862.21,-380.83 872.08,-384.68 872.33,-377.69"/>
</g>
<!-- 18&#45;&gt;17 -->
<g id="edge18" class="edge">
<title>18&#45;&gt;17</title>
<path fill="none" stroke="black" d="M1567.5,-431.7C1567.5,-423.98 1567.5,-414.71 1567.5,-406.11"/>
<polygon fill="black" stroke="black" points="1571,-406.1 1567.5,-396.1 1564,-406.1 1571,-406.1"/>
</g>
<!-- 19 -->
<g id="node20" class="node">
<title>19</title>
<polygon fill="none" stroke="black" points="959.5,-468 807.5,-468 807.5,-432 959.5,-432 959.5,-468"/>
<text text-anchor="middle" x="883.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_player_list</text>
</g>
<!-- 19&#45;&gt;2 -->
<g id="edge19" class="edge">
<title>19&#45;&gt;2</title>
<path fill="none" stroke="black" d="M862.98,-431.7C852.63,-422.97 839.91,-412.24 828.66,-402.75"/>
<polygon fill="black" stroke="black" points="830.68,-399.88 820.78,-396.1 826.17,-405.23 830.68,-399.88"/>
</g>
<!-- 20 -->
<g id="node21" class="node">
<title>20</title>
<polygon fill="none" stroke="black" points="1135,-468 978,-468 978,-432 1135,-432 1135,-468"/>
<text text-anchor="middle" x="1056.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_scoreboard</text>
</g>
<!-- 20&#45;&gt;2 -->
<g id="edge20" class="edge">
<title>20&#45;&gt;2</title>
<path fill="none" stroke="black" d="M994.2,-431.97C957.38,-421.9 910.62,-409.11 872.26,-398.62"/>
<polygon fill="black" stroke="black" points="872.76,-395.13 862.19,-395.87 870.91,-401.88 872.76,-395.13"/>
</g>
<!-- 21 -->
<g id="node22" class="node">
<title>21</title>
<polygon fill="none" stroke="black" points="1228,-612 1103,-612 1103,-576 1228,-576 1228,-612"/>
<text text-anchor="middle" x="1165.5" y="-590.3" font-family="Times,serif" font-size="14.00">valence_spatial</text>
</g>
<!-- 22 -->
<g id="node23" class="node">
<title>22</title>
<polygon fill="none" stroke="black" points="1289.5,-468 1153.5,-468 1153.5,-432 1289.5,-432 1289.5,-468"/>
<text text-anchor="middle" x="1221.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_weather</text>
</g>
<!-- 22&#45;&gt;2 -->
<g id="edge21" class="edge">
<title>22&#45;&gt;2</title>
<path fill="none" stroke="black" d="M1153.11,-433.66C1150.21,-433.09 1147.33,-432.53 1144.5,-432 1050.81,-414.46 941.97,-398.41 872.22,-388.68"/>
<polygon fill="black" stroke="black" points="872.61,-385.2 862.22,-387.29 871.65,-392.13 872.61,-385.2"/>
</g>
<!-- 23 -->
<g id="node24" class="node">
<title>23</title>
<polygon fill="none" stroke="black" points="1481,-468 1308,-468 1308,-432 1481,-432 1481,-468"/>
<text text-anchor="middle" x="1394.5" y="-446.3" font-family="Times,serif" font-size="14.00">valence_world_border</text>
</g>
<!-- 23&#45;&gt;2 -->
<g id="edge22" class="edge">
<title>23&#45;&gt;2</title>
<path fill="none" stroke="black" d="M1307.94,-433.39C1304.75,-432.9 1301.6,-432.44 1298.5,-432 1147.18,-410.58 968.87,-393.58 871.98,-385.04"/>
<polygon fill="black" stroke="black" points="872.27,-381.55 862,-384.16 871.66,-388.53 872.27,-381.55"/>
</g>
<!-- 24 -->
<g id="node25" class="node">
<title>24</title>
<polygon fill="none" stroke="black" points="798,-612 671,-612 671,-576 798,-576 798,-612"/>
<text text-anchor="middle" x="734.5" y="-590.3" font-family="Times,serif" font-size="14.00">dump_schedule</text>
</g>
<!-- 25 -->
<g id="node26" class="node">
<title>25</title>
<polygon fill="none" stroke="black" points="835,-540 764,-540 764,-504 835,-504 835,-540"/>
<text text-anchor="middle" x="799.5" y="-518.3" font-family="Times,serif" font-size="14.00">valence</text>
</g>
<!-- 24&#45;&gt;25 -->
<g id="edge23" class="edge">
<title>24&#45;&gt;25</title>
<path fill="none" stroke="black" d="M750.57,-575.7C758.44,-567.22 768.06,-556.86 776.67,-547.58"/>
<polygon fill="black" stroke="black" points="779.38,-549.81 783.62,-540.1 774.25,-545.05 779.38,-549.81"/>
</g>
<!-- 25&#45;&gt;1 -->
<g id="edge24" class="edge">
<title>25&#45;&gt;1</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M763.91,-519.06C670.48,-513.74 410.4,-497.37 183.16,-468.01"/>
<polygon fill="black" stroke="black" points="183.42,-464.52 173.05,-466.69 182.52,-471.46 183.42,-464.52"/>
</g>
<!-- 25&#45;&gt;13 -->
<g id="edge25" class="edge">
<title>25&#45;&gt;13</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M763.8,-518.92C684.47,-513.92 487.48,-499.37 313.84,-468.1"/>
<polygon fill="black" stroke="black" points="314.22,-464.61 303.76,-466.26 312.97,-471.49 314.22,-464.61"/>
</g>
<!-- 25&#45;&gt;14 -->
<g id="edge26" class="edge">
<title>25&#45;&gt;14</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M763.85,-515.88C705.14,-507.31 584.18,-489.1 471.82,-468.2"/>
<polygon fill="black" stroke="black" points="472.15,-464.7 461.67,-466.3 470.86,-471.58 472.15,-464.7"/>
</g>
<!-- 25&#45;&gt;15 -->
<g id="edge27" class="edge">
<title>25&#45;&gt;15</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M763.85,-510.9C726.93,-500.43 668.29,-483.82 622.14,-470.74"/>
<polygon fill="black" stroke="black" points="623.07,-467.36 612.49,-468 621.16,-474.1 623.07,-467.36"/>
</g>
<!-- 25&#45;&gt;16 -->
<g id="edge28" class="edge">
<title>25&#45;&gt;16</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M778.98,-503.7C768.63,-494.97 755.91,-484.24 744.66,-474.75"/>
<polygon fill="black" stroke="black" points="746.68,-471.88 736.78,-468.1 742.17,-477.23 746.68,-471.88"/>
</g>
<!-- 25&#45;&gt;18 -->
<g id="edge29" class="edge">
<title>25&#45;&gt;18</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M835.3,-520.03C936.52,-516.91 1233.48,-505.17 1488.94,-468.11"/>
<polygon fill="black" stroke="black" points="1489.77,-471.53 1499.16,-466.61 1488.76,-464.6 1489.77,-471.53"/>
</g>
<!-- 25&#45;&gt;19 -->
<g id="edge30" class="edge">
<title>25&#45;&gt;19</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M820.26,-503.7C830.74,-494.97 843.61,-484.24 855,-474.75"/>
<polygon fill="black" stroke="black" points="857.53,-477.19 862.97,-468.1 853.05,-471.82 857.53,-477.19"/>
</g>
<!-- 25&#45;&gt;20 -->
<g id="edge31" class="edge">
<title>25&#45;&gt;20</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M835.23,-511.27C873.56,-500.83 935.45,-483.97 984.05,-470.73"/>
<polygon fill="black" stroke="black" points="985.16,-474.06 993.89,-468.05 983.32,-467.31 985.16,-474.06"/>
</g>
<!-- 25&#45;&gt;22 -->
<g id="edge32" class="edge">
<title>25&#45;&gt;22</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M835.39,-516.27C896.52,-508.04 1024.94,-490.02 1143.17,-468.19"/>
<polygon fill="black" stroke="black" points="1143.92,-471.61 1153.11,-466.34 1142.64,-464.73 1143.92,-471.61"/>
</g>
<!-- 25&#45;&gt;23 -->
<g id="edge33" class="edge">
<title>25&#45;&gt;23</title>
<path fill="none" stroke="black" stroke-dasharray="1,5" d="M835.3,-518.06C915.94,-511.25 1118.07,-493.14 1298.03,-468.01"/>
<polygon fill="black" stroke="black" points="1298.52,-471.47 1307.94,-466.61 1297.55,-464.54 1298.52,-471.47"/>
</g>
<!-- 26 -->
<g id="node27" class="node">
<title>26</title>
<polygon fill="none" stroke="black" points="594,-252 457,-252 457,-216 594,-216 594,-252"/>
<text text-anchor="middle" x="525.5" y="-230.3" font-family="Times,serif" font-size="14.00">packet_inspector</text>
</g>
<!-- 26&#45;&gt;9 -->
<g id="edge34" class="edge">
<title>26&#45;&gt;9</title>
<path fill="none" stroke="black" d="M555.83,-215.88C572.2,-206.64 592.58,-195.13 610.15,-185.21"/>
<polygon fill="black" stroke="black" points="612.06,-188.15 619.05,-180.19 608.62,-182.06 612.06,-188.15"/>
</g>
<!-- 27 -->
<g id="node28" class="node">
<title>27</title>
<polygon fill="none" stroke="black" points="914.5,-612 816.5,-612 816.5,-576 914.5,-576 914.5,-612"/>
<text text-anchor="middle" x="865.5" y="-590.3" font-family="Times,serif" font-size="14.00">playground</text>
</g>
<!-- 27&#45;&gt;25 -->
<g id="edge35" class="edge">
<title>27&#45;&gt;25</title>
<path fill="none" stroke="black" d="M849.19,-575.7C841.19,-567.22 831.43,-556.86 822.68,-547.58"/>
<polygon fill="black" stroke="black" points="825.03,-544.98 815.63,-540.1 819.94,-549.78 825.03,-544.98"/>
</g>
<!-- 28 -->
<g id="node29" class="node">
<title>28</title>
<polygon fill="none" stroke="black" points="687,-252 612,-252 612,-216 687,-216 687,-252"/>
<text text-anchor="middle" x="649.5" y="-230.3" font-family="Times,serif" font-size="14.00">stresser</text>
</g>
<!-- 28&#45;&gt;9 -->
<g id="edge36" class="edge">
<title>28&#45;&gt;9</title>
<path fill="none" stroke="black" d="M649.5,-215.7C649.5,-207.98 649.5,-198.71 649.5,-190.11"/>
<polygon fill="black" stroke="black" points="653,-190.1 649.5,-180.1 646,-190.1 653,-190.1"/>
</g>
</g>
</svg>

For reference, here is a diff against the old depgraph.svg:

diff --git a/assets/depgraph.svg b/assets/depgraph.svg
index c538097..8060e3d 100644
--- a/assets/depgraph.svg
+++ b/assets/depgraph.svg
@@ -75,89 +75,89 @@
 <path fill="none" stroke="black" d="M855.46,-287.7C846.44,-279.05 835.38,-268.45 825.56,-259.03"/>
 <polygon fill="black" stroke="black" points="827.98,-256.5 818.34,-252.1 823.13,-261.55 827.98,-256.5"/>
 </g>
-<!-- 7 -->
-<g id="node10" class="node">
-<title>7</title>
+<!-- 9 -->
+<g id="node12" class="node">
+<title>9</title>
 <polygon fill="none" stroke="black" points="717.5,-180 581.5,-180 581.5,-144 717.5,-144 717.5,-180"/>
 <text text-anchor="middle" x="649.5" y="-158.3" font-family="Times,serif" font-size="14.00">valence_protocol</text>
 </g>
-<!-- 11&#45;&gt;7 -->
+<!-- 11&#45;&gt;9 -->
 <g id="edge11" class="edge">
-<title>11&#45;&gt;7</title>
+<title>11&#45;&gt;9</title>
 <path fill="none" stroke="black" d="M763.56,-215.88C743.01,-206.35 717.25,-194.41 695.41,-184.28"/>
 <polygon fill="black" stroke="black" points="696.86,-181.1 686.32,-180.07 693.92,-187.45 696.86,-181.1"/>
 </g>
 <!-- 4 -->
 <g id="node7" class="node">
 <title>4</title>
-<polygon fill="none" stroke="black" points="577.5,-36 463.5,-36 463.5,0 577.5,0 577.5,-36"/>
-<text text-anchor="middle" x="520.5" y="-14.3" font-family="Times,serif" font-size="14.00">valence_math</text>
+<polygon fill="none" stroke="black" points="651.5,-108 501.5,-108 501.5,-72 651.5,-72 651.5,-108"/>
+<text text-anchor="middle" x="576.5" y="-86.3" font-family="Times,serif" font-size="14.00">valence_generated</text>
 </g>
 <!-- 5 -->
 <g id="node8" class="node">
 <title>5</title>
-<polygon fill="none" stroke="black" points="829,-36 728,-36 728,0 829,0 829,-36"/>
-<text text-anchor="middle" x="778.5" y="-14.3" font-family="Times,serif" font-size="14.00">valence_nbt</text>
+<polygon fill="none" stroke="black" points="709.5,-36 595.5,-36 595.5,0 709.5,0 709.5,-36"/>
+<text text-anchor="middle" x="652.5" y="-14.3" font-family="Times,serif" font-size="14.00">valence_ident</text>
+</g>
+<!-- 4&#45;&gt;5 -->
+<g id="edge5" class="edge">
+<title>4&#45;&gt;5</title>
+<path fill="none" stroke="black" d="M595.29,-71.7C604.67,-63.05 616.18,-52.45 626.41,-43.03"/>
+<polygon fill="black" stroke="black" points="628.95,-45.45 633.93,-36.1 624.2,-40.3 628.95,-45.45"/>
 </g>
 <!-- 6 -->
 <g id="node9" class="node">
 <title>6</title>
-<polygon fill="none" stroke="black" points="709.5,-36 595.5,-36 595.5,0 709.5,0 709.5,-36"/>
-<text text-anchor="middle" x="652.5" y="-14.3" font-family="Times,serif" font-size="14.00">valence_ident</text>
+<polygon fill="none" stroke="black" points="577.5,-36 463.5,-36 463.5,0 577.5,0 577.5,-36"/>
+<text text-anchor="middle" x="520.5" y="-14.3" font-family="Times,serif" font-size="14.00">valence_math</text>
+</g>
+<!-- 4&#45;&gt;6 -->
+<g id="edge6" class="edge">
+<title>4&#45;&gt;6</title>
+<path fill="none" stroke="black" d="M562.66,-71.7C556.01,-63.39 547.92,-53.28 540.61,-44.14"/>
+<polygon fill="black" stroke="black" points="543.16,-41.73 534.18,-36.1 537.7,-46.1 543.16,-41.73"/>
+</g>
+<!-- 7 -->
+<g id="node10" class="node">
+<title>7</title>
+<polygon fill="none" stroke="black" points="1084.5,-612 932.5,-612 932.5,-576 1084.5,-576 1084.5,-612"/>
+<text text-anchor="middle" x="1008.5" y="-590.3" font-family="Times,serif" font-size="14.00">valence_build_utils</text>
 </g>
 <!-- 8 -->
 <g id="node11" class="node">
 <title>8</title>
-<polygon fill="none" stroke="black" points="651.5,-108 501.5,-108 501.5,-72 651.5,-72 651.5,-108"/>
-<text text-anchor="middle" x="576.5" y="-86.3" font-family="Times,serif" font-size="14.00">valence_generated</text>
+<polygon fill="none" stroke="black" points="829,-36 728,-36 728,0 829,0 829,-36"/>
+<text text-anchor="middle" x="778.5" y="-14.3" font-family="Times,serif" font-size="14.00">valence_nbt</text>
 </g>
-<!-- 7&#45;&gt;8 -->
-<g id="edge5" class="edge">
-<title>7&#45;&gt;8</title>
+<!-- 9&#45;&gt;4 -->
+<g id="edge7" class="edge">
+<title>9&#45;&gt;4</title>
 <path fill="none" stroke="black" d="M631.46,-143.7C622.44,-135.05 611.38,-124.45 601.56,-115.03"/>
 <polygon fill="black" stroke="black" points="603.98,-112.5 594.34,-108.1 599.13,-117.55 603.98,-112.5"/>
 </g>
 <!-- 10 -->
-<g id="node12" class="node">
+<g id="node13" class="node">
 <title>10</title>
 <polygon fill="none" stroke="black" points="775.5,-108 669.5,-108 669.5,-72 775.5,-72 775.5,-108"/>
 <text text-anchor="middle" x="722.5" y="-86.3" font-family="Times,serif" font-size="14.00">valence_text</text>
 </g>
-<!-- 7&#45;&gt;10 -->
-<g id="edge6" class="edge">
-<title>7&#45;&gt;10</title>
+<!-- 9&#45;&gt;10 -->
+<g id="edge8" class="edge">
+<title>9&#45;&gt;10</title>
 <path fill="none" stroke="black" d="M667.54,-143.7C676.56,-135.05 687.62,-124.45 697.44,-115.03"/>
 <polygon fill="black" stroke="black" points="699.87,-117.55 704.66,-108.1 695.02,-112.5 699.87,-117.55"/>
 </g>
-<!-- 8&#45;&gt;4 -->
-<g id="edge7" class="edge">
-<title>8&#45;&gt;4</title>
-<path fill="none" stroke="black" d="M562.66,-71.7C556.01,-63.39 547.92,-53.28 540.61,-44.14"/>
-<polygon fill="black" stroke="black" points="543.16,-41.73 534.18,-36.1 537.7,-46.1 543.16,-41.73"/>
-</g>
-<!-- 8&#45;&gt;6 -->
-<g id="edge8" class="edge">
-<title>8&#45;&gt;6</title>
-<path fill="none" stroke="black" d="M595.29,-71.7C604.67,-63.05 616.18,-52.45 626.41,-43.03"/>
-<polygon fill="black" stroke="black" points="628.95,-45.45 633.93,-36.1 624.2,-40.3 628.95,-45.45"/>
-</g>
 <!-- 10&#45;&gt;5 -->
 <g id="edge9" class="edge">
 <title>10&#45;&gt;5</title>
-<path fill="none" stroke="black" d="M736.34,-71.7C742.99,-63.39 751.08,-53.28 758.39,-44.14"/>
-<polygon fill="black" stroke="black" points="761.3,-46.1 764.82,-36.1 755.84,-41.73 761.3,-46.1"/>
-</g>
-<!-- 10&#45;&gt;6 -->
-<g id="edge10" class="edge">
-<title>10&#45;&gt;6</title>
 <path fill="none" stroke="black" d="M705.2,-71.7C696.64,-63.14 686.16,-52.66 676.8,-43.3"/>
 <polygon fill="black" stroke="black" points="679.15,-40.7 669.6,-36.1 674.2,-45.65 679.15,-40.7"/>
 </g>
-<!-- 9 -->
-<g id="node13" class="node">
-<title>9</title>
-<polygon fill="none" stroke="black" points="1084.5,-612 932.5,-612 932.5,-576 1084.5,-576 1084.5,-612"/>
-<text text-anchor="middle" x="1008.5" y="-590.3" font-family="Times,serif" font-size="14.00">valence_build_utils</text>
+<!-- 10&#45;&gt;8 -->
+<g id="edge10" class="edge">
+<title>10&#45;&gt;8</title>
+<path fill="none" stroke="black" d="M736.34,-71.7C742.99,-63.39 751.08,-53.28 758.39,-44.14"/>
+<polygon fill="black" stroke="black" points="761.3,-46.1 764.82,-36.1 755.84,-41.73 761.3,-46.1"/>
 </g>
 <!-- 13 -->
 <g id="node14" class="node">
@@ -369,9 +369,9 @@
 <polygon fill="none" stroke="black" points="594,-252 457,-252 457,-216 594,-216 594,-252"/>
 <text text-anchor="middle" x="525.5" y="-230.3" font-family="Times,serif" font-size="14.00">packet_inspector</text>
 </g>
-<!-- 26&#45;&gt;7 -->
+<!-- 26&#45;&gt;9 -->
 <g id="edge34" class="edge">
-<title>26&#45;&gt;7</title>
+<title>26&#45;&gt;9</title>
 <path fill="none" stroke="black" d="M555.83,-215.88C572.2,-206.64 592.58,-195.13 610.15,-185.21"/>
 <polygon fill="black" stroke="black" points="612.06,-188.15 619.05,-180.19 608.62,-182.06 612.06,-188.15"/>
 </g>
@@ -393,9 +393,9 @@
 <polygon fill="none" stroke="black" points="687,-252 612,-252 612,-216 687,-216 687,-252"/>
 <text text-anchor="middle" x="649.5" y="-230.3" font-family="Times,serif" font-size="14.00">stresser</text>
 </g>
-<!-- 28&#45;&gt;7 -->
+<!-- 28&#45;&gt;9 -->
 <g id="edge36" class="edge">
-<title>28&#45;&gt;7</title>
+<title>28&#45;&gt;9</title>
 <path fill="none" stroke="black" d="M649.5,-215.7C649.5,-207.98 649.5,-198.71 649.5,-190.11"/>
 <polygon fill="black" stroke="black" points="653,-190.1 649.5,-180.1 646,-190.1 653,-190.1"/>
 </g>

Copy link
Contributor

@qualterz qualterz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good enough.

@SelfMadeSystem SelfMadeSystem marked this pull request as ready for review December 29, 2023 19:27
Copy link
Contributor

@qualterz qualterz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's no need to implement effects with the same logic multiple times, here's glowing effect already implemented. It just reduces brevity of the code.

Copy link
Collaborator

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a minor thing.

@dyc3 dyc3 enabled auto-merge (squash) December 29, 2023 20:19
@dyc3 dyc3 merged commit 5123826 into valence-rs:main Dec 29, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potion Effects
3 participants