WeatheringCopperTrapDoorBlock .java

net.minecraft.world.level.block.WeatheringCopperTrapDoorBlock (class): members: weatherState, getAge, isRandomlyTicking, randomTick. imports: BlockSetType.

net.minecraft.world.level.blockclass38 linescommonextends TrapDoorBlock1.3 KB

Implements

API Surface (3)

void randomTick(final BlockState state, final ServerLevel level, final BlockPos pos, final RandomSource random)
boolean isRandomlyTicking(final BlockState state)
WeatheringCopper.WeatherState getAge()

Fields & Constants (1)

weatherState

Full Source

WeatheringCopperTrapDoorBlock.java38 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.block;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.server.level.ServerLevel;
5
import net.minecraft.util.RandomSource;
6
import net.minecraft.world.level.block.state.BlockBehaviour;
7
import net.minecraft.world.level.block.state.BlockState;
8
import net.minecraft.world.level.block.state.properties.BlockSetType;
9
10
/**
11
 * Access widened by fabric-transitive-access-wideners-v1 to accessible
12
 */
13
public class WeatheringCopperTrapDoorBlock extends TrapDoorBlock implements WeatheringCopper {
14
	private final WeatheringCopper.WeatherState weatherState;
15
16
	/**
17
	 * Access widened by fabric-transitive-access-wideners-v1 to accessible
18
	 */
19
	public WeatheringCopperTrapDoorBlock(final BlockSetType type, final WeatheringCopper.WeatherState weatherState, final BlockBehaviour.Properties properties) {
20
		super(type, properties);
21
		this.weatherState = weatherState;
22
	}
23
24
	@Override
25
	protected void randomTick(final BlockState state, final ServerLevel level, final BlockPos pos, final RandomSource random) {
26
		this.changeOverTime(state, level, pos, random);
27
	}
28
29
	@Override
30
	protected boolean isRandomlyTicking(final BlockState state) {
31
		return WeatheringCopper.getNext(state.getBlock()).isPresent();
32
	}
33
34
	public WeatheringCopper.WeatherState getAge() {
35
		return this.weatherState;
36
	}
37
}
38

Decompiled Minecraft 26.3 source of WeatheringCopperTrapDoorBlock (net/minecraft/world/level/block/WeatheringCopperTrapDoorBlock.java) with Mojang official mappings, stored verbatim on the site.