Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void applyPollinationEffect() {
- if (getBeeData().getMutationData().hasMutation()) {
- AxisAlignedBB box = this.getMutationBoundingBox();
- List<Entity> entityList = this.world.getEntitiesInAABBexcluding(this, box, (entity) ->
- getBeeData().getMutationData().iEntityMutations.get(entity.getType()) != null);
- if (!entityList.isEmpty()) {
- MutationData.IEntityMutation mutation = getBeeData().getMutationData().iEntityMutations.get(entityList.get(0).getType());
- Pair<EntityType, MutationData.MutationOutputData> output = mutation.outputs.next();
- float nextFloat = world.rand.nextFloat();
- if (output.getRight().chance >= nextFloat) {
- output.getKey().spawn((ServerWorld) world, output.getRight().nbt, null, null, entityList.get(0).getBlockPos(), SpawnReason.NATURAL, false, false);
- entityList.get(0).remove();
- world.playEvent(2005, this.getBlockPos().down(1), 0);
- }
- addCropCounter();
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement