All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.parzivail.util.block.mutating.RuiningDryingStairsBlock Maven / Gradle / Ivy

package com.parzivail.util.block.mutating;

import com.google.common.base.Suppliers;
import com.parzivail.util.world.WorldUtil;
import java.util.function.Supplier;
import net.minecraft.class_1297;
import net.minecraft.class_1309;
import net.minecraft.class_1657;
import net.minecraft.class_1928;
import net.minecraft.class_1937;
import net.minecraft.class_2338;
import net.minecraft.class_2510;
import net.minecraft.class_2680;
import net.minecraft.class_3218;
import net.minecraft.class_5819;

public class RuiningDryingStairsBlock extends MutatingStairsBlock
{
	private final Supplier ruinedBlock;

	public RuiningDryingStairsBlock(class_2680 baseBlockState, class_2510 target, int meanTransitionTime, Supplier ruinedBlock, class_2251 settings)
	{
		super(baseBlockState, target, meanTransitionTime, settings);
		this.ruinedBlock = Suppliers.memoize(ruinedBlock::get);
	}

	@Override
	protected boolean canTransition(class_2680 state, class_3218 world, class_2338 pos, class_5819 random)
	{
		return WorldUtil.isSunLit(world, pos);
	}

	@Override
	public void method_9548(class_2680 state, class_1937 world, class_2338 pos, class_1297 entity)
	{
		if (!world.field_9236 && entity instanceof class_1309 && (entity instanceof class_1657 || world.method_8450().method_8355(class_1928.field_19388)) && entity.method_17681() * entity.method_17681() * entity.method_17682() > 0.512F)
			world.method_8501(pos, method_9582(state, ruinedBlock.get().method_34725(state), world, pos));

		super.method_9548(state, world, pos, entity);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy