Quotient .java

net.minecraft.world.level.storage.loot.providers.number.ints.Quotient (record): members: left, right, getIntUnsafe, MAP_CODEC, codec. imports: LootContext.

net.minecraft.world.level.storage.loot.providers.number.intsrecord21 linescommon830 B

Implements

API Surface (2)

MapCodec<Quotient> codec()
int getIntUnsafe(final LootContext context)

Fields & Constants (1)

MAP_CODEC

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

Quotient.java21 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.storage.loot.providers.number.ints;
2
3
import com.mojang.serialization.MapCodec;
4
import net.minecraft.core.Holder;
5
import net.minecraft.world.level.storage.loot.LootContext;
6
import net.minecraft.world.level.storage.loot.providers.number.BinaryProvider;
7
8
public record Quotient(Holder<ContextIntProvider> left, Holder<ContextIntProvider> right) implements ContextIntProvider, BinaryProvider<ContextIntProvider> {
9
	public static final MapCodec<Quotient> MAP_CODEC = BinaryProvider.mapCodec(ContextIntProviders.CODEC, Quotient::new);
10
11
	@Override
12
	public MapCodec<Quotient> codec() {
13
		return MAP_CODEC;
14
	}
15
16
	@Override
17
	public int getIntUnsafe(final LootContext context) throws ArithmeticException {
18
		return this.left().value().getIntUnsafe(context) / this.right().value().getIntUnsafe(context);
19
	}
20
}
21

Decompiled Minecraft 26.3 source of Quotient (net/minecraft/world/level/storage/loot/providers/number/ints/Quotient.java) with Mojang official mappings, stored verbatim on the site.