Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ public void readRequirements(CompoundTag nodeRequirementProgresses, boolean inco
ListTag list = (ListTag)nodeRequirementProgresses.get(key);

var node = tree.getNamedNode(id);
if (node == null) {
LOGGER.warn("Missing node {} for tree {} while reading requirement progress", id, tree.getTreeLocation());
return;
}
var progressList = node.getRequirementProgress();
if (!incomplete)
Comment thread
kattosaurus marked this conversation as resolved.
Resolved
progressList.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public boolean requirementMet(AbilityTreeInstance.AccountedTree tree, AbilityNod
PlayerAdvancements playerAdvancements = serverPlayer.getAdvancements();

return matchMode.apply(advancementIds.stream().map(advancementManager::getAdvancement), advancement -> {
return playerAdvancements.getOrStartProgress(advancement).isDone();
return advancement != null && playerAdvancements.getOrStartProgress(advancement).isDone();
});
}

Expand All @@ -74,10 +74,13 @@ public Tag serializeProgress(AbilityTreeInstance.AccountedTree tree, AbilityNode
CompoundTag entryTag = new CompoundTag();

Advancement advancement = advancementManager.getAdvancement(advancementId);

entryTag.putBoolean("state", playerAdvancements.getOrStartProgress(advancement).isDone());
if (advancement.getDisplay() != null)
entryTag.putString("title", Component.Serializer.toJson(advancement.getDisplay().getTitle()));
if (advancement == null) {
entryTag.putBoolean("state", false);
} else {
entryTag.putBoolean("state", playerAdvancements.getOrStartProgress(advancement).isDone());
if (advancement.getDisplay() != null)
entryTag.putString("title", Component.Serializer.toJson(advancement.getDisplay().getTitle()));
}

tag.put(advancementId.toString(), entryTag);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import java.util.Set;

public class AbilityRenderer implements ResourceManagerReloadListener {
public static final ResourceLocation ENCHANT_GLINT_LOCATION = ResourceLocation.parse("textures/misc/enchanted_item_glint.png");
public static final ResourceLocation ENCHANT_GLINT_LOCATION = ResourceLocation.parse("textures/misc/enchanted_glint_item.png");
public static final Set<ResourceLocation> IGNORED = Sets.newHashSet();
public float blitOffset;
private final AbilityModelShaper abilityModelShaper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public NodeButton(AbilityTreeInstance.AccountedTree accountedTree,
protected NodeRenderState determineRenderState() {
if (isUnlocked())
return NodeRenderState.UNLOCKED;
if (parent != null && !parent.isUnlocked() && !parent.canBeSkipped())
if (!accountedTree.isParentNodeUnlocked(AbilityTreeScreen.this.entity, nodeName))
return NodeRenderState.DISTANT;
if (entity.getEntity() instanceof Player player && player.getAbilities().instabuild) {
return NodeRenderState.CAN_ACQUIRE;
Expand Down Expand Up @@ -461,7 +461,8 @@ private Map<Either<AbilityTree, AbilityNode>, TreeButton> buildNodeGraph(Transfu
}
};

var accountedTrees = menu.abilityTree.getTrees(variant);
var accountedTrees = menu.abilityTree.getTrees(variant).stream()
.sorted(Comparator.comparing(t -> t.getTree().getTreeLocation()));
accountedTrees.forEach(accountedTree -> {
if (accountedTree.getTree().isHidden())
return;
Expand Down Expand Up @@ -652,7 +653,7 @@ protected void renderBg(GuiGraphics graphics, float partialTicks, int mx, int my

@Override
public boolean mouseDragged(double x, double y, int button, double dx, double dy) {
if (button == GLFW.GLFW_MOUSE_BUTTON_2) {
if (button == GLFW.GLFW_MOUSE_BUTTON_2 || button == GLFW.GLFW_MOUSE_BUTTON_3) {
panX += dx;
panY += dy;
return true;
Expand Down
Comment thread
kattosaurus marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ private static int addTreeLevels(CommandSourceStack source, ServerPlayer player,
pointStore.addLevels(deltaLevels);

int actualDelta = pointStore.getLevels() - levelsBefore;
if (actualDelta != 0) {
player.connection.send(
Changed.PACKET_HANDLER.toVanillaPacket(AbilityTreeSyncInstancePacket.ofActiveTrees(abilityTree, variant.getParent()), NetworkDirection.PLAY_TO_CLIENT)
);
}

if (actualDelta > 0)
source.sendSuccess(() -> Component.translatable("command.changed.success.abilitytree.addlevels.positive", actualDelta, player.getScoreboardName()), false);
else if (actualDelta < 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ public CompletableFuture<Void> handle(NetworkEvent.Context context, CompletableF
context.setPacketHandled(true);
return levelFuture.thenAccept(level -> {
var localPlayer = UniversalDist.getLocalPlayer();
AbilityTreeInstance.getForPlayer(localPlayer).getTree(tree)
.readPointStore(pointStoreInfo, incomplete);
var accountedTree = AbilityTreeInstance.getForPlayer(localPlayer).getTree(tree);
if (accountedTree != null)
accountedTree.readPointStore(pointStoreInfo, incomplete);
});
}

Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/assets/changed/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,20 @@
"changed.ability_tree.taur_mobility.rear.flavor": "Stand on your hind legs to reach higher, or to intimidate your foes!",
"changed.ability_tree.taur_mobility.run_faster.flavor": "Four powerful legs allow you to run much faster.",

"changed.ability_tree.aquatic.practice1.flavor": "You're getting used to holding your breath and moving through water.",
"changed.ability_tree.aquatic.practice2.flavor": "Your lungs and body have adapted further to the depths.",
"changed.ability_tree.back_wing.gale_force_winds.flavor": "A powerful downforce whips up a gale, knocking back anything in your path.",
"changed.ability_tree.dark_latex.wave_vision": "Wave Vision",
Comment thread
kattosaurus marked this conversation as resolved.
Resolved
"changed.ability_tree.dark_latex.wave_vision.flavor": "Change your perception of the world. Crystalline and familiar materials resonate from your waves.",
"changed.ability_tree.dark_latex_pup.puddle": "Puddle",
"changed.ability_tree.dark_latex_pup.puddle.flavor": "Reduce your form into a puddle that slows trespassers.",
"changed.ability_tree.malleable.switch_gender": "Switch Gender",
"changed.ability_tree.malleable.switch_gender.flavor": "Reshape your malleable body to switch your gender.",
"changed.ability_tree.night_eyes.night_vision": "Night Vision",
"changed.ability_tree.night_eyes.night_vision.flavor": "Your eyes are attuned to sparse lighting conditions.",
"changed.ability_tree.siren.sing": "Sing",
"changed.ability_tree.siren.sing.flavor": "Your beautiful voice disrupts others' attention. Affected entities move randomly.",

"application.changed.file_explorer": "File Explorer",
"application.changed.save_file_dialog": "Save As...",
"application.changed.door_controller": "Door Controller",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "changed:abilities/rear"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"texture_size": [64, 64],
"textures": {
"0": "changed:block/wolf_gas_canister",
"particle": "changed:block/gas_canister"
"particle": "changed:block/empty_canister"
},
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"texture_size": [64, 64],
"textures": {
"0": "changed:block/wolf_gas_canister",
"particle": "changed:block/gas_canister"
"particle": "changed:block/empty_canister"
},
"elements": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"credit": "Made with Blockbench",
"texture_size": [64, 64],
"textures": {
"particle": "changed:block/gas_canister"
"particle": "changed:block/empty_canister"
},
"elements": [
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": { "tree": "changed:aquatic" },
"titleId": "changed.ability_tree.practice1",
"flavorId": "changed.ability_tree.aquatic.practice1",
"flavorId": "changed.ability_tree.aquatic.practice1.flavor",
"display": {
"icon": {
"item": "changed:wetsuit"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parent": "changed:aquatic/practice1",
"titleId": "changed.ability_tree.practice2",
"flavorId": "changed.ability_tree.aquatic.practice2",
"flavorId": "changed.ability_tree.aquatic.practice2.flavor",
"display": {
"icon": {
"item": "changed:wetsuit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"flavorId": "changed.ability_tree.back_wing.autonomous_landing.flavor",
"display": {
"icon": "minecraft:textures/mob_effect/slow_falling.png",
"image_height": 18,
"image_width": 18,
"iconWidth": 18,
"iconHeight": 18,
"frame": "ultimate"
},
"price": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"parent": { "tree": "changed:dark_latex" },
"titleId": "changed.ability_tree.dark_latex.wave_vision",
"flavorId": "changed.ability_tree.dark_latex.wave_vision.flavor",
"display": { "icon": "changed:textures/abilities/use_waves_pulse.png" },
"price": 0,

"acquiredEffects": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"parent": { "tree": "changed:dark_latex_pup" },
"titleId": "changed.ability_tree.dark_latex_pup.puddle",
"flavorId": "changed.ability_tree.dark_latex_pup.puddle.flavor",
"display": { "icon": "changed:textures/abilities/puddle.png" },
"price": 0,

"acquiredEffects": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"flavorId": "changed.ability_tree.hypnosis.hypnosis.flavor",
"display": {
"icon": "changed:textures/gui/nodes/hypnosis.png",
"image_height": 18,
"image_width": 18
"iconHeight": 18,
"iconWidth": 18
},
"price": 0,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"flavorId": "changed.ability_tree.hypnosis.potency1.flavor",
"display": {
"icon": "minecraft:textures/mob_effect/darkness.png",
"image_height": 18,
"image_width": 18,
"iconHeight": 18,
"iconWidth": 18,
"numeral": 1
},
"price": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"parent": { "tree": "changed:malleable" },
"titleId": "changed.ability_tree.malleable.switch_gender",
"flavorId": "changed.ability_tree.malleable.switch_gender.flavor",
"display": { "icon": "changed:textures/abilities/switch_gender.png" },
"price": 0,

"acquiredEffects": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"parent": "changed:mer_mobility/practice3",
"titleId": "changed.ability_tree.movement.tail_whip",
"titleId": "changed.ability_tree.mer_mobility.tail_whip",
"flavorId": "changed.ability_tree.mer_mobility.tail_whip.flavor",
"display": { "icon": "changed:textures/gui/nodes/tail_whip.png", "frame:": "strong" },
"display": { "icon": "changed:textures/gui/nodes/tail_whip.png", "frame": "strong" },
"price": {
"levels": 2,
"groupDiscountLevels": -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"parent": { "tree": "changed:night_eyes" },
"titleId": "changed.ability_tree.night_eyes.night_vision",
"flavorId": "changed.ability_tree.night_eyes.night_vision.flavor",
"display": { "icon": "changed:textures/abilities/toggle_night_vision.png" },
"price": 0,

"acquiredEffects": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"parent": { "tree": "changed:siren" },
"titleId": "changed.ability_tree.siren.sing",
"flavorId": "changed.ability_tree.siren.sing.flavor",
"display": { "icon": "changed:textures/abilities/siren_sing.png" },
"price": 0,

"acquiredEffects": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"parent": "changed:taur_mobility/practice1",
"titleId": "changed.ability_tree.taur_mobility.rear",
"flavorId": "changed.ability_tree.taur_mobility.rear.flavor",
"display": { "icon": "changed:textures/abilities/rear.png" },
"price": {
"levels": 1,
"groupDiscountLevels": -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
],
"titleId": "changed.ability_tree.quadrupedal_mobility",
"flavorId": "changed.ability_tree.quadrupedal_mobility.flavor",
"flavorCompletedId": "changed.ability_tree.quadrupedal.mastered"
}
"flavorCompletedId": "changed.ability_tree.quadrupedal_mobility.mastered"
}