com.parzivail.pswg.mixin.CactusBlockMixin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pswg Show documentation
Show all versions of pswg Show documentation
Explore the galaxy with Galaxies: Parzi's Star Wars Mod!
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