diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index 2600b35fe..be4299224 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -1,5 +1,8 @@ package com.simibubi.create; +import com.simibubi.create.foundation.advancement.AllCriterionTriggers; +import com.simibubi.create.foundation.advancement.SandpaperUseTrigger; +import net.minecraft.advancements.CriteriaTriggers; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -69,6 +72,7 @@ public class Create { CraftingHelper.register(new ModuleLoadedCondition.Serializer()); AllPackets.registerPackets(); + AllCriterionTriggers.register(); } public static void serverStarting(FMLServerStartingEvent event) { diff --git a/src/main/java/com/simibubi/create/foundation/advancement/AllCriterionTriggers.java b/src/main/java/com/simibubi/create/foundation/advancement/AllCriterionTriggers.java new file mode 100644 index 000000000..59d65fcf3 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/advancement/AllCriterionTriggers.java @@ -0,0 +1,27 @@ +package com.simibubi.create.foundation.advancement; + +import net.minecraft.advancements.CriteriaTriggers; + +import java.util.LinkedList; +import java.util.List; + +public class AllCriterionTriggers { + + private static List> triggers = new LinkedList<>(); + + public static SandpaperUseTrigger SANDPAPER_USE = add(new SandpaperUseTrigger("sandpaper_use")); + public static NoArgumentTrigger DEPLOYER_BOOP = add(new NoArgumentTrigger("deployer")); + public static NoArgumentTrigger ABSORBED_LIGHT = add(new NoArgumentTrigger("light_absorbed")); + public static NoArgumentTrigger SPEED_READ = add(new NoArgumentTrigger("speed_read")); + + private static > T add(T instance) { + triggers.add(instance); + return instance; + } + + public static void register(){ + triggers.forEach(CriteriaTriggers::register); + } + + +} diff --git a/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java b/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java new file mode 100644 index 000000000..9b8bf41d6 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/advancement/CriterionTriggerBase.java @@ -0,0 +1,79 @@ +package com.simibubi.create.foundation.advancement; + +import com.google.common.collect.Maps; +import com.simibubi.create.Create; +import net.minecraft.advancements.ICriterionTrigger; +import net.minecraft.advancements.PlayerAdvancements; +import net.minecraft.advancements.criterion.CriterionInstance; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.util.ResourceLocation; + +import java.util.*; +import java.util.function.Supplier; + +public abstract class CriterionTriggerBase implements ICriterionTrigger { + + public CriterionTriggerBase(String id) { + this.ID = new ResourceLocation(Create.ID, id); + } + + private ResourceLocation ID; + protected final Map>> listeners = Maps.newHashMap(); + + @Override + public void addListener(PlayerAdvancements playerAdvancementsIn, Listener listener) { + Set> playerListeners = this.listeners.computeIfAbsent(playerAdvancementsIn, k -> new HashSet<>()); + + playerListeners.add(listener); + } + + @Override + public void removeListener(PlayerAdvancements playerAdvancementsIn, Listener listener) { + Set> playerListeners = this.listeners.get(playerAdvancementsIn); + if (playerListeners != null){ + playerListeners.remove(listener); + if (playerListeners.isEmpty()){ + this.listeners.remove(playerAdvancementsIn); + } + } + } + + @Override + public void removeAllListeners(PlayerAdvancements playerAdvancementsIn) { + this.listeners.remove(playerAdvancementsIn); + } + + @Override + public ResourceLocation getId() { + return ID; + } + + protected void trigger(ServerPlayerEntity player, List> suppliers){ + PlayerAdvancements playerAdvancements = player.getAdvancements(); + Set> playerListeners = this.listeners.get(playerAdvancements); + if (playerListeners != null){ + List> list = new LinkedList<>(); + + for (Listener listener : + playerListeners) { + if (listener.getCriterionInstance().test(suppliers)) { + list.add(listener); + } + } + + list.forEach(listener -> listener.grantCriterion(playerAdvancements)); + + } + } + + protected abstract static class Instance extends CriterionInstance { + + public Instance(ResourceLocation idIn) { + super(idIn); + } + + protected abstract boolean test(List> suppliers); + } + + +} diff --git a/src/main/java/com/simibubi/create/foundation/advancement/NoArgumentTrigger.java b/src/main/java/com/simibubi/create/foundation/advancement/NoArgumentTrigger.java new file mode 100644 index 000000000..98819e158 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/advancement/NoArgumentTrigger.java @@ -0,0 +1,37 @@ +package com.simibubi.create.foundation.advancement; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonObject; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.util.ResourceLocation; + +import java.util.List; +import java.util.function.Supplier; + +public class NoArgumentTrigger extends CriterionTriggerBase { + + public NoArgumentTrigger(String id) { + super(id); + } + + @Override + public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) { + return new Instance(getId()); + } + + public void trigger(ServerPlayerEntity player){ + super.trigger(player, null); + } + + public static class Instance extends CriterionTriggerBase.Instance { + + public Instance(ResourceLocation idIn) { + super(idIn); + } + + @Override + protected boolean test(List> suppliers) { + return true; + } + } +} diff --git a/src/main/java/com/simibubi/create/foundation/advancement/SandpaperUseTrigger.java b/src/main/java/com/simibubi/create/foundation/advancement/SandpaperUseTrigger.java new file mode 100644 index 000000000..9be31fd55 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/advancement/SandpaperUseTrigger.java @@ -0,0 +1,66 @@ +package com.simibubi.create.foundation.advancement; + +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonObject; +import net.minecraft.advancements.PlayerAdvancements; +import net.minecraft.advancements.criterion.CriterionInstance; +import net.minecraft.advancements.criterion.ItemPredicate; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.function.Supplier; + +public class SandpaperUseTrigger extends CriterionTriggerBase { + + public SandpaperUseTrigger(String id) { + super(id); + } + + @Override + public Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) { + return new SandpaperUseTrigger.Instance(getId(), ItemPredicate.deserialize(json.get("target")),ItemPredicate.deserialize(json.get("result"))); + } + + public void trigger(ServerPlayerEntity player, ItemStack target, ItemStack result){ + trigger(player, Arrays.asList(() -> target, () -> result)); + + /*PlayerAdvancements playerAdvancements = player.getAdvancements(); + Set> playerListeners = this.listeners.get(playerAdvancements); + if (playerListeners != null){ + List> list = new LinkedList<>(); + + for (Listener listener : + playerListeners) { + if (listener.getCriterionInstance().test(target, result)) { + list.add(listener); + } + } + + list.forEach(listener -> listener.grantCriterion(playerAdvancements)); + + }*/ + } + + public static class Instance extends CriterionTriggerBase.Instance { + private final ItemPredicate target; + private final ItemPredicate result; + + public Instance(ResourceLocation idIn, ItemPredicate target, ItemPredicate result) { + super(idIn); + this.target = target; + this.result = result; + + } + + @Override + protected boolean test(List> suppliers) { + return this.target.test((ItemStack) suppliers.get(0).get()) && + this.result.test((ItemStack) suppliers.get(1).get()); + } + } +} diff --git a/src/main/java/com/simibubi/create/foundation/command/ToggleDebugCommand.java b/src/main/java/com/simibubi/create/foundation/command/ToggleDebugCommand.java index d8cdfa182..eb30e2494 100644 --- a/src/main/java/com/simibubi/create/foundation/command/ToggleDebugCommand.java +++ b/src/main/java/com/simibubi/create/foundation/command/ToggleDebugCommand.java @@ -4,7 +4,6 @@ import com.mojang.brigadier.arguments.BoolArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import com.simibubi.create.AllPackets; import com.simibubi.create.config.AllConfigs; - import net.minecraft.command.CommandSource; import net.minecraft.command.Commands; import net.minecraft.entity.player.ServerPlayerEntity; @@ -16,23 +15,23 @@ import net.minecraftforge.fml.network.PacketDistributor; public class ToggleDebugCommand { static ArgumentBuilder register() { - return Commands.literal("toggleDebug").requires(cs -> cs.hasPermissionLevel(0)) - .then(Commands.argument("value", BoolArgumentType.bool()).executes(ctx -> { - boolean value = BoolArgumentType.getBool(ctx, "value"); - System.out.println("Command toggleDebug " + value); + return Commands.literal("toggleDebug") + .requires(cs -> cs.hasPermissionLevel(0)) + .then(Commands.argument("value", BoolArgumentType.bool()) + .executes(ctx -> { + boolean value = BoolArgumentType.getBool(ctx, "value"); + System.out.println("Command toggleDebug " + value); - DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> AllConfigs.CLIENT.rainbowDebug.set(value)); + DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> AllConfigs.CLIENT.rainbowDebug.set(value)); - DistExecutor.runWhenOn(Dist.DEDICATED_SERVER, - () -> () -> AllPackets.channel.send( - PacketDistributor.PLAYER - .with(() -> (ServerPlayerEntity) ctx.getSource().getEntity()), - new ConfigureConfigPacket("rainbowDebug", String.valueOf(value)))); + DistExecutor.runWhenOn(Dist.DEDICATED_SERVER, () -> () -> + AllPackets.channel.send( + PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) ctx.getSource().getEntity()), + new ConfigureConfigPacket("rainbowDebug", String.valueOf(value)))); - ctx.getSource().sendFeedback( - new StringTextComponent((value ? "enabled" : "disabled") + " rainbow debug"), true); + ctx.getSource().sendFeedback(new StringTextComponent((value ? "enabled" : "disabled") + " rainbow debug"), true); - return 1; - })); + return 1; + })); } } diff --git a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerTileEntity.java index 0a0aa5021..1c2f3b85b 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/components/deployer/DeployerTileEntity.java @@ -9,6 +9,9 @@ import java.util.Iterator; import java.util.List; import java.util.stream.Collectors; +import com.simibubi.create.foundation.advancement.AllCriterionTriggers; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.tileentity.TileEntity; import org.apache.commons.lang3.tuple.Pair; import com.google.common.collect.Multimap; @@ -81,6 +84,7 @@ public class DeployerTileEntity extends KineticTileEntity { protected DeployerFakePlayer player; protected int timer; protected float reach; + protected boolean boop = false; protected List overflowItems = new ArrayList<>(); protected Pair blockBreakingProgress; @@ -203,6 +207,28 @@ public class DeployerTileEntity extends KineticTileEntity { } } + //Check for advancement conditions + if (mode == Mode.PUNCH && !boop) { + if (world.isAirBlock(pos.offset(facing,1)) && world.isAirBlock(pos.offset(facing,2))) { + BlockPos otherDeployer = pos.offset(facing, 4); + if (world.isBlockPresent(otherDeployer)){ + TileEntity otherTile = world.getTileEntity(otherDeployer); + if (otherTile instanceof DeployerTileEntity){ + DeployerTileEntity deployerTile = (DeployerTileEntity) otherTile; + if (world.getBlockState(otherDeployer).get(FACING).getOpposite() == facing && deployerTile.mode == Mode.PUNCH) { + //two facing deployer + boop = true; + reach = 1f; + timer = 1000; + state = State.EXPANDING; + sendData(); + return; + } + } + } + } + } + state = State.EXPANDING; Vec3d movementVector = getMovementVector(); Vec3d rayOrigin = VecHelper.getCenterOf(pos).add(movementVector.scale(3 / 2f)); @@ -218,6 +244,31 @@ public class DeployerTileEntity extends KineticTileEntity { } if (state == State.EXPANDING) { + if (boop){ + TileEntity otherTile = world.getTileEntity(pos.offset(getBlockState().get(FACING),4)); + if (otherTile instanceof DeployerTileEntity){ + DeployerTileEntity deployerTile = (DeployerTileEntity) otherTile; + if (deployerTile.boop && deployerTile.state == State.EXPANDING){ + if(deployerTile.timer <= 0){ + //everything should be met + boop = false; + state = State.RETRACTING; + timer = 1000; + deployerTile.boop = false; + deployerTile.state = State.RETRACTING; + deployerTile.timer = 1000; + + deployerTile.sendData(); + sendData(); + + //award nearby players + List players = world.getEntitiesWithinAABB(ServerPlayerEntity.class, new AxisAlignedBB(pos).grow(9)); + players.forEach(AllCriterionTriggers.DEPLOYER_BOOP::trigger); + } + } + } + return; + } Multimap attributeModifiers = stack .getAttributeModifiers(EquipmentSlotType.MAINHAND); player.getAttributes().applyAttributeModifiers(attributeModifiers); diff --git a/src/main/java/com/simibubi/create/modules/contraptions/relays/gauge/SpeedGaugeTileEntity.java b/src/main/java/com/simibubi/create/modules/contraptions/relays/gauge/SpeedGaugeTileEntity.java index 70876994a..e0b63e949 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/relays/gauge/SpeedGaugeTileEntity.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/relays/gauge/SpeedGaugeTileEntity.java @@ -2,11 +2,18 @@ package com.simibubi.create.modules.contraptions.relays.gauge; import com.simibubi.create.AllTileEntities; import com.simibubi.create.config.AllConfigs; +import com.simibubi.create.foundation.advancement.AllCriterionTriggers; import com.simibubi.create.foundation.utility.ColorHelper; +import com.simibubi.create.modules.contraptions.GogglesItem; import com.simibubi.create.modules.contraptions.base.IRotate.SpeedLevel; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.MathHelper; +import java.util.List; + public class SpeedGaugeTileEntity extends GaugeTileEntity { public SpeedGaugeTileEntity() { @@ -22,6 +29,12 @@ public class SpeedGaugeTileEntity extends GaugeTileEntity { float max = AllConfigs.SERVER.kinetics.maxRotationSpeed.get().floatValue(); color = ColorHelper.mixColors(SpeedLevel.of(speed).getColor(), 0xffffff, .25f); + if (speed == 666){ + assert world != null; + List players = world.getEntitiesWithinAABB(ServerPlayerEntity.class, new AxisAlignedBB(pos).grow(6)); + players.stream().filter(GogglesItem::canSeeParticles).forEach(AllCriterionTriggers.SPEED_READ::trigger); + } + if (speed == 0) { dialTarget = 0; color = 0x333333; diff --git a/src/main/java/com/simibubi/create/modules/curiosities/ChromaticCompoundCubeItem.java b/src/main/java/com/simibubi/create/modules/curiosities/ChromaticCompoundCubeItem.java index 3d668afce..88dd21499 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/ChromaticCompoundCubeItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/ChromaticCompoundCubeItem.java @@ -1,10 +1,12 @@ package com.simibubi.create.modules.curiosities; +import java.util.List; import java.util.Random; import com.simibubi.create.AllItems; import com.simibubi.create.config.AllConfigs; import com.simibubi.create.config.CCuriosities; +import com.simibubi.create.foundation.advancement.AllCriterionTriggers; import com.simibubi.create.foundation.item.IItemWithColorHandler; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.ColorHelper; @@ -15,6 +17,7 @@ import net.minecraft.block.Blocks; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.color.IItemColor; import net.minecraft.entity.item.ItemEntity; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; @@ -22,13 +25,10 @@ import net.minecraft.particles.ParticleTypes; import net.minecraft.tileentity.BeaconTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Direction; -import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.*; import net.minecraft.util.math.BlockPos.MutableBlockPos; -import net.minecraft.util.math.MathHelper; -import net.minecraft.util.math.RayTraceContext; import net.minecraft.util.math.RayTraceContext.BlockMode; import net.minecraft.util.math.RayTraceContext.FluidMode; -import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -157,6 +157,10 @@ public class ChromaticCompoundCubeItem extends Item implements IItemWithColorHan newStack.setCount(stack.getCount()); data.putBoolean("FromLight", true); entity.setItem(newStack); + + List players = world.getEntitiesWithinAABB(ServerPlayerEntity.class, new AxisAlignedBB(entity.getPosition()).grow(8)); + players.forEach(AllCriterionTriggers.ABSORBED_LIGHT::trigger); + return false; } diff --git a/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java b/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java index de251d29a..b8d58688c 100644 --- a/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java +++ b/src/main/java/com/simibubi/create/modules/curiosities/tools/SandPaperItem.java @@ -1,5 +1,7 @@ package com.simibubi.create.modules.curiosities.tools; +import com.simibubi.create.foundation.advancement.AllCriterionTriggers; +import com.simibubi.create.foundation.advancement.SandpaperUseTrigger; import com.simibubi.create.foundation.block.render.CustomRenderedItemModel; import com.simibubi.create.foundation.item.IHaveCustomItemModel; import com.simibubi.create.foundation.utility.VecHelper; @@ -12,6 +14,7 @@ import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; @@ -132,8 +135,11 @@ public class SandPaperItem extends Item implements IHaveCustomItemModel { if (!polished.isEmpty()) { if (player instanceof DeployerFakePlayer) { player.dropItem(polished, false, false); - } else + } else { + AllCriterionTriggers.SANDPAPER_USE.trigger((ServerPlayerEntity) player, toPolish, polished); + player.inventory.placeItemBackInInventory(worldIn, polished); + } } tag.remove("Polishing"); stack.damageItem(1, entityLiving, p -> p.sendBreakAnimation(p.getActiveHand())); diff --git a/src/main/resources/assets/create/lang/en_us.json b/src/main/resources/assets/create/lang/en_us.json index ea0a76265..6e805d112 100644 --- a/src/main/resources/assets/create/lang/en_us.json +++ b/src/main/resources/assets/create/lang/en_us.json @@ -570,9 +570,43 @@ "create.command.killTPSCommand.argument.tickTime": "tickTime", "advancement.create:root": "Create Advancements", - "advancement.create:root.desc": "~ todo", - "advancement.create:test": "test advancement", - "advancement.create:test.desc": "test advancement description", + "advancement.create:root.desc": "~ Root Description", + "advancement.create:andesite_alloy": "Andesite Alloy", + "advancement.create:andesite_alloy.desc": "A basic building block of Create", + "advancement.create:andesite_casing": "Andesite Casing", + "advancement.create:andesite_casing.desc": "Use some Andesite, Metal and Wood to create a basic Casing", + "advancement.create:crushing_wheel": "I've got a crush on you", + "advancement.create:crushing_wheel.desc": "Create a pair of Crushing Wheels", + "advancement.create:gear": "Know what really grinds my Gears?", + "advancement.create:gear.desc": "~ Oh you don't care? Fine then..", + "advancement.create:sand_paper": "Sand Paper", + "advancement.create:sand_paper.desc": "~ Description", + "advancement.create:polished_rose_quartz": "Polished Rose Quartz", + "advancement.create:polished_rose_quartz.desc": "~ Description", + "advancement.create:sand_paper_secret": "Sandier Paper?", + "advancement.create:sand_paper_secret.desc": "Use your Sand Paper to sand some Sand Paper", + "advancement.create:press": "Squeezing real hard", + "advancement.create:press.desc": "Make a Mechanical Press and use it to create some Plates", + "advancement.create:mixer": "Don't get this mixed up!", + "advancement.create:mixer.desc": "Make a Mechanical Mixer", + "advancement.create:brass": "Brass", + "advancement.create:brass.desc": "~ Description", + "advancement.create:brass_casing": "Brass Casing", + "advancement.create:brass_casing.desc": "~ Description", + "advancement.create:deployer": "Deployer", + "advancement.create:deployer.desc": "~ Description", + "advancement.create:deployer_secret": "Pound it, brother", + "advancement.create:deployer_secret.desc": "~ Description", + "advancement.create:chromatic_compound": "Chromatic Compound", + "advancement.create:chromatic_compound.desc": "~ Description", + "advancement.create:shadow_steel": "Not quite as Shiny", + "advancement.create:shadow_steel.desc": "~ Description", + "advancement.create:refined_radiance": "SHINY!!", + "advancement.create:refined_radiance.desc": "~ Description", + "advancement.create:refined_radiance_secret": "~ Name", + "advancement.create:refined_radiance_secret.desc": "Find the alternative way to make Refined Radiance", + "advancement.create:speed_secret": "Hella fast", + "advancement.create:speed_secret.desc": "Watch a Speedometer reach exactly 666 speed", "_comment": "-------------------------] ITEM DESCRIPTIONS [------------------------------------------------", diff --git a/src/main/resources/data/create/advancements/andesite_alloy.json b/src/main/resources/data/create/advancements/andesite_alloy.json index 667d9c220..2eb334beb 100644 --- a/src/main/resources/data/create/advancements/andesite_alloy.json +++ b/src/main/resources/data/create/advancements/andesite_alloy.json @@ -1,10 +1,10 @@ { "display": { "title": { - "text": "Andesite Alloy" + "translate": "advancement.create:andesite_alloy" }, "description": { - "text": "A basic building block of create" + "translate": "advancement.create:andesite_alloy.desc" }, "icon": { "item": "create:andesite_alloy" diff --git a/src/main/resources/data/create/advancements/andesite_casing.json b/src/main/resources/data/create/advancements/andesite_casing.json index 15674e5b4..ccf09422d 100644 --- a/src/main/resources/data/create/advancements/andesite_casing.json +++ b/src/main/resources/data/create/advancements/andesite_casing.json @@ -1,18 +1,18 @@ { "display": { "title": { - "text": "Andesite Casing", + "translate": "advancement.create:andesite_casing", "color": "gray" }, "description": { - "text": "Use some Andesite, Metal and Wood to create a basic Casing" + "translate": "advancement.create:andesite_casing.desc" }, "icon": { "item": "create:andesite_casing" }, "frame": "task", "show_toast": true, - "announce_to_chat": true, + "announce_to_chat": false, "hidden": false }, "criteria": { diff --git a/src/main/resources/data/create/advancements/brass.json b/src/main/resources/data/create/advancements/brass.json index 598df5922..b43592d94 100644 --- a/src/main/resources/data/create/advancements/brass.json +++ b/src/main/resources/data/create/advancements/brass.json @@ -1,11 +1,11 @@ { "display": { "title": { - "text": "brass", + "translate": "advancement.create:brass", "color": "gold" }, "description": { - "text": "Description" + "translate": "advancement.create:brass.desc" }, "icon": { "item": "create:crushed_brass" diff --git a/src/main/resources/data/create/advancements/brass_casing.json b/src/main/resources/data/create/advancements/brass_casing.json index b469b2337..27ceca47f 100644 --- a/src/main/resources/data/create/advancements/brass_casing.json +++ b/src/main/resources/data/create/advancements/brass_casing.json @@ -11,7 +11,7 @@ }, "frame": "task", "show_toast": true, - "announce_to_chat": true, + "announce_to_chat": false, "hidden": false }, "criteria": { diff --git a/src/main/resources/data/create/advancements/chromatic_compound.json b/src/main/resources/data/create/advancements/chromatic_compound.json index 18cd53db5..65e496c4d 100644 --- a/src/main/resources/data/create/advancements/chromatic_compound.json +++ b/src/main/resources/data/create/advancements/chromatic_compound.json @@ -1,23 +1,22 @@ { "display": { "title": { - "text": "Chromatic Compound", + "translate": "advancement.create:chromatic_compound", "color": "dark_purple" }, "description": { - "text": "Description" + "translate": "advancement.create:chromatic_compound.desc" }, "icon": { "item": "create:chromatic_compound" }, "frame": "task", "show_toast": true, - "announce_to_chat": true, + "announce_to_chat": false, "hidden": false }, "criteria": { "alloy": { - "comment_": "TODO introduce trigger for mixer recipes", "trigger": "minecraft:inventory_changed", "conditions": { "items": [ diff --git a/src/main/resources/data/create/advancements/crushing_wheel.json b/src/main/resources/data/create/advancements/crushing_wheel.json index ba4ab13d5..26af94ec9 100644 --- a/src/main/resources/data/create/advancements/crushing_wheel.json +++ b/src/main/resources/data/create/advancements/crushing_wheel.json @@ -1,17 +1,17 @@ { "display": { "title": { - "text": "I've got a crush on you" + "translate": "advancement.create:crushing_wheel" }, "description": { - "text": "create a pair of crushing wheels" + "translate": "advancement.create:crushing_wheel.desc" }, "icon": { "item": "create:crushing_wheel" }, "frame": "task", "show_toast": true, - "announce_to_chat": true, + "announce_to_chat": false, "hidden": false }, "criteria": { @@ -23,7 +23,7 @@ "item": "create:crushing_wheel", "count": { "min": 2, - "max": 2 + "max": 64 } } ] diff --git a/src/main/resources/data/create/advancements/deployer.json b/src/main/resources/data/create/advancements/deployer.json index 7327b8fdd..88169d3a7 100644 --- a/src/main/resources/data/create/advancements/deployer.json +++ b/src/main/resources/data/create/advancements/deployer.json @@ -1,10 +1,10 @@ { "display": { "title": { - "text": "deployer" + "translate": "advancement.create:deployer" }, "description": { - "text": "Description" + "translate": "advancement.create:deployer.desc" }, "icon": { "item": "create:deployer" diff --git a/src/main/resources/data/create/advancements/deployer_secret.json b/src/main/resources/data/create/advancements/deployer_secret.json index 199bc649a..b87806234 100644 --- a/src/main/resources/data/create/advancements/deployer_secret.json +++ b/src/main/resources/data/create/advancements/deployer_secret.json @@ -1,13 +1,13 @@ { "display": { "title": { - "text": "deployer_secret" + "translate": "advancement.create:deployer_secret" }, "description": { - "text": "Description" + "translate": "advancement.create:deployer_secret.desc" }, "icon": { - "item": "minecraft:stone" + "item": "create:deployer" }, "frame": "goal", "show_toast": true, @@ -16,8 +16,7 @@ }, "criteria": { "touching": { - "comment_": "custom trigger needed", - "trigger": "minecraft:impossible" + "trigger": "create:deployer" } }, "parent": "create:deployer" diff --git a/src/main/resources/data/create/advancements/gear.json b/src/main/resources/data/create/advancements/gear.json index 548cca988..1c8ca2406 100644 --- a/src/main/resources/data/create/advancements/gear.json +++ b/src/main/resources/data/create/advancements/gear.json @@ -1,17 +1,17 @@ { "display": { "title": { - "text": "Know what really grinds my Gears?" + "translate": "advancement.create:gear" }, "description": { - "text": "sand paper." + "translate": "advancement.create:gear.desc" }, "icon": { "item": "create:cogwheel" }, "frame": "task", "show_toast": true, - "announce_to_chat": true, + "announce_to_chat": false, "hidden": true }, "criteria": { diff --git a/src/main/resources/data/create/advancements/mechanical_mixer.json b/src/main/resources/data/create/advancements/mechanical_mixer.json index 0e3d6d6d3..8c633569e 100644 --- a/src/main/resources/data/create/advancements/mechanical_mixer.json +++ b/src/main/resources/data/create/advancements/mechanical_mixer.json @@ -1,17 +1,17 @@ { "display": { "title": { - "text": "mixer" + "translate": "advancement.create:mixer" }, "description": { - "text": "mixer_desc" + "translate": "advancement.create:mixer.desc" }, "icon": { "item": "create:mechanical_mixer" }, "frame": "task", "show_toast": true, - "announce_to_chat": true, + "announce_to_chat": false, "hidden": false }, "criteria": { diff --git a/src/main/resources/data/create/advancements/mechanical_press.json b/src/main/resources/data/create/advancements/mechanical_press.json index 6a8d30c3c..aff99de88 100644 --- a/src/main/resources/data/create/advancements/mechanical_press.json +++ b/src/main/resources/data/create/advancements/mechanical_press.json @@ -1,10 +1,10 @@ { "display": { "title": { - "text": "Squeezing real hard" + "translate": "advancement.create:press" }, "description": { - "text": "Make a Mechanical Press and use it to create some plates" + "translate": "advancement.create:press.desc" }, "icon": { "item": "create:mechanical_press" diff --git a/src/main/resources/data/create/advancements/polished_rose_quartz.json b/src/main/resources/data/create/advancements/polished_rose_quartz.json index 65d4fbeca..f50fba33b 100644 --- a/src/main/resources/data/create/advancements/polished_rose_quartz.json +++ b/src/main/resources/data/create/advancements/polished_rose_quartz.json @@ -1,11 +1,11 @@ { "display": { "title": { - "text": "Polished Rose Quartz", + "translate": "advancement.create:polished_rose_quartz", "color": "red" }, "description": { - "text": "Description" + "translate": "advancement.create:polished_rose_quartz.desc" }, "icon": { "item": "create:polished_rose_quartz" @@ -17,14 +17,14 @@ }, "criteria": { "quartz": { - "comment_": "TODO replace this with a custom trigger for sand paper use or maybe item durability change", - "trigger": "minecraft:inventory_changed", + "trigger": "create:sandpaper_use", "conditions": { - "items": [ - { - "item": "create:polished_rose_quartz" - } - ] + "target": { + "item": "create:rose_quartz" + }, + "result": { + "item": "create:polished_rose_quartz" + } } } }, diff --git a/src/main/resources/data/create/advancements/refined_radiance.json b/src/main/resources/data/create/advancements/refined_radiance.json index 2ee5bb0d6..55e0c8d0f 100644 --- a/src/main/resources/data/create/advancements/refined_radiance.json +++ b/src/main/resources/data/create/advancements/refined_radiance.json @@ -1,18 +1,18 @@ { "display": { "title": { - "text": "SHINY!!!", + "translate": "advancement.create:refined_radiance", "color": "white" }, "description": { - "text": "Description" + "translate": "advancement.create:refined_radiance.desc" }, "icon": { "item": "create:refined_radiance" }, "frame": "goal", "show_toast": true, - "announce_to_chat": true, + "announce_to_chat": false, "hidden": false }, "criteria": { diff --git a/src/main/resources/data/create/advancements/refined_radiance_secret.json b/src/main/resources/data/create/advancements/refined_radiance_secret.json index 421b30f59..02272aa91 100644 --- a/src/main/resources/data/create/advancements/refined_radiance_secret.json +++ b/src/main/resources/data/create/advancements/refined_radiance_secret.json @@ -1,10 +1,11 @@ { "display": { "title": { - "text": "shiny secret" + "translate": "advancement.create:refined_radiance_secret", + "color": "white" }, "description": { - "text": "find the alternative way to make refined radiance" + "translate": "advancement.create:refined_radiance_secret.desc" }, "icon": { "item": "create:refined_radiance" @@ -16,8 +17,7 @@ }, "criteria": { "ritual": { - "comment_": "custom trigger needed", - "trigger": "minecraft:impossible" + "trigger": "create:light_absorbed" } }, "parent": "create:chromatic_compound" diff --git a/src/main/resources/data/create/advancements/root.json b/src/main/resources/data/create/advancements/root.json index 8a4479c08..9a0590e05 100644 --- a/src/main/resources/data/create/advancements/root.json +++ b/src/main/resources/data/create/advancements/root.json @@ -1,7 +1,7 @@ { "display": { "icon": { - "item": "create:cogwheel" + "item": "create:placement_handgun" }, "title": { "translate": "advancement.create:root" @@ -9,7 +9,7 @@ "description": { "translate": "advancement.create:root.desc" }, - "background": "create:textures/block/brass_casing_side.png", + "background": "create:textures/block/gabbro_layers.png", "show_toast": false, "announce_to_chat": false }, diff --git a/src/main/resources/data/create/advancements/sand_paper.json b/src/main/resources/data/create/advancements/sand_paper.json index 5573a0f00..43a68859c 100644 --- a/src/main/resources/data/create/advancements/sand_paper.json +++ b/src/main/resources/data/create/advancements/sand_paper.json @@ -1,11 +1,11 @@ { "display": { "title": { - "text": "Sand Paper", + "translate": "advancement.create:sand_paper", "color": "yellow" }, "description": { - "text": "Description" + "translate": "advancement.create:sand_paper.desc" }, "icon": { "item": "create:sand_paper" diff --git a/src/main/resources/data/create/advancements/sand_paper_secret.json b/src/main/resources/data/create/advancements/sand_paper_secret.json new file mode 100644 index 000000000..a1909c12b --- /dev/null +++ b/src/main/resources/data/create/advancements/sand_paper_secret.json @@ -0,0 +1,43 @@ +{ + "display": { + "title": { + "translate": "advancement.create:sand_paper_secret", + "color": "yellow" + }, + "description": { + "translate": "advancement.create:sand_paper_secret.desc" + }, + "icon": { + "item": "create:sand_paper" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "normal": { + "trigger": "create:sandpaper_use", + "conditions": { + "result": { + "item": "create:sand_paper" + } + } + }, + "red": { + "trigger": "create:sandpaper_use", + "conditions": { + "result": { + "item": "create:red_sand_paper" + } + } + } + }, + "requirements": [ + [ + "normal", + "red" + ] + ], + "parent": "create:sand_paper" +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/shadow_steel.json b/src/main/resources/data/create/advancements/shadow_steel.json index a58ca6e04..d5acbbc23 100644 --- a/src/main/resources/data/create/advancements/shadow_steel.json +++ b/src/main/resources/data/create/advancements/shadow_steel.json @@ -1,11 +1,11 @@ { "display": { "title": { - "text": "Not quite as shiny", + "translate": "advancement.create:shadow_steel", "color": "black" }, "description": { - "text": "Description" + "translate": "advancement.create:shadow_steel.desc" }, "icon": { "item": "create:shadow_steel" diff --git a/src/main/resources/data/create/advancements/speed_secret.json b/src/main/resources/data/create/advancements/speed_secret.json new file mode 100644 index 000000000..4003d997f --- /dev/null +++ b/src/main/resources/data/create/advancements/speed_secret.json @@ -0,0 +1,24 @@ +{ + "display": { + "title": { + "translate": "advancement.create:speed_secret", + "color": "red" + }, + "description": { + "translate": "advancement.create:speed_secret.desc" + }, + "icon": { + "item": "create:rose_quartz" + }, + "frame": "goal", + "show_toast": true, + "announce_to_chat": true, + "hidden": true + }, + "criteria": { + "alloy": { + "trigger": "create:speed_read" + } + }, + "parent": "create:root" +} \ No newline at end of file diff --git a/src/main/resources/data/create/advancements/test.json b/src/main/resources/data/create/advancements/test.json deleted file mode 100644 index bf5f5bb6f..000000000 --- a/src/main/resources/data/create/advancements/test.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "display": { - "icon": { - "item": "create:wrench" - }, - "title": { - "translate": "advancement.create:test" - }, - "description": { - "translate": "advancement.create:test.desc" - } - }, - "parent": "create:root", - "criteria": { - "flower": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "item": "create:wrench" - } - ] - } - } - } -} \ No newline at end of file