Biome Features Updated

This commit is contained in:
Frank Bauer 2021-06-24 17:58:09 +02:00
parent aca43764ad
commit 78bf62bdca
8 changed files with 57 additions and 19 deletions

View file

@ -0,0 +1,26 @@
package ru.betterend.mixin.common;
import net.minecraft.world.entity.ai.behavior.ShufflingList;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import ru.betterend.util.ShuffelingListExtended;
import java.util.List;
import java.util.Random;
import java.util.stream.Stream;
@Mixin(ShufflingList.class)
public abstract class ShuffelingListMixin<U> implements ShuffelingListExtended<U> {
@Shadow @Final protected List<ShufflingList.WeightedEntry<U>> entries;
public boolean isEmpty() {
return this.entries.isEmpty();
}
@Shadow public abstract ShufflingList<U> shuffle();
public U getOne() {
return this.shuffle().stream().findFirst().orElseThrow(RuntimeException::new);
}
}