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

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

There is a newer version: 0.0.114+1.20.2
Show newest version
package com.parzivail.util.block;

import net.minecraft.class_1750;
import net.minecraft.class_1937;
import net.minecraft.class_2248;
import net.minecraft.class_2338;
import net.minecraft.class_2459;
import net.minecraft.class_2680;
import net.minecraft.class_2689;
import net.minecraft.class_2746;
import net.minecraft.class_3218;
import net.minecraft.class_4970;
import net.minecraft.class_5819;
import org.jetbrains.annotations.Nullable;

public class InvertedLampBlock extends class_2248
{
	public static final class_2746 LIT = class_2459.field_11446;

	public InvertedLampBlock(class_4970.class_2251 settings)
	{
		super(settings);
		this.method_9590(this.method_9564().method_11657(LIT, true));
	}

	@Override
	@Nullable
	public class_2680 method_9605(class_1750 ctx)
	{
		return this.method_9564().method_11657(LIT, !ctx.method_8045().method_49803(ctx.method_8037()));
	}

	@Override
	public void method_9612(class_2680 state, class_1937 world, class_2338 pos, class_2248 block, class_2338 fromPos, boolean notify)
	{
		if (!world.field_9236)
		{
			boolean bl = state.method_11654(LIT);
			if (bl == world.method_49803(pos))
			{
				if (bl)
				{
					world.method_39279(pos, this, 4);
				}
				else
				{
					world.method_8652(pos, state.method_28493(LIT), 2);
				}
			}
		}
	}

	@Override
	public void method_9588(class_2680 state, class_3218 world, class_2338 pos, class_5819 random)
	{
		if (state.method_11654(LIT) && world.method_49803(pos))
		{
			world.method_8652(pos, state.method_28493(LIT), 2);
		}
	}

	@Override
	protected void method_9515(class_2689.class_2690 builder)
	{
		builder.method_11667(LIT);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy