aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/rosegoldaddons/mixins/blocksize/MixinBlockLever.java
blob: 9a929f366b89820e45467a1518ca3bcd4903145c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package rosegoldaddons.mixins.blocksize;

import net.minecraft.block.Block;
import net.minecraft.block.BlockLever;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
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.CallbackInfo;
import rosegoldaddons.Main;

@Mixin(BlockLever.class)
public abstract class MixinBlockLever extends Block {

    public MixinBlockLever(Material blockMaterialIn, MapColor blockMapColorIn) {
        super(blockMaterialIn, blockMapColorIn);
    }

    @Inject(method = "setBlockBoundsBasedOnState", at = @At("HEAD"), cancellable = true)
    private void changeBlockBounds(IBlockAccess worldIn, BlockPos pos, CallbackInfo ci) {
        if(Main.configFile.dungeonBlocksBig) {
            this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
            ci.cancel();
        }
    }
}