From 61f966c071395a2063cddfe28feea7d7b3186bbd Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 24 Jan 2020 22:45:11 +0100 Subject: [PATCH] disabled the dimension rail, updated forge --- build.gradle | 2 +- .../naturesaura/blocks/BlockDimensionRail.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index de827152..ddf05ec9 100644 --- a/build.gradle +++ b/build.gradle @@ -89,7 +89,7 @@ repositories { } dependencies { - minecraft 'net.minecraftforge:forge:1.14.4-28.1.92' + minecraft 'net.minecraftforge:forge:1.14.4-28.1.116' compileOnly fg.deobf("mezz.jei:jei-1.14.4:6.0.0.11:api") runtimeOnly fg.deobf("mezz.jei:jei-1.14.4:6.0.0.11") diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java index baf1a7a0..da4e6e37 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockDimensionRail.java @@ -12,6 +12,7 @@ import net.minecraft.block.AbstractRailBlock; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; +import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.item.minecart.AbstractMinecartEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; @@ -27,12 +28,19 @@ import net.minecraft.util.SoundEvents; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; +import net.minecraft.util.text.Style; +import net.minecraft.util.text.TextFormatting; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.gen.Heightmap; import net.minecraft.world.server.ServerWorld; +import javax.annotation.Nullable; +import java.util.List; + public class BlockDimensionRail extends AbstractRailBlock implements IModItem, IModelProvider { public static final EnumProperty SHAPE = BlockStateProperties.RAIL_SHAPE; @@ -85,6 +93,10 @@ public class BlockDimensionRail extends AbstractRailBlock implements IModItem, I BlockPos goalCoords = this.getGoalCoords(world, pos); + // TODO wait for Forge to have re-implemented ITeleporter + if (true) + return; + cart.changeDimension(DimensionType.getById(this.goalDim)); cart.moveToBlockPosAndAngles(goalCoords, cart.rotationYaw, cart.rotationPitch); @@ -92,6 +104,12 @@ public class BlockDimensionRail extends AbstractRailBlock implements IModItem, I IAuraChunk.getAuraChunk(world, spot).drainAura(spot, 50000); } + @Override + public void addInformation(ItemStack stack, @Nullable IBlockReader worldIn, List tooltip, ITooltipFlag flagIn) { + super.addInformation(stack, worldIn, tooltip, flagIn); + tooltip.add(new StringTextComponent("CURRENTLY UNIMPLEMENTED - Waiting for a Forge change").setStyle(new Style().setColor(TextFormatting.RED))); + } + private BlockPos getGoalCoords(World world, BlockPos pos) { MinecraftServer server = world.getServer(); DimensionType goalDimType = DimensionType.getById(this.goalDim);