diff --git a/gradle.properties b/gradle.properties index 374850c..56c8864 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,6 +8,6 @@ loader_version=0.8.8+build.202 #Fabric api fabric_version=0.13.1+build.370-1.16 -mod_version=2.2.0 +mod_version=2.3.0 archives_base_name=simpleteleporters maven_group=party.lemons \ No newline at end of file diff --git a/src/main/java/party/lemons/simpleteleporters/SimpleTeleportersClient.java b/src/main/java/party/lemons/simpleteleporters/SimpleTeleportersClient.java index 30a83cf..1cf0082 100644 --- a/src/main/java/party/lemons/simpleteleporters/SimpleTeleportersClient.java +++ b/src/main/java/party/lemons/simpleteleporters/SimpleTeleportersClient.java @@ -15,6 +15,7 @@ import net.minecraft.util.registry.Registry; import party.lemons.simpleteleporters.init.SimpleTeleportersBlocks; import party.lemons.simpleteleporters.init.SimpleTeleportersItems; +import party.lemons.simpleteleporters.item.BaseTeleportCrystalItem; public class SimpleTeleportersClient implements ClientModInitializer { @Override @@ -24,7 +25,7 @@ public void onInitializeClient() { if (client.world != null && client.player != null) { for (Hand hand : Hand.values()) { ItemStack stack = client.player.getStackInHand(hand); - if (!stack.isEmpty() && stack.getItem() == SimpleTeleportersItems.TELE_CRYSTAL) { + if (!stack.isEmpty() && stack.getItem() instanceof BaseTeleportCrystalItem) { CompoundTag tags = stack.getTag(); if (tags != null) { String s = tags.getString("dim"); diff --git a/src/main/java/party/lemons/simpleteleporters/block/TeleporterBlock.java b/src/main/java/party/lemons/simpleteleporters/block/TeleporterBlock.java index 18374d6..a262b9e 100644 --- a/src/main/java/party/lemons/simpleteleporters/block/TeleporterBlock.java +++ b/src/main/java/party/lemons/simpleteleporters/block/TeleporterBlock.java @@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.particle.ParticleTypes; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; @@ -17,67 +18,85 @@ import net.minecraft.state.property.Properties; import net.minecraft.text.Style; import net.minecraft.text.TranslatableText; -import net.minecraft.util.ActionResult; -import net.minecraft.util.Formatting; -import net.minecraft.util.Hand; -import net.minecraft.util.ItemScatterer; +import net.minecraft.util.*; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; +import net.minecraft.util.registry.Registry; +import net.minecraft.util.registry.RegistryKey; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; import net.minecraft.world.World; import net.minecraft.world.WorldAccess; +import net.minecraft.world.dimension.DimensionType; import party.lemons.simpleteleporters.block.entity.TeleporterBlockEntity; import party.lemons.simpleteleporters.init.SimpleTeleportersItems; +import party.lemons.simpleteleporters.item.BaseTeleportCrystalItem; import java.util.Collections; import java.util.EnumSet; import java.util.Random; +import java.util.Set; public class TeleporterBlock extends BlockWithEntity { public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; protected static final VoxelShape TELE_AABB = VoxelShapes.cuboid(0D, 0.0D, 0D, 1D, 0.3D, 1D); public static BooleanProperty ON = BooleanProperty.of("on"); - + public TeleporterBlock(Settings settings) { super(settings); this.setDefaultState(this.getStateManager().getDefaultState().with(ON, false).with(WATERLOGGED, false)); } - + @Override public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { if (entity.isSneaking() && entity instanceof PlayerEntity) { TeleporterBlockEntity teleporter = (TeleporterBlockEntity) world.getBlockEntity(pos); if (teleporter == null) return; - if (!teleporter.isCoolingDown() && teleporter.hasCrystal() && teleporter.isInDimension(entity)) { + if (!teleporter.isCoolingDown() && teleporter.hasCrystal() && teleporter.canTeleportTo(entity)) { if (entity instanceof ServerPlayerEntity && !world.isClient) { BlockPos teleporterPos = teleporter.getTeleportPosition(); ServerPlayerEntity splayer = (ServerPlayerEntity) entity; - + String targetWorld = teleporter.getTeleportWorld(); + ServerWorld wrld = (ServerWorld) world; + + // If we need to change dimensions, do so + if (!targetWorld.equals(world.getDimensionRegistryKey().toString())) { + wrld = world.getServer().getWorld(RegistryKey.of(Registry.DIMENSION, Identifier.tryParse(targetWorld))); + + if (wrld == null) { + splayer.sendMessage(new TranslatableText("text.teleporters.error.missing_dimen", targetWorld).setStyle(Style.EMPTY.withColor(Formatting.RED)), true); + return; + } + } + if (teleporterPos == null) { splayer.sendMessage(new TranslatableText("text.teleporters.error.unlinked").setStyle(Style.EMPTY.withColor(Formatting.RED)), true); return; - } else if (world.getBlockState(teleporterPos).shouldSuffocate(world, teleporterPos)) { + } else if (wrld.getBlockState(teleporterPos).shouldSuffocate(wrld, teleporterPos)) { splayer.sendMessage(new TranslatableText("text.teleporters.error.invalid_position").setStyle(Style.EMPTY.withColor(Formatting.RED)), true); return; } - + splayer.velocityModified = true; - + + // If we need to change dimensions, do so now + if (wrld != world) + splayer.changeDimension(wrld); + Vec3d playerPos = new Vec3d(teleporterPos.getX() + 0.5, teleporterPos.getY(), teleporterPos.getZ() + 0.5); splayer.networkHandler.teleportRequest(playerPos.getX(), playerPos.getY(), playerPos.getZ(), entity.yaw, entity.pitch, Collections.EMPTY_SET); - + splayer.setVelocity(0, 0, 0); splayer.velocityDirty = true; - - world.playSoundFromEntity(null, splayer, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.BLOCKS, 1.0F, 1.0F); + + wrld.playSoundFromEntity(null, splayer, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.BLOCKS, 1.0F, 1.0F); teleporter.setCooldown(10); - - BlockEntity down = world.getBlockEntity(teleporterPos.down()); + + BlockEntity down = wrld.getBlockEntity(teleporterPos.down()); if (down != null && down instanceof TeleporterBlockEntity) { ((TeleporterBlockEntity) down).setCooldown(10); } @@ -97,7 +116,7 @@ public void onEntityCollision(BlockState state, World world, BlockPos pos, Entit } } } - + @Override public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hitResult) { TeleporterBlockEntity tele = (TeleporterBlockEntity) world.getBlockEntity(pos); @@ -105,15 +124,15 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt ItemStack crystalStack = tele.getCrystal(); player.giveItemStack(crystalStack); player.playSound(SoundEvents.ENTITY_ARROW_SHOOT, 0.5F, 0.4F / (world.random.nextFloat() * 0.4F + 0.8F)); - + world.setBlockState(pos, state.with(ON, false)); tele.setCrystal(ItemStack.EMPTY); - + return ActionResult.SUCCESS; } else { ItemStack stack = player.getStackInHand(hand); if (!stack.isEmpty()) { - if (stack.getItem() == SimpleTeleportersItems.TELE_CRYSTAL && stack.getTag() != null) { + if (stack.getItem() instanceof BaseTeleportCrystalItem && stack.getTag() != null) { player.playSound(SoundEvents.ENTITY_ARROW_SHOOT, 0.5F, 0.4F / (world.random.nextFloat() * 0.4F + 0.8F)); world.setBlockState(pos, state.with(ON, true)); ItemStack setstack = stack.copy(); @@ -126,29 +145,29 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt } return ActionResult.PASS; } - + @Override public void onBreak(World world, BlockPos blockPos, BlockState blockState, PlayerEntity playerEntity) { TeleporterBlockEntity tele = (TeleporterBlockEntity) world.getBlockEntity(blockPos); ItemScatterer.spawn(world, blockPos.getX(), blockPos.getY(), blockPos.getZ(), tele.getCrystal()); super.onBreak(world, blockPos, blockState, playerEntity); } - - + + @Override public FluidState getFluidState(BlockState var1) { return var1.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(var1); } - + @Override public BlockState getStateForNeighborUpdate(BlockState state, Direction facing, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { if (state.get(WATERLOGGED)) { world.getFluidTickScheduler().schedule(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); // getTickRate == method_15789? } - + return super.getStateForNeighborUpdate(state, facing, neighborState, world, pos, neighborPos); } - + @Override public VoxelShape getRayTraceShape(BlockState state, BlockView world, BlockPos pos) { return TELE_AABB; @@ -170,17 +189,17 @@ public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos po protected void appendProperties(StateManager.Builder st) { st.add(ON).add(WATERLOGGED); } - + @Override public BlockEntity createBlockEntity(BlockView blockView) { return new TeleporterBlockEntity(); } - + @Override public BlockRenderType getRenderType(BlockState var1) { return BlockRenderType.MODEL; } - + @Override public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { if (state.get(ON)) { @@ -189,7 +208,7 @@ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Rando } } } - + @Override public BlockState getPlacementState(ItemPlacementContext ctx) { FluidState fs = ctx.getWorld().getFluidState(ctx.getBlockPos()); diff --git a/src/main/java/party/lemons/simpleteleporters/block/entity/TeleporterBlockEntity.java b/src/main/java/party/lemons/simpleteleporters/block/entity/TeleporterBlockEntity.java index 93aab3d..f88fc76 100644 --- a/src/main/java/party/lemons/simpleteleporters/block/entity/TeleporterBlockEntity.java +++ b/src/main/java/party/lemons/simpleteleporters/block/entity/TeleporterBlockEntity.java @@ -3,47 +3,63 @@ import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.Entity; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundTag; import net.minecraft.util.Tickable; import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; import party.lemons.simpleteleporters.init.SimpleTeleportersBlockEntities; +import party.lemons.simpleteleporters.item.BaseTeleportCrystalItem; +import party.lemons.simpleteleporters.item.DimensionalTeleportCrystalItem; +import party.lemons.simpleteleporters.item.TeleportCrystalItem; public class TeleporterBlockEntity extends BlockEntity implements Tickable { private ItemStack stack = ItemStack.EMPTY; private int cooldown = 0; - + public TeleporterBlockEntity() { super(SimpleTeleportersBlockEntities.TELE_BE); } - + @Override public void tick() { if (isCoolingDown()) { this.setCooldown(this.getCooldown() - 1); } } - + public boolean hasCrystal() { return !getCrystal().isEmpty(); } - + public boolean isInDimension(Entity entityIn) { if (getCrystal().isEmpty()) return false; - + CompoundTag tags = getCrystal().getTag(); if (tags == null) return false; - + return tags.getString("dim").equals(entityIn.world.getDimensionRegistryKey().getValue().toString()); } - + + public boolean canTeleportTo(Entity entityIn) { + if (getCrystal().isEmpty()) + return false; + + Item crystal = getCrystal().getItem(); + if (crystal instanceof TeleportCrystalItem) + return isInDimension(entityIn); + + return crystal instanceof DimensionalTeleportCrystalItem; + } + public ItemStack getCrystal() { return stack; } - + public void setCrystal(ItemStack stack) { this.stack = stack; markDirty(); @@ -52,22 +68,33 @@ public void setCrystal(ItemStack stack) { getWorld().updateListeners(getPos(), state, state, 3); } } - + public BlockPos getTeleportPosition() { if (!hasCrystal()) return null; - + CompoundTag tags = getCrystal().getTag(); if (tags == null) return null; - + int xx = tags.getInt("x"); int yy = tags.getInt("y"); int zz = tags.getInt("z"); - + return new BlockPos(xx, yy, zz); } + public String getTeleportWorld() { + if (!hasCrystal()) + return null; + + CompoundTag tags = getCrystal().getTag(); + if (tags == null) + return null; + + return tags.getString("dim"); + } + @Override public void fromTag(BlockState state, CompoundTag tag) { @@ -85,11 +112,11 @@ public void fromTag(BlockState state, CompoundTag tag) } } - + @Override public CompoundTag toTag(CompoundTag compound) { compound = super.toTag(compound); - + if (!stack.isEmpty()) { CompoundTag tagCompound = stack.toTag(new CompoundTag()); compound.put("item", tagCompound); @@ -97,15 +124,15 @@ public CompoundTag toTag(CompoundTag compound) { compound.putInt("cooldown", cooldown); return compound; } - + public boolean isCoolingDown() { return getCooldown() > 0; } - + public int getCooldown() { return cooldown; } - + public void setCooldown(int cooldown) { this.cooldown = cooldown; } diff --git a/src/main/java/party/lemons/simpleteleporters/init/SimpleTeleportersItems.java b/src/main/java/party/lemons/simpleteleporters/init/SimpleTeleportersItems.java index 91e3e9a..138460f 100644 --- a/src/main/java/party/lemons/simpleteleporters/init/SimpleTeleportersItems.java +++ b/src/main/java/party/lemons/simpleteleporters/init/SimpleTeleportersItems.java @@ -4,15 +4,18 @@ import net.minecraft.item.ItemGroup; import net.minecraft.util.registry.Registry; +import party.lemons.simpleteleporters.item.DimensionalTeleportCrystalItem; import party.lemons.simpleteleporters.item.TeleportCrystalItem; import static party.lemons.simpleteleporters.SimpleTeleporters.MODID; public class SimpleTeleportersItems { public static Item TELE_CRYSTAL; + public static Item DIMEN_TELE_CRYSTAL; public static void init() { TELE_CRYSTAL = registerItem(new TeleportCrystalItem(new Item.Settings().group(ItemGroup.TRANSPORTATION)), "tele_crystal"); + DIMEN_TELE_CRYSTAL = registerItem(new DimensionalTeleportCrystalItem(new Item.Settings().group(ItemGroup.TRANSPORTATION)), "dimen_tele_crystal"); } public static Item registerItem(Item item, String name) { diff --git a/src/main/java/party/lemons/simpleteleporters/item/BaseTeleportCrystalItem.java b/src/main/java/party/lemons/simpleteleporters/item/BaseTeleportCrystalItem.java new file mode 100644 index 0000000..a31ec5a --- /dev/null +++ b/src/main/java/party/lemons/simpleteleporters/item/BaseTeleportCrystalItem.java @@ -0,0 +1,77 @@ +package party.lemons.simpleteleporters.item; + +import net.minecraft.client.item.TooltipContext; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemUsageContext; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.sound.SoundEvents; +import net.minecraft.text.Style; +import net.minecraft.text.Text; +import net.minecraft.text.TranslatableText; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Formatting; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.registry.Registry; +import net.minecraft.world.World; +import net.minecraft.world.dimension.DimensionType; + +import java.util.List; + +public class BaseTeleportCrystalItem extends Item { + public BaseTeleportCrystalItem(Settings settings) { + super(settings); + } + + @Override + public ActionResult useOnBlock(ItemUsageContext ctx) { + PlayerEntity player = ctx.getPlayer(); + + if (player.isSneaking()) { + ItemStack stack = ctx.getStack(); + CompoundTag tags = stack.getTag(); + if (tags == null) { + stack.setTag(new CompoundTag()); + tags = stack.getTag(); + } + + BlockPos offPos = ctx.getBlockPos().offset(ctx.getSide()); + tags.putInt("x", offPos.getX()); + tags.putInt("y", offPos.getY()); + tags.putInt("z", offPos.getZ()); + tags.putString("dim", player.world.getDimensionRegistryKey().getValue().toString()); + tags.putFloat("direction", player.yaw); + + TranslatableText msg = new TranslatableText("text.teleporters.crystal_info", offPos.getX(), offPos.getY(), offPos.getZ()); + msg.setStyle(Style.EMPTY.withColor(Formatting.GREEN)); + + player.sendMessage(msg, true); + + player.playSound(SoundEvents.ENTITY_ENDERMAN_TELEPORT, 0.5F, 0.4F / (ctx.getWorld().random.nextFloat() * 0.4F + 0.8F)); + return ActionResult.PASS; + } + return ActionResult.PASS; + } + + @Override + public void appendTooltip(ItemStack stack, World world, List tooltip, TooltipContext options) { + CompoundTag tags = stack.getTag(); + if (tags == null) { + TranslatableText unlinked = new TranslatableText("text.teleporters.unlinked"); + unlinked.setStyle(Style.EMPTY.withColor(Formatting.RED)); + + TranslatableText info = new TranslatableText("text.teleporters.how_to_link"); + info.setStyle(Style.EMPTY.withColor(Formatting.BLUE)); + + tooltip.add(unlinked); + tooltip.add(info); + + } else { + TranslatableText pos = new TranslatableText("text.teleporters.linked", tags.getInt("x"), tags.getInt("y"), tags.getInt("z"), tags.getString("dim")); + pos.setStyle(Style.EMPTY.withColor(Formatting.GREEN)); + + tooltip.add(pos); + } + } +} diff --git a/src/main/java/party/lemons/simpleteleporters/item/DimensionalTeleportCrystalItem.java b/src/main/java/party/lemons/simpleteleporters/item/DimensionalTeleportCrystalItem.java new file mode 100644 index 0000000..641ce86 --- /dev/null +++ b/src/main/java/party/lemons/simpleteleporters/item/DimensionalTeleportCrystalItem.java @@ -0,0 +1,7 @@ +package party.lemons.simpleteleporters.item; + +public class DimensionalTeleportCrystalItem extends BaseTeleportCrystalItem { + public DimensionalTeleportCrystalItem(Settings settings) { + super(settings); + } +} diff --git a/src/main/java/party/lemons/simpleteleporters/item/TeleportCrystalItem.java b/src/main/java/party/lemons/simpleteleporters/item/TeleportCrystalItem.java index a6eac5a..27ef633 100644 --- a/src/main/java/party/lemons/simpleteleporters/item/TeleportCrystalItem.java +++ b/src/main/java/party/lemons/simpleteleporters/item/TeleportCrystalItem.java @@ -1,77 +1,7 @@ package party.lemons.simpleteleporters.item; -import net.minecraft.client.item.TooltipContext; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemUsageContext; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.sound.SoundEvents; -import net.minecraft.text.Style; -import net.minecraft.text.Text; -import net.minecraft.text.TranslatableText; -import net.minecraft.util.ActionResult; -import net.minecraft.util.Formatting; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.Registry; -import net.minecraft.world.World; -import net.minecraft.world.dimension.DimensionType; - -import java.util.List; - -public class TeleportCrystalItem extends Item { +public class TeleportCrystalItem extends BaseTeleportCrystalItem { public TeleportCrystalItem(Settings settings) { super(settings); } - - @Override - public ActionResult useOnBlock(ItemUsageContext ctx) { - PlayerEntity player = ctx.getPlayer(); - - if (player.isSneaking()) { - ItemStack stack = ctx.getStack(); - CompoundTag tags = stack.getTag(); - if (tags == null) { - stack.setTag(new CompoundTag()); - tags = stack.getTag(); - } - - BlockPos offPos = ctx.getBlockPos().offset(ctx.getSide()); - tags.putInt("x", offPos.getX()); - tags.putInt("y", offPos.getY()); - tags.putInt("z", offPos.getZ()); - tags.putString("dim", player.world.getDimensionRegistryKey().getValue().toString()); - tags.putFloat("direction", player.yaw); - - TranslatableText msg = new TranslatableText("text.teleporters.crystal_info", offPos.getX(), offPos.getY(), offPos.getZ()); - msg.setStyle(Style.EMPTY.withColor(Formatting.GREEN)); - - player.sendMessage(msg, true); - - player.playSound(SoundEvents.ENTITY_ENDERMAN_TELEPORT, 0.5F, 0.4F / (ctx.getWorld().random.nextFloat() * 0.4F + 0.8F)); - return ActionResult.PASS; - } - return ActionResult.PASS; - } - - @Override - public void appendTooltip(ItemStack stack, World world, List tooltip, TooltipContext options) { - CompoundTag tags = stack.getTag(); - if (tags == null) { - TranslatableText unlinked = new TranslatableText("text.teleporters.unlinked"); - unlinked.setStyle(Style.EMPTY.withColor(Formatting.RED)); - - TranslatableText info = new TranslatableText("text.teleporters.how_to_link"); - info.setStyle(Style.EMPTY.withColor(Formatting.BLUE)); - - tooltip.add(unlinked); - tooltip.add(info); - - } else { - TranslatableText pos = new TranslatableText("text.teleporters.linked", tags.getInt("x"), tags.getInt("y"), tags.getInt("z"), tags.getString("dim")); - pos.setStyle(Style.EMPTY.withColor(Formatting.GREEN)); - - tooltip.add(pos); - } - } } diff --git a/src/main/resources/assets/simpleteleporters/lang/en_us.json b/src/main/resources/assets/simpleteleporters/lang/en_us.json index c7707ce..072b0dd 100644 --- a/src/main/resources/assets/simpleteleporters/lang/en_us.json +++ b/src/main/resources/assets/simpleteleporters/lang/en_us.json @@ -1,5 +1,6 @@ { "item.simpleteleporters.tele_crystal": "Ender Shard", + "item.simpleteleporters.dimen_tele_crystal": "Dimensional Ender Shard", "block.simpleteleporters.teleporter": "Teleporter", "text.teleporters.unlinked": "Unlinked", @@ -8,6 +9,7 @@ "text.teleporters.crystal_info": "Linked Ender Shard to %1$s, %2$s, %3$s", "text.teleporters.error.no_crystal": "This teleporter doesn't have an Ender Shard!", "text.teleporters.error.unlinked": "This teleporter's Ender Shard is unlinked!", + "text.teleporters.error.missing_dimen": "This teleporter's Ender Shard links to an unknown dimension! %1$s", "text.teleporters.error.invalid_position": "Teleport position is invalid! Perhaps there's a block in the way?", "text.teleporters.error.wrong_dimension": "This teleporter's Ender Shard isn't powerful enough to cross dimensions!" } \ No newline at end of file diff --git a/src/main/resources/assets/simpleteleporters/models/item/dimen_tele_crystal.json b/src/main/resources/assets/simpleteleporters/models/item/dimen_tele_crystal.json new file mode 100644 index 0000000..70db1b4 --- /dev/null +++ b/src/main/resources/assets/simpleteleporters/models/item/dimen_tele_crystal.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "simpleteleporters:items/dimenendercrystal" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/simpleteleporters/textures/items/dimenendercrystal.png b/src/main/resources/assets/simpleteleporters/textures/items/dimenendercrystal.png new file mode 100644 index 0000000..1268ef8 Binary files /dev/null and b/src/main/resources/assets/simpleteleporters/textures/items/dimenendercrystal.png differ diff --git a/src/main/resources/assets/simpleteleporters/textures/items/dimenendercrystal.png.mcmeta b/src/main/resources/assets/simpleteleporters/textures/items/dimenendercrystal.png.mcmeta new file mode 100644 index 0000000..a965928 --- /dev/null +++ b/src/main/resources/assets/simpleteleporters/textures/items/dimenendercrystal.png.mcmeta @@ -0,0 +1,14 @@ +{ + "animation": { + "frametime": 100, + "interpolate": true, + "frames": [ + 0, + 1, + 2, + 3, + 2, + 1 + ] + } +} diff --git a/src/main/resources/data/simpleteleporters/recipes/dimen_clear_shard.json b/src/main/resources/data/simpleteleporters/recipes/dimen_clear_shard.json new file mode 100644 index 0000000..a848f93 --- /dev/null +++ b/src/main/resources/data/simpleteleporters/recipes/dimen_clear_shard.json @@ -0,0 +1,12 @@ +{ + "type": "crafting_shapeless", + "ingredients": [ + { + "item": "simpleteleporters:dimen_tele_crystal" + } + ], + "result": { + "item": "simpleteleporters:dimen_tele_crystal", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/simpleteleporters/recipes/dimen_tele_crystal.json b/src/main/resources/data/simpleteleporters/recipes/dimen_tele_crystal.json new file mode 100644 index 0000000..e293353 --- /dev/null +++ b/src/main/resources/data/simpleteleporters/recipes/dimen_tele_crystal.json @@ -0,0 +1,20 @@ +{ + "type": "crafting_shaped", + "pattern": [ + "D D", + " T ", + "D D" + ], + "key": { + "D": { + "item": "minecraft:diamond" + }, + "T": { + "item": "simpleteleporters:tele_crystal" + } + }, + "result": { + "item": "simpleteleporters:dimen_tele_crystal", + "count": 1 + } +} \ No newline at end of file