This commit is contained in:
parent
8695aface5
commit
0ec13d83fd
@ -110,21 +110,23 @@ public class MixinBoatEntity implements BoatUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
private void dropItemsOnDestroy() {
|
private void dropItemsOnDestroy(boolean isCreative) {
|
||||||
if (((BoatEntity) (Object) this).getEntityWorld().getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) {
|
if (((BoatEntity) (Object) this).getEntityWorld().getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) {
|
||||||
|
if (!isCreative) {
|
||||||
((BoatEntity) (Object) this).dropStack(new ItemStack(getChestItem()));
|
((BoatEntity) (Object) this).dropStack(new ItemStack(getChestItem()));
|
||||||
|
}
|
||||||
dropItems();
|
dropItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/vehicle/BoatEntity;remove()V"), method = "damage")
|
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/vehicle/BoatEntity;remove()V"), method = "damage")
|
||||||
public void damage(DamageSource source, float amount, CallbackInfoReturnable<Boolean> info) {
|
public void damage(DamageSource source, float amount, CallbackInfoReturnable<Boolean> info) {
|
||||||
dropItemsOnDestroy();
|
dropItemsOnDestroy(source.getAttacker() instanceof PlayerEntity && ((PlayerEntity) source.getAttacker()).isCreative());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/vehicle/BoatEntity;remove()V"), method = "fall")
|
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/vehicle/BoatEntity;remove()V"), method = "fall")
|
||||||
public void fall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition, CallbackInfo info) {
|
public void fall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition, CallbackInfo info) {
|
||||||
dropItemsOnDestroy();
|
dropItemsOnDestroy(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Unique
|
@Unique
|
||||||
|
Reference in New Issue
Block a user