2018-11-05 16:36:10 +01:00
|
|
|
package de.ellpeck.naturesaura.blocks;
|
|
|
|
|
2019-02-02 14:54:52 +01:00
|
|
|
import de.ellpeck.naturesaura.api.render.IVisualizable;
|
2021-12-04 15:40:09 +01:00
|
|
|
import de.ellpeck.naturesaura.blocks.tiles.BlockEntityPlacer;
|
2020-01-29 01:34:58 +01:00
|
|
|
import de.ellpeck.naturesaura.data.BlockStateGenerator;
|
|
|
|
import de.ellpeck.naturesaura.reg.ICustomBlockState;
|
2021-12-15 16:24:53 +01:00
|
|
|
import net.minecraft.core.BlockPos;
|
|
|
|
import net.minecraft.world.level.Level;
|
|
|
|
import net.minecraft.world.level.block.SoundType;
|
|
|
|
import net.minecraft.world.phys.AABB;
|
2019-10-20 22:30:49 +02:00
|
|
|
import net.minecraftforge.api.distmarker.Dist;
|
|
|
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
2018-11-05 16:36:10 +01:00
|
|
|
|
2020-01-29 01:34:58 +01:00
|
|
|
public class BlockPlacer extends BlockContainerImpl implements IVisualizable, ICustomBlockState {
|
2018-11-05 16:36:10 +01:00
|
|
|
|
|
|
|
public BlockPlacer() {
|
2023-07-08 12:32:27 +02:00
|
|
|
super("placer", BlockEntityPlacer.class, Properties.of().strength(2.5F).sound(SoundType.STONE));
|
2018-11-05 16:36:10 +01:00
|
|
|
}
|
2019-02-02 14:54:52 +01:00
|
|
|
|
|
|
|
@Override
|
2019-10-20 22:30:49 +02:00
|
|
|
@OnlyIn(Dist.CLIENT)
|
2021-12-15 14:26:42 +01:00
|
|
|
public AABB getVisualizationBounds(Level level, BlockPos pos) {
|
2021-12-15 16:24:53 +01:00
|
|
|
return new AABB(pos).inflate(5);
|
2019-02-02 14:54:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-10-20 22:30:49 +02:00
|
|
|
@OnlyIn(Dist.CLIENT)
|
2021-12-04 15:40:09 +01:00
|
|
|
public int getVisualizationColor(Level level, BlockPos pos) {
|
2019-02-02 14:54:52 +01:00
|
|
|
return 0x078a93;
|
|
|
|
}
|
2020-01-29 01:34:58 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void generateCustomBlockState(BlockStateGenerator generator) {
|
|
|
|
generator.simpleBlock(this, generator.models().cubeBottomTop(this.getBaseName(),
|
|
|
|
generator.modLoc("block/" + this.getBaseName()),
|
|
|
|
generator.modLoc("block/" + this.getBaseName() + "_top"),
|
|
|
|
generator.modLoc("block/" + this.getBaseName() + "_top")));
|
|
|
|
}
|
2018-11-05 16:36:10 +01:00
|
|
|
}
|