fix water issue
This commit is contained in:
@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
loader_version=0.16.10
|
loader_version=0.16.10
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.0
|
mod_version = 1.1
|
||||||
maven_group = com.kasetoatz
|
maven_group = com.kasetoatz
|
||||||
archives_base_name = BoatJump
|
archives_base_name = BoatJump
|
||||||
|
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.kasetoatz.boatjump.mixin;
|
||||||
|
|
||||||
|
import com.kasetoatz.boatjump.BoatJump;
|
||||||
|
import net.minecraft.entity.EntityType;
|
||||||
|
import net.minecraft.entity.vehicle.AbstractBoatEntity;
|
||||||
|
import net.minecraft.entity.vehicle.VehicleEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
|
||||||
|
@Mixin(AbstractBoatEntity.class)
|
||||||
|
public abstract class BoatEntityMixin extends VehicleEntity {
|
||||||
|
@Shadow private AbstractBoatEntity.Location location;
|
||||||
|
|
||||||
|
public BoatEntityMixin(EntityType<?> entityType, World world) {
|
||||||
|
super(entityType, world);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method="tick", at=@At("HEAD"))
|
||||||
|
public void tick(CallbackInfo ci) {
|
||||||
|
if (this.getControllingPassenger() == BoatJump.client.player && this.location == AbstractBoatEntity.Location.IN_WATER) {
|
||||||
|
this.setOnGround(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,7 +4,8 @@
|
|||||||
"package": "com.kasetoatz.boatjump.mixin",
|
"package": "com.kasetoatz.boatjump.mixin",
|
||||||
"compatibilityLevel": "JAVA_21",
|
"compatibilityLevel": "JAVA_21",
|
||||||
"client": [
|
"client": [
|
||||||
"EntityMixin"
|
"EntityMixin",
|
||||||
|
"BoatEntityMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
Reference in New Issue
Block a user