This commit is contained in:
parent
8695aface5
commit
0ec13d83fd
@ -110,21 +110,23 @@ public class MixinBoatEntity implements BoatUtil {
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void dropItemsOnDestroy() {
|
||||
private void dropItemsOnDestroy(boolean isCreative) {
|
||||
if (((BoatEntity) (Object) this).getEntityWorld().getGameRules().getBoolean(GameRules.DO_ENTITY_DROPS)) {
|
||||
((BoatEntity) (Object) this).dropStack(new ItemStack(getChestItem()));
|
||||
if (!isCreative) {
|
||||
((BoatEntity) (Object) this).dropStack(new ItemStack(getChestItem()));
|
||||
}
|
||||
dropItems();
|
||||
}
|
||||
}
|
||||
|
||||
@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) {
|
||||
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")
|
||||
public void fall(double heightDifference, boolean onGround, BlockState landedState, BlockPos landedPosition, CallbackInfo info) {
|
||||
dropItemsOnDestroy();
|
||||
dropItemsOnDestroy(false);
|
||||
}
|
||||
|
||||
@Unique
|
||||
|
Reference in New Issue
Block a user