Skip to content

Commit

Permalink
Fix a fatal bug. Bump to 1.4.28.
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <[email protected]>
  • Loading branch information
qyl27 committed Nov 18, 2024
1 parent 312a74b commit 84efcb4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod_name=Power Tool
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPL-3.0
# The mod version. See https://semver.org/
mod_version=1.4.27
mod_version=1.4.28
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public boolean hurt(@NotNull DamageSource source, float amount) {
this.setDamage(this.getDamage() + amount * 10.0F);
this.gameEvent(GameEvent.ENTITY_DAMAGE, source.getEntity());
boolean flag = source.getEntity() instanceof Player && ((Player) source.getEntity()).getAbilities().instabuild;
if ((flag || !(this.getDamage() > 40.0F)) && !this.shouldSourceDestroy(source)) {
if ((flag || !(this.getDamage() > 10.0F)) && !this.shouldSourceDestroy(source)) {
if (flag) {
this.discard();
}
Expand All @@ -148,7 +148,7 @@ boolean shouldSourceDestroy(DamageSource source) {
}

public void destroy(Item dropItem) {
this.kill();
this.discard();
if (this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
ItemStack itemstack = new ItemStack(dropItem);
itemstack.set(DataComponents.CUSTOM_NAME, this.getCustomName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void appendHoverText(@NotNull ItemStack stack, @NotNull TooltipContext co
var entity = new MartingCarEntity(PowerToolEntities.MARTING.get(), level);
entity.setVariant(variant);
entity.setPos(pos.getCenter());
context.getItemInHand().shrink(1);
level.addFreshEntity(entity);
}
return InteractionResult.SUCCESS;
Expand Down

0 comments on commit 84efcb4

Please sign in to comment.