Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update for minecraft 1.20.0 #9

Merged
merged 2 commits into from
Jun 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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