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

com.parzivail.pswg.mixin.CactusBlockMixin Maven / Gradle / Ivy

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

import com.parzivail.pswg.container.SwgTags;
import net.minecraft.class_2266;
import net.minecraft.class_2338;
import net.minecraft.class_2680;
import net.minecraft.class_4538;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(class_2266.class)
public abstract class CactusBlockMixin
{
	@Inject(method = "canPlaceAt", at = @At(value = "RETURN", ordinal = 1), cancellable = true)
	private void canPlaceAt(class_2680 state, class_4538 world, class_2338 pos, CallbackInfoReturnable cir)
	{
		var below = world.method_8320(pos.method_10074());
		if (below.method_26164(SwgTags.Blocks.DESERT_SAND))
			cir.setReturnValue(true);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy