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

The Big Fat Advancements PR #1977

Draft
wants to merge 5 commits into
base: 1.20.1
Choose a base branch
from
Draft
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
18 changes: 18 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -2594,6 +2594,24 @@
"fluid.tile.lava": "ɐʌɐꞀ",
"fluid.tile.water": "ɹǝʇɐM",
"fluid_cell.empty": "ʎʇdɯƎ",
"gtceu.advancement.high_voltage.89_fluid_pipe_death_cold.desc": "˙pınןℲ pןoƆ ɟo ןןnɟ ǝdıԀ pınןℲ ɐ oʇ ǝıᗡ",
"gtceu.advancement.high_voltage.89_fluid_pipe_death_cold.title": "¡pןoƆ buızǝǝɹℲ",
"gtceu.advancement.low_voltage.electrocution_death.desc": "˙ǝɹıM pǝʇɐןnsuıu∩ uɐ oʇ ǝıᗡ",
"gtceu.advancement.low_voltage.electrocution_death.title": "¡sǝɹıM ɹnoʎ pǝɹǝʌoƆ ɐpןnoɥS",
"gtceu.advancement.low_voltage.first_cover_place.desc": "˙ɹǝʌoƆ ǝuıɥɔɐW ʇsɹıɟ ɹnoʎ ǝɔɐןԀ",
"gtceu.advancement.low_voltage.first_cover_place.title": "ʎuɐW ɟo ʇsɹıℲ ǝɥ⟘",
"gtceu.advancement.root_lv.desc": "ǝuıqɹn⟘ ɯɐǝʇS ɔısɐᗺ ɐ ʇɟɐɹƆ",
"gtceu.advancement.root_lv.title": "ǝbɐʇןoΛ ʍoꞀ",
"gtceu.advancement.root_misc.desc": "sʇuǝɯǝʌǝıɥɔɐ snoǝuɐןןǝɔsıW",
"gtceu.advancement.root_misc.title": "ɔsıW",
"gtceu.advancement.root_steam.desc": "˙sʇobuı ɹǝddoɔ ʇsɹıɟ ɹnoʎ ɥʇıʍ suıbǝq buıɥʇʎɹǝʌƎ ¡ɥɔǝ⟘bǝɹ⅁ oʇ ǝɯoɔןǝM",
"gtceu.advancement.root_steam.title": "ǝbⱯ ɯɐǝʇS",
"gtceu.advancement.steam.fluid_pipe_death_heat.desc": "˙pınןℲ ʇoH ɟo ןןnɟ ǝdıԀ pınןℲ ɐ oʇ ǝıᗡ",
"gtceu.advancement.steam.fluid_pipe_death_heat.title": "¡ʇoH buıןıoᗺ",
"gtceu.advancement.steam.steam_vent_death.desc": "˙ǝuıɥɔɐW ɯɐǝʇS buıʇuǝʌ ɐ oʇ ǝıᗡ",
"gtceu.advancement.steam.steam_vent_death.title": "¡ʎɐʍ ǝɥʇ ɟo ʇno ʇǝ⅁",
"gtceu.advancement.ultimate_voltage.77_ultimate_battery.desc": "˙ʎɹǝʇʇɐᗺ ǝʇɐɯıʇן∩ uɐ ʇɟɐɹƆ",
"gtceu.advancement.ultimate_voltage.77_ultimate_battery.title": "¿ʍoN ʇɐɥM",
"gtceu.air_scrubber": "ɹǝqqnɹɔS ɹıⱯ",
"gtceu.alloy_blast_smelter": "ɹǝʇןǝɯS ʇsɐןᗺ ʎoןןⱯ",
"gtceu.alloy_smelter": "ɹǝʇןǝɯS ʎoןןⱯ",
Expand Down
18 changes: 18 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2594,6 +2594,24 @@
"fluid.tile.lava": "Lava",
"fluid.tile.water": "Water",
"fluid_cell.empty": "Empty",
"gtceu.advancement.high_voltage.89_fluid_pipe_death_cold.desc": "Die to a Fluid Pipe full of Cold Fluid.",
"gtceu.advancement.high_voltage.89_fluid_pipe_death_cold.title": "Freezing Cold!",
"gtceu.advancement.low_voltage.electrocution_death.desc": "Die to an Uninsulated Wire.",
"gtceu.advancement.low_voltage.electrocution_death.title": "Shoulda Covered your Wires!",
"gtceu.advancement.low_voltage.first_cover_place.desc": "Place your first Machine Cover.",
"gtceu.advancement.low_voltage.first_cover_place.title": "The First of Many",
"gtceu.advancement.root_lv.desc": "Craft a Basic Steam Turbine",
"gtceu.advancement.root_lv.title": "Low Voltage",
"gtceu.advancement.root_misc.desc": "Miscellaneous achievements",
"gtceu.advancement.root_misc.title": "Misc",
"gtceu.advancement.root_steam.desc": "Welcome to GregTech! Everything begins with your first copper ingots.",
"gtceu.advancement.root_steam.title": "Steam Age",
"gtceu.advancement.steam.fluid_pipe_death_heat.desc": "Die to a Fluid Pipe full of Hot Fluid.",
"gtceu.advancement.steam.fluid_pipe_death_heat.title": "Boiling Hot!",
"gtceu.advancement.steam.steam_vent_death.desc": "Die to a venting Steam Machine.",
"gtceu.advancement.steam.steam_vent_death.title": "Get out of the way!",
"gtceu.advancement.ultimate_voltage.77_ultimate_battery.desc": "Craft an Ultimate Battery.",
"gtceu.advancement.ultimate_voltage.77_ultimate_battery.title": "What Now?",
"gtceu.air_scrubber": "Air Scrubber",
"gtceu.alloy_blast_smelter": "Alloy Blast Smelter",
"gtceu.alloy_smelter": "Alloy Smelter",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"criteria": {
"gt_placeholder_criteria": {
"trigger": "minecraft:impossible"
}
},
"display": {
"announce_to_chat": true,
"background": "gtceu:textures/gui/advancements/background.png",
"description": {
"translate": "gtceu.advancement.low_voltage.electrocution_death.desc"
},
"frame": "task",
"hidden": false,
"icon": {
"item": "gtceu:terminal"
},
"show_toast": true,
"title": {
"translate": "gtceu.advancement.low_voltage.electrocution_death.title"
}
},
"requirements": [
[
"gt_placeholder_criteria"
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"criteria": {
"gt_placeholder_criteria": {
"trigger": "minecraft:impossible"
}
},
"display": {
"announce_to_chat": true,
"background": "gtceu:textures/gui/advancements/background.png",
"description": {
"translate": "gtceu.advancement.low_voltage.first_cover_place.desc"
},
"frame": "task",
"hidden": false,
"icon": {
"item": "gtceu:item_filter"
},
"show_toast": true,
"title": {
"translate": "gtceu.advancement.low_voltage.first_cover_place.title"
}
},
"requirements": [
[
"gt_placeholder_criteria"
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"criteria": {
"gt_placeholder_criteria": {
"trigger": "minecraft:impossible"
}
},
"display": {
"announce_to_chat": true,
"background": "gtceu:textures/gui/advancements/background.png",
"description": {
"translate": "gtceu.advancement.root_lv.desc"
},
"frame": "task",
"hidden": false,
"icon": {
"item": "gtceu:lv_machine_casing"
},
"show_toast": true,
"title": {
"translate": "gtceu.advancement.root_lv.title"
}
},
"requirements": [
[
"gt_placeholder_criteria"
]
],
"sends_telemetry_event": true
}
21 changes: 21 additions & 0 deletions src/generated/resources/data/gtceu/advancements/misc/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"criteria": {},
"display": {
"announce_to_chat": true,
"background": "gtceu:textures/gui/advancements/background.png",
"description": {
"translate": "gtceu.advancement.root_steam.desc"
},
"frame": "task",
"hidden": false,
"icon": {
"item": "gtceu:lp_steam_solid_boiler"
},
"show_toast": true,
"title": {
"translate": "gtceu.advancement.root_steam.title"
}
},
"requirements": [],
"sends_telemetry_event": true
}
29 changes: 29 additions & 0 deletions src/generated/resources/data/gtceu/advancements/steam/root.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"criteria": {
"gt_placeholder_criteria": {
"trigger": "minecraft:impossible"
}
},
"display": {
"announce_to_chat": true,
"background": "gtceu:textures/gui/advancements/background.png",
"description": {
"translate": "gtceu.advancement.root_steam.desc"
},
"frame": "task",
"hidden": false,
"icon": {
"item": "gtceu:bronze_machine_casing"
},
"show_toast": true,
"title": {
"translate": "gtceu.advancement.root_steam.title"
}
},
"requirements": [
[
"gt_placeholder_criteria"
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"criteria": {
"gt_placeholder_criteria": {
"trigger": "minecraft:impossible"
}
},
"display": {
"announce_to_chat": true,
"background": "gtceu:textures/gui/advancements/background.png",
"description": {
"translate": "gtceu.advancement.steam.85_steam_vent_death.desc"
},
"frame": "task",
"hidden": false,
"icon": {
"item": "gtceu:item_detector_cover"
},
"show_toast": true,
"title": {
"translate": "gtceu.advancement.steam.85_steam_vent_death.title"
}
},
"requirements": [
[
"gt_placeholder_criteria"
]
],
"sends_telemetry_event": true
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.gregtechceu.gtceu.api.capability;

import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.api.block.IAppearance;
import com.gregtechceu.gtceu.api.blockentity.ITickSubscription;
import com.gregtechceu.gtceu.api.cover.CoverBehavior;
import com.gregtechceu.gtceu.api.cover.CoverDefinition;
import com.gregtechceu.gtceu.utils.AdvancementUtil;
import com.gregtechceu.gtceu.utils.GTUtil;

import com.lowdragmc.lowdraglib.LDLib;
import com.lowdragmc.lowdraglib.side.fluid.IFluidTransfer;
import com.lowdragmc.lowdraglib.side.item.IItemTransfer;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerPlayer;
Expand All @@ -24,7 +24,6 @@
import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;

import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
Expand Down Expand Up @@ -92,8 +91,7 @@ default boolean placeCoverOnSide(Direction side, ItemStack itemStack, CoverDefin
notifyBlockUpdate();
markDirty();
scheduleNeighborShapeUpdate();
// TODO achievement
// AdvancementTriggers.FIRST_COVER_PLACE.trigger((PlayerMP) player);
AdvancementUtil.awardAdvancement(player, GTCEu.id("low_voltage/first_cover_place"), "gt_placeholder_criteria");
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import com.gregtechceu.gtceu.GTCEu;
import com.gregtechceu.gtceu.common.data.GTDamageTypes;
import com.gregtechceu.gtceu.config.ConfigHolder;

import com.gregtechceu.gtceu.data.advancements.SteamAdvancements;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.entity.LivingEntity;
Expand All @@ -16,7 +17,6 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.shapes.Shapes;

import org.jetbrains.annotations.NotNull;

/**
Expand Down Expand Up @@ -108,10 +108,9 @@ default void doVentingDamage(@NotNull Level level, @NotNull BlockPos pos) {
new AABB(pos.relative(getVentingDirection())),
entity -> !(entity instanceof Player player) || !player.isSpectator() && !player.isCreative())) {
entity.hurt(GTDamageTypes.HEAT.source(level), getVentingDamage());
// TODO ADVANCEMENT
// if (entity instanceof ServerPlayer) {
// AdvancementTriggers.STEAM_VENT_DEATH.trigger((ServerPlayer) entity);
// }
if (this instanceof ServerPlayer player) {
player.getAdvancements().award(SteamAdvancements.STEAM_VENT_DEATH, "gt_placeholder_criteria");
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.gregtechceu.gtceu.common.data.GTDamageTypes;
import com.gregtechceu.gtceu.common.pipelike.cable.Insulation;
import com.gregtechceu.gtceu.common.pipelike.cable.LevelEnergyNet;
import com.gregtechceu.gtceu.data.advancements.LVAdvancements;
import com.gregtechceu.gtceu.utils.GTUtil;

import net.minecraft.MethodsReturnNonnullByDefault;
Expand Down Expand Up @@ -135,9 +136,8 @@ public void entityInside(BlockState state, Level level, BlockPos pos, Entity ent
if (voltage > 0L && amperage > 0L) {
float damageAmount = (float) ((GTUtil.getTierByVoltage(voltage) + 1) * amperage * 4);
entityLiving.hurt(GTDamageTypes.ELECTRIC.source(level), damageAmount);
if (entityLiving instanceof ServerPlayer) {
// TODO advancments
// AdvancementTriggers.ELECTROCUTION_DEATH.trigger((EntityPlayerMP) entityLiving);
if (entityLiving instanceof ServerPlayer player) {
player.getAdvancements().award(LVAdvancements.ELECTROCUTION_DEATH, "gt_placeholder_criteria");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.gregtechceu.gtceu.data;

import com.gregtechceu.gtceu.common.registry.GTRegistration;
import com.gregtechceu.gtceu.data.advancements.AdvancementsHandler;
import com.gregtechceu.gtceu.data.lang.LangHandler;
import com.gregtechceu.gtceu.data.tags.TagsHandler;

Expand All @@ -19,5 +20,6 @@ public static void init() {
GTRegistration.REGISTRATE.addDataGenerator(ProviderType.FLUID_TAGS, TagsHandler::initFluid);
GTRegistration.REGISTRATE.addDataGenerator(ProviderType.ENTITY_TAGS, TagsHandler::initEntity);
GTRegistration.REGISTRATE.addDataGenerator(ProviderType.LANG, LangHandler::init);
GTRegistration.REGISTRATE.addDataGenerator(ProviderType.ADVANCEMENT, AdvancementsHandler::init);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.gregtechceu.gtceu.data.advancements;

import com.tterrag.registrate.providers.RegistrateAdvancementProvider;

public class AdvancementsHandler {

public static void init(RegistrateAdvancementProvider provider) {
RootAdvancements.init(provider);
SteamAdvancements.init(provider);
LVAdvancements.init(provider);
MiscAdvancements.init(provider);

}
}
Loading
Loading