Skip to content

Commit

Permalink
update for minecraft 1.20.0 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcal43 authored Jun 10, 2023
1 parent 6da105f commit 4352c58
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
org.gradle.jvmargs=-Xmx1G

# Mod
mod_version = 0.2.1+1.19.4-prerelease
mod_version = 0.3.0+1.20.0-prerelease
maven_group = net.pcal
archives_base_name = highspeed-rail

# Fabric & Minecraft - https://fabricmc.net/develop
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.19
minecraft_version=1.20
yarn_mappings=1.20+build.1
loader_version=0.14.21

#Fabric api
fabric_version=0.76.0+1.19.4
fabric_version=0.83.0+1.20
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ private double getModifiedMaxSpeed() {
currentPos.getY(),
currentPos.getZ() + MathHelper.sign(v.getZ())
);
final BlockState nextState = minecart.world.getBlockState(nextPos);
final BlockState nextState = minecart.getWorld().getBlockState(nextPos);
if (nextState.getBlock() instanceof AbstractRailBlock rail) {
final RailShape shape = nextState.get(rail.getShapeProperty());
if (shape == RailShape.NORTH_EAST || shape == RailShape.NORTH_WEST || shape == RailShape.SOUTH_EAST || shape == RailShape.SOUTH_WEST) {
return maxSpeed = VANILLA_MAX_SPEED;
} else {
final BlockState underState = minecart.world.getBlockState(currentPos.down());
final BlockState underState = minecart.getWorld().getBlockState(currentPos.down());
final Identifier underBlockId = Registries.BLOCK.getId(underState.getBlock());
final Integer cartSpeedBps = HighspeedService.getInstance().getCartSpeed(underBlockId);
if (cartSpeedBps != null) {
Expand Down Expand Up @@ -97,7 +97,7 @@ private void updateSpeedometer() {
final HighspeedService service = HighspeedService.getInstance();
if (!service.isSpeedometerEnabled()) return;
final AbstractMinecartEntity minecart = (AbstractMinecartEntity) (Object) this;
if (!minecart.world.isClient) return;
if (!minecart.getWorld().isClient) return;
final HighspeedClientService client = service.getClientService();
if (!client.isPlayerRiding(minecart)) return;
final double override = getModifiedMaxSpeed();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"depends": {
"fabricloader": ">=0.11.3",
"fabric": "*",
"minecraft": "1.19.x",
"minecraft": "1.20.x",
"java": ">=17"
},
"conflicts": {}
Expand Down

0 comments on commit 4352c58

Please sign in to comment.