diff --git a/build.gradle b/build.gradle index b67e32c..ac51a0d 100644 --- a/build.gradle +++ b/build.gradle @@ -25,6 +25,14 @@ dependencies { // modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-api:${project.cca_version}" modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}" modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}" + + modLocalRuntime "maven.modrinth:here-be-no-dragons:1.0.0" + modLocalRuntime "maven.modrinth:limitless-structure-block:1.0" + modLocalRuntime "dev.emi:emi-fabric:1.0.29+1.20.1" +} + +loom { + accessWidenerPath = file("src/main/resources/artifality.accesswidener") } base { diff --git a/gradle.properties b/gradle.properties index 7cd84e0..6eb3182 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ archives_base_name = artifality # Dependencies minecraft_version = 1.20.1 yarn_mappings = 1.20.1+build.10 -fabric_loader = 0.15.2 +fabric_loader = 0.15.3 fabric_api = 0.91.0+1.20.1 trinkets_version = 3.7.1 cca_version = 5.2.2 \ No newline at end of file diff --git a/src/main/java/artifality/ArtifalityMod.java b/src/main/java/artifality/ArtifalityMod.java index ced833d..88963ff 100644 --- a/src/main/java/artifality/ArtifalityMod.java +++ b/src/main/java/artifality/ArtifalityMod.java @@ -1,5 +1,6 @@ package artifality; +import artifality.command.ArtifalityCommands; import artifality.data.ArtifalityLootTables; import artifality.registry.*; import net.fabricmc.api.ModInitializer; @@ -36,11 +37,13 @@ public class ArtifalityMod implements ModInitializer { public void onInitialize() { ArtifalityItems.init(); ArtifalityBlocks.init(); + ArtifalityBlockEntities.init(); ArtifalityEnchants.init(); ArtifalityFeatures.init(); ArtifalityEvents.init(); ArtifalityLootTables.init(); ArtifalityEffects.init(); + ArtifalityCommands.init(); Registry.register(Registries.ITEM_GROUP, id("items"), ITEM_GROUP); } diff --git a/src/main/java/artifality/block/CrateBlock.java b/src/main/java/artifality/block/CrateBlock.java index f33bce7..88a9239 100644 --- a/src/main/java/artifality/block/CrateBlock.java +++ b/src/main/java/artifality/block/CrateBlock.java @@ -45,7 +45,7 @@ public class CrateBlock extends BaseBlock implements Waterloggable { public static final VoxelShape SHAPE = createCuboidShape(2, 0, 2, 14, 12, 14); public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; - public static final ArrayList CRYSTALS = new ArrayList<>(List.of(INCREMENTAL_CRYSTAL, LUNAR_CRYSTAL, LIFE_CRYSTAL, WRATH_CRYSTAL)); + public static final ArrayList CRYSTALS = new ArrayList<>(List.of(INCREMENTAL_CRYSTAL, LUNAR_CRYSTAL, LIFE_CRYSTAL)); private final ArrayList commonArtifacts = new ArrayList<>(); private final ArrayList rareArtifacts = new ArrayList<>(); @@ -58,7 +58,7 @@ public CrateBlock(Settings settings, ArtifactRarity rarity) { this.rarity = rarity; ArtifalityItems.ITEMS.forEach((id, item) -> { if(item instanceof ArtifactItem artifact) { - ArtifactRarity artifactRarity = artifact.config.rarity; + ArtifactRarity artifactRarity = artifact.artifactSettings.rarity; switch (artifactRarity) { case COMMON -> commonArtifacts.add(item); case RARE -> rareArtifacts.add(item); diff --git a/src/main/java/artifality/block/LunarPortalBlock.java b/src/main/java/artifality/block/LunarPortalBlock.java new file mode 100644 index 0000000..617e037 --- /dev/null +++ b/src/main/java/artifality/block/LunarPortalBlock.java @@ -0,0 +1,40 @@ +package artifality.block; + +import artifality.extension.PlayerExtension; +import artifality.registry.ArtifalityDimensions; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import java.util.Set; + +public class LunarPortalBlock extends Block { + + public LunarPortalBlock(Settings settings) { + super(settings); + } + + @Override + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + MinecraftServer server = world.getServer(); + + if(server != null && player instanceof PlayerExtension ex) { + if (!world.getDimensionKey().getValue().equals(ArtifalityDimensions.LUNAR_BAZAAR.getValue())) { + ex.savePrevPosition(); + player.teleport(server.getWorld(ArtifalityDimensions.LUNAR_BAZAAR), -20.5, 120.0, -20.5, Set.of(), -45, 0); + } + else { + ex.teleportToPrevPosition(); + } + return ActionResult.SUCCESS; + } + + return super.onUse(state, world, pos, player, hand, hit); + } +} diff --git a/src/main/java/artifality/block/TradingPedestalBlock.java b/src/main/java/artifality/block/TradingPedestalBlock.java new file mode 100644 index 0000000..d1df970 --- /dev/null +++ b/src/main/java/artifality/block/TradingPedestalBlock.java @@ -0,0 +1,46 @@ +package artifality.block; + +import artifality.block.base.BaseBlock; +import artifality.block.entity.TradingPedestalBlockEntity; +import net.minecraft.block.BlockEntityProvider; +import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import org.jetbrains.annotations.Nullable; + +public class TradingPedestalBlock extends BaseBlock implements BlockEntityProvider { + + public TradingPedestalBlock(Settings settings) { + super(settings); + } + + @Nullable + @Override + public BlockEntity createBlockEntity(BlockPos pos, BlockState state) { + return new TradingPedestalBlockEntity(pos, state); + } + + @Override + public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) { + if(world.getBlockEntity(pos) instanceof TradingPedestalBlockEntity be) { +// player.sendMessage(Text.literal(be.sellingItem.getName().getString() + " x" + be.sellingItem.getCount())); +// player.sendMessage(Text.literal(be.chargeItem.getName().getString() + " x" + be.chargeItem.getCount())); + + if(!be.sellingItem.isEmpty()) { + if(!world.isClient()) { + dropStack(world, pos.up(), be.sellingItem.copy()); + be.sellingItem = ItemStack.EMPTY; + be.updateListeners(); + } + return ActionResult.SUCCESS; + } + } + return super.onUse(state, world, pos, player, hand, hit); + } +} diff --git a/src/main/java/artifality/block/UpgradingPedestalBlock.java b/src/main/java/artifality/block/UpgradingPedestalBlock.java index 4198b75..c84044a 100644 --- a/src/main/java/artifality/block/UpgradingPedestalBlock.java +++ b/src/main/java/artifality/block/UpgradingPedestalBlock.java @@ -48,7 +48,7 @@ else if(stack.isOf(Items.NETHER_STAR) && getCharges(state) != 4) { stack.decrement(1); return ActionResult.SUCCESS; } - else if(item instanceof ArtifactItem artifact && artifact.config.hasTiers) { + else if(item instanceof ArtifactItem artifact && artifact.artifactSettings.hasTiers) { if(getCharges(state) == 3 && TiersUtils.getTier(stack) == 1) { world.playSound(null, pos.getX() + 0.5D, pos.getY() + 0.5D, pos.getZ() + 0.5D, SoundEvents.BLOCK_RESPAWN_ANCHOR_DEPLETE.value(), SoundCategory.BLOCKS, 1.0F, 1.0F); player.setStackInHand(Hand.MAIN_HAND, TiersUtils.withTier(item, 2)); diff --git a/src/main/java/artifality/block/entity/TradingPedestalBlockEntity.java b/src/main/java/artifality/block/entity/TradingPedestalBlockEntity.java new file mode 100644 index 0000000..1d9c228 --- /dev/null +++ b/src/main/java/artifality/block/entity/TradingPedestalBlockEntity.java @@ -0,0 +1,85 @@ +package artifality.block.entity; + +import artifality.registry.ArtifalityBlockEntities; +import artifality.registry.ArtifalityItems; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.network.listener.ClientPlayPacketListener; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket; +import net.minecraft.registry.Registries; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import org.jetbrains.annotations.Nullable; + +public class TradingPedestalBlockEntity extends BlockEntity { + public ItemStack sellingItem = ItemStack.EMPTY; + public ItemStack chargeItem = new ItemStack(ArtifalityItems.LUNAR_CRYSTAL, 10); + + public TradingPedestalBlockEntity(BlockPos pos, BlockState state) { + super(ArtifalityBlockEntities.TRADING_PEDESTAL, pos, state); + } + + @Override + public void writeNbt(NbtCompound nbt) { + super.writeNbt(nbt); + + NbtCompound sellingItemNbt = new NbtCompound(); + sellingItemNbt.putString("item", Registries.ITEM.getId(sellingItem.getItem()).toString()); + sellingItemNbt.put("nbt", sellingItem.getOrCreateNbt()); + sellingItemNbt.putInt("count", sellingItem.getCount()); + nbt.put("sellingItem", sellingItemNbt); + + NbtCompound chargeItemNbt = new NbtCompound(); + chargeItemNbt.putString("item", Registries.ITEM.getId(chargeItem.getItem()).toString()); + chargeItemNbt.put("nbt", chargeItem.getOrCreateNbt()); + chargeItemNbt.putInt("count", chargeItem.getCount()); + nbt.put("chargeItem", chargeItemNbt); + } + + @Override + public void readNbt(NbtCompound nbt) { + super.readNbt(nbt); + + if(nbt.contains("sellingItem")) { + NbtCompound sellingItemNbt = nbt.getCompound("sellingItem"); + var item = Registries.ITEM.getOrEmpty(new Identifier(sellingItemNbt.getString("item"))); + + if(item.isPresent()) { + this.sellingItem = new ItemStack(item.get(), sellingItemNbt.getInt("count")); + this.sellingItem.setNbt((NbtCompound)sellingItemNbt.get("nbt")); + } + } + + if(nbt.contains("chargeItem")) { + NbtCompound chargeItemNbt = nbt.getCompound("chargeItem"); + var item = Registries.ITEM.getOrEmpty(new Identifier(chargeItemNbt.getString("item"))); + + if(item.isPresent()) { + this.chargeItem = new ItemStack(item.get(), chargeItemNbt.getInt("count")); + this.chargeItem.setNbt((NbtCompound)chargeItemNbt.get("nbt")); + } + } + } + + @Override + public NbtCompound toInitialChunkDataNbt() { + NbtCompound nbtCompound = new NbtCompound(); + this.writeNbt(nbtCompound); + return nbtCompound; + } + + @Nullable + @Override + public Packet toUpdatePacket() { + return BlockEntityUpdateS2CPacket.create(this); + } + + public void updateListeners() { + this.markDirty(); + this.getWorld().updateListeners(this.getPos(), this.getCachedState(), this.getCachedState(), Block.NOTIFY_ALL); + } +} diff --git a/src/main/java/artifality/client/ArtifalityClient.java b/src/main/java/artifality/client/ArtifalityClient.java index 0834e22..8dd37fa 100644 --- a/src/main/java/artifality/client/ArtifalityClient.java +++ b/src/main/java/artifality/client/ArtifalityClient.java @@ -3,7 +3,10 @@ import artifality.ArtifalityMod; import artifality.block.CrateBlock; import artifality.block.base.*; +import artifality.client.render.TradingPedestalHud; +import artifality.client.render.TradingPedestalRenderer; import artifality.item.base.ArtifactItem; +import artifality.registry.ArtifalityBlockEntities; import artifality.registry.ArtifalityBlocks; import artifality.api.TwoModelsItemRegistry; import artifality.registry.ArtifalityItems; @@ -12,24 +15,25 @@ import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin; -import net.fabricmc.fabric.api.resource.ResourceManagerHelper; -import net.fabricmc.fabric.api.resource.ResourcePackActivationType; -import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.render.RenderLayer; +import net.minecraft.client.render.block.entity.BlockEntityRendererFactories; import net.minecraft.client.util.ModelIdentifier; public class ArtifalityClient implements ClientModInitializer { @Override public void onInitializeClient() { + BlockEntityRendererFactories.register(ArtifalityBlockEntities.TRADING_PEDESTAL, ctx -> new TradingPedestalRenderer<>()); + + TradingPedestalHud.register(); ArtifalityParticles.register(); ArtifalityItems.ITEMS.forEach((id, item) -> { if(item instanceof ArtifactItem artifact) { - if (artifact.config.renderer != null) { - TrinketRendererRegistry.registerRenderer(item, artifact.config.renderer); + if (artifact.artifactSettings.renderer != null) { + TrinketRendererRegistry.registerRenderer(item, artifact.artifactSettings.renderer); } - if(artifact.config.hasTwoModels) { + if(artifact.artifactSettings.hasTwoModels) { TwoModelsItemRegistry.register(item); } } @@ -71,7 +75,7 @@ public void onInitializeClient() { // }); // Thanks Juce! :) - FabricLoader.getInstance().getModContainer(ArtifalityMod.MOD_ID).ifPresent(artifality -> - ResourceManagerHelper.registerBuiltinResourcePack(ArtifalityMod.id("fancyclusters"), artifality, ResourcePackActivationType.NORMAL)); +// FabricLoader.getInstance().getModContainer(ArtifalityMod.MOD_ID).ifPresent(artifality -> +// ResourceManagerHelper.registerBuiltinResourcePack(ArtifalityMod.id("fancyclusters"), artifality, ResourcePackActivationType.NORMAL)); } } diff --git a/src/main/java/artifality/client/render/TradingPedestalHud.java b/src/main/java/artifality/client/render/TradingPedestalHud.java new file mode 100644 index 0000000..943c271 --- /dev/null +++ b/src/main/java/artifality/client/render/TradingPedestalHud.java @@ -0,0 +1,37 @@ +package artifality.client.render; + +import artifality.block.TradingPedestalBlock; +import artifality.block.entity.TradingPedestalBlockEntity; +import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; +import net.minecraft.block.BlockState; +import net.minecraft.client.MinecraftClient; +import net.minecraft.text.Text; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.hit.HitResult; +import net.minecraft.util.math.BlockPos; + +public class TradingPedestalHud { + + public static void register() { + HudRenderCallback.EVENT.register((drawContext, tickDelta) -> { + MinecraftClient client = MinecraftClient.getInstance(); + HitResult hitResult = client.crosshairTarget; + + if (hitResult != null && hitResult.getType() == HitResult.Type.BLOCK) { + BlockPos blockPos = ((BlockHitResult)hitResult).getBlockPos(); + BlockState block = client.world.getBlockState(blockPos); + + if(block.getBlock() instanceof TradingPedestalBlock && client.world.getBlockEntity(blockPos) instanceof TradingPedestalBlockEntity entity && !entity.sellingItem.isEmpty()) { + drawContext.getMatrices().push(); + var height = drawContext.getScaledWindowHeight(); + var width = drawContext.getScaledWindowWidth(); + + var text = Text.literal("Requires: " + entity.chargeItem.getName().getString() + " x" + entity.chargeItem.getCount()); + drawContext.drawItem(entity.chargeItem, (width / 2) + 7, (height / 2) - 7); + drawContext.drawTextWithShadow(client.textRenderer, text, (width / 2) - (client.textRenderer.getWidth(text) / 2), (height / 2) + 10, 16777215); + drawContext.getMatrices().pop(); + } + } + }); + } +} diff --git a/src/main/java/artifality/client/render/TradingPedestalRenderer.java b/src/main/java/artifality/client/render/TradingPedestalRenderer.java new file mode 100644 index 0000000..0b2e3c9 --- /dev/null +++ b/src/main/java/artifality/client/render/TradingPedestalRenderer.java @@ -0,0 +1,45 @@ +package artifality.client.render; + +import artifality.block.entity.TradingPedestalBlockEntity; +import net.minecraft.client.MinecraftClient; +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.block.entity.BlockEntityRenderer; +import net.minecraft.client.render.model.BakedModel; +import net.minecraft.client.render.model.json.ModelTransformationMode; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.BlockItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.RotationAxis; +import org.joml.Vector3f; + +public class TradingPedestalRenderer implements BlockEntityRenderer { + + @Override + public void render(T entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { + var world = entity.getWorld(); + + if(world != null && !entity.isRemoved()) { + matrices.push(); + + ItemStack stack = entity.sellingItem; + MinecraftClient client = MinecraftClient.getInstance(); + BakedModel model = client.getItemRenderer().getModel(stack, world, null, 0); + Vector3f translate = model.getTransformation().ground.translation; + matrices.translate(translate.x() + 0.5, translate.y() + 1.25, translate.z() + 0.5); + + if (stack.getItem() instanceof BlockItem) { + matrices.scale(1.5F, 1.5F, 1.5F); + } + else { + matrices.scale(1.25F, 1.25F, 1.25F); + } + + float rotation = ((int) (MinecraftClient.getInstance().world.getTime() % 314) + tickDelta) / 25.0F + 6.0F; + matrices.multiply(RotationAxis.POSITIVE_Y.rotation(rotation)); + client.getItemRenderer().renderItem(stack, ModelTransformationMode.GROUND, false, matrices, vertexConsumers, light, overlay, model); + + matrices.pop(); + } + } + +} diff --git a/src/main/java/artifality/command/ArtifalityCommands.java b/src/main/java/artifality/command/ArtifalityCommands.java new file mode 100644 index 0000000..7b7525e --- /dev/null +++ b/src/main/java/artifality/command/ArtifalityCommands.java @@ -0,0 +1,45 @@ +package artifality.command; + +import artifality.block.entity.TradingPedestalBlockEntity; +import artifality.registry.ArtifalityBlocks; +import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.arguments.IntegerArgumentType; +import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; +import net.minecraft.command.CommandRegistryAccess; +import net.minecraft.command.argument.ItemStackArgumentType; +import net.minecraft.item.ItemStack; +import net.minecraft.server.command.CommandManager; +import net.minecraft.server.command.ServerCommandSource; +import net.minecraft.util.math.BlockPos; + +import static net.minecraft.server.command.CommandManager.literal; +import static net.minecraft.server.command.CommandManager.argument; + +public class ArtifalityCommands { + + public static void init() { + CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> ArtifalityCommands.register(dispatcher, registryAccess)); + } + + private static void register(CommandDispatcher dispatcher, CommandRegistryAccess commandRegistryAccess) { + dispatcher.register(literal("artifality").then(literal("create-trading-pedestal").requires((source) -> source.hasPermissionLevel(4)) + .then(argument("selling-item", ItemStackArgumentType.itemStack(commandRegistryAccess)) + .then(CommandManager.argument("selling-count", IntegerArgumentType.integer(1)) + .then(CommandManager.argument("charge-item", ItemStackArgumentType.itemStack(commandRegistryAccess)) + .then(argument("charge-count", IntegerArgumentType.integer(1)).executes(context -> { + ItemStack sellingItem = ItemStackArgumentType.getItemStackArgument(context, "selling-item").createStack(IntegerArgumentType.getInteger(context, "selling-count"), true); + ItemStack chargeItem = ItemStackArgumentType.getItemStackArgument(context, "charge-item").createStack(IntegerArgumentType.getInteger(context, "charge-count"), true); + BlockPos pos = context.getSource().getPlayer().getBlockPos(); + + context.getSource().getWorld().setBlockState(pos, ArtifalityBlocks.LUNAR_TRADING_PEDESTAL.getDefaultState()); + + if(context.getSource().getWorld().getBlockEntity(pos) instanceof TradingPedestalBlockEntity be) { + be.sellingItem = sellingItem.copy(); + be.chargeItem = chargeItem.copy(); + be.updateListeners(); + } + + return 1; + }))))))); + } +} diff --git a/src/main/java/artifality/extension/PlayerExtension.java b/src/main/java/artifality/extension/PlayerExtension.java new file mode 100644 index 0000000..3404ffb --- /dev/null +++ b/src/main/java/artifality/extension/PlayerExtension.java @@ -0,0 +1,30 @@ +package artifality.extension; + +import net.minecraft.util.Identifier; +import net.minecraft.util.math.Vec3d; + +public interface PlayerExtension { + void savePrevPosition(); + void teleportToPrevPosition(); + void resetPrevPosition(); + PlayerPosition getPrevPosition(); + void setPrevPosition(PlayerPosition pos); + + class PlayerPosition { + public Vec3d pos = null; + public float yaw = 0; + public float pitch = 0; + public Identifier dimension = null; + + public PlayerPosition(Vec3d pos, float yaw, float pitch, Identifier dimension) { + this.pos = pos; + this.yaw = yaw; + this.pitch = pitch; + this.dimension = dimension; + } + + public PlayerPosition copy() { + return new PlayerPosition(this.pos, this.yaw, this.pitch, this.dimension); + } + } +} diff --git a/src/main/java/artifality/item/ArtifactSettings.java b/src/main/java/artifality/item/ArtifactSettings.java index c7f2eec..7a53be8 100644 --- a/src/main/java/artifality/item/ArtifactSettings.java +++ b/src/main/java/artifality/item/ArtifactSettings.java @@ -6,34 +6,40 @@ public class ArtifactSettings { public final FabricItemSettings fabricItemSettings; - public final Parameters parameters = new Parameters(); + public ArtifactRarity rarity = ArtifactRarity.COMMON; + public TrinketRenderer renderer; + public boolean isCrateLoot = true; + public boolean isTrinket = false; + public boolean hasTiers = false; + public boolean hasTwoModels = false; + public ArtifactSettings() { fabricItemSettings = new FabricItemSettings(); } public ArtifactSettings rarity(ArtifactRarity rarity) { - this.parameters.rarity = rarity; + this.rarity = rarity; return this; } public ArtifactSettings nonCrateItem() { - this.parameters.isCrateLoot = false; + this.isCrateLoot = false; return this; } public ArtifactSettings twoModeled() { - this.parameters.hasTwoModels = true; + this.hasTwoModels = true; return this; } public ArtifactSettings trinket() { - this.parameters.isTrinket = true; + this.isTrinket = true; return this; } public ArtifactSettings tiered() { - this.parameters.hasTiers = true; + this.hasTiers = true; return this; } @@ -48,16 +54,7 @@ public ArtifactSettings maxDamage(int maxDamage) { } public ArtifactSettings renderer(TrinketRenderer renderer) { - this.parameters.renderer = renderer; + this.renderer = renderer; return this; } - - public static class Parameters { - public ArtifactRarity rarity = ArtifactRarity.COMMON; - public TrinketRenderer renderer; - public boolean isCrateLoot = true; - public boolean isTrinket = false; - public boolean hasTiers = false; - public boolean hasTwoModels = false; - } } diff --git a/src/main/java/artifality/item/base/ArtifactItem.java b/src/main/java/artifality/item/base/ArtifactItem.java index c3f7a15..d15081e 100644 --- a/src/main/java/artifality/item/base/ArtifactItem.java +++ b/src/main/java/artifality/item/base/ArtifactItem.java @@ -15,15 +15,13 @@ import java.util.List; public class ArtifactItem extends BaseItem { - public final ArtifactSettings.Parameters config; - public final ArtifactSettings settings; + public final ArtifactSettings artifactSettings; public ArtifactItem(ArtifactSettings settings) { super(settings.fabricItemSettings); - this.settings = settings; - this.config = settings.parameters; + this.artifactSettings = settings; - if(config.isTrinket) { + if(artifactSettings.isTrinket) { TrinketsApi.registerTrinket(this, (Trinket)this); } } @@ -33,7 +31,7 @@ public void appendTooltipInfo(ItemStack stack, List tooltip) { @Override public boolean hasGlint(ItemStack stack) { - if(config.hasTiers) { + if(artifactSettings.hasTiers) { return TiersUtils.getTier(stack) == 3; } return false; @@ -41,7 +39,7 @@ public boolean hasGlint(ItemStack stack) { @Override public ActionResult useOnBlock(ItemUsageContext context) { - if (config.hasTiers) { + if (artifactSettings.hasTiers) { if(context.getWorld().getBlockState(context.getBlockPos()).isOf(ArtifalityBlocks.UPGRADING_PEDESTAL)) { return ActionResult.FAIL; } @@ -49,9 +47,9 @@ public ActionResult useOnBlock(ItemUsageContext context) { return super.useOnBlock(context); } - @Override - public Text getName(ItemStack stack) { - Color color = config.rarity.getColor(); - return Text.translatable(this.getTranslationKey(stack)).setStyle(Style.EMPTY.withColor(color.getRGB())); - } +// @Override +// public Text getName(ItemStack stack) { +// Color color = artifactSettings.rarity.getColor(); +// return Text.translatable(this.getTranslationKey(stack)).setStyle(Style.EMPTY.withColor(color.getRGB())); +// } } diff --git a/src/main/java/artifality/list/CrystalClusterPacks.java b/src/main/java/artifality/list/CrystalClusterPacks.java index cfe9df3..3c317ea 100644 --- a/src/main/java/artifality/list/CrystalClusterPacks.java +++ b/src/main/java/artifality/list/CrystalClusterPacks.java @@ -29,12 +29,12 @@ public class CrystalClusterPacks { MEDIUM_LIFE_CRYSTAL_CLUSTER, LIFE_CRYSTAL_CLUSTER ); - add( - WRATH_CRYSTAL_GEODE, - SMALL_WRATH_CRYSTAL_CLUSTER, - MEDIUM_WRATH_CRYSTAL_CLUSTER, - WRATH_CRYSTAL_CLUSTER - ); +// add( +// WRATH_CRYSTAL_GEODE, +// SMALL_WRATH_CRYSTAL_CLUSTER, +// MEDIUM_WRATH_CRYSTAL_CLUSTER, +// WRATH_CRYSTAL_CLUSTER +// ); } public static void add(Block geode, Block... clusters) { diff --git a/src/main/java/artifality/list/Crystallizations.java b/src/main/java/artifality/list/Crystallizations.java deleted file mode 100644 index 71edfef..0000000 --- a/src/main/java/artifality/list/Crystallizations.java +++ /dev/null @@ -1,19 +0,0 @@ -package artifality.list; - -import artifality.list.crystallization.*; - -import java.util.ArrayList; - -public class Crystallizations { - public static final ArrayList ELEMENTS = new ArrayList<>(); - - public static final Crystallization INCREMENTAL = add(new IncrementalElement("incremental")); - public static final Crystallization LUNAR = add(new LunarElement("lunar")); - public static final Crystallization LIFE = add(new LifeElement("life")); -// public static final Crystallization WRATH = add(new WrathElement("wrath")); - - public static Crystallization add(Crystallization element) { - ELEMENTS.add(element); - return element; - } -} diff --git a/src/main/java/artifality/list/crystallization/Crystallization.java b/src/main/java/artifality/list/crystallization/Crystallization.java deleted file mode 100644 index c25d16c..0000000 --- a/src/main/java/artifality/list/crystallization/Crystallization.java +++ /dev/null @@ -1,22 +0,0 @@ -package artifality.list.crystallization; - -import net.minecraft.entity.LivingEntity; -import net.minecraft.world.World; - -public abstract class Crystallization { - String name; - - public Crystallization(String name){ - this.name = name; - } - - public String getName() { - return name; - } - - public abstract void tick(LivingEntity entity, World world); - - public abstract void onAttack(LivingEntity target, World world); - - public abstract void onInit(LivingEntity entity, World world); -} diff --git a/src/main/java/artifality/list/crystallization/IncrementalElement.java b/src/main/java/artifality/list/crystallization/IncrementalElement.java deleted file mode 100644 index 0c18202..0000000 --- a/src/main/java/artifality/list/crystallization/IncrementalElement.java +++ /dev/null @@ -1,39 +0,0 @@ -package artifality.list.crystallization; - -import artifality.util.EffectsUtils; -import com.google.common.collect.ImmutableMultimap; -import com.google.common.collect.Multimap; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.attribute.EntityAttribute; -import net.minecraft.entity.attribute.EntityAttributeModifier; -import net.minecraft.entity.attribute.EntityAttributes; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.world.World; - -public class IncrementalElement extends Crystallization { - - public IncrementalElement(String name) { - super(name); - } - - @Override - public void tick(LivingEntity entity, World world) { - EffectsUtils.ticking(entity, StatusEffects.SPEED, 1); - EffectsUtils.ticking(entity, StatusEffects.JUMP_BOOST, 1); - } - - @Override - public void onAttack(LivingEntity target, World world) { - - } - - @Override - public void onInit(LivingEntity entity, World world) { - Multimap attributes; - ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); - builder.put(EntityAttributes.GENERIC_MAX_HEALTH, new EntityAttributeModifier("Element modifier", 15, EntityAttributeModifier.Operation.ADDITION)); - attributes = builder.build(); - entity.getAttributes().addTemporaryModifiers(attributes); - entity.heal(15); - } -} diff --git a/src/main/java/artifality/list/crystallization/LifeElement.java b/src/main/java/artifality/list/crystallization/LifeElement.java deleted file mode 100644 index 7227e11..0000000 --- a/src/main/java/artifality/list/crystallization/LifeElement.java +++ /dev/null @@ -1,36 +0,0 @@ -package artifality.list.crystallization; - -import com.google.common.collect.ImmutableMultimap; -import com.google.common.collect.Multimap; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.attribute.EntityAttribute; -import net.minecraft.entity.attribute.EntityAttributeModifier; -import net.minecraft.entity.attribute.EntityAttributes; -import net.minecraft.world.World; - -public class LifeElement extends Crystallization { - - public LifeElement(String name) { - super(name); - } - - @Override - public void tick(LivingEntity entity, World world) { - - } - - @Override - public void onAttack(LivingEntity target, World world) { - - } - - @Override - public void onInit(LivingEntity entity, World world) { - Multimap attributes; - ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); - builder.put(EntityAttributes.GENERIC_MAX_HEALTH, new EntityAttributeModifier("Element modifier", 30, EntityAttributeModifier.Operation.ADDITION)); - attributes = builder.build(); - entity.getAttributes().addTemporaryModifiers(attributes); - entity.heal(30); - } -} diff --git a/src/main/java/artifality/list/crystallization/LunarElement.java b/src/main/java/artifality/list/crystallization/LunarElement.java deleted file mode 100644 index f04c68b..0000000 --- a/src/main/java/artifality/list/crystallization/LunarElement.java +++ /dev/null @@ -1,40 +0,0 @@ -package artifality.list.crystallization; - -import artifality.util.EffectsUtils; -import com.google.common.collect.ImmutableMultimap; -import com.google.common.collect.Multimap; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.attribute.EntityAttribute; -import net.minecraft.entity.attribute.EntityAttributeModifier; -import net.minecraft.entity.attribute.EntityAttributes; -import net.minecraft.entity.effect.StatusEffectInstance; -import net.minecraft.world.World; - -public class LunarElement extends Crystallization { - - public LunarElement(String name) { - super(name); - } - - @Override - public void tick(LivingEntity entity, World world) { - if (world.getTime() % 100L == 0L) { - entity.addStatusEffect(new StatusEffectInstance(EffectsUtils.getRandomPositive(), 100, 0, true, true)); - } - } - - @Override - public void onAttack(LivingEntity target, World world) { - target.addStatusEffect(new StatusEffectInstance(EffectsUtils.getRandomNegative(), 100, 0, true, true)); - } - - @Override - public void onInit(LivingEntity entity, World world) { - Multimap attributes; - ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); - builder.put(EntityAttributes.GENERIC_MAX_HEALTH, new EntityAttributeModifier("Element modifier", 15, EntityAttributeModifier.Operation.ADDITION)); - attributes = builder.build(); - entity.getAttributes().addTemporaryModifiers(attributes); - entity.heal(15); - } -} diff --git a/src/main/java/artifality/list/crystallization/WrathElement.java b/src/main/java/artifality/list/crystallization/WrathElement.java deleted file mode 100644 index d547615..0000000 --- a/src/main/java/artifality/list/crystallization/WrathElement.java +++ /dev/null @@ -1,39 +0,0 @@ -package artifality.list.crystallization; - -import artifality.util.EffectsUtils; -import com.google.common.collect.ImmutableMultimap; -import com.google.common.collect.Multimap; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.attribute.EntityAttribute; -import net.minecraft.entity.attribute.EntityAttributeModifier; -import net.minecraft.entity.attribute.EntityAttributes; -import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.world.World; - -public class WrathElement extends Crystallization { - - public WrathElement(String name) { - super(name); - } - - @Override - public void tick(LivingEntity entity, World world) { - EffectsUtils.ticking(entity, StatusEffects.STRENGTH, 0); - EffectsUtils.ticking(entity, StatusEffects.SPEED, 0); - } - - @Override - public void onAttack(LivingEntity target, World world) { - - } - - @Override - public void onInit(LivingEntity entity, World world) { - Multimap attributes; - ImmutableMultimap.Builder builder = ImmutableMultimap.builder(); - builder.put(EntityAttributes.GENERIC_MAX_HEALTH, new EntityAttributeModifier("Element modifier", 15, EntityAttributeModifier.Operation.ADDITION)); - attributes = builder.build(); - entity.getAttributes().addTemporaryModifiers(attributes); - entity.heal(15); - } -} diff --git a/src/main/java/artifality/mixin/common/PlayerMixin.java b/src/main/java/artifality/mixin/common/PlayerMixin.java index be94eae..525b975 100644 --- a/src/main/java/artifality/mixin/common/PlayerMixin.java +++ b/src/main/java/artifality/mixin/common/PlayerMixin.java @@ -1,5 +1,6 @@ package artifality.mixin.common; +import artifality.extension.PlayerExtension; import artifality.registry.ArtifalityEnchants; import artifality.registry.ArtifalityItems; import artifality.item.BalloonItem; @@ -7,6 +8,7 @@ import artifality.util.TiersUtils; import artifality.util.TrinketsUtils; import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.EntityType; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.entity.damage.DamageSource; @@ -14,7 +16,10 @@ import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NbtCompound; import net.minecraft.util.Hand; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; @@ -23,10 +28,18 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import java.util.Set; + @Mixin(PlayerEntity.class) -public class PlayerMixin { +abstract class PlayerMixin extends LivingEntity implements PlayerExtension { PlayerEntity self = (PlayerEntity)(Object)this; + public PlayerExtension.PlayerPosition prevPosition = null; + + protected PlayerMixin(EntityType entityType, World world) { + super(entityType, world); + } + @Inject(method = "getAttackCooldownProgressPerTick", at = @At("HEAD"), cancellable = true) void getAttackCooldownProgressPerTick(CallbackInfoReturnable cir) { if(EnchantmentHelper.get(self.getStackInHand(Hand.MAIN_HAND)).containsKey(ArtifalityEnchants.LUNAR_DAMAGE)) { @@ -98,4 +111,71 @@ void useBalloon() { } }); } + + @Inject(method = "writeCustomDataToNbt", at = @At("HEAD")) + void writeCustomDataToNbt(NbtCompound nbt, CallbackInfo ci) { + + if(prevPosition != null) { + NbtCompound compound = new NbtCompound(); + compound.putDouble("x", prevPosition.pos.x); + compound.putDouble("y", prevPosition.pos.y); + compound.putDouble("z", prevPosition.pos.z); + compound.putFloat("yaw", prevPosition.yaw); + compound.putFloat("pitch", prevPosition.pitch); + compound.putString("dimension", prevPosition.dimension.toString()); + + nbt.put("PrevPositionBeforeBazaar", compound); + } + } + + @Inject(method = "readCustomDataFromNbt", at = @At("HEAD")) + void readCustomDataFromNbt(NbtCompound nbt, CallbackInfo ci) { + if(nbt.contains("PrevPositionBeforeBazaar")) { + NbtCompound compound = nbt.getCompound("PrevPositionBeforeBazaar"); + prevPosition = new PlayerPosition( + new Vec3d(compound.getDouble("x"), compound.getDouble("y"), compound.getDouble("z")), + compound.getFloat("yaw"), + compound.getFloat("pitch"), + new Identifier(compound.getString("dimension")) + ); + } + } + + @Override + public void savePrevPosition() { + prevPosition = new PlayerPosition( + getPos(), + getYaw(), + getPitch(), + getWorld().getDimensionKey().getValue() + ); + } + + @Override + public void teleportToPrevPosition() { + if(prevPosition != null) { + for(var world : getServer().getWorlds()) { + if(world.getDimensionKey().getValue().equals(prevPosition.dimension)) { + teleport(world, prevPosition.pos.x, prevPosition.pos.y + 0.5, prevPosition.pos.z, Set.of(), prevPosition.yaw, prevPosition.pitch); + resetPrevPosition(); + break; + } + } + } + } + + @Override + public void resetPrevPosition() { + prevPosition = null; + } + + @Override + public void setPrevPosition(PlayerPosition pos) { + this.prevPosition = pos; + } + + @Override + public PlayerPosition getPrevPosition() { + return this.prevPosition; + } } diff --git a/src/main/java/artifality/registry/ArtifalityBlockEntities.java b/src/main/java/artifality/registry/ArtifalityBlockEntities.java new file mode 100644 index 0000000..13005d6 --- /dev/null +++ b/src/main/java/artifality/registry/ArtifalityBlockEntities.java @@ -0,0 +1,36 @@ +package artifality.registry; + +import artifality.ArtifalityMod; +import artifality.block.TradingPedestalBlock; +import artifality.block.entity.TradingPedestalBlockEntity; +import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder; +import net.minecraft.block.entity.BlockEntityType; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; + +import java.util.ArrayList; + +public class ArtifalityBlockEntities { + + public static final BlockEntityType TRADING_PEDESTAL = Registry.register( + Registries.BLOCK_ENTITY_TYPE, + ArtifalityMod.id("trading_pedestal"), + FabricBlockEntityTypeBuilder.create(TradingPedestalBlockEntity::new, collectPedestals()).build() + ); + + public static void init() { + + } + + public static TradingPedestalBlock[] collectPedestals() { + ArrayList pedestals = new ArrayList<>(); + + ArtifalityBlocks.BLOCKS.forEach((id, block) -> { + if(block instanceof TradingPedestalBlock pedestal) { + pedestals.add(pedestal); + } + }); + + return pedestals.toArray(new TradingPedestalBlock[0]); + } +} diff --git a/src/main/java/artifality/registry/ArtifalityBlocks.java b/src/main/java/artifality/registry/ArtifalityBlocks.java index 842c842..2a1dfa7 100644 --- a/src/main/java/artifality/registry/ArtifalityBlocks.java +++ b/src/main/java/artifality/registry/ArtifalityBlocks.java @@ -1,9 +1,7 @@ package artifality.registry; import artifality.ArtifalityMod; -import artifality.block.CrateBlock; -import artifality.block.CrystalGeodeBlock; -import artifality.block.UpgradingPedestalBlock; +import artifality.block.*; import artifality.block.base.*; import artifality.item.base.BaseBlockItem; import artifality.list.ArtifactRarity; @@ -27,10 +25,10 @@ public class ArtifalityBlocks { public static final Map ITEMS = new LinkedHashMap<>(); public static final Map BLOCKS = new LinkedHashMap<>(); - public static final Block COMMON_CRATE = add("common_crate", new CrateBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.WOOD).luminance(7), ArtifactRarity.COMMON)); - public static final Block RARE_CRATE = add("rare_crate", new CrateBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.STONE).luminance(7), ArtifactRarity.RARE)); - public static final Block LEGENDARY_CRATE = add("legendary_crate", new CrateBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.STONE).luminance(7), ArtifactRarity.LEGENDARY)); - public static final Block LUNAR_CRATE = add("lunar_crate", new CrateBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.STONE).luminance(7), ArtifactRarity.RARE)); +// public static final Block COMMON_CRATE = add("common_crate", new CrateBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.WOOD).luminance(7), ArtifactRarity.COMMON)); +// public static final Block RARE_CRATE = add("rare_crate", new CrateBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.STONE).luminance(7), ArtifactRarity.RARE)); +// public static final Block LEGENDARY_CRATE = add("legendary_crate", new CrateBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.STONE).luminance(7), ArtifactRarity.LEGENDARY)); +// public static final Block LUNAR_CRATE = add("lunar_crate", new CrateBlock(copyOf(WHITE_WOOL).sounds(BlockSoundGroup.STONE).luminance(7), ArtifactRarity.RARE)); public static final Block SMALL_INCREMENTAL_CRYSTAL_CLUSTER = cluster("small_incremental_crystal_cluster", "small"); public static final Block MEDIUM_INCREMENTAL_CRYSTAL_CLUSTER = cluster("medium_incremental_crystal_cluster", "medium"); @@ -74,26 +72,30 @@ public class ArtifalityBlocks { public static final Block LIFE_CRYSTAL_SLAB = crystalSlab("life_crystal_slab"); public static final Block LIFE_CRYSTAL_STAIRS = crystalStairs("life_crystal_stairs"); - public static final Block SMALL_WRATH_CRYSTAL_CLUSTER = cluster("small_wrath_crystal_cluster", "small"); - public static final Block MEDIUM_WRATH_CRYSTAL_CLUSTER = cluster("medium_wrath_crystal_cluster", "medium"); - public static final Block WRATH_CRYSTAL_CLUSTER = cluster("wrath_crystal_cluster", "large"); - - public static final Block WRATH_CRYSTAL_GEODE = geode("wrath_crystal_geode", - SMALL_WRATH_CRYSTAL_CLUSTER, - MEDIUM_WRATH_CRYSTAL_CLUSTER, - WRATH_CRYSTAL_CLUSTER - ); - - public static final Block WRATH_CRYSTAL_BLOCK = crystalBlock("wrath_crystal_block"); - public static final Block WRATH_CRYSTAL_SLAB = crystalSlab("wrath_crystal_slab"); - public static final Block WRATH_CRYSTAL_STAIRS = crystalStairs("wrath_crystal_stairs"); +// public static final Block SMALL_WRATH_CRYSTAL_CLUSTER = cluster("small_wrath_crystal_cluster", "small"); +// public static final Block MEDIUM_WRATH_CRYSTAL_CLUSTER = cluster("medium_wrath_crystal_cluster", "medium"); +// public static final Block WRATH_CRYSTAL_CLUSTER = cluster("wrath_crystal_cluster", "large"); +// +// public static final Block WRATH_CRYSTAL_GEODE = geode("wrath_crystal_geode", +// SMALL_WRATH_CRYSTAL_CLUSTER, +// MEDIUM_WRATH_CRYSTAL_CLUSTER, +// WRATH_CRYSTAL_CLUSTER +// ); +// +// public static final Block WRATH_CRYSTAL_BLOCK = crystalBlock("wrath_crystal_block"); +// public static final Block WRATH_CRYSTAL_SLAB = crystalSlab("wrath_crystal_slab"); +// public static final Block WRATH_CRYSTAL_STAIRS = crystalStairs("wrath_crystal_stairs"); public static final Block INCREMENTAL_CRYSTAL_LENS = lens("incremental_crystal_lens", LensEffects.INCREMENTAL); public static final Block LUNAR_CRYSTAL_LENS = lens("lunar_crystal_lens", LensEffects.LUNAR); public static final Block LIFE_CRYSTAL_LENS = lens("life_crystal_lens", LensEffects.LIFE); - public static final Block WRATH_CRYSTAL_LENS = lens("wrath_crystal_lens", LensEffects.WRATH); +// public static final Block WRATH_CRYSTAL_LENS = lens("wrath_crystal_lens", LensEffects.WRATH); public static final Block EMPTY_LENS = lens("empty_lens", LensEffects.EMPTY); + public static final Block LUNASTONE = add("lunastone", new BaseBlock(copyOf(Blocks.STONE))); + public static final Block LUNAR_PORTAL = add("lunar_portal", new LunarPortalBlock(copyOf(Blocks.STONE))); + public static final Block LUNAR_TRADING_PEDESTAL = add("lunar_trading_pedestal", new TradingPedestalBlock(copyOf(Blocks.STONE).nonOpaque().notSolid())); + public static final Block UPGRADING_PEDESTAL = add("upgrading_pedestal", new UpgradingPedestalBlock(copyOf(COBBLESTONE).luminance(state -> state.get(UpgradingPedestalBlock.CHARGES) * 3))); // public static final Block LUNAR_PEDESTAL = add("lunar_pedestal", new BaseBlock(copyOf(COBBLESTONE))); diff --git a/src/main/java/artifality/registry/ArtifalityDimensions.java b/src/main/java/artifality/registry/ArtifalityDimensions.java new file mode 100644 index 0000000..6aeda80 --- /dev/null +++ b/src/main/java/artifality/registry/ArtifalityDimensions.java @@ -0,0 +1,10 @@ +package artifality.registry; + +import artifality.ArtifalityMod; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.world.World; + +public class ArtifalityDimensions { + public static final RegistryKey LUNAR_BAZAAR = RegistryKey.of(RegistryKeys.WORLD, ArtifalityMod.id("lunar_bazaar")); +} diff --git a/src/main/java/artifality/registry/ArtifalityEvents.java b/src/main/java/artifality/registry/ArtifalityEvents.java index 75834f9..f1a714e 100644 --- a/src/main/java/artifality/registry/ArtifalityEvents.java +++ b/src/main/java/artifality/registry/ArtifalityEvents.java @@ -1,8 +1,70 @@ package artifality.registry; +import artifality.ArtifalityMod; +import artifality.extension.PlayerExtension; +import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; +import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; +import net.fabricmc.fabric.api.event.player.UseBlockCallback; +import net.fabricmc.fabric.api.event.player.UseItemCallback; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.structure.StructurePlacementData; +import net.minecraft.structure.StructureTemplate; +import net.minecraft.util.ActionResult; +import net.minecraft.util.BlockMirror; +import net.minecraft.util.TypedActionResult; +import net.minecraft.util.math.BlockPos; + public class ArtifalityEvents { public static void init() { + + ServerLifecycleEvents.SERVER_STARTED.register(server -> { + var bazaar = server.getWorld(ArtifalityDimensions.LUNAR_BAZAAR); + + StructureTemplate structure = server.getStructureTemplateManager().getTemplateOrBlank(ArtifalityMod.id("lunar_bazaar")); + StructurePlacementData data = new StructurePlacementData().setMirror(BlockMirror.NONE).setIgnoreEntities(true); + structure.place(bazaar, new BlockPos(-32, 0, -32), new BlockPos(0, 0, 0), data, bazaar.getRandom(), Block.FORCE_STATE); + }); + + UseItemCallback.EVENT.register((player, world, hand) -> { + if (!player.isCreative() && world.getDimensionKey().getValue().equals(ArtifalityDimensions.LUNAR_BAZAAR.getValue())) { + return TypedActionResult.fail(ItemStack.EMPTY); + } + + return TypedActionResult.pass(ItemStack.EMPTY); + }); + + UseBlockCallback.EVENT.register((player, world, hand, res) -> { + if (!player.isCreative() && !player.getStackInHand(hand).isEmpty() && world.getDimensionKey().getValue().equals(ArtifalityDimensions.LUNAR_BAZAAR.getValue())) { + return ActionResult.FAIL; + } + + return ActionResult.PASS; + }); + + PlayerBlockBreakEvents.BEFORE.register((world, player, pos, state, blockEntity) -> { + if (!player.isCreative() && world.getDimensionKey().getValue().equals(ArtifalityDimensions.LUNAR_BAZAAR.getValue())) { + return false; + } + + return true; + }); + + ServerLivingEntityEvents.ALLOW_DEATH.register((entity, damageSource, damageAmount) -> { + if(entity instanceof ServerPlayerEntity player && player instanceof PlayerExtension ex) { + if (player.getWorld().getDimensionKey().getValue().equals(ArtifalityDimensions.LUNAR_BAZAAR.getValue())) { + player.setHealth(20F); + ex.teleportToPrevPosition(); + return false; + } + } + + return true; + }); + // ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY.register((world, entity, killedEntity) -> { // if (killedEntity instanceof ElementalExtension extension) { // if (world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT) && extension.artifality$isElemental()) { diff --git a/src/main/java/artifality/registry/ArtifalityItems.java b/src/main/java/artifality/registry/ArtifalityItems.java index 82e599b..deb05be 100644 --- a/src/main/java/artifality/registry/ArtifalityItems.java +++ b/src/main/java/artifality/registry/ArtifalityItems.java @@ -30,7 +30,7 @@ public class ArtifalityItems { public static final Item INCREMENTAL_CRYSTAL = add("incremental_crystal", new BaseItem(settings())); public static final Item LUNAR_CRYSTAL = add("lunar_crystal", new BaseItem(settings())); public static final Item LIFE_CRYSTAL = add("life_crystal", new BaseItem(settings())); - public static final Item WRATH_CRYSTAL = add("wrath_crystal", new BaseItem(settings())); +// public static final Item WRATH_CRYSTAL = add("wrath_crystal", new BaseItem(settings())); public static final Item INCREMENTAL_ORB = add("incremental_orb", new BaseItem(settings())); diff --git a/src/main/java/artifality/util/TooltipAppender.java b/src/main/java/artifality/util/TooltipAppender.java index b1cbb89..3eae9b9 100644 --- a/src/main/java/artifality/util/TooltipAppender.java +++ b/src/main/java/artifality/util/TooltipAppender.java @@ -31,10 +31,11 @@ public static void append(ItemStack stack, List tooltip) { if(!getTooltip(Registries.ITEM.getId(item).getPath()).isEmpty() && shiftPressed(tooltip, item)) { if(item instanceof ArtifactItem artifact) { - if(artifact.config.hasTiers) appendTier(stack, tooltip); + if(artifact.artifactSettings.hasTiers) appendTier(stack, tooltip); } appendItemTooltip(stack, tooltip); - }else if(item instanceof EnchantedBookItem) { + } + else if(item instanceof EnchantedBookItem) { if(!FabricLoader.getInstance().isModLoaded("enchdesc")) { appendEnchantmentTooltip(stack, tooltip); } @@ -44,18 +45,19 @@ public static void append(ItemStack stack, List tooltip) { private static boolean shiftPressed(List tooltip, Item item) { if(!Screen.hasShiftDown()) { if(item instanceof ArtifactItem artifact) { - ArtifactRarity rarity = artifact.config.rarity; - tooltip.add(Text.literal(ofKey(rarity.getName())).setStyle(Style.EMPTY.withColor(rarity.getColor().getRGB()))); +// ArtifactRarity rarity = artifact.artifactSettings.rarity; +// tooltip.add(Text.literal(ofKey(rarity.getName())).setStyle(Style.EMPTY.withColor(rarity.getColor().getRGB()))); } if(!(item instanceof EnchantedBookItem && FabricLoader.getInstance().isModLoaded("enchdesc"))) { tooltip.add(Text.literal("")); tooltip.add(Text.literal(ofKey("press_shift")).formatted(Formatting.GRAY)); } if(item instanceof ArtifactItem artifact) { - if(artifact.config.isTrinket) tooltip.add(Text.literal("")); + if(artifact.artifactSettings.isTrinket) tooltip.add(Text.literal("")); } return false; - }else{ + } + else { return true; } } @@ -77,7 +79,7 @@ private static void appendItemTooltip(ItemStack stack, List tooltip) { } if(stack.getItem() instanceof ArtifactItem artifact) { artifact.appendTooltipInfo(stack, tooltip); - if(artifact.config.isTrinket) tooltip.add(Text.literal("")); + if(artifact.artifactSettings.isTrinket) tooltip.add(Text.literal("")); } } diff --git a/src/main/resources/artifality.accesswidener b/src/main/resources/artifality.accesswidener new file mode 100644 index 0000000..22e331b --- /dev/null +++ b/src/main/resources/artifality.accesswidener @@ -0,0 +1 @@ +accessWidener v1 named \ No newline at end of file diff --git a/src/main/resources/assets/artifality/blockstates/incremental_crystal_block.json b/src/main/resources/assets/artifality/blockstates/incremental_crystal_block.json index 8e9ca0c..c5a8ff4 100644 --- a/src/main/resources/assets/artifality/blockstates/incremental_crystal_block.json +++ b/src/main/resources/assets/artifality/blockstates/incremental_crystal_block.json @@ -1,6 +1,5 @@ { "variants": { - "": { "model": "artifality:block/incremental_crystal_block" - } + "": { "model": "artifality:block/incremental_crystal_block" } } } \ No newline at end of file diff --git a/src/main/resources/assets/artifality/blockstates/lunastone.json b/src/main/resources/assets/artifality/blockstates/lunastone.json new file mode 100644 index 0000000..347ab04 --- /dev/null +++ b/src/main/resources/assets/artifality/blockstates/lunastone.json @@ -0,0 +1,8 @@ +{ + "variants": { + "": [ + { "model": "artifality:block/lunastone" }, + { "model": "artifality:block/lunastone_2" } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/assets/artifality/models/block/lunastone.json b/src/main/resources/assets/artifality/models/block/lunastone.json new file mode 100644 index 0000000..606289d --- /dev/null +++ b/src/main/resources/assets/artifality/models/block/lunastone.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "artifality:block/lunastone" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/artifality/models/block/lunastone_2.json b/src/main/resources/assets/artifality/models/block/lunastone_2.json new file mode 100644 index 0000000..3c5637d --- /dev/null +++ b/src/main/resources/assets/artifality/models/block/lunastone_2.json @@ -0,0 +1,6 @@ +{ + "parent": "block/cube_all", + "textures": { + "all": "artifality:block/lunastone_2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/artifality/models/item/lunastone.json b/src/main/resources/assets/artifality/models/item/lunastone.json new file mode 100644 index 0000000..cd95102 --- /dev/null +++ b/src/main/resources/assets/artifality/models/item/lunastone.json @@ -0,0 +1,3 @@ +{ + "parent": "artifality:block/lunastone" +} \ No newline at end of file diff --git a/src/main/resources/assets/artifality/textures/block/lunastone.png b/src/main/resources/assets/artifality/textures/block/lunastone.png new file mode 100644 index 0000000..0ff2a9b Binary files /dev/null and b/src/main/resources/assets/artifality/textures/block/lunastone.png differ diff --git a/src/main/resources/assets/artifality/textures/block/lunastone_2.png b/src/main/resources/assets/artifality/textures/block/lunastone_2.png new file mode 100644 index 0000000..404b0b3 Binary files /dev/null and b/src/main/resources/assets/artifality/textures/block/lunastone_2.png differ diff --git a/src/main/resources/data/artifality/advancements/gather_all_crystals.json b/src/main/resources/data/artifality/advancements/gather_all_crystals.json index 6f5d949..d6e6fea 100644 --- a/src/main/resources/data/artifality/advancements/gather_all_crystals.json +++ b/src/main/resources/data/artifality/advancements/gather_all_crystals.json @@ -50,18 +50,6 @@ } ] } - }, - "wrath_crystal": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "artifality:wrath_crystal" - ] - } - ] - } } }, "parent": "artifality:gather_crystal" diff --git a/src/main/resources/data/artifality/advancements/positive_vision.json b/src/main/resources/data/artifality/advancements/positive_vision.json index 1a8dc20..b5df81a 100644 --- a/src/main/resources/data/artifality/advancements/positive_vision.json +++ b/src/main/resources/data/artifality/advancements/positive_vision.json @@ -50,18 +50,6 @@ } ] } - }, - "wrath_crystal_lens": { - "trigger": "minecraft:inventory_changed", - "conditions": { - "items": [ - { - "items": [ - "artifality:wrath_crystal_lens" - ] - } - ] - } } }, "parent": "artifality:negative_vision" diff --git a/src/main/resources/data/artifality/dimension/lunar_bazaar.json b/src/main/resources/data/artifality/dimension/lunar_bazaar.json new file mode 100644 index 0000000..5634c40 --- /dev/null +++ b/src/main/resources/data/artifality/dimension/lunar_bazaar.json @@ -0,0 +1,23 @@ +{ + "type": "artifality:lunar_bazaar", + "generator": { + "type": "minecraft:flat", + "settings": { + "layers": [ + { + "height": 64, + "block": "minecraft:air" + }, + { + "height": 1, + "block": "minecraft:bedrock" + } + ], + "biome": "artifality:lunar_void" + }, + "biome_source": { + "type": "minecraft:fixed", + "biome": "artifality:lunar_void" + } + } +} \ No newline at end of file diff --git a/src/main/resources/data/artifality/dimension_type/lunar_bazaar.json b/src/main/resources/data/artifality/dimension_type/lunar_bazaar.json new file mode 100644 index 0000000..bb7efde --- /dev/null +++ b/src/main/resources/data/artifality/dimension_type/lunar_bazaar.json @@ -0,0 +1,20 @@ +{ + "ambient_light": 0.05, + "bed_works": false, + "respawn_anchor_works": false, + "coordinate_scale": 1.0, + "has_ceiling": false, + "has_raids": false, + "has_skylight": false, + "effects": "minecraft:the_nether", + "fixed_time": 6000, + "min_y": 0, + "height": 256, + "logical_height": 256, + "infiniburn": "#minecraft:infiniburn_overworld", + "monster_spawn_block_light_limit": 15, + "monster_spawn_light_level": 0, + "natural": false, + "piglin_safe": true, + "ultrawarm": false +} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/blocks/medium_wrath_crystal_cluster.json b/src/main/resources/data/artifality/loot_tables/blocks/medium_wrath_crystal_cluster.json deleted file mode 100644 index 1c101f4..0000000 --- a/src/main/resources/data/artifality/loot_tables/blocks/medium_wrath_crystal_cluster.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ], - "name": "artifality:medium_wrath_crystal_cluster" - }, - { - "type": "minecraft:item", - "functions": [ - { - "function": "minecraft:set_count", - "count": 2.0, - "add": false - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], - "name": "artifality:wrath_crystal" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/blocks/small_wrath_crystal_cluster.json b/src/main/resources/data/artifality/loot_tables/blocks/small_wrath_crystal_cluster.json deleted file mode 100644 index 1075314..0000000 --- a/src/main/resources/data/artifality/loot_tables/blocks/small_wrath_crystal_cluster.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ], - "name": "artifality:small_wrath_crystal_cluster" - }, - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], - "name": "artifality:wrath_crystal" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_block.json b/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_block.json deleted file mode 100644 index 159658a..0000000 --- a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_block.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "artifality:wrath_crystal_block" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_cluster.json b/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_cluster.json deleted file mode 100644 index a5510cf..0000000 --- a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_cluster.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:alternatives", - "children": [ - { - "type": "minecraft:item", - "conditions": [ - { - "condition": "minecraft:match_tool", - "predicate": { - "enchantments": [ - { - "enchantment": "minecraft:silk_touch", - "levels": { - "min": 1 - } - } - ] - } - } - ], - "name": "artifality:wrath_crystal_cluster" - }, - { - "type": "minecraft:item", - "functions": [ - { - "function": "minecraft:set_count", - "count": 3.0, - "add": false - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ], - "name": "artifality:wrath_crystal" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_lens.json b/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_lens.json deleted file mode 100644 index 7ed131e..0000000 --- a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_lens.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "artifality:wrath_crystal_lens" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_slab.json b/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_slab.json deleted file mode 100644 index 676176e..0000000 --- a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_slab.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1.0, - "bonus_rolls": 0.0, - "entries": [ - { - "type": "minecraft:item", - "functions": [ - { - "function": "minecraft:set_count", - "conditions": [ - { - "condition": "minecraft:block_state_property", - "block": "artifality:wrath_crystal_slab", - "properties": { - "type": "double" - } - } - ], - "count": 2.0, - "add": false - }, - { - "function": "minecraft:explosion_decay" - } - ], - "name": "artifality:wrath_crystal_slab" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_stairs.json b/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_stairs.json deleted file mode 100644 index a26ef85..0000000 --- a/src/main/resources/data/artifality/loot_tables/blocks/wrath_crystal_stairs.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "minecraft:block", - "pools": [ - { - "rolls": 1, - "entries": [ - { - "type": "minecraft:item", - "name": "artifality:wrath_crystal_stairs" - } - ], - "conditions": [ - { - "condition": "minecraft:survives_explosion" - } - ] - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal.json b/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal.json deleted file mode 100644 index dd6e893..0000000 --- a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "minecraft:crafting_shapeless", - "ingredients": [ - { - "item": "artifality:wrath_crystal_block" - } - ], - "result": { - "item": "artifality:wrath_crystal", - "count": 4 - } -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_block.json b/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_block.json deleted file mode 100644 index 3a26358..0000000 --- a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_block.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "##", - "##" - ], - "key": { - "#": { - "item": "artifality:wrath_crystal" - } - }, - "result": { - "item": "artifality:wrath_crystal_block", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_lens.json b/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_lens.json deleted file mode 100644 index c5c444b..0000000 --- a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_lens.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "nWn", - "WWW", - "nWn" - ], - "key": { - "n": { - "item": "minecraft:netherite_ingot" - }, - "W": { - "item": "artifality:wrath_crystal_block" - } - }, - "result": { - "item": "artifality:wrath_crystal_lens", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_slab.json b/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_slab.json deleted file mode 100644 index 4851476..0000000 --- a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_slab.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "###" - ], - "key": { - "#": { - "item": "artifality:wrath_crystal_block" - } - }, - "result": { - "item": "artifality:wrath_crystal_slab", - "count": 6 - } -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_stairs.json b/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_stairs.json deleted file mode 100644 index 140f7ee..0000000 --- a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_crystal_stairs.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "# ", - "## ", - "###" - ], - "key": { - "#": { - "item": "artifality:wrath_crystal_block" - } - }, - "result": { - "item": "artifality:wrath_crystal_stairs", - "count": 4 - } -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_orb.json b/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_orb.json deleted file mode 100644 index 0df055d..0000000 --- a/src/main/resources/data/artifality/loot_tables/recipes/item/wrath_orb.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - " # ", - "###", - " # " - ], - "key": { - "#": { - "item": "artifality:wrath_crystal" - } - }, - "result": { - "item": "artifality:wrath_orb", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/recipes/item/wrath_crystal_lens.json b/src/main/resources/data/artifality/recipes/item/wrath_crystal_lens.json deleted file mode 100644 index bf26b51..0000000 --- a/src/main/resources/data/artifality/recipes/item/wrath_crystal_lens.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "type": "minecraft:crafting_shaped", - "pattern": [ - "NCN", - "CCC", - "NCN" - ], - "key": { - "N": { - "item": "minecraft:netherite_ingot" - }, - "C": { - "item": "artifality:wrath_crystal_block" - } - }, - "result": { - "item": "artifality:wrath_crystal_lens", - "count": 1 - } -} \ No newline at end of file diff --git a/src/main/resources/data/artifality/structures/lunar_bazaar.nbt b/src/main/resources/data/artifality/structures/lunar_bazaar.nbt new file mode 100644 index 0000000..e685131 Binary files /dev/null and b/src/main/resources/data/artifality/structures/lunar_bazaar.nbt differ diff --git a/src/main/resources/data/artifality/tags/items/crystals.json b/src/main/resources/data/artifality/tags/items/crystals.json index d3955fc..7f2deb5 100644 --- a/src/main/resources/data/artifality/tags/items/crystals.json +++ b/src/main/resources/data/artifality/tags/items/crystals.json @@ -3,7 +3,6 @@ "values": [ "artifality:incremental_crystal", "artifality:lunar_crystal", - "artifality:life_crystal", - "artifality:wrath_crystal" + "artifality:life_crystal" ] } \ No newline at end of file diff --git a/src/main/resources/data/artifality/tags/items/lenses.json b/src/main/resources/data/artifality/tags/items/lenses.json index 4020aa0..be29e87 100644 --- a/src/main/resources/data/artifality/tags/items/lenses.json +++ b/src/main/resources/data/artifality/tags/items/lenses.json @@ -3,7 +3,6 @@ "values": [ "artifality:incremental_crystal_lens", "artifality:lunar_crystal_lens", - "artifality:life_crystal_lens", - "artifality:wrath_crystal_lens" + "artifality:life_crystal_lens" ] } \ No newline at end of file diff --git a/src/main/resources/data/artifality/worldgen/biome/lunar_void.json b/src/main/resources/data/artifality/worldgen/biome/lunar_void.json new file mode 100644 index 0000000..8d96ae2 --- /dev/null +++ b/src/main/resources/data/artifality/worldgen/biome/lunar_void.json @@ -0,0 +1,18 @@ +{ + "creature_spawn_probability": 0.0, + "downfall": 0.0, + "effects": { + "fog_color": 4039572, + "sky_color": 2505807, + "water_color": 3833242, + "water_fog_color": 4958384, + "foliage_color": 2924181, + "grass_color": 2924181 + }, + "spawn_costs": {}, + "has_precipitation": false, + "temperature": 0.5, + "features": [], + "spawners": {}, + "carvers": {} +} \ No newline at end of file diff --git a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json index c531cad..6a522b4 100644 --- a/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json +++ b/src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json @@ -29,15 +29,6 @@ "artifality:life_crystal_lens", "artifality:life_crystal_geode", "artifality:life_crystal_stairs", - "artifality:life_crystal_slab", - - "artifality:wrath_crystal_cluster", - "artifality:small_wrath_crystal_cluster", - "artifality:medium_wrath_crystal_cluster", - "artifality:wrath_crystal_block", - "artifality:wrath_crystal_lens", - "artifality:wrath_crystal_geode", - "artifality:wrath_crystal_stairs", - "artifality:wrath_crystal_slab" + "artifality:life_crystal_slab" ] } \ No newline at end of file