use of net.minecraft.entity.item.ExperienceBottleEntity in project Arclight by IzzelAliz.
the class ExperienceBottleEntityMixin method onImpact.
/**
* @author IzzelAliz
* @reason
*/
@Overwrite
protected void onImpact(RayTraceResult result) {
if (!this.world.isRemote) {
int i = 3 + this.world.rand.nextInt(5) + this.world.rand.nextInt(5);
ExpBottleEvent event = CraftEventFactory.callExpBottleEvent((ExperienceBottleEntity) (Object) this, i);
i = event.getExperience();
if (event.getShowEffect()) {
this.world.playEvent(2002, new BlockPos((ExperienceBottleEntity) (Object) this), PotionUtils.getPotionColor(Potions.WATER));
}
while (i > 0) {
int j = ExperienceOrbEntity.getXPSplit(i);
i -= j;
this.world.addEntity(new ExperienceOrbEntity(this.world, this.posX, this.posY, this.posZ, j));
}
this.remove();
}
}
Aggregations