Class Divider

java.lang.Object
net.minecraft.util.math.Divider
All Implemented Interfaces:
IntIterator, Iterator<Integer>, PrimitiveIterator<Integer,IntConsumer>, PrimitiveIterator.OfInt

public class Divider extends Object implements IntIterator
A class for dividing an integer into divisor number of integers such that the difference between any integers is 0 or 1. The resulting integers sum to the dividend. For example, new Divider(13, 5) will produce 2, 3, 2, 3, 3.
Mappings:
Namespace Name
official c
intermediary net/minecraft/class_7836
named net/minecraft/util/math/Divider
  • Field Details

    • divisor

      private final int divisor
      Mappings:
      Namespace Name Mixin selector
      official a Lc;a:I
      intermediary field_40738 Lnet/minecraft/class_7836;field_40738:I
      named divisor Lnet/minecraft/util/math/Divider;divisor:I
    • quotient

      private final int quotient
      Mappings:
      Namespace Name Mixin selector
      official b Lc;b:I
      intermediary field_40739 Lnet/minecraft/class_7836;field_40739:I
      named quotient Lnet/minecraft/util/math/Divider;quotient:I
    • mod

      private final int mod
      Mappings:
      Namespace Name Mixin selector
      official c Lc;c:I
      intermediary field_40740 Lnet/minecraft/class_7836;field_40740:I
      named mod Lnet/minecraft/util/math/Divider;mod:I
    • returnedCount

      private int returnedCount
      Mappings:
      Namespace Name Mixin selector
      official d Lc;d:I
      intermediary field_40741 Lnet/minecraft/class_7836;field_40741:I
      named returnedCount Lnet/minecraft/util/math/Divider;returnedCount:I
    • remainder

      private int remainder
      Mappings:
      Namespace Name Mixin selector
      official e Lc;e:I
      intermediary field_40742 Lnet/minecraft/class_7836;field_40742:I
      named remainder Lnet/minecraft/util/math/Divider;remainder:I
  • Constructor Details

    • Divider

      public Divider(int dividend, int divisor)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lc;<init>(II)V
      intermediary <init> Lnet/minecraft/class_7836;<init>(II)V
      named <init> Lnet/minecraft/util/math/Divider;<init>(II)V
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<Integer>
    • nextInt

      public int nextInt()
      Specified by:
      nextInt in interface IntIterator
      Specified by:
      nextInt in interface PrimitiveIterator.OfInt
    • asIterable

      public static Iterable<Integer> asIterable(int dividend, int divisor)
      Mappings:
      Namespace Name Mixin selector
      official a Lc;a(II)Ljava/lang/Iterable;
      intermediary method_46402 Lnet/minecraft/class_7836;method_46402(II)Ljava/lang/Iterable;
      named asIterable Lnet/minecraft/util/math/Divider;asIterable(II)Ljava/lang/Iterable;