Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Sihuai2412 committed Oct 4, 2024
1 parent 27eeb09 commit 8844cd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ public void tick() {
if (ownerAttack != null){
Vec3 direction = ModUtils.getDirection(position(), ownerAttack.position(), 1.8D);
double[] dirs = {direction.x, direction.y, direction.z};
setDeltaMovement(dirs[0] / 20.5, dirs[1] / 20.5, dirs[2] / 20.5);
setDeltaMovement(dirs[0] / 18.5
, dirs[1] / 18.5
, dirs[2] / 18.5);
setRot(-(ModUtils.dirToRot(direction)[0]), -(ModUtils.dirToRot(direction)[1]));
} else {
if (owner != null){
Expand All @@ -50,9 +52,7 @@ protected void onHitEntity(@NotNull EntityHitResult entityHitResult) {
Entity entity = entityHitResult.getEntity();
if (level() instanceof ServerLevel){
float damage = 3.8F;
entity.hurt(damageSources().mobAttack(owner), damage);
RandomSource random = level().random;
setDeltaMovement(random.nextFloat() / 2, random.nextFloat() / 2, random.nextFloat() / 2);
entity.hurt(damageSources().mobAttack(this), damage);
}
}
}
3 changes: 2 additions & 1 deletion src/main/java/org/confluence/mod/item/ModTabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.confluence.mod.item.mana.ManaWeapons;
import org.confluence.mod.item.pickaxe.Pickaxes;
import org.confluence.mod.item.potion.TerraPotions;
import org.confluence.mod.item.staff.Staffs;
import org.confluence.mod.item.sword.Swords;

import static org.confluence.mod.block.ModBlocks.*;
Expand Down Expand Up @@ -398,7 +399,7 @@ public final class ModTabs {
() -> CreativeModeTab.builder().icon(() -> new ItemStack(IconItem.Icons.SUMMON_ICON.get()))
.title(Component.translatable("creativetab.confluence.summoners"))
.displayItems((parameters, output) -> {

for (Staffs staff : Staffs.values()) output.accept(staff.get());
})
.build());
// 食物与药水
Expand Down

0 comments on commit 8844cd7

Please sign in to comment.