Fix scarpet's unmountable attribute
This commit is contained in:
1 parent
469a9356f6
commit
c9b90ab766
2 files changed
+9
-2
No files matched your search
@@ -204,7 +204,7 @@ Entity that `e` rides.
|
|||||||
|
|
||||||
### `query(e, 'unmountable')`
|
### `query(e, 'unmountable')`
|
||||||
|
|
||||||
Boolean, true if the entity cannot be mounted.
|
Boolean, true if the entity cannot be unmounted.
|
||||||
|
|
||||||
### `(deprecated) query(e, 'tags')`
|
### `(deprecated) query(e, 'tags')`
|
||||||
|
|
||||||
@@ -727,7 +727,7 @@ Mounts the entity to the `other`.
|
|||||||
|
|
||||||
### `modify(e, 'unmountable', boolean)`
|
### `modify(e, 'unmountable', boolean)`
|
||||||
|
|
||||||
Denies or allows an entity to be mounted.
|
Denies or allows an entity to be unmounted.
|
||||||
|
|
||||||
### `modify(e, 'drop_passengers')`
|
### `modify(e, 'drop_passengers')`
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||||
|
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
|
||||||
|
|
||||||
import static carpet.script.CarpetEventServer.Event.PLAYER_ATTACKS_ENTITY;
|
import static carpet.script.CarpetEventServer.Event.PLAYER_ATTACKS_ENTITY;
|
||||||
import static carpet.script.CarpetEventServer.Event.PLAYER_DEALS_DAMAGE;
|
import static carpet.script.CarpetEventServer.Event.PLAYER_DEALS_DAMAGE;
|
||||||
@@ -86,4 +87,10 @@ public abstract class Player_scarpetEventsMixin extends LivingEntity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ModifyReturnValue(method = "wantsToStopRiding", at = @At("TAIL"))
|
||||||
|
private boolean dontUnmountFromIfPermanentVehicle(boolean original)
|
||||||
|
{
|
||||||
|
return original && !((EntityInterface) this.getVehicle()).isPermanentVehicle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user