mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 10:27:55 +01:00
Added ItemMonsterEgg.java for diff visibility
This commit is contained in:
parent
a4ce846d07
commit
390a79e098
32
src/main/java/net/minecraft/server/ItemMonsterEgg.java
Normal file
32
src/main/java/net/minecraft/server/ItemMonsterEgg.java
Normal file
@ -0,0 +1,32 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
public class ItemMonsterEgg extends Item {
|
||||
|
||||
public ItemMonsterEgg(int i) {
|
||||
super(i);
|
||||
this.e(1);
|
||||
this.a(true);
|
||||
}
|
||||
|
||||
public boolean a(ItemStack itemstack, EntityHuman entityhuman, World world, int i, int j, int k, int l) {
|
||||
if (world.isStatic) {
|
||||
return true;
|
||||
} else {
|
||||
i += Facing.b[l];
|
||||
j += Facing.c[l];
|
||||
k += Facing.d[l];
|
||||
Entity entity = EntityTypes.a(itemstack.getData(), world);
|
||||
|
||||
if (entity != null) {
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
--itemstack.count;
|
||||
}
|
||||
|
||||
entity.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
|
||||
world.addEntity(entity);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user