Class WeightedList<U>

java.lang.Object
net.minecraft.util.collection.WeightedList<U>

public class WeightedList<U>
extends Object
Mappings:
Namespace Name
official avr
intermediary net/minecraft/class_4131
named net/minecraft/util/collection/WeightedList
  • Field Details

    • entries

      protected final List<WeightedList.Entry<U>> entries
      Mappings:
      Namespace Name Mixin selector
      official a Lavr;a:Ljava/util/List;
      intermediary field_18397 Lnet/minecraft/class_4131;field_18397:Ljava/util/List;
      named entries Lnet/minecraft/util/collection/WeightedList;entries:Ljava/util/List;
    • random

      private final Random random
      Mappings:
      Namespace Name Mixin selector
      official b Lavr;b:Ljava/util/Random;
      intermediary field_18398 Lnet/minecraft/class_4131;field_18398:Ljava/util/Random;
      named random Lnet/minecraft/util/collection/WeightedList;random:Ljava/util/Random;
  • Constructor Details

    • WeightedList

      public WeightedList()
    • WeightedList

      private WeightedList​(List<WeightedList.Entry<U>> entries)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lavr;<init>(Ljava/util/List;)V
      intermediary <init> Lnet/minecraft/class_4131;<init>(Ljava/util/List;)V
      named <init> Lnet/minecraft/util/collection/WeightedList;<init>(Ljava/util/List;)V
  • Method Details

    • createCodec

      public static <U> com.mojang.serialization.Codec<WeightedList<U>> createCodec​(com.mojang.serialization.Codec<U> codec)
      Mappings:
      Namespace Name Mixin selector
      official a Lavr;a(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      intermediary method_28338 Lnet/minecraft/class_4131;method_28338(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
      named createCodec Lnet/minecraft/util/collection/WeightedList;createCodec(Lcom/mojang/serialization/Codec;)Lcom/mojang/serialization/Codec;
    • add

      public WeightedList<U> add​(U item, int weight)
      Mappings:
      Namespace Name Mixin selector
      official a Lavr;a(Ljava/lang/Object;I)Lavr;
      intermediary method_19031 Lnet/minecraft/class_4131;method_19031(Ljava/lang/Object;I)Lnet/minecraft/class_4131;
      named add Lnet/minecraft/util/collection/WeightedList;add(Ljava/lang/Object;I)Lnet/minecraft/util/collection/WeightedList;
    • shuffle

      public WeightedList<U> shuffle()
      Mappings:
      Namespace Name Mixin selector
      official a Lavr;a()Lavr;
      intermediary method_19029 Lnet/minecraft/class_4131;method_19029()Lnet/minecraft/class_4131;
      named shuffle Lnet/minecraft/util/collection/WeightedList;shuffle()Lnet/minecraft/util/collection/WeightedList;
    • shuffle

      public WeightedList<U> shuffle​(Random random)
      Mappings:
      Namespace Name Mixin selector
      official a Lavr;a(Ljava/util/Random;)Lavr;
      intermediary method_23333 Lnet/minecraft/class_4131;method_23333(Ljava/util/Random;)Lnet/minecraft/class_4131;
      named shuffle Lnet/minecraft/util/collection/WeightedList;shuffle(Ljava/util/Random;)Lnet/minecraft/util/collection/WeightedList;
    • isEmpty

      public boolean isEmpty()
      Mappings:
      Namespace Name Mixin selector
      official b Lavr;b()Z
      intermediary method_28339 Lnet/minecraft/class_4131;method_28339()Z
      named isEmpty Lnet/minecraft/util/collection/WeightedList;isEmpty()Z
    • stream

      public Stream<U> stream()
      Mappings:
      Namespace Name Mixin selector
      official c Lavr;c()Ljava/util/stream/Stream;
      intermediary method_19032 Lnet/minecraft/class_4131;method_19032()Ljava/util/stream/Stream;
      named stream Lnet/minecraft/util/collection/WeightedList;stream()Ljava/util/stream/Stream;
    • pickRandom

      public U pickRandom​(Random random)
      Mappings:
      Namespace Name Mixin selector
      official b Lavr;b(Ljava/util/Random;)Ljava/lang/Object;
      intermediary method_23337 Lnet/minecraft/class_4131;method_23337(Ljava/util/Random;)Ljava/lang/Object;
      named pickRandom Lnet/minecraft/util/collection/WeightedList;pickRandom(Ljava/util/Random;)Ljava/lang/Object;
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Mappings:
      Namespace Name Mixin selector
      official toString Lavr;toString()Ljava/lang/String;
      intermediary toString Lnet/minecraft/class_4131;toString()Ljava/lang/String;
      named toString Lnet/minecraft/util/collection/WeightedList;toString()Ljava/lang/String;