Finish criteria and advancements
This commit is contained in:
parent
da67369796
commit
20a8da57c1
24 changed files with 520 additions and 60 deletions
|
@ -2,6 +2,10 @@ package org.dimdev.dimdoors.datagen;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import org.dimdev.dimdoors.block.ModBlocks;
|
||||
import org.dimdev.dimdoors.block.door.data.DoorData;
|
||||
import org.dimdev.dimdoors.entity.advancement.PocketSpawnPointSetCondition;
|
||||
import org.dimdev.dimdoors.entity.advancement.RiftTrackedCriterion;
|
||||
import org.dimdev.dimdoors.item.ModItems;
|
||||
import org.dimdev.dimdoors.world.ModDimensions;
|
||||
|
||||
|
@ -10,11 +14,25 @@ import net.minecraft.advancement.AdvancementDisplay;
|
|||
import net.minecraft.advancement.AdvancementFrame;
|
||||
import net.minecraft.advancement.criterion.ChangedDimensionCriterion;
|
||||
import net.minecraft.advancement.criterion.InventoryChangedCriterion;
|
||||
import net.minecraft.advancement.criterion.ItemUsedOnBlockCriterion;
|
||||
import net.minecraft.advancement.criterion.PlacedBlockCriterion;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.predicate.BlockPredicate;
|
||||
import net.minecraft.predicate.FluidPredicate;
|
||||
import net.minecraft.predicate.LightPredicate;
|
||||
import net.minecraft.predicate.NbtPredicate;
|
||||
import net.minecraft.predicate.NumberRange;
|
||||
import net.minecraft.predicate.entity.EntityPredicate;
|
||||
import net.minecraft.predicate.entity.LocationPredicate;
|
||||
import net.minecraft.predicate.item.EnchantmentPredicate;
|
||||
import net.minecraft.predicate.item.ItemPredicate;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
import net.fabricmc.fabric.api.tag.TagRegistry;
|
||||
|
||||
public class AdvancementTab implements Consumer<Consumer<Advancement>> {
|
||||
static AdvancementDisplay makeDisplay(ItemConvertible item, String titleKey) {
|
||||
|
@ -52,6 +70,82 @@ public class AdvancementTab implements Consumer<Consumer<Advancement>> {
|
|||
.criterion("inventory_changed", InventoryChangedCriterion.Conditions.items(ModItems.WORLD_THREAD))
|
||||
.parent(root)
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/string_theory");
|
||||
Advancement holeInTheSky = Advancement.Task.create()
|
||||
.display(makeDisplay(ModItems.RIFT_CONFIGURATION_TOOL, "hole_in_the_sky"))
|
||||
.criterion("encounter_rift", new RiftTrackedCriterion.Conditions(EntityPredicate.Extended.EMPTY))
|
||||
.parent(root)
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/hole_in_the_sky");
|
||||
Advancement darkOstiology = Advancement.Task.create()
|
||||
.display(makeDisplay(Registry.BLOCK.get(new Identifier("dimdoors:oak_dimensional_door")), "dark_ostiology"))
|
||||
.criterion("place_door", PlacedBlockCriterion.Conditions.block(Registry.BLOCK.get(new Identifier("dimdoors:oak_dimensional_door"))))
|
||||
.parent(holeInTheSky)
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/dark_ostiology");
|
||||
Advancement.Task.create()
|
||||
.display(makeDisplay(Registry.BLOCK.get(new Identifier("dimdoors:iron_dimensional_door")), "public_pocket"))
|
||||
.parent(darkOstiology)
|
||||
.criterion("public_pocket", ChangedDimensionCriterion.Conditions.to(ModDimensions.PUBLIC))
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/public_pocket");
|
||||
Advancement.Task.create()
|
||||
.display(makeDisplay(Registry.BLOCK.get(new Identifier("dimdoors:iron_dimensional_door")), "home_away_from_home"))
|
||||
.parent(darkOstiology)
|
||||
.criterion("private_pocket", ChangedDimensionCriterion.Conditions.to(ModDimensions.PERSONAL))
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/home_away_from_home");
|
||||
Advancement.Task.create()
|
||||
.display(makeDisplay(Blocks.RESPAWN_ANCHOR, "out_of_time"))
|
||||
.criterion("spawn", new PocketSpawnPointSetCondition.Conditions(EntityPredicate.Extended.EMPTY))
|
||||
.parent(darkOstiology)
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/out_of_time");
|
||||
Advancement doorToAdventure = Advancement.Task.create()
|
||||
.display(makeDisplay(Registry.BLOCK.get(new Identifier("dimdoors:gold_dimensional_door")), "door_to_adventure"))
|
||||
.parent(holeInTheSky)
|
||||
.criterion("enter_dungeon", ChangedDimensionCriterion.Conditions.to(ModDimensions.DUNGEON))
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/door_to_adventure");
|
||||
Advancement.Task.create()
|
||||
.display(makeDisplay(Items.CHEST, "lost_and_found"))
|
||||
.parent(doorToAdventure)
|
||||
.criterion("open_chest", new ItemUsedOnBlockCriterion.Conditions
|
||||
(
|
||||
EntityPredicate.Extended.EMPTY,
|
||||
new LocationPredicate(
|
||||
NumberRange.FloatRange.ANY,
|
||||
NumberRange.FloatRange.ANY,
|
||||
NumberRange.FloatRange.ANY,
|
||||
null,
|
||||
null,
|
||||
ModDimensions.DUNGEON,
|
||||
null,
|
||||
LightPredicate.ANY,
|
||||
BlockPredicate.Builder.create().block(Blocks.CHEST).build(),
|
||||
FluidPredicate.ANY
|
||||
),
|
||||
new ItemPredicate(
|
||||
null,
|
||||
null,
|
||||
NumberRange.IntRange.ANY,
|
||||
NumberRange.IntRange.ANY,
|
||||
EnchantmentPredicate.ARRAY_OF_ANY,
|
||||
EnchantmentPredicate.ARRAY_OF_ANY,
|
||||
null,
|
||||
NbtPredicate.ANY
|
||||
)
|
||||
)
|
||||
)
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/lost_and_found");
|
||||
Advancement.Task.create()
|
||||
.display(makeDisplay(ModItems.BLACK_FABRIC, "darklight"))
|
||||
.parent(doorToAdventure)
|
||||
.criterion("get_fabric", InventoryChangedCriterion.Conditions.items(ItemPredicate.Builder.create().tag(TagRegistry.item(new Identifier("dimdoors", "fabric"))).build()))
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/darklight");
|
||||
Advancement enterLimbo = Advancement.Task.create()
|
||||
.display(makeDisplay(ModItems.MONOLITH_SPAWNER, "enter_limbo"))
|
||||
.parent(doorToAdventure)
|
||||
.criterion("enter_limbo", ChangedDimensionCriterion.Conditions.to(ModDimensions.LIMBO))
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/enter_limbo");
|
||||
Advancement.Task.create()
|
||||
.display(makeDisplay(ModItems.UNRAVELLED_FABRIC, "world_unfurled"))
|
||||
.parent(enterLimbo)
|
||||
.criterion("get_fabric", InventoryChangedCriterion.Conditions.items(ModItems.UNRAVELLED_FABRIC))
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/world_unfurled");
|
||||
|
||||
// Advancement.Task.create()
|
||||
// .display(makeDisplay(ModItems.IRON_DIMENSIONAL_DOOR, "public_pocket"))
|
||||
|
@ -68,15 +162,15 @@ public class AdvancementTab implements Consumer<Consumer<Advancement>> {
|
|||
// .criterion("changed_dimension", ChangedDimensionCriterion.Conditions.to(ModDimensions.DUNGEON))
|
||||
// .parent(root)
|
||||
// .build(advancementConsumer, "dimdoors:dimdoors/dungeon");
|
||||
Advancement limbo = Advancement.Task.create()
|
||||
.display(makeDisplay(ModItems.UNRAVELLED_FABRIC, "limbo"))
|
||||
.criterion("changed_dimension", ChangedDimensionCriterion.Conditions.to(ModDimensions.LIMBO))
|
||||
.parent(root)
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/limbo");
|
||||
Advancement.Task.create()
|
||||
.display(makeDisplay(ModItems.ETERNAL_FLUID_BUCKET, "escape_limbo"))
|
||||
.criterion("changed_dimension", new ChangedDimensionCriterion.Conditions(EntityPredicate.Extended.EMPTY, ModDimensions.LIMBO, null))
|
||||
.parent(limbo)
|
||||
.build(advancementConsumer, "dimdoors:dimdoors/escape_limbo");
|
||||
// Advancement limbo = Advancement.Task.create()
|
||||
// .display(makeDisplay(ModItems.UNRAVELLED_FABRIC, "limbo"))
|
||||
// .criterion("changed_dimension", ChangedDimensionCriterion.Conditions.to(ModDimensions.LIMBO))
|
||||
// .parent(root)
|
||||
// .build(advancementConsumer, "dimdoors:dimdoors/limbo");
|
||||
// Advancement.Task.create()
|
||||
// .display(makeDisplay(ModItems.ETERNAL_FLUID_BUCKET, "escape_limbo"))
|
||||
// .criterion("changed_dimension", new ChangedDimensionCriterion.Conditions(EntityPredicate.Extended.EMPTY, ModDimensions.LIMBO, null))
|
||||
// .parent(limbo)
|
||||
// .build(advancementConsumer, "dimdoors:dimdoors/escape_limbo");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,18 @@ package org.dimdev.dimdoors.datagen;
|
|||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
|
||||
import org.dimdev.dimdoors.block.ModBlocks;
|
||||
import org.dimdev.dimdoors.block.door.data.condition.Condition;
|
||||
import org.dimdev.dimdoors.entity.advancement.ModCriteria;
|
||||
import org.dimdev.dimdoors.item.ModItems;
|
||||
import org.dimdev.dimdoors.pockets.generator.PocketGenerator;
|
||||
import org.dimdev.dimdoors.pockets.modifier.Modifier;
|
||||
import org.dimdev.dimdoors.pockets.virtual.VirtualSingularPocket;
|
||||
import org.dimdev.dimdoors.rift.targets.Targets;
|
||||
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
|
||||
import org.dimdev.dimdoors.world.pocket.type.AbstractPocket;
|
||||
import org.dimdev.dimdoors.world.pocket.type.addon.PocketAddon;
|
||||
|
||||
import net.minecraft.Bootstrap;
|
||||
import net.minecraft.data.DataGenerator;
|
||||
|
@ -23,8 +33,10 @@ public class DatagenInitializer implements PreLaunchEntrypoint {
|
|||
public void onPreLaunch() {
|
||||
try {
|
||||
Bootstrap.initialize();
|
||||
DimensionalDoorsInitializer.registerRegistries();
|
||||
ModBlocks.init();
|
||||
ModItems.init();
|
||||
ModCriteria.init();
|
||||
DataGenerator dataGenerator = new DataGenerator(Paths.get("./generated"), Collections.emptyList());
|
||||
dataGenerator.install(new FabricRecipeProvider(dataGenerator));
|
||||
dataGenerator.install(new AdvancementProvider(dataGenerator));
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.dimdev.dimdoors;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
|
@ -63,7 +64,7 @@ import net.fabricmc.loader.api.FabricLoader;
|
|||
import net.fabricmc.loader.api.ModContainer;
|
||||
|
||||
public class DimensionalDoorsInitializer implements ModInitializer {
|
||||
public static List<DimensionalDoorsApi> apiSubscribers;
|
||||
public static List<DimensionalDoorsApi> apiSubscribers = Collections.emptyList();
|
||||
private static final Supplier<Path> CONFIG_ROOT = () -> FabricLoader.getInstance().getConfigDir().resolve("dimdoors").toAbsolutePath();
|
||||
private static final ConfigHolder<ModConfig> CONFIG_MANAGER = AutoConfig.register(ModConfig.class, ModConfig.SubRootJanksonConfigSerializer::new);
|
||||
private static MinecraftServer server;
|
||||
|
@ -101,14 +102,7 @@ public class DimensionalDoorsInitializer implements ModInitializer {
|
|||
server = minecraftServer;
|
||||
});
|
||||
|
||||
Targets.registerDefaultTargets();
|
||||
VirtualTarget.VirtualTargetType.register();
|
||||
VirtualSingularPocket.VirtualSingularPocketType.register();
|
||||
Modifier.ModifierType.register();
|
||||
PocketGenerator.PocketGeneratorType.register();
|
||||
AbstractPocket.AbstractPocketType.register();
|
||||
PocketAddon.PocketAddonType.register();
|
||||
Condition.ConditionType.register();
|
||||
registerRegistries();
|
||||
|
||||
ModBlocks.init();
|
||||
ModItems.init();
|
||||
|
@ -131,6 +125,17 @@ public class DimensionalDoorsInitializer implements ModInitializer {
|
|||
apiSubscribers.forEach(DimensionalDoorsApi::postInitialize);
|
||||
}
|
||||
|
||||
public static void registerRegistries() {
|
||||
Targets.registerDefaultTargets();
|
||||
VirtualTarget.VirtualTargetType.register();
|
||||
VirtualSingularPocket.VirtualSingularPocketType.register();
|
||||
Modifier.ModifierType.register();
|
||||
PocketGenerator.PocketGeneratorType.register();
|
||||
AbstractPocket.AbstractPocketType.register();
|
||||
PocketAddon.PocketAddonType.register();
|
||||
Condition.ConditionType.register();
|
||||
}
|
||||
|
||||
private void registerListeners() {
|
||||
ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> {
|
||||
((ExtendedServerPlayNetworkHandler) handler).getDimDoorsPacketHandler().init();
|
||||
|
|
|
@ -8,16 +8,21 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.item.ItemPlacementContext;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemUsageContext;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.DyeColor;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.fabricmc.fabric.api.tag.TagRegistry;
|
||||
|
||||
public class FabricBlock extends Block {
|
||||
public static final Tag<Block> BLOCK_TAG = TagRegistry.block(new Identifier("dimdoors", "fabric"));
|
||||
|
||||
FabricBlock(DyeColor color) {
|
||||
super(FabricBlockSettings.of(Material.STONE, color).strength(1.2F).luminance(15));
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ import net.fabricmc.fabric.api.object.builder.v1.advancement.CriterionRegistry;
|
|||
|
||||
public class ModCriteria {
|
||||
public static final RiftTrackedCriterion RIFT_TRACKED = CriterionRegistry.register(new RiftTrackedCriterion());
|
||||
public static final TagBlockBreakCriteria TAG_BLOCK_BREAK = CriterionRegistry.register(new TagBlockBreakCriteria());
|
||||
public static final PocketSpawnPointSetCondition POCKET_SPAWN_POINT_SET = CriterionRegistry.register(new PocketSpawnPointSetCondition());
|
||||
|
||||
public static void init() {
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package org.dimdev.dimdoors.entity.advancement;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.advancement.criterion.AbstractCriterion;
|
||||
import net.minecraft.advancement.criterion.AbstractCriterionConditions;
|
||||
import net.minecraft.predicate.entity.AdvancementEntityPredicateDeserializer;
|
||||
import net.minecraft.predicate.entity.EntityPredicate;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class PocketSpawnPointSetCondition extends AbstractCriterion<PocketSpawnPointSetCondition.Conditions> {
|
||||
public static final Identifier ID = new Identifier("dimdoors", "pocket_spawn_point_set");
|
||||
|
||||
@Override
|
||||
protected Conditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
|
||||
return new Conditions(playerPredicate);
|
||||
}
|
||||
|
||||
public void trigger(ServerPlayerEntity player) {
|
||||
this.test(player, t -> true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getId() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
public static class Conditions extends AbstractCriterionConditions {
|
||||
public Conditions(EntityPredicate.Extended playerPredicate) {
|
||||
super(ID, playerPredicate);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,7 +23,7 @@ public class RiftTrackedCriterion extends AbstractCriterion<RiftTrackedCriterion
|
|||
|
||||
@Override
|
||||
public Identifier getId() {
|
||||
return null;
|
||||
return ID;
|
||||
}
|
||||
|
||||
public static class Conditions extends AbstractCriterionConditions {
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
package org.dimdev.dimdoors.entity.advancement;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.advancement.criterion.AbstractCriterion;
|
||||
import net.minecraft.advancement.criterion.AbstractCriterionConditions;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.predicate.entity.AdvancementEntityPredicateDeserializer;
|
||||
import net.minecraft.predicate.entity.AdvancementEntityPredicateSerializer;
|
||||
import net.minecraft.predicate.entity.EntityPredicate;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import net.fabricmc.fabric.api.tag.TagRegistry;
|
||||
|
||||
public class TagBlockBreakCriteria extends AbstractCriterion<TagBlockBreakCriteria.Conditions> {
|
||||
public static final Identifier ID = new Identifier("dimdoors", "tag_block_break");
|
||||
|
||||
@Override
|
||||
protected Conditions conditionsFromJson(JsonObject obj, EntityPredicate.Extended playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) {
|
||||
return new Conditions(playerPredicate, TagRegistry.block(Identifier.tryParse(obj.get("tag").getAsString())));
|
||||
}
|
||||
|
||||
public void trigger(ServerPlayerEntity player, Block block) {
|
||||
this.test(player, c -> c.getBlockTag().contains(block));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier getId() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
public static class Conditions extends AbstractCriterionConditions {
|
||||
private final Tag<Block> blockTag;
|
||||
|
||||
public Conditions(EntityPredicate.Extended playerPredicate, Tag<Block> blockTag) {
|
||||
super(ID, playerPredicate);
|
||||
this.blockTag = Objects.requireNonNull(blockTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObject toJson(AdvancementEntityPredicateSerializer predicateSerializer) {
|
||||
JsonObject json = new JsonObject();
|
||||
json.addProperty("tag", ((Tag.Identified<Block>) blockTag).getId().toString());
|
||||
return super.toJson(predicateSerializer);
|
||||
}
|
||||
|
||||
public Tag<Block> getBlockTag() {
|
||||
return blockTag;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,7 +14,6 @@ import org.dimdev.dimdoors.network.ClientPacketHandler;
|
|||
import org.dimdev.dimdoors.network.c2s.HitBlockWithItemC2SPacket;
|
||||
|
||||
public class AttackBlockCallbackListener implements AttackBlockCallback {
|
||||
|
||||
@Override
|
||||
public ActionResult interact(PlayerEntity player, World world, Hand hand, BlockPos pos, Direction direction) {
|
||||
if (!world.isClient) return ActionResult.PASS;
|
||||
|
|
22
src/main/java/org/dimdev/dimdoors/mixin/BlockMixin.java
Normal file
22
src/main/java/org/dimdev/dimdoors/mixin/BlockMixin.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
package org.dimdev.dimdoors.mixin;
|
||||
|
||||
import org.dimdev.dimdoors.entity.advancement.ModCriteria;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Mixin(Block.class)
|
||||
public class BlockMixin {
|
||||
@Inject(method = "onBreak", at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/block/Block;spawnBreakParticles(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)V"))
|
||||
public void triggerTagBlockBreak(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfo ci) {
|
||||
ModCriteria.TAG_BLOCK_BREAK.trigger((ServerPlayerEntity) player, state.getBlock());
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package org.dimdev.dimdoors.mixin;
|
||||
|
||||
import org.dimdev.dimdoors.entity.advancement.ModCriteria;
|
||||
import org.dimdev.dimdoors.entity.stat.ModStats;
|
||||
import org.dimdev.dimdoors.api.util.TeleportUtil;
|
||||
import org.dimdev.dimdoors.world.ModDimensions;
|
||||
|
@ -12,6 +13,8 @@ import net.minecraft.entity.EntityType;
|
|||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Mixin(value = ServerPlayerEntity.class, priority = 900)
|
||||
|
@ -31,4 +34,11 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin {
|
|||
TeleportUtil.teleportRandom(this, ModDimensions.LIMBO_DIMENSION, 384);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "setSpawnPoint", at = @At("TAIL"))
|
||||
public void onSpawnPointSet(RegistryKey<World> dimension, BlockPos pos, float angle, boolean spawnPointSet, boolean bl, CallbackInfo ci) {
|
||||
if (ModDimensions.isPocketDimension(dimension)) {
|
||||
ModCriteria.POCKET_SPAWN_POINT_SET.trigger((ServerPlayerEntity) (Object) this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,18 +223,32 @@
|
|||
"argument.dimdoors.schematic.invalidNamespace": "Invalid schematic namespace. Expected one of %s, found %s.",
|
||||
"command.dimdoors.schematicv2.unknownSchematic": "Unknown schematic \"%s\" in namespace \"%s\" ",
|
||||
"dimdoors.destination": "Destination type",
|
||||
|
||||
"dimdoors.advancement.root": "Dimensional Doors",
|
||||
"dimdoors.advancement.root.desc": "Venture into the depths",
|
||||
"dimdoors.advancement.public_pocket": "Public Pockets",
|
||||
"dimdoors.advancement.public_pocket.desc": "Enter a public pocket",
|
||||
"dimdoors.advancement.private_pocket": "Private Pockets",
|
||||
"dimdoors.advancement.private_pocket.desc": "Enter a private pocket",
|
||||
"dimdoors.advancement.dungeon": "Dungeons",
|
||||
"dimdoors.advancement.dungeon.desc": "Enter a dungeon",
|
||||
"dimdoors.advancement.limbo": "Decay",
|
||||
"dimdoors.advancement.limbo.desc": "Enter limbo",
|
||||
"dimdoors.advancement.escape_limbo": "Escape",
|
||||
"dimdoors.advancement.escape_limbo.desc": "Escape limbo",
|
||||
"dimdoors.advancement.dark_ostiology": "Dark Ostiology",
|
||||
"dimdoors.advancement.dark_ostiology.desc": "Place an Oak Dimensional Door",
|
||||
"dimdoors.advancement.darklight": "Darklight",
|
||||
"dimdoors.advancement.darklight.desc": "Obtain Fabric of Reality",
|
||||
"dimdoors.advancement.door_to_adventure": "Door to Adventure",
|
||||
"dimdoors.advancement.door_to_adventure.desc": "Enter a dungeon",
|
||||
"dimdoors.advancement.enter_limbo": "Limbo",
|
||||
"dimdoors.advancement.enter_limbo.desc": "Enter Limbo",
|
||||
"dimdoors.advancement.hole_in_the_sky": "Hole in the Sky",
|
||||
"dimdoors.advancement.hole_in_the_sky.desc": "Encounter a Rift",
|
||||
"dimdoors.advancement.home_away_from_home": "Home away from Home",
|
||||
"dimdoors.advancement.home_away_from_home.desc": "Enter your private pocket",
|
||||
"dimdoors.advancement.lost_and_found": "Lost and Found",
|
||||
"dimdoors.advancement.lost_and_found.desc": "Open a chest in a Dungeon",
|
||||
"dimdoors.advancement.out_of_time": "Out of Time",
|
||||
"dimdoors.advancement.out_of_time.desc": "Set your spawn point in a pocket dimension",
|
||||
"dimdoors.advancement.public_pocket": "Public Pocket",
|
||||
"dimdoors.advancement.public_pocket.desc": "Enter a Public Pocket",
|
||||
"dimdoors.advancement.string_theory": "String Theory",
|
||||
"dimdoors.advancement.string_theory.desc": "Collect World Thread",
|
||||
"dimdoors.advancement.world_unfurled": "World Unfurled",
|
||||
"dimdoors.advancement.world_unfurled.desc": "Collect Unravelled Fabric",
|
||||
|
||||
"biome.dimdoors.black_void": "Black void (Public Pockets)",
|
||||
"biome.dimdoors.dangerous_black_void": "Dangerous Black void (Dungeon Pockets)",
|
||||
"biome.dimdoors.limbo": "Limbo",
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/limbo",
|
||||
"parent": "dimdoors:dimdoors/hole_in_the_sky",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "dimdoors:eternal_fluid_bucket"
|
||||
"item": "dimdoors:oak_dimensional_door"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.escape_limbo"
|
||||
"translate": "dimdoors.advancement.dark_ostiology"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.escape_limbo.desc"
|
||||
"translate": "dimdoors.advancement.dark_ostiology.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
|
@ -17,16 +17,16 @@
|
|||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"changed_dimension": {
|
||||
"trigger": "minecraft:changed_dimension",
|
||||
"place_door": {
|
||||
"trigger": "minecraft:placed_block",
|
||||
"conditions": {
|
||||
"from": "dimdoors:limbo"
|
||||
"block": "dimdoors:oak_dimensional_door"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"changed_dimension"
|
||||
"place_door"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/door_to_adventure",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "dimdoors:black_fabric"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.darklight"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.darklight.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
"announce_to_chat": true,
|
||||
"hidden": false,
|
||||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"get_fabric": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"tag": "dimdoors:fabric"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"get_fabric"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/root",
|
||||
"parent": "dimdoors:dimdoors/hole_in_the_sky",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "dimdoors:gold_dimensional_door"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.dungeon"
|
||||
"translate": "dimdoors.advancement.door_to_adventure"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.dungeon.desc"
|
||||
"translate": "dimdoors.advancement.door_to_adventure.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
|
@ -17,7 +17,7 @@
|
|||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"changed_dimension": {
|
||||
"enter_dungeon": {
|
||||
"trigger": "minecraft:changed_dimension",
|
||||
"conditions": {
|
||||
"to": "dimdoors:dungeon_pockets"
|
||||
|
@ -26,7 +26,7 @@
|
|||
},
|
||||
"requirements": [
|
||||
[
|
||||
"changed_dimension"
|
||||
"enter_dungeon"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/root",
|
||||
"parent": "dimdoors:dimdoors/door_to_adventure",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "dimdoors:unravelled_fabric"
|
||||
"item": "dimdoors:monolith_spawner"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.limbo"
|
||||
"translate": "dimdoors.advancement.enter_limbo"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.limbo.desc"
|
||||
"translate": "dimdoors.advancement.enter_limbo.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
|
@ -17,7 +17,7 @@
|
|||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"changed_dimension": {
|
||||
"enter_limbo": {
|
||||
"trigger": "minecraft:changed_dimension",
|
||||
"conditions": {
|
||||
"to": "dimdoors:limbo"
|
||||
|
@ -26,7 +26,7 @@
|
|||
},
|
||||
"requirements": [
|
||||
[
|
||||
"changed_dimension"
|
||||
"enter_limbo"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/root",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "dimdoors:rift_configuration_tool",
|
||||
"nbt": "{Damage:0}"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.hole_in_the_sky"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.hole_in_the_sky.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
"announce_to_chat": true,
|
||||
"hidden": false,
|
||||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"encounter_rift": {
|
||||
"trigger": "dimdoors:rift_tracked",
|
||||
"conditions": {}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"encounter_rift"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/root",
|
||||
"parent": "dimdoors:dimdoors/dark_ostiology",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "dimdoors:quartz_dimensional_door"
|
||||
"item": "dimdoors:iron_dimensional_door"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.private_pocket"
|
||||
"translate": "dimdoors.advancement.home_away_from_home"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.private_pocket.desc"
|
||||
"translate": "dimdoors.advancement.home_away_from_home.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
|
@ -17,7 +17,7 @@
|
|||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"changed_dimension": {
|
||||
"private_pocket": {
|
||||
"trigger": "minecraft:changed_dimension",
|
||||
"conditions": {
|
||||
"to": "dimdoors:personal_pockets"
|
||||
|
@ -26,7 +26,7 @@
|
|||
},
|
||||
"requirements": [
|
||||
[
|
||||
"changed_dimension"
|
||||
"private_pocket"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/door_to_adventure",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "minecraft:chest"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.lost_and_found"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.lost_and_found.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
"announce_to_chat": true,
|
||||
"hidden": false,
|
||||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"open_chest": {
|
||||
"trigger": "minecraft:item_used_on_block",
|
||||
"conditions": {
|
||||
"location": {
|
||||
"dimension": "dimdoors:dungeon_pockets",
|
||||
"block": {
|
||||
"block": "minecraft:chest"
|
||||
}
|
||||
},
|
||||
"item": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"open_chest"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/dark_ostiology",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "minecraft:respawn_anchor"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.out_of_time"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.out_of_time.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
"announce_to_chat": true,
|
||||
"hidden": false,
|
||||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"spawn": {
|
||||
"trigger": "dimdoors:pocket_spawn_point_set",
|
||||
"conditions": {}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"spawn"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/root",
|
||||
"parent": "dimdoors:dimdoors/dark_ostiology",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "dimdoors:iron_dimensional_door"
|
||||
|
@ -17,7 +17,7 @@
|
|||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"changed_dimension": {
|
||||
"public_pocket": {
|
||||
"trigger": "minecraft:changed_dimension",
|
||||
"conditions": {
|
||||
"to": "dimdoors:public_pockets"
|
||||
|
@ -26,7 +26,7 @@
|
|||
},
|
||||
"requirements": [
|
||||
[
|
||||
"changed_dimension"
|
||||
"public_pocket"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/root",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "dimdoors:world_thread"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.string_theory"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.string_theory.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
"announce_to_chat": true,
|
||||
"hidden": false,
|
||||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"inventory_changed": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "dimdoors:world_thread"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"inventory_changed"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"parent": "dimdoors:dimdoors/enter_limbo",
|
||||
"display": {
|
||||
"icon": {
|
||||
"item": "dimdoors:unravelled_fabric"
|
||||
},
|
||||
"title": {
|
||||
"translate": "dimdoors.advancement.world_unfurled"
|
||||
},
|
||||
"description": {
|
||||
"translate": "dimdoors.advancement.world_unfurled.desc"
|
||||
},
|
||||
"frame": "task",
|
||||
"show_toast": true,
|
||||
"announce_to_chat": true,
|
||||
"hidden": false,
|
||||
"background": "dimdoors:textures/block/unravelled_fabric.png"
|
||||
},
|
||||
"criteria": {
|
||||
"get_fabric": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "dimdoors:unravelled_fabric"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"get_fabric"
|
||||
]
|
||||
]
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
"package": "org.dimdev.dimdoors.mixin",
|
||||
"compatibilityLevel": "JAVA_8",
|
||||
"mixins": [
|
||||
"BlockMixin",
|
||||
"DefaultBiomeFeaturesMixin",
|
||||
"ExtendedServerPlayNetworkhandlerMixin",
|
||||
"ItemMixin",
|
||||
|
|
Loading…
Reference in a new issue