com.parzivail.util.block.mutating.FallingMutatingBlock Maven / Gradle / Ivy
package com.parzivail.util.block.mutating;
import com.parzivail.util.block.PFallingBlock;
import net.minecraft.class_2248;
import net.minecraft.class_2338;
import net.minecraft.class_2680;
import net.minecraft.class_3218;
import net.minecraft.class_5819;
public class FallingMutatingBlock extends PFallingBlock
{
private final class_2248 target;
private final int meanTransitionTime;
public FallingMutatingBlock(class_2248 target, int meanTransitionTime, class_2251 settings, int dustColor)
{
super(settings.method_9640(), dustColor);
this.target = target;
this.meanTransitionTime = meanTransitionTime;
}
@Override
public void method_9514(class_2680 state, class_3218 world, class_2338 pos, class_5819 random)
{
if (!canTransition(state, world, pos, random))
return;
if (random.method_43048(meanTransitionTime) == 0)
world.method_8652(pos, target.method_34725(state), field_31028);
}
protected boolean canTransition(class_2680 state, class_3218 world, class_2338 pos, class_5819 random)
{
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy