Mark prism as manual model, use vanilla tag for beacon bases

This commit is contained in:
Vincent Lee committed 2020-07-03 12:21:04 -05:00
1 parent 2404503e1b
commit c55af7f190
8 files changed
+32 -82

No files matched your search

@@ -22,6 +22,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.particles.ParticleType;
import net.minecraft.potion.Effect;
import net.minecraft.tags.BlockTags;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.ResourceLocation;
@@ -264,14 +265,8 @@ public class Botania {
"_________",
}
};
IStateMatcher sm = PatchouliAPI.instance.predicateMatcher(Blocks.IRON_BLOCK, state -> {
try {
// No world to pass here, so just fall back to false if it errors
return state.isBeaconBase(null, null, null);
} catch (Exception ignored) {
return false;
}
});
IStateMatcher sm = PatchouliAPI.instance.predicateMatcher(Blocks.IRON_BLOCK,
state -> state.func_235714_a_(BlockTags.field_232875_ap_));
IMultiblock mb = PatchouliAPI.instance.makeMultiblock(
pat,
'P', ModBlocks.gaiaPylon,
@@ -1,33 +0,0 @@
/*
* This class is distributed as part of the Botania Mod.
* Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*/
package vazkii.botania.common.block;
import net.minecraft.block.BlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IWorldReader;
import vazkii.botania.api.recipe.IElvenItem;
public class BlockStorage extends BlockMod implements IElvenItem {
public BlockStorage(Properties builder) {
super(builder);
}
@Override
public boolean isBeaconBase(BlockState state, IWorldReader world, BlockPos pos, BlockPos beaconPos) {
return true;
}
@Override
public boolean isElvenItem(ItemStack stack) {
return this == ModBlocks.elementiumBlock;
}
}
@@ -119,11 +119,11 @@ public final class ModBlocks {
public static final Block openCrate = new BlockOpenCrate(Block.Properties.from(livingwood));
public static final Block craftCrate = new BlockCraftyCrate(Block.Properties.from(livingwood));
public static final Block forestEye = new BlockForestEye(Block.Properties.create(Material.IRON).hardnessAndResistance(5, 10).sound(SoundType.METAL));
public static final Block manasteelBlock = new BlockStorage(Block.Properties.create(Material.IRON).hardnessAndResistance(3, 10).sound(SoundType.METAL));
public static final Block terrasteelBlock = new BlockStorage(Block.Properties.from(manasteelBlock));
public static final Block elementiumBlock = new BlockStorage(Block.Properties.from(manasteelBlock));
public static final Block manaDiamondBlock = new BlockStorage(Block.Properties.from(manasteelBlock));
public static final Block dragonstoneBlock = new BlockStorage(Block.Properties.from(manasteelBlock));
public static final Block manasteelBlock = new BlockMod(Block.Properties.create(Material.IRON).hardnessAndResistance(3, 10).sound(SoundType.METAL));
public static final Block terrasteelBlock = new BlockMod(Block.Properties.from(manasteelBlock));
public static final Block elementiumBlock = new BlockMod(Block.Properties.from(manasteelBlock));
public static final Block manaDiamondBlock = new BlockMod(Block.Properties.from(manasteelBlock));
public static final Block dragonstoneBlock = new BlockMod(Block.Properties.from(manasteelBlock));
public static final Block wildDrum = new BlockForestDrum(BlockForestDrum.Variant.WILD, Block.Properties.from(livingwood));
public static final Block gatheringDrum = new BlockForestDrum(BlockForestDrum.Variant.GATHERING, Block.Properties.from(livingwood));
public static final Block canopyDrum = new BlockForestDrum(BlockForestDrum.Variant.CANOPY, Block.Properties.from(livingwood));
@@ -216,7 +216,7 @@ public final class ModBlocks {
public static final Block enderEye = new BlockEnderEye(Block.Properties.from(manasteelBlock));
public static final Block starfield = new BlockStarfield(Block.Properties.create(Material.IRON).hardnessAndResistance(5, 2000).sound(SoundType.METAL));
public static final Block rfGenerator = new BlockRFGenerator(Block.Properties.from(livingrock));
public static final Block elfGlass = new BlockElfGlass(Block.Properties.from(Blocks.GLASS).func_235838_a_(s -> 15));
public static final Block elfGlass = new BlockModGlass(Block.Properties.from(Blocks.GLASS).func_235838_a_(s -> 15));
public static final Block brewery = new BlockBrewery(Block.Properties.from(livingrock));
public static final Block manaGlass = new BlockModGlass(Block.Properties.from(elfGlass));
public static final Block terraPlate = new BlockTerraPlate(Block.Properties.create(Material.IRON).hardnessAndResistance(3, 10).sound(SoundType.METAL));
@@ -1,25 +0,0 @@
/*
* This class is distributed as part of the Botania Mod.
* Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*/
package vazkii.botania.common.block.decor;
import net.minecraft.item.ItemStack;
import vazkii.botania.api.recipe.IElvenItem;
public class BlockElfGlass extends BlockModGlass implements IElvenItem {
public BlockElfGlass(Properties builder) {
super(builder);
}
@Override
public boolean isElvenItem(ItemStack stack) {
return true;
}
}
@@ -22,7 +22,7 @@ public class ItemBlockElven extends BlockItem implements IElvenItem {
@Override
public boolean isElvenItem(ItemStack stack) {
return ((IElvenItem) getBlock()).isElvenItem(stack);
return true;
}
}
@@ -120,6 +120,8 @@ public class BlockTagProvider extends BlockTagsProvider {
func_240522_a_(BlockTags.FLOWERS).func_240531_a_(ModTags.Blocks.SPECIAL_FLOWERS);
func_240522_a_(BlockTags.IMPERMEABLE).func_240534_a_(ModBlocks.elfGlass, ModBlocks.manaGlass, ModBlocks.bifrost, ModBlocks.bifrostPerm);
func_240522_a_(BlockTags.field_232875_ap_).func_240534_a_(ModBlocks.manasteelBlock, ModBlocks.terrasteelBlock, ModBlocks.elementiumBlock,
ModBlocks.manaDiamondBlock, ModBlocks.dragonstoneBlock);
}
@Nonnull
@@ -69,6 +69,7 @@ public class BlockstateProvider extends BlockStateProvider {
// Manually written simpleBlock
manualModel(blocks, cocoon);
manualModel(blocks, corporeaCrystalCube);
manualModel(blocks, prism);
manualModel(blocks, runeAltar);
// Single blocks
@@ -105,7 +106,7 @@ public class BlockstateProvider extends BlockStateProvider {
String felName = Registry.BLOCK.getKey(felPumpkin).getPath();
simpleBlock(felPumpkin, models().orientable(felName, new ResourceLocation("block/pumpkin_side"), prefix("block/" + felName),
new ResourceLocation("block/pumpkin_top")));
new ResourceLocation("block/pumpkin_top")));
blocks.remove(felPumpkin);
// TESRs with only particles
@@ -155,7 +156,7 @@ public class BlockstateProvider extends BlockStateProvider {
});
ModelFile petalBlockModel = models().withExistingParent("petal_block", prefix("block/shapes/cube_all_tinted"))
.texture("all", prefix("block/petal_block"));
.texture("all", prefix("block/petal_block"));
takeAll(blocks, b -> b instanceof BlockPetalBlock).forEach(b -> simpleBlock(b, petalBlockModel));
takeAll(blocks, b -> b instanceof StairsBlock).forEach(b -> {
@@ -209,7 +210,7 @@ public class BlockstateProvider extends BlockStateProvider {
});
for (String variant : new String[] { "desert", "forest", "fungal", "mesa", "mountain",
"plains", "swamp", "taiga"}) {
"plains", "swamp", "taiga" }) {
ResourceLocation baseId = prefix(LibBlockNames.METAMORPHIC_PREFIX + variant + "_stone");
Block base = Registry.BLOCK.getValue(baseId).get();
simpleBlock(base);
@@ -243,9 +244,9 @@ public class BlockstateProvider extends BlockStateProvider {
takeAll(blocks, b -> b instanceof BlockAltar).forEach(b -> {
String name = Registry.BLOCK.getKey(b).getPath();
ModelFile model = models().withExistingParent(name, prefix("block/shapes/petal_apothecary"))
.texture("side", prefix("block/" + name + "_side"))
.texture("goblet", prefix("block/" + name + "_goblet"))
.texture("top_bottom", prefix("block/" + name + "_top_bottom"));
.texture("side", prefix("block/" + name + "_side"))
.texture("goblet", prefix("block/" + name + "_goblet"))
.texture("top_bottom", prefix("block/" + name + "_top_bottom"));
simpleBlock(b, model);
});
@@ -321,11 +322,11 @@ public class BlockstateProvider extends BlockStateProvider {
private void fixedWallBlock(WallBlock block, ResourceLocation tex) {
String name = Registry.BLOCK.getKey(block).getPath();
ModelFile post = models().withExistingParent(name + "_post", "block/template_wall_post")
.texture("wall", tex);
.texture("wall", tex);
ModelFile side = models().withExistingParent(name + "_wall_side", "block/template_wall_side")
.texture("wall", tex);
.texture("wall", tex);
ModelFile tallSide = models().withExistingParent(name + "_wall_side_tall", "block/template_wall_side_tall")
.texture("wall", tex);
.texture("wall", tex);
MultiPartBlockStateBuilder builder = getMultipartBuilder(block)
.part().modelFile(post).addModel()
.condition(WallBlock.UP, true).end();