nether version of the catalysts

This commit is contained in:
Ellpeck 2020-02-26 10:55:19 +01:00
parent 0ef69b0560
commit be96feb704
10 changed files with 72 additions and 16 deletions

View file

@ -1,7 +0,0 @@
{
"variants": {
"": {
"model": "naturesaura:block/conversion_catalyst"
}
}
}

View file

@ -1,7 +0,0 @@
{
"variants": {
"": {
"model": "naturesaura:block/crushing_catalyst"
}
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "naturesaura:block/conversion_catalyst_nether"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "naturesaura:block/crushing_catalyst_nether"
}
}

View file

@ -0,0 +1,38 @@
package de.ellpeck.naturesaura.blocks;
import de.ellpeck.naturesaura.api.NaturesAuraAPI;
import de.ellpeck.naturesaura.api.aura.type.IAuraType;
import de.ellpeck.naturesaura.data.BlockStateGenerator;
import de.ellpeck.naturesaura.reg.ICustomBlockState;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty;
import net.minecraft.state.StateContainer;
public class BlockCatalyst extends BlockImpl implements ICustomBlockState {
public static final BooleanProperty NETHER = BlockNatureAltar.NETHER;
public BlockCatalyst(String baseName, Properties properties) {
super(baseName, properties);
this.setDefaultState(this.getDefaultState().with(NETHER, false));
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
boolean nether = IAuraType.forWorld(context.getWorld()).isSimilar(NaturesAuraAPI.TYPE_NETHER);
return super.getStateForPlacement(context).with(NETHER, nether);
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
super.fillStateContainer(builder);
builder.add(NETHER);
}
@Override
public void generateCustomBlockState(BlockStateGenerator generator) {
generator.models().cubeAll(this.getBaseName(), generator.modLoc("block/" + this.getBaseName()));
generator.models().cubeAll(this.getBaseName() + "_nether", generator.modLoc("block/" + this.getBaseName() + "_nether"));
}
}

View file

@ -93,8 +93,8 @@ public final class ModRegistry {
new BlockFurnaceHeater(), new BlockFurnaceHeater(),
new BlockPotionGenerator(), new BlockPotionGenerator(),
new BlockAuraDetector(), new BlockAuraDetector(),
new BlockImpl("conversion_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)), new BlockCatalyst("conversion_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)),
new BlockImpl("crushing_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)), new BlockCatalyst("crushing_catalyst", ModBlocks.prop(Material.ROCK).sound(SoundType.STONE).hardnessAndResistance(2.5F)),
new BlockFlowerGenerator(), new BlockFlowerGenerator(),
new BlockPlacer(), new BlockPlacer(),
new BlockHopperUpgrade(), new BlockHopperUpgrade(),

View file

@ -0,0 +1,10 @@
{
"variants": {
"nether=false": {
"model": "naturesaura:block/conversion_catalyst"
},
"nether=true": {
"model": "naturesaura:block/conversion_catalyst_nether"
}
}
}

View file

@ -0,0 +1,10 @@
{
"variants": {
"nether=false": {
"model": "naturesaura:block/crushing_catalyst"
},
"nether=true": {
"model": "naturesaura:block/crushing_catalyst_nether"
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B