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

com.parzivail.util.block.DisplacingBlock Maven / Gradle / Ivy

package com.parzivail.util.block;

import net.minecraft.class_1922;
import net.minecraft.class_2338;
import net.minecraft.class_265;
import net.minecraft.class_2680;
import net.minecraft.class_3726;

public class DisplacingBlock extends WaterloggableBlock
{
	@FunctionalInterface
	public interface ShapeFunction
	{
		class_265 apply(class_2680 state, class_1922 world, class_2338 pos, class_3726 context);
	}

	private final ShapeFunction shapeFunction;

	public DisplacingBlock(ShapeFunction shapeFunction, class_2251 settings)
	{
		super(settings.method_9624());
		this.shapeFunction = shapeFunction;
	}

	public DisplacingBlock(class_265 shape, class_2251 settings)
	{
		super(settings.method_9624());
		this.shapeFunction = (state, world, pos, context) -> shape;
	}

	@Override
	public class_265 method_9530(class_2680 state, class_1922 world, class_2338 pos, class_3726 context)
	{
		return shapeFunction.apply(state, world, pos, context);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy