Skip to content

Commit

Permalink
Merge branch '1.20' of https://github.com/Mrbysco/TelePastries into 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Oct 15, 2023
2 parents 9d0c884 + 77de040 commit a16a744
Show file tree
Hide file tree
Showing 3 changed files with 252 additions and 191 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public class BlockCakeBase extends BlockPastryBase {
Block.box(11.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D),
Block.box(13.0D, 0.0D, 1.0D, 15.0D, 8.0D, 15.0D)};

protected static final CakeTeleporter TELEPORTER = new CakeTeleporter();

public BlockCakeBase(BlockBehaviour.Properties properties) {
super(properties.strength(0.5F).sound(SoundType.WOOL).randomTicks());
this.registerDefaultState(this.stateDefinition.any().setValue(BITES, Integer.valueOf(0)));
Expand Down Expand Up @@ -181,9 +183,8 @@ public void teleportToDimension(LevelAccessor worldIn, BlockPos pos, Player play
return;
}

CakeTeleporter cakeTeleporter = new CakeTeleporter(destinationWorld);
CakeTeleporter.addDimensionPosition(serverPlayer, serverPlayer.level().dimension(), serverPlayer.blockPosition().offset(0, 1, 0));
serverPlayer.changeDimension(destinationWorld, cakeTeleporter);
CakeTeleporter.addDimensionPosition(serverPlayer, serverPlayer.level().dimension(), serverPlayer.blockPosition());
serverPlayer.changeDimension(destinationWorld, TELEPORTER);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ public void teleportToDimension(LevelAccessor worldIn, BlockPos pos, Player play
if (destinationWorld == null)
return;

CakeTeleporter teleporter = new CakeTeleporter(destinationWorld);
CakeTeleporter.addDimensionPosition(serverPlayer, serverPlayer.level().dimension(), serverPlayer.blockPosition().offset(0, 1, 0));
serverPlayer.changeDimension(destinationWorld, teleporter);
CakeTeleporter.addDimensionPosition(serverPlayer, serverPlayer.level().dimension(), serverPlayer.blockPosition());
serverPlayer.changeDimension(destinationWorld, TELEPORTER);
}
}
}
Expand Down
Loading

0 comments on commit a16a744

Please sign in to comment.