WeatheringCopperDoorBlock .java

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

net.minecraft.world.level.blockclass41 linescommonextends DoorBlock1.4 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

WeatheringCopperDoorBlock.java41 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
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf;
10
11
/**
12
 * Access widened by fabric-transitive-access-wideners-v1 to accessible
13
 */
14
public class WeatheringCopperDoorBlock extends DoorBlock implements WeatheringCopper {
15
	private final WeatheringCopper.WeatherState weatherState;
16
17
	/**
18
	 * Access widened by fabric-transitive-access-wideners-v1 to accessible
19
	 */
20
	public WeatheringCopperDoorBlock(final BlockSetType type, final WeatheringCopper.WeatherState weatherState, final BlockBehaviour.Properties properties) {
21
		super(type, properties);
22
		this.weatherState = weatherState;
23
	}
24
25
	@Override
26
	protected void randomTick(final BlockState state, final ServerLevel level, final BlockPos pos, final RandomSource random) {
27
		if (state.getValue(DoorBlock.HALF) == DoubleBlockHalf.LOWER) {
28
			this.changeOverTime(state, level, pos, random);
29
		}
30
	}
31
32
	@Override
33
	protected boolean isRandomlyTicking(final BlockState state) {
34
		return WeatheringCopper.getNext(state.getBlock()).isPresent();
35
	}
36
37
	public WeatheringCopper.WeatherState getAge() {
38
		return this.weatherState;
39
	}
40
}
41

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