Fix server issues
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
package com.kasetoatz.boatjump;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class BoatJump implements ModInitializer {
|
||||
public static MinecraftClient client;
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
client = MinecraftClient.getInstance();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.kasetoatz.boatjump.mixin;
|
||||
|
||||
import com.kasetoatz.boatjump.BoatJump;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.vehicle.AbstractBoatEntity;
|
||||
import net.minecraft.entity.vehicle.VehicleEntity;
|
||||
import net.minecraft.world.World;
|
||||
@@ -22,7 +22,7 @@ public abstract class BoatEntityMixin extends VehicleEntity {
|
||||
|
||||
@Inject(method="tick", at=@At("HEAD"))
|
||||
public void tick(CallbackInfo ci) {
|
||||
if (this.getControllingPassenger() == BoatJump.client.player && this.location == AbstractBoatEntity.Location.IN_WATER) {
|
||||
if (this.getControllingPassenger() instanceof PlayerEntity && this.location == AbstractBoatEntity.Location.IN_WATER) {
|
||||
this.setOnGround(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.kasetoatz.boatjump.mixin;
|
||||
|
||||
import com.kasetoatz.boatjump.BoatJump;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.vehicle.AbstractBoatEntity;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -17,7 +17,7 @@ public abstract class EntityMixin {
|
||||
|
||||
@Inject(method="getStepHeight", at = @At("HEAD"), cancellable = true)
|
||||
public void getStepHeight(CallbackInfoReturnable<Float> cir) {
|
||||
if ((Entity)(Object)this instanceof AbstractBoatEntity && this.getControllingPassenger() == BoatJump.client.player) {
|
||||
if ((Entity)(Object)this instanceof AbstractBoatEntity && this.getControllingPassenger() instanceof PlayerEntity) {
|
||||
cir.setReturnValue(1.f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,6 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"com.kasetoatz.boatjump.BoatJump"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
"boatjump.mixins.json"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user