1.0.4
RelicCraft/pipeline/head This commit looks good Details

Bug Fixes
This commit is contained in:
TheBrokenRail 2020-04-06 13:20:15 -04:00
parent 9068e3d3d6
commit f7103e32c5
6 changed files with 45 additions and 22 deletions

View File

@ -1,5 +1,8 @@
# Changelog
**1.0.4**
* Bug Fixes
**1.0.3**
* Final Tweaks

View File

@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
fabric_loader_version = 0.7.10+build.191
# Mod Properties
mod_version = 1.0.3
mod_version = 1.0.4
maven_group = com.thebrokenrail
archives_base_name = reliccraft

View File

@ -84,7 +84,7 @@ public abstract class AbstractDragonEggHolderBlock extends Block implements Bloc
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
if (isActive(world, pos)) {
if (random.nextInt(100) == 0) {
world.playSound(null, pos, SoundEvents.BLOCK_PORTAL_AMBIENT, SoundCategory.BLOCKS, 0.5F, random.nextFloat() * 0.4F + 0.8F);
world.playSound((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, SoundEvents.BLOCK_PORTAL_AMBIENT, SoundCategory.BLOCKS, 0.5F, random.nextFloat() * 0.4F + 0.8F, false);
}
for (int i = 0; i < 24; ++i) {

View File

@ -9,6 +9,7 @@ import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.network.ServerPlayerEntity;
@ -33,7 +34,7 @@ import java.util.List;
public class TargetedEnderPearlItem extends Item {
public TargetedEnderPearlItem() {
super(new Settings().rarity(Rarity.UNCOMMON).maxCount(16));
super(new Settings().rarity(Rarity.UNCOMMON).group(ItemGroup.MISC).maxCount(16));
}
@Override
@ -48,7 +49,7 @@ public class TargetedEnderPearlItem extends Item {
if (!world.isClient()) {
CompoundTag tag = stack.getTag();
if (tag == null) {
tag = new CompoundTag();
return new TypedActionResult<>(ActionResult.FAIL, stack);
}
BlockPos target = new BlockPos(tag.getInt("TargetX"), tag.getInt("TargetY"), tag.getInt("TargetZ"));
@ -57,29 +58,31 @@ public class TargetedEnderPearlItem extends Item {
if (user.dimension != dimension || dimension == null) {
user.sendMessage(new TranslatableText("chat." + RelicCraft.NAMESPACE + ".teleportation_beacon_in_different_dimension"));
return new TypedActionResult<>(ActionResult.FAIL, stack);
} else if (((TeleportationRestrictorBlock.TeleportingEntity) user).cannotTeleport()) {
user.sendMessage(new TranslatableText("chat." + RelicCraft.NAMESPACE + ".teleportation_beacon_restricted"));
return new TypedActionResult<>(ActionResult.FAIL, stack);
} else if (world.getBlockState(target).getBlock() != RelicCraft.TELEPORTATION_BEACON_BLOCK || !world.getBlockState(target).get(AbstractDragonEggHolderBlock.ACTIVE)) {
user.sendMessage(new TranslatableText("chat." + RelicCraft.NAMESPACE + ".missing_teleportation_beacon"));
return new TypedActionResult<>(ActionResult.FAIL, stack);
} else {
if (((TeleportationRestrictorBlock.TeleportingEntity) user).cannotTeleport()) {
user.sendMessage(new TranslatableText("chat." + RelicCraft.NAMESPACE + ".teleportation_beacon_restricted"));
} else if (world.getBlockState(target).getBlock() != RelicCraft.TELEPORTATION_BEACON_BLOCK || !world.getBlockState(target).get(AbstractDragonEggHolderBlock.ACTIVE)) {
user.sendMessage(new TranslatableText("chat." + RelicCraft.NAMESPACE + ".missing_teleportation_beacon"));
} else {
Vec3d oldPos = user.getPos();
if (user.teleport(teleportTarget.getX(), teleportTarget.getY(), teleportTarget.getZ(), true)) {
world.playSound(null, oldPos.getX(), oldPos.getY(), oldPos.getZ(), SoundEvents.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1.0f, 1.0f);
world.playSound(null, teleportTarget.getX(), teleportTarget.getY(), teleportTarget.getZ(), SoundEvents.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1.0f, 1.0f);
Vec3d oldPos = user.getPos();
if (user.teleport(teleportTarget.getX(), teleportTarget.getY(), teleportTarget.getZ(), true)) {
world.playSound(null, oldPos.getX(), oldPos.getY(), oldPos.getZ(), SoundEvents.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1.0f, 1.0f);
world.playSound(null, teleportTarget.getX(), teleportTarget.getY(), teleportTarget.getZ(), SoundEvents.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1.0f, 1.0f);
RelicCraft.USE_TARGETED_ENDER_PEARL.trigger((ServerPlayerEntity) user);
RelicCraft.USE_TARGETED_ENDER_PEARL.trigger((ServerPlayerEntity) user);
user.damage(DamageSource.FALL, 16.0f);
user.damage(DamageSource.FALL, 16.0f);
user.fallDistance = 0f;
user.fallDistance = 0f;
if (!user.isCreative()) {
stack.decrement(1);
}
} else {
user.sendMessage(new TranslatableText("chat." + RelicCraft.NAMESPACE + ".teleportation_beacon_obstructed"));
if (!user.isCreative()) {
stack.decrement(1);
}
} else {
user.sendMessage(new TranslatableText("chat." + RelicCraft.NAMESPACE + ".teleportation_beacon_obstructed"));
return new TypedActionResult<>(ActionResult.FAIL, stack);
}
}
}
@ -94,8 +97,9 @@ public class TargetedEnderPearlItem extends Item {
CompoundTag tag = stack.getTag();
if (tag == null) {
tag = new CompoundTag();
return;
}
tooltip.add(new TranslatableText("item." + RelicCraft.NAMESPACE + ".tooltip.targeted_ender_pearl.x", new LiteralText(String.valueOf(tag.getInt("TargetX"))).formatted(Formatting.GRAY)).formatted(Formatting.WHITE));
tooltip.add(new TranslatableText("item." + RelicCraft.NAMESPACE + ".tooltip.targeted_ender_pearl.y", new LiteralText(String.valueOf(tag.getInt("TargetY"))).formatted(Formatting.GRAY)).formatted(Formatting.WHITE));
tooltip.add(new TranslatableText("item." + RelicCraft.NAMESPACE + ".tooltip.targeted_ender_pearl.z", new LiteralText(String.valueOf(tag.getInt("TargetZ"))).formatted(Formatting.GRAY)).formatted(Formatting.WHITE));

View File

@ -19,5 +19,10 @@
"use": {
"trigger": "reliccraft:use_teleportation_beacon"
}
},
"rewards": {
"recipes": [
"reliccraft:reset_targeted_ender_pearl"
]
}
}

View File

@ -0,0 +1,11 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "reliccraft:targeted_ender_pearl"
}
],
"result": {
"item": "minecraft:ender_pearl"
}
}