Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba7263a
commit 5315abc
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/org/auioc/mcmod/arnicalib/server/event/impl/ItemHurtEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.auioc.mcmod.arnicalib.server.event.impl; | ||
|
||
import java.util.Random; | ||
import javax.annotation.Nullable; | ||
import org.auioc.mcmod.arnicalib.api.game.event.ServerPlayerEvent; | ||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
public class ItemHurtEvent extends ServerPlayerEvent { | ||
|
||
private final ItemStack itemStack; | ||
private final Random random; | ||
private int damage; | ||
|
||
public ItemHurtEvent(ItemStack itemStack, int damage, Random random, @Nullable ServerPlayer player) { | ||
super(player); | ||
this.itemStack = itemStack; | ||
this.damage = damage; | ||
this.random = random; | ||
} | ||
|
||
public ItemStack getItemStack() { | ||
return this.itemStack; | ||
} | ||
|
||
public Random getRandom() { | ||
return this.random; | ||
} | ||
|
||
public int getDamage() { | ||
return this.damage; | ||
} | ||
|
||
public void setDamage(int damage) { | ||
this.damage = damage; | ||
} | ||
|
||
} | ||
|