Initial Update to 1.19

- Updated to 1.19
- Added mangrove vertical slabs

It has one launch crash that will need to be fixed
This commit is contained in:
QPCrummer 2022-07-12 19:19:05 -04:00
parent 081b744755
commit caa0f277f1
32 changed files with 434 additions and 322 deletions

View File

@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '0.10-SNAPSHOT' id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }

View File

@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx4G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/versions.html # check these on https://fabricmc.net/versions.html
minecraft_version=1.18.1 minecraft_version=1.19
yarn_mappings=1.18.1+build.1 yarn_mappings=1.19+build.4
loader_version=0.12.12 loader_version=0.14.8
# Mod Properties # Mod Properties
mod_version = 1.1.1 mod_version = 1.1.1
@ -13,4 +13,4 @@ maven_group = tech.nevets
archives_base_name = vplus archives_base_name = vplus
# Dependencies # Dependencies
fabric_version=0.44.0+1.18 fabric_version=0.57.0+1.19

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -7,11 +7,12 @@ import tech.nevets.vplus.food.VPFood;
import tech.nevets.vplus.items.VPItems; import tech.nevets.vplus.items.VPItems;
import tech.nevets.vplus.misc.VPFuels; import tech.nevets.vplus.misc.VPFuels;
import tech.nevets.vplus.misc.VPOreGen; import tech.nevets.vplus.misc.VPOreGen;
import tech.nevets.vplus.misc.VPZoom;
import tech.nevets.vplus.tools.VPTools; import tech.nevets.vplus.tools.VPTools;
public class Main implements ModInitializer { public class Main implements ModInitializer {
public static String modid = "vplus";
@Override @Override
public void onInitialize() { public void onInitialize() {
VPBlocks.vpBlocks(); VPBlocks.vpBlocks();

View File

@ -4,7 +4,6 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment; import net.fabricmc.api.Environment;
import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorMaterial; import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvent;
@ -15,18 +14,10 @@ import tech.nevets.vplus.items.VPItems;
import java.util.function.Supplier; import java.util.function.Supplier;
public enum ArmorMaterials implements ArmorMaterial { public enum ArmorMaterials implements ArmorMaterial {
COPPER("copper", 13, new int[]{2, 4, 5, 2}, 20, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0F, 0.0F, () -> { COPPER("copper", 13, new int[]{2, 4, 5, 2}, 20, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0.0F, 0.0F, () -> Ingredient.ofItems(Items.COPPER_INGOT)),
return Ingredient.ofItems(new ItemConvertible[]{Items.COPPER_INGOT}); EMERALD("emerald", 30, new int[]{2, 6, 8, 2}, 30, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 1.0F, 0.0F, () -> Ingredient.ofItems(Items.EMERALD)),
}), PLATINUM("platinum", 40, new int[]{6, 8, 10, 6}, 40, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 1.0F, 0.5F, () -> Ingredient.ofItems(VPItems.PLATINUMINGOT)),
EMERALD("emerald", 30, new int[]{2, 6, 8, 2}, 30, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 1.0F, 0.0F, () -> { RUBY("ruby", 75, new int[]{10, 15, 20, 10}, 100, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 4.0F, 1.0F, () -> Ingredient.ofItems(VPItems.RUBY));
return Ingredient.ofItems(new ItemConvertible[]{Items.EMERALD});
}),
PLATINUM("platinum", 40, new int[]{6, 8, 10, 6}, 40, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 1.0F, 0.5F, () -> {
return Ingredient.ofItems(new ItemConvertible[]{VPItems.PLATINUMINGOT});
}),
RUBY("ruby", 75, new int[]{10, 15, 20, 10}, 100, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 4.0F, 1.0F, () -> {
return Ingredient.ofItems(new ItemConvertible[]{VPItems.RUBY});
});
private static final int[] BASE_DURABILITY = new int[]{13, 15, 16, 11}; private static final int[] BASE_DURABILITY = new int[]{13, 15, 16, 11};
private final String name; private final String name;
@ -38,7 +29,7 @@ public enum ArmorMaterials implements ArmorMaterial {
private final float knockbackResistance; private final float knockbackResistance;
private final Lazy<Ingredient> repairIngredientSupplier; private final Lazy<Ingredient> repairIngredientSupplier;
private ArmorMaterials(String name, int durabilityMultiplier, int[] protectionAmounts, int enchantability, SoundEvent equipSound, float toughness, float knockbackResistance, Supplier<Ingredient> repairIngredientSupplier) { ArmorMaterials(String name, int durabilityMultiplier, int[] protectionAmounts, int enchantability, SoundEvent equipSound, float toughness, float knockbackResistance, Supplier<Ingredient> repairIngredientSupplier) {
this.name = name; this.name = name;
this.durabilityMultiplier = durabilityMultiplier; this.durabilityMultiplier = durabilityMultiplier;
this.protectionAmounts = protectionAmounts; this.protectionAmounts = protectionAmounts;
@ -46,7 +37,7 @@ public enum ArmorMaterials implements ArmorMaterial {
this.equipSound = equipSound; this.equipSound = equipSound;
this.toughness = toughness; this.toughness = toughness;
this.knockbackResistance = knockbackResistance; this.knockbackResistance = knockbackResistance;
this.repairIngredientSupplier = new Lazy(repairIngredientSupplier); this.repairIngredientSupplier = new Lazy<>(repairIngredientSupplier);
} }
public int getDurability(EquipmentSlot slot) { public int getDurability(EquipmentSlot slot) {
@ -66,7 +57,7 @@ public enum ArmorMaterials implements ArmorMaterial {
} }
public Ingredient getRepairIngredient() { public Ingredient getRepairIngredient() {
return (Ingredient)this.repairIngredientSupplier.get(); return this.repairIngredientSupplier.get();
} }
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)

View File

@ -5,6 +5,8 @@ import net.minecraft.item.ArmorMaterial;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import static tech.nevets.vplus.Main.modid;
public class VPArmor { public class VPArmor {
public static final ArmorMaterial COPPER_ARMOR = ArmorMaterials.COPPER; public static final ArmorMaterial COPPER_ARMOR = ArmorMaterials.COPPER;
@ -20,30 +22,30 @@ public class VPArmor {
} }
public static void initializeHelmet() { public static void initializeHelmet() {
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_helmet"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.HEAD)); Registry.register(Registry.ITEM, new Identifier(modid, "copper_helmet"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.HEAD));
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_helmet"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.HEAD)); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_helmet"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.HEAD));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_helmet"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.HEAD)); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_helmet"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.HEAD));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_helmet"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.HEAD)); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_helmet"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.HEAD));
} }
public static void initializeChestplates() { public static void initializeChestplates() {
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_chestplate"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.CHEST)); Registry.register(Registry.ITEM, new Identifier(modid, "copper_chestplate"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.CHEST));
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_chestplate"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.CHEST)); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_chestplate"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.CHEST));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_chestplate"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.CHEST)); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_chestplate"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.CHEST));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_chestplate"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.CHEST)); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_chestplate"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.CHEST));
} }
public static void initialzeLeggings() { public static void initialzeLeggings() {
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_leggings"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.LEGS)); Registry.register(Registry.ITEM, new Identifier(modid, "copper_leggings"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.LEGS));
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_leggings"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.LEGS)); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_leggings"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.LEGS));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_leggings"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.LEGS)); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_leggings"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.LEGS));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_leggings"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.LEGS)); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_leggings"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.LEGS));
} }
public static void initializeBoots() { public static void initializeBoots() {
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_boots"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.FEET)); Registry.register(Registry.ITEM, new Identifier(modid, "copper_boots"), new BaseArmor(COPPER_ARMOR, EquipmentSlot.FEET));
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_boots"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.FEET)); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_boots"), new BaseArmor(EMERALD_ARMOR, EquipmentSlot.FEET));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_boots"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.FEET)); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_boots"), new BaseArmor(PLATINUM_ARMOR, EquipmentSlot.FEET));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_boots"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.FEET)); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_boots"), new BaseArmor(RUBY_ARMOR, EquipmentSlot.FEET));
} }
} }

View File

@ -8,7 +8,6 @@ import net.minecraft.particle.ParticleEffect;
import net.minecraft.particle.ParticleTypes; import net.minecraft.particle.ParticleTypes;
import net.minecraft.state.StateManager; import net.minecraft.state.StateManager;
import net.minecraft.state.property.DirectionProperty; import net.minecraft.state.property.DirectionProperty;
import net.minecraft.state.property.Property;
import net.minecraft.util.BlockMirror; import net.minecraft.util.BlockMirror;
import net.minecraft.util.BlockRotation; import net.minecraft.util.BlockRotation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -30,7 +29,7 @@ public class ColorWallTorchBlock extends TorchBlock {
protected ColorWallTorchBlock(Settings settings, ParticleEffect particleEffect) { protected ColorWallTorchBlock(Settings settings, ParticleEffect particleEffect) {
super(settings, particleEffect); super(settings, particleEffect);
this.setDefaultState((BlockState)((BlockState)this.stateManager.getDefaultState()).with(FACING, Direction.NORTH)); this.setDefaultState(this.stateManager.getDefaultState().with(FACING, Direction.NORTH));
} }
public String getTranslationKey() { public String getTranslationKey() {
@ -42,11 +41,11 @@ public class ColorWallTorchBlock extends TorchBlock {
} }
public static VoxelShape getBoundingShape(BlockState state) { public static VoxelShape getBoundingShape(BlockState state) {
return (VoxelShape)BOUNDING_SHAPES.get(state.get(FACING)); return BOUNDING_SHAPES.get(state.get(FACING));
} }
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
Direction direction = (Direction)state.get(FACING); Direction direction = state.get(FACING);
BlockPos blockPos = pos.offset(direction.getOpposite()); BlockPos blockPos = pos.offset(direction.getOpposite());
BlockState blockState = world.getBlockState(blockPos); BlockState blockState = world.getBlockState(blockPos);
return blockState.isSideSolidFullSquare(world, blockPos, direction); return blockState.isSideSolidFullSquare(world, blockPos, direction);
@ -58,14 +57,11 @@ public class ColorWallTorchBlock extends TorchBlock {
WorldView worldView = ctx.getWorld(); WorldView worldView = ctx.getWorld();
BlockPos blockPos = ctx.getBlockPos(); BlockPos blockPos = ctx.getBlockPos();
Direction[] directions = ctx.getPlacementDirections(); Direction[] directions = ctx.getPlacementDirections();
Direction[] var6 = directions;
int var7 = directions.length;
for(int var8 = 0; var8 < var7; ++var8) { for (Direction direction : directions) {
Direction direction = var6[var8];
if (direction.getAxis().isHorizontal()) { if (direction.getAxis().isHorizontal()) {
Direction direction2 = direction.getOpposite(); Direction direction2 = direction.getOpposite();
blockState = (BlockState)blockState.with(FACING, direction2); blockState = blockState.with(FACING, direction2);
if (blockState.canPlaceAt(worldView, blockPos)) { if (blockState.canPlaceAt(worldView, blockPos)) {
return blockState; return blockState;
} }
@ -80,7 +76,7 @@ public class ColorWallTorchBlock extends TorchBlock {
} }
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
Direction direction = (Direction)state.get(FACING); Direction direction = state.get(FACING);
double d = (double)pos.getX() + 0.5D; double d = (double)pos.getX() + 0.5D;
double e = (double)pos.getY() + 0.7D; double e = (double)pos.getY() + 0.7D;
double f = (double)pos.getZ() + 0.5D; double f = (double)pos.getZ() + 0.5D;
@ -92,15 +88,15 @@ public class ColorWallTorchBlock extends TorchBlock {
} }
public BlockState rotate(BlockState state, BlockRotation rotation) { public BlockState rotate(BlockState state, BlockRotation rotation) {
return (BlockState)state.with(FACING, rotation.rotate((Direction)state.get(FACING))); return state.with(FACING, rotation.rotate(state.get(FACING)));
} }
public BlockState mirror(BlockState state, BlockMirror mirror) { public BlockState mirror(BlockState state, BlockMirror mirror) {
return state.rotate(mirror.getRotation((Direction)state.get(FACING))); return state.rotate(mirror.getRotation(state.get(FACING)));
} }
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) { protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {
builder.add(new Property[]{FACING}); builder.add(FACING);
} }
static { static {

View File

@ -41,18 +41,16 @@ public class LavaSpongeBlock extends Block {
private boolean absorbLava(World world, BlockPos pos) { private boolean absorbLava(World world, BlockPos pos) {
Queue<Pair<BlockPos, Integer>> queue = Lists.newLinkedList(); Queue<Pair<BlockPos, Integer>> queue = Lists.newLinkedList();
queue.add(new Pair(pos, 0)); queue.add(new Pair<>(pos, 0));
int i = 0; int i = 0;
while(!queue.isEmpty()) { while(!queue.isEmpty()) {
Pair<BlockPos, Integer> pair = (Pair)queue.poll(); Pair<BlockPos, Integer> pair = queue.poll();
BlockPos blockPos = (BlockPos)pair.getLeft(); BlockPos blockPos = pair.getLeft();
int j = (Integer)pair.getRight(); int j = pair.getRight();
Direction[] var8 = Direction.values(); Direction[] var8 = Direction.values();
int var9 = var8.length;
for(int var10 = 0; var10 < var9; ++var10) { for (Direction direction : var8) {
Direction direction = var8[var10];
BlockPos blockPos2 = blockPos.offset(direction); BlockPos blockPos2 = blockPos.offset(direction);
BlockState blockState = world.getBlockState(blockPos2); BlockState blockState = world.getBlockState(blockPos2);
FluidState fluidState = world.getFluidState(blockPos2); FluidState fluidState = world.getFluidState(blockPos2);
@ -61,13 +59,13 @@ public class LavaSpongeBlock extends Block {
if (blockState.getBlock() instanceof FluidDrainable && !((FluidDrainable) blockState.getBlock()).tryDrainFluid(world, blockPos2, blockState).isEmpty()) { if (blockState.getBlock() instanceof FluidDrainable && !((FluidDrainable) blockState.getBlock()).tryDrainFluid(world, blockPos2, blockState).isEmpty()) {
++i; ++i;
if (j < 6) { if (j < 6) {
queue.add(new Pair(blockPos2, j + 1)); queue.add(new Pair<>(blockPos2, j + 1));
} }
} else if (blockState.getBlock() instanceof FluidBlock) { } else if (blockState.getBlock() instanceof FluidBlock) {
world.setBlockState(blockPos2, Blocks.AIR.getDefaultState(), 3); world.setBlockState(blockPos2, Blocks.AIR.getDefaultState(), 3);
++i; ++i;
if (j < 6) { if (j < 6) {
queue.add(new Pair(blockPos2, j + 1)); queue.add(new Pair<>(blockPos2, j + 1));
} }
} }
} }

View File

@ -1,7 +1,6 @@
package tech.nevets.vplus.blocks; package tech.nevets.vplus.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.BlockSoundGroup;
@ -9,6 +8,6 @@ import net.minecraft.sound.BlockSoundGroup;
//TODO Change platinum to saphire //TODO Change platinum to saphire
public class PlatinumBlock extends Block { public class PlatinumBlock extends Block {
public PlatinumBlock() { public PlatinumBlock() {
super(FabricBlockSettings.of(Material.STONE).breakByHand(false).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.METAL).strength(30, 1000f)); super(FabricBlockSettings.of(Material.STONE).requiresTool().sounds(BlockSoundGroup.METAL).strength(30, 1000f));
} }
} }

View File

@ -1,7 +1,6 @@
package tech.nevets.vplus.blocks; package tech.nevets.vplus.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
@ -17,20 +16,19 @@ import java.util.Random;
public class PlatinumOre extends Block { public class PlatinumOre extends Block {
public PlatinumOre() { public PlatinumOre() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES, 3).sounds(BlockSoundGroup.STONE).strength(3, 1500f)); super(FabricBlockSettings.of(Material.STONE).requiresTool().sounds(BlockSoundGroup.STONE).strength(3, 1500f));
} }
protected int getExperienceWhenMined(Random random) { protected int getExperienceWhenMined(Random random) {
return MathHelper.nextInt(random, 3, 7); return MathHelper.nextInt((net.minecraft.util.math.random.Random) random, 3, 7);
} }
public void onStacksDropped(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack) { public void onStacksDropped(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack) {
super.onStacksDropped(state, world, pos, stack); super.onStacksDropped(state, world, pos, stack, true);
if (EnchantmentHelper.getLevel(Enchantments.SILK_TOUCH, stack) == 0) { if (EnchantmentHelper.get(stack).containsKey(Enchantments.SILK_TOUCH)) {
int i = this.getExperienceWhenMined(world.random); int i = this.getExperienceWhenMined((Random) world.random);
if (i > 0) { if (i > 0) {
this.dropExperience(world, pos, i); this.dropExperience(world, pos, i);
} }
} }
} }
} }

View File

@ -1,13 +1,12 @@
package tech.nevets.vplus.blocks; package tech.nevets.vplus.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.BlockSoundGroup;
public class RubyBlock extends Block { public class RubyBlock extends Block {
public RubyBlock() { public RubyBlock() {
super(FabricBlockSettings.of(Material.STONE).breakByHand(false).breakByTool(FabricToolTags.PICKAXES).sounds(BlockSoundGroup.METAL).strength(5, 6.0f)); super(FabricBlockSettings.of(Material.STONE).requiresTool().sounds(BlockSoundGroup.METAL).strength(5, 6.0f));
} }
} }

View File

@ -1,7 +1,6 @@
package tech.nevets.vplus.blocks; package tech.nevets.vplus.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
@ -17,16 +16,16 @@ import java.util.Random;
public class RubyOre extends Block { public class RubyOre extends Block {
public RubyOre() { public RubyOre() {
super(FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES, 3).sounds(BlockSoundGroup.STONE).strength(3, 1500f)); super(FabricBlockSettings.of(Material.STONE).requiresTool().sounds(BlockSoundGroup.STONE).strength(3, 1500f));
} }
protected int getExperienceWhenMined(Random random) { protected int getExperienceWhenMined(Random random) {
return MathHelper.nextInt(random, 3, 7); return MathHelper.nextInt((net.minecraft.util.math.random.Random) random, 3, 7);
} }
public void onStacksDropped(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack) { public void onStacksDropped(BlockState state, ServerWorld world, BlockPos pos, ItemStack stack) {
super.onStacksDropped(state, world, pos, stack); super.onStacksDropped(state, world, pos, stack, true);
if (EnchantmentHelper.getLevel(Enchantments.SILK_TOUCH, stack) == 0) { if (EnchantmentHelper.get(stack).containsKey(Enchantments.SILK_TOUCH)) {
int i = this.getExperienceWhenMined(world.random); int i = this.getExperienceWhenMined((Random) world.random);
if (i > 0) { if (i > 0) {
this.dropExperience(world, pos, i); this.dropExperience(world, pos, i);
} }

View File

@ -22,14 +22,14 @@ public class SaturatedLavaSpongeBlock extends Block {
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) { public void randomDisplayTick(BlockState state, World world, BlockPos pos, Random random) {
Direction direction = Direction.random(random); Direction direction = Direction.random((net.minecraft.util.math.random.Random) random);
if (direction != Direction.UP) { if (direction != Direction.UP) {
BlockPos blockPos = pos.offset(direction); BlockPos blockPos = pos.offset(direction);
BlockState blockState = world.getBlockState(blockPos); BlockState blockState = world.getBlockState(blockPos);
if (!state.isOpaque() || !blockState.isSideSolidFullSquare(world, blockPos, direction.getOpposite())) { if (!state.isOpaque() || !blockState.isSideSolidFullSquare(world, blockPos, direction.getOpposite())) {
double d = (double)pos.getX(); double d = pos.getX();
double e = (double)pos.getY(); double e = pos.getY();
double f = (double)pos.getZ(); double f = pos.getZ();
if (direction == Direction.DOWN) { if (direction == Direction.DOWN) {
e -= 0.05D; e -= 0.05D;
d += random.nextDouble(); d += random.nextDouble();

View File

@ -9,6 +9,8 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import tech.nevets.vplus.items.VPItemGroups; import tech.nevets.vplus.items.VPItemGroups;
import static tech.nevets.vplus.Main.modid;
public class VPBlocks { public class VPBlocks {
public static final Block LAVASPONGEBLOCK = new LavaSpongeBlock(); public static final Block LAVASPONGEBLOCK = new LavaSpongeBlock();
@ -26,25 +28,25 @@ public class VPBlocks {
} }
public static void initializeBlocks() { public static void initializeBlocks() {
Registry.register(Registry.BLOCK, new Identifier("vplus", "lava_sponge"), LAVASPONGEBLOCK); Registry.register(Registry.BLOCK, new Identifier(modid, "lava_sponge"), LAVASPONGEBLOCK);
Registry.register(Registry.BLOCK, new Identifier("vplus", "saturated_lava_sponge"), SATURATEDLAVASPONGEBLOCK); Registry.register(Registry.BLOCK, new Identifier(modid, "saturated_lava_sponge"), SATURATEDLAVASPONGEBLOCK);
Registry.register(Registry.BLOCK, new Identifier("vplus", "platinum_ore"), PLATINUMORE); Registry.register(Registry.BLOCK, new Identifier(modid, "platinum_ore"), PLATINUMORE);
Registry.register(Registry.BLOCK, new Identifier("vplus", "platinum_block"), PLATINUMBLOCK); Registry.register(Registry.BLOCK, new Identifier(modid, "platinum_block"), PLATINUMBLOCK);
Registry.register(Registry.BLOCK, new Identifier("vplus", "ruby_block"), RUBYBLOCK); Registry.register(Registry.BLOCK, new Identifier(modid, "ruby_block"), RUBYBLOCK);
Registry.register(Registry.BLOCK, new Identifier("vplus", "ruby_ore"), RUBYORE); Registry.register(Registry.BLOCK, new Identifier(modid, "ruby_ore"), RUBYORE);
} }
public static void initializeBlockItems() { public static void initializeBlockItems() {
Registry.register(Registry.ITEM, new Identifier("vplus", "lava_sponge"), new BlockItem(LAVASPONGEBLOCK, new Item.Settings().group(VPItemGroups.ALL))); Registry.register(Registry.ITEM, new Identifier(modid, "lava_sponge"), new BlockItem(LAVASPONGEBLOCK, new Item.Settings().group(VPItemGroups.ALL)));
Registry.register(Registry.ITEM, new Identifier("vplus", "saturated_lava_sponge"), new BlockItem(SATURATEDLAVASPONGEBLOCK, new Item.Settings().group(VPItemGroups.ALL).recipeRemainder(Item.fromBlock(VPBlocks.LAVASPONGEBLOCK)))); Registry.register(Registry.ITEM, new Identifier(modid, "saturated_lava_sponge"), new BlockItem(SATURATEDLAVASPONGEBLOCK, new Item.Settings().group(VPItemGroups.ALL).recipeRemainder(Item.fromBlock(VPBlocks.LAVASPONGEBLOCK))));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_ore"), new BlockItem(PLATINUMORE, new Item.Settings().group(VPItemGroups.ALL))); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_ore"), new BlockItem(PLATINUMORE, new Item.Settings().group(VPItemGroups.ALL)));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_block"), new BlockItem(PLATINUMBLOCK, new Item.Settings().group(VPItemGroups.ALL))); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_block"), new BlockItem(PLATINUMBLOCK, new Item.Settings().group(VPItemGroups.ALL)));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_block"), new BlockItem(RUBYBLOCK, new Item.Settings().group(VPItemGroups.ALL))); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_block"), new BlockItem(RUBYBLOCK, new Item.Settings().group(VPItemGroups.ALL)));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_ore"), new BlockItem(RUBYORE, new Item.Settings().group(VPItemGroups.ALL))); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_ore"), new BlockItem(RUBYORE, new Item.Settings().group(VPItemGroups.ALL)));
} }
public static void initializeTorches() { public static void initializeTorches() {
Registry.register(Registry.BLOCK, new Identifier("vplus", "green_torch"), new ColorTorchBlock(AbstractBlock.Settings.of(Material.DECORATION).noCollision().breakInstantly().luminance((state) -> {return 14;}).sounds(BlockSoundGroup.WOOD), ParticleTypes.FLAME)); Registry.register(Registry.BLOCK, new Identifier(modid, "green_torch"), new ColorTorchBlock(AbstractBlock.Settings.of(Material.DECORATION).noCollision().breakInstantly().luminance((state) -> 14).sounds(BlockSoundGroup.WOOD), ParticleTypes.FLAME));
Registry.register(Registry.BLOCK, new Identifier("vplus", "green_wall_torch"), new ColorWallTorchBlock(AbstractBlock.Settings.of(Material.DECORATION).noCollision().breakInstantly().luminance((state) -> {return 14;}).sounds(BlockSoundGroup.WOOD).dropsLike(Blocks.TORCH), ParticleTypes.FLAME)); Registry.register(Registry.BLOCK, new Identifier(modid, "green_wall_torch"), new ColorWallTorchBlock(AbstractBlock.Settings.of(Material.DECORATION).noCollision().breakInstantly().luminance((state) -> 14).sounds(BlockSoundGroup.WOOD).dropsLike(Blocks.TORCH), ParticleTypes.FLAME));
} }
} }

View File

@ -1,7 +1,6 @@
package tech.nevets.vplus.blocks; package tech.nevets.vplus.blocks;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
@ -11,6 +10,8 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import tech.nevets.vplus.items.VPItemGroups; import tech.nevets.vplus.items.VPItemGroups;
import static tech.nevets.vplus.Main.modid;
public class VPVerticalSlabs { public class VPVerticalSlabs {
//TODO add new 1.17 blocks //TODO add new 1.17 blocks
@ -23,6 +24,7 @@ public class VPVerticalSlabs {
public static final Block VERTICAL_DARK_OAK_SLAB; public static final Block VERTICAL_DARK_OAK_SLAB;
public static final Block VERTICAL_CRIMSON_SLAB; public static final Block VERTICAL_CRIMSON_SLAB;
public static final Block VERTICAL_WARPED_SLAB; public static final Block VERTICAL_WARPED_SLAB;
public static final Block VERTICAL_MANGROVE_SLAB;
public static final Block VERTICAL_STONE_SLAB; public static final Block VERTICAL_STONE_SLAB;
public static final Block VERTICAL_SMOOTH_STONE_SLAB; public static final Block VERTICAL_SMOOTH_STONE_SLAB;
public static final Block VERTICAL_SANDSTONE_SLAB; public static final Block VERTICAL_SANDSTONE_SLAB;
@ -56,125 +58,128 @@ public class VPVerticalSlabs {
public static final Block VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB; public static final Block VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB;
public static void vpVerticalSlabs() { public static void vpVerticalSlabs() {
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_oak_slab"), VERTICAL_OAK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_oak_slab"), VERTICAL_OAK_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_oak_slab"), new BlockItem(VERTICAL_OAK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_oak_slab"), new BlockItem(VERTICAL_OAK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_spruce_slab"), VERTICAL_SPRUCE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_spruce_slab"), VERTICAL_SPRUCE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_spruce_slab"), new BlockItem(VERTICAL_SPRUCE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_spruce_slab"), new BlockItem(VERTICAL_SPRUCE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_birch_slab"), VERTICAL_BIRCH_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_birch_slab"), VERTICAL_BIRCH_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_birch_slab"), new BlockItem(VERTICAL_BIRCH_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_birch_slab"), new BlockItem(VERTICAL_BIRCH_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_jungle_slab"), VERTICAL_JUNGLE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_jungle_slab"), VERTICAL_JUNGLE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_jungle_slab"), new BlockItem(VERTICAL_JUNGLE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_jungle_slab"), new BlockItem(VERTICAL_JUNGLE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_acacia_slab"), VERTICAL_ACACIA_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_acacia_slab"), VERTICAL_ACACIA_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_acacia_slab"), new BlockItem(VERTICAL_ACACIA_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_acacia_slab"), new BlockItem(VERTICAL_ACACIA_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_dark_oak_slab"), VERTICAL_DARK_OAK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_dark_oak_slab"), VERTICAL_DARK_OAK_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_dark_oak_slab"), new BlockItem(VERTICAL_DARK_OAK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_dark_oak_slab"), new BlockItem(VERTICAL_DARK_OAK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_crimson_slab"), VERTICAL_CRIMSON_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_crimson_slab"), VERTICAL_CRIMSON_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_crimson_slab"), new BlockItem(VERTICAL_CRIMSON_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_crimson_slab"), new BlockItem(VERTICAL_CRIMSON_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_warped_slab"), VERTICAL_WARPED_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_warped_slab"), VERTICAL_WARPED_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_warped_slab"), new BlockItem(VERTICAL_WARPED_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_warped_slab"), new BlockItem(VERTICAL_WARPED_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_stone_slab"), VERTICAL_STONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_mangrove_slab"), VERTICAL_MANGROVE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_stone_slab"), new BlockItem(VERTICAL_STONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_mangrove_slab"), new BlockItem(VERTICAL_MANGROVE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_smooth_stone_slab"), VERTICAL_SMOOTH_STONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_stone_slab"), VERTICAL_STONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_smooth_stone_slab"), new BlockItem(VERTICAL_SMOOTH_STONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_stone_slab"), new BlockItem(VERTICAL_STONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_sandstone_slab"), VERTICAL_SANDSTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_smooth_stone_slab"), VERTICAL_SMOOTH_STONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_sandstone_slab"), new BlockItem(VERTICAL_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_smooth_stone_slab"), new BlockItem(VERTICAL_SMOOTH_STONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_cut_sandstone_slab"), VERTICAL_CUT_SANDSTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_sandstone_slab"), VERTICAL_SANDSTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_cut_sandstone_slab"), new BlockItem(VERTICAL_CUT_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_sandstone_slab"), new BlockItem(VERTICAL_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_cobblestone_slab"), VERTICAL_COBBLESTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_cut_sandstone_slab"), VERTICAL_CUT_SANDSTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_cobblestone_slab"), new BlockItem(VERTICAL_COBBLESTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_cut_sandstone_slab"), new BlockItem(VERTICAL_CUT_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_brick_slab"), VERTICAL_BRICK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_cobblestone_slab"), VERTICAL_COBBLESTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_brick_slab"), new BlockItem(VERTICAL_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_cobblestone_slab"), new BlockItem(VERTICAL_COBBLESTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_stone_brick_slab"), VERTICAL_STONE_BRICK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_brick_slab"), VERTICAL_BRICK_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_stone_brick_slab"), new BlockItem(VERTICAL_STONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_brick_slab"), new BlockItem(VERTICAL_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_nether_brick_slab"), VERTICAL_NETHER_BRICK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_stone_brick_slab"), VERTICAL_STONE_BRICK_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_nether_brick_slab"), new BlockItem(VERTICAL_NETHER_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_stone_brick_slab"), new BlockItem(VERTICAL_STONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_quartz_slab"), VERTICAL_QUARTZ_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_nether_brick_slab"), VERTICAL_NETHER_BRICK_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_quartz_slab"), new BlockItem(VERTICAL_QUARTZ_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_nether_brick_slab"), new BlockItem(VERTICAL_NETHER_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_red_sandstone_slab"), VERTICAL_RED_SANDSTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_quartz_slab"), VERTICAL_QUARTZ_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_red_sandstone_slab"), new BlockItem(VERTICAL_RED_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_quartz_slab"), new BlockItem(VERTICAL_QUARTZ_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_cut_red_sandstone_slab"), VERTICAL_CUT_RED_SANDSTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_red_sandstone_slab"), VERTICAL_RED_SANDSTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_cut_red_sandstone_slab"), new BlockItem(VERTICAL_CUT_RED_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_red_sandstone_slab"), new BlockItem(VERTICAL_RED_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_purpur_slab"), VERTICAL_PURPUR_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_cut_red_sandstone_slab"), VERTICAL_CUT_RED_SANDSTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_purpur_slab"), new BlockItem(VERTICAL_PURPUR_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_cut_red_sandstone_slab"), new BlockItem(VERTICAL_CUT_RED_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_prismarine_slab"), VERTICAL_PRISMARINE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_purpur_slab"), VERTICAL_PURPUR_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_prismarine_slab"), new BlockItem(VERTICAL_PRISMARINE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_purpur_slab"), new BlockItem(VERTICAL_PURPUR_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_prismarine_brick_slab"), VERTICAL_PRISMARINE_BRICK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_prismarine_slab"), VERTICAL_PRISMARINE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_prismarine_brick_slab"), new BlockItem(VERTICAL_PRISMARINE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_prismarine_slab"), new BlockItem(VERTICAL_PRISMARINE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_dark_prismarine_slab"), VERTICAL_DARK_PRISMARINE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_prismarine_brick_slab"), VERTICAL_PRISMARINE_BRICK_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_dark_prismarine_slab"), new BlockItem(VERTICAL_DARK_PRISMARINE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_prismarine_brick_slab"), new BlockItem(VERTICAL_PRISMARINE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_granite_slab"), VERTICAL_POLISHED_GRANITE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_dark_prismarine_slab"), VERTICAL_DARK_PRISMARINE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_granite_slab"), new BlockItem(VERTICAL_POLISHED_GRANITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_dark_prismarine_slab"), new BlockItem(VERTICAL_DARK_PRISMARINE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_smooth_red_sandstone_slab"), VERTICAL_SMOOTH_RED_SANDSTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_polished_granite_slab"), VERTICAL_POLISHED_GRANITE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_smooth_red_sandstone_slab"), new BlockItem(VERTICAL_SMOOTH_RED_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_polished_granite_slab"), new BlockItem(VERTICAL_POLISHED_GRANITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_mossy_stone_brick_slab"), VERTICAL_MOSSY_STONE_BRICK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_smooth_red_sandstone_slab"), VERTICAL_SMOOTH_RED_SANDSTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_mossy_stone_brick_slab"), new BlockItem(VERTICAL_MOSSY_STONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_smooth_red_sandstone_slab"), new BlockItem(VERTICAL_SMOOTH_RED_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_diorite_slab"), VERTICAL_POLISHED_DIORITE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_mossy_stone_brick_slab"), VERTICAL_MOSSY_STONE_BRICK_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_diorite_slab"), new BlockItem(VERTICAL_POLISHED_DIORITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_mossy_stone_brick_slab"), new BlockItem(VERTICAL_MOSSY_STONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_mossy_cobblestone_slab"), VERTICAL_MOSSY_COBBLESTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_polished_diorite_slab"), VERTICAL_POLISHED_DIORITE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_mossy_cobblestone_slab"), new BlockItem(VERTICAL_MOSSY_COBBLESTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_polished_diorite_slab"), new BlockItem(VERTICAL_POLISHED_DIORITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_end_stone_brick_slab"), VERTICAL_END_STONE_BRICK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_mossy_cobblestone_slab"), VERTICAL_MOSSY_COBBLESTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_end_stone_brick_slab"), new BlockItem(VERTICAL_END_STONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_mossy_cobblestone_slab"), new BlockItem(VERTICAL_MOSSY_COBBLESTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_smooth_sandstone_slab"), VERTICAL_SMOOTH_SANDSTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_end_stone_brick_slab"), VERTICAL_END_STONE_BRICK_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_smooth_sandstone_slab"), new BlockItem(VERTICAL_SMOOTH_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_end_stone_brick_slab"), new BlockItem(VERTICAL_END_STONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_smooth_quartz_slab"), VERTICAL_SMOOTH_QUARTZ_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_smooth_sandstone_slab"), VERTICAL_SMOOTH_SANDSTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_smooth_quartz_slab"), new BlockItem(VERTICAL_SMOOTH_QUARTZ_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_smooth_sandstone_slab"), new BlockItem(VERTICAL_SMOOTH_SANDSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_granite_slab"), VERTICAL_GRANITE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_smooth_quartz_slab"), VERTICAL_SMOOTH_QUARTZ_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_granite_slab"), new BlockItem(VERTICAL_GRANITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_smooth_quartz_slab"), new BlockItem(VERTICAL_SMOOTH_QUARTZ_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_andesite_slab"), VERTICAL_ANDESITE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_granite_slab"), VERTICAL_GRANITE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_andesite_slab"), new BlockItem(VERTICAL_ANDESITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_granite_slab"), new BlockItem(VERTICAL_GRANITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_red_nether_brick_slab"), VERTICAL_RED_NETHER_BRICK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_andesite_slab"), VERTICAL_ANDESITE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_red_nether_brick_slab"), new BlockItem(VERTICAL_RED_NETHER_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_andesite_slab"), new BlockItem(VERTICAL_ANDESITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_andesite_slab"), VERTICAL_POLISHED_ANDESITE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_red_nether_brick_slab"), VERTICAL_RED_NETHER_BRICK_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_andesite_slab"), new BlockItem(VERTICAL_POLISHED_ANDESITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_red_nether_brick_slab"), new BlockItem(VERTICAL_RED_NETHER_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_diorite_slab"), VERTICAL_DIORITE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_polished_andesite_slab"), VERTICAL_POLISHED_ANDESITE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_diorite_slab"), new BlockItem(VERTICAL_DIORITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_polished_andesite_slab"), new BlockItem(VERTICAL_POLISHED_ANDESITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_blackstone_slab"), VERTICAL_BLACKSTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_diorite_slab"), VERTICAL_DIORITE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_blackstone_slab"), new BlockItem(VERTICAL_BLACKSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_diorite_slab"), new BlockItem(VERTICAL_DIORITE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_blackstone_slab"), VERTICAL_POLISHED_BLACKSTONE_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_blackstone_slab"), VERTICAL_BLACKSTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_blackstone_slab"), new BlockItem(VERTICAL_POLISHED_BLACKSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_blackstone_slab"), new BlockItem(VERTICAL_BLACKSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier("vplus","vertical_polished_blackstone_brick_slab"), VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB); Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_polished_blackstone_slab"), VERTICAL_POLISHED_BLACKSTONE_SLAB);
Registry.register(Registry.ITEM, new Identifier("vplus","vertical_polished_blackstone_brick_slab"), new BlockItem(VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS))); Registry.register(Registry.ITEM, new Identifier(modid,"vertical_polished_blackstone_slab"), new BlockItem(VERTICAL_POLISHED_BLACKSTONE_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
Registry.register(Registry.BLOCK, new Identifier(modid,"vertical_polished_blackstone_brick_slab"), VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB);
Registry.register(Registry.ITEM, new Identifier(modid,"vertical_polished_blackstone_brick_slab"), new BlockItem(VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB, new Item.Settings().group(VPItemGroups.VERTICAL_SLABS)));
} }
static { static {
VERTICAL_OAK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES)); VERTICAL_OAK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F));
VERTICAL_SPRUCE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES)); VERTICAL_SPRUCE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F));
VERTICAL_BIRCH_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES)); VERTICAL_BIRCH_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F));
VERTICAL_JUNGLE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES)); VERTICAL_JUNGLE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F));
VERTICAL_ACACIA_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES)); VERTICAL_ACACIA_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F));
VERTICAL_DARK_OAK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES)); VERTICAL_DARK_OAK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F));
VERTICAL_CRIMSON_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES)); VERTICAL_CRIMSON_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F));
VERTICAL_WARPED_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F).breakByTool(FabricToolTags.AXES)); VERTICAL_WARPED_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F));
VERTICAL_STONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_MANGROVE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.WOOD).sounds(BlockSoundGroup.WOOD).hardness(2.0F));
VERTICAL_SMOOTH_STONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_STONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_SMOOTH_STONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_CUT_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_COBBLESTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_CUT_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_COBBLESTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_STONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_NETHER_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_STONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_QUARTZ_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_NETHER_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_RED_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_QUARTZ_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_CUT_RED_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_RED_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_PURPUR_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_CUT_RED_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_PRISMARINE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_PURPUR_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_PRISMARINE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_PRISMARINE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_DARK_PRISMARINE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_PRISMARINE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_POLISHED_GRANITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_DARK_PRISMARINE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_SMOOTH_RED_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_POLISHED_GRANITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_MOSSY_STONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_SMOOTH_RED_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_POLISHED_DIORITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_MOSSY_STONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_MOSSY_COBBLESTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_POLISHED_DIORITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_END_STONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_MOSSY_COBBLESTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_SMOOTH_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_END_STONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_SMOOTH_QUARTZ_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_SMOOTH_SANDSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_GRANITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_SMOOTH_QUARTZ_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_ANDESITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_GRANITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_RED_NETHER_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_ANDESITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_POLISHED_ANDESITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_RED_NETHER_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_DIORITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_POLISHED_ANDESITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_BLACKSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_DIORITE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_POLISHED_BLACKSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_BLACKSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES)); VERTICAL_POLISHED_BLACKSTONE_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
VERTICAL_POLISHED_BLACKSTONE_BRICK_SLAB = new VerticalSlabs(FabricBlockSettings.of(Material.STONE).sounds(BlockSoundGroup.STONE).hardness(2.0F).requiresTool());
} }
} }

View File

@ -14,6 +14,8 @@ import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes; import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import java.util.Objects;
public class VerticalSlabs extends HorizontalFacingBlock { public class VerticalSlabs extends HorizontalFacingBlock {
private static final VoxelShape NORTH_SHAPE; private static final VoxelShape NORTH_SHAPE;
@ -30,7 +32,7 @@ public class VerticalSlabs extends HorizontalFacingBlock {
//TODO Fix Waterlogging //TODO Fix Waterlogging
@Override @Override
public FluidState getFluidState(BlockState blockState_1) { public FluidState getFluidState(BlockState blockState_1) {
return (Boolean)blockState_1.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(blockState_1); return blockState_1.get(WATERLOGGED) ? Fluids.WATER.getStill(false) : super.getFluidState(blockState_1);
} }
@Override @Override
@ -42,7 +44,7 @@ public class VerticalSlabs extends HorizontalFacingBlock {
public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) { public BlockState getPlacementState(ItemPlacementContext itemPlacementContext) {
FluidState fluidState = itemPlacementContext.getWorld().getFluidState(itemPlacementContext.getBlockPos()); FluidState fluidState = itemPlacementContext.getWorld().getFluidState(itemPlacementContext.getBlockPos());
boolean waterLog = fluidState.isIn(FluidTags.WATER) && fluidState.getLevel() == 8; boolean waterLog = fluidState.isIn(FluidTags.WATER) && fluidState.getLevel() == 8;
return super.getPlacementState(itemPlacementContext).with(WATERLOGGED, waterLog) return Objects.requireNonNull(super.getPlacementState(itemPlacementContext)).with(WATERLOGGED, waterLog)
.with(FACING, itemPlacementContext.getPlayerFacing().getOpposite()); .with(FACING, itemPlacementContext.getPlayerFacing().getOpposite());
} }
@ -53,28 +55,28 @@ public class VerticalSlabs extends HorizontalFacingBlock {
@Override @Override
public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) { public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) {
switch(state.get(FACING)) { return switch (state.get(FACING)) {
case NORTH: return NORTH_SHAPE; case NORTH -> NORTH_SHAPE;
case EAST: return EAST_SHAPE; case EAST -> EAST_SHAPE;
case SOUTH: return SOUTH_SHAPE; case SOUTH -> SOUTH_SHAPE;
case WEST: return WEST_SHAPE; case WEST -> WEST_SHAPE;
default: return super.getOutlineShape(state, view, pos, context); default -> super.getOutlineShape(state, view, pos, context);
} };
} }
static { static {
VoxelShape shape = createCuboidShape(0.0D, 0.0D, 0.0D, 8.0D, 16.0D, 16.0D); VoxelShape shape = createCuboidShape(0.0D, 0.0D, 0.0D, 8.0D, 16.0D, 16.0D);
EAST_SHAPE = shape; EAST_SHAPE = shape;
NORTH_SHAPE = rotate(Direction.EAST, Direction.NORTH, shape); NORTH_SHAPE = rotate(Direction.NORTH, shape);
SOUTH_SHAPE = rotate(Direction.EAST, Direction.SOUTH, shape); SOUTH_SHAPE = rotate(Direction.SOUTH, shape);
WEST_SHAPE = rotate(Direction.EAST, Direction.WEST, shape); WEST_SHAPE = rotate(Direction.WEST, shape);
} }
private static VoxelShape rotate(Direction from, Direction to, VoxelShape shape) { private static VoxelShape rotate(Direction to, VoxelShape shape) {
VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() }; VoxelShape[] buffer = new VoxelShape[]{ shape, VoxelShapes.empty() };
int times = (to.getHorizontal() - from.getHorizontal() + 4) % 4; int times = (to.getHorizontal() - Direction.EAST.getHorizontal() + 4) % 4;
for (int i = 0; i < times; i++) { for (int i = 0; i < times; i++) {
buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX))); buffer[0].forEachBox((minX, minY, minZ, maxX, maxY, maxZ) -> buffer[1] = VoxelShapes.union(buffer[1], VoxelShapes.cuboid(1-maxZ, minY, minX, 1-minZ, maxY, maxX)));
buffer[0] = buffer[1]; buffer[0] = buffer[1];

View File

@ -4,6 +4,8 @@ import net.minecraft.item.Item;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import static tech.nevets.vplus.Main.modid;
public class VPFood { public class VPFood {
public static final Item IRONAPPLE = new IronApple(); public static final Item IRONAPPLE = new IronApple();
@ -27,19 +29,19 @@ public class VPFood {
//TODO Balance apple strengths //TODO Balance apple strengths
public static void initializeApples() { public static void initializeApples() {
Registry.register(Registry.ITEM, new Identifier("vplus", "iron_apple"), IRONAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "iron_apple"), IRONAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_iron_apple"), ENCHANTEDIRONAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "enchanted_iron_apple"), ENCHANTEDIRONAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_apple"), COPPERAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "copper_apple"), COPPERAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_copper_apple"), ENCHANTEDCOPPERAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "enchanted_copper_apple"), ENCHANTEDCOPPERAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "diamond_apple"), DIAMONDAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "diamond_apple"), DIAMONDAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_diamond_apple"), ENCHANTEDDIAMONDAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "enchanted_diamond_apple"), ENCHANTEDDIAMONDAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_apple"), EMERALDAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_apple"), EMERALDAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_emerald_apple"), ENCHANTEDEMERALDAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "enchanted_emerald_apple"), ENCHANTEDEMERALDAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "netherite_apple"), NETHERITEAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "netherite_apple"), NETHERITEAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_netherite_apple"), ENCHANTEDNETHERITEAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "enchanted_netherite_apple"), ENCHANTEDNETHERITEAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_apple"), PLATINUMAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_apple"), PLATINUMAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_platinum_apple"), ENCHANTEDPLATINUMAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "enchanted_platinum_apple"), ENCHANTEDPLATINUMAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_apple"), RUBYAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_apple"), RUBYAPPLE);
Registry.register(Registry.ITEM, new Identifier("vplus", "enchanted_ruby_apple"), ENCHANTEDRUBYAPPLE); Registry.register(Registry.ITEM, new Identifier(modid, "enchanted_ruby_apple"), ENCHANTEDRUBYAPPLE);
} }
} }

View File

@ -4,6 +4,8 @@ import net.minecraft.item.Item;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import static tech.nevets.vplus.Main.modid;
public class VPItems { public class VPItems {
public static final Item PLATINUMINGOT = new PlatinumIngot(new Item.Settings().group(VPItemGroups.ALL)); public static final Item PLATINUMINGOT = new PlatinumIngot(new Item.Settings().group(VPItemGroups.ALL));
@ -15,9 +17,9 @@ public class VPItems {
} }
public static void initializeValuables() { public static void initializeValuables() {
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_ingot"), PLATINUMINGOT); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_ingot"), PLATINUMINGOT);
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_nugget"), PLATINUMNUGGET); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_nugget"), PLATINUMNUGGET);
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby"), RUBY); Registry.register(Registry.ITEM, new Identifier(modid, "ruby"), RUBY);
} }
} }

View File

@ -5,44 +5,55 @@ import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.util.registry.RegistryKey; import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.gen.GenerationStep; import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.YOffset; import net.minecraft.world.gen.YOffset;
import net.minecraft.world.gen.decorator.*;
import net.minecraft.world.gen.feature.*; import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.placementmodifier.CountPlacementModifier;
import net.minecraft.world.gen.placementmodifier.HeightRangePlacementModifier;
import net.minecraft.world.gen.placementmodifier.SquarePlacementModifier;
import tech.nevets.vplus.blocks.VPBlocks; import tech.nevets.vplus.blocks.VPBlocks;
import java.util.Arrays;
import static tech.nevets.vplus.Main.modid;
public class VPOreGen { public class VPOreGen {
private static ConfiguredFeature<?, ?> ORE_PLATINUM_OVERWORLD_CONFIGURED = Feature.ORE private static final ConfiguredFeature<?, ?> ORE_PLATINUM_OVERWORLD_CONFIGURED = new ConfiguredFeature<>
.configure(new OreFeatureConfig( (Feature.ORE, new OreFeatureConfig(
OreConfiguredFeatures.BASE_STONE_OVERWORLD, OreConfiguredFeatures.BASE_STONE_OVERWORLD,
VPBlocks.PLATINUMORE.getDefaultState(), VPBlocks.PLATINUMORE.getDefaultState(),
3)); // vein size 3)); // vein size
public static PlacedFeature ORE_PLATINUM_OVERWORLD_PLACED = ORE_PLATINUM_OVERWORLD_CONFIGURED.withPlacement( public static PlacedFeature ORE_PLATINUM_OVERWORLD_PLACED = new PlacedFeature(
RegistryEntry.of(ORE_PLATINUM_OVERWORLD_CONFIGURED),
Arrays.asList(
CountPlacementModifier.of(2), // number of veins per chunk CountPlacementModifier.of(2), // number of veins per chunk
SquarePlacementModifier.of(), SquarePlacementModifier.of(),
HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(15)) HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(15))
); ));
private static ConfiguredFeature<?, ?> ORE_RUBY_OVERWORLD_CONFIGURED = Feature.ORE private static final ConfiguredFeature<?, ?> ORE_RUBY_OVERWORLD_CONFIGURED = new ConfiguredFeature<>
.configure(new OreFeatureConfig( (Feature.ORE, new OreFeatureConfig(
OreConfiguredFeatures.BASE_STONE_OVERWORLD, OreConfiguredFeatures.BASE_STONE_OVERWORLD,
VPBlocks.PLATINUMORE.getDefaultState(), VPBlocks.RUBYORE.getDefaultState(),
1)); // vein size 1));
public static PlacedFeature ORE_RUBY_OVERWORLD_PLACED = ORE_PLATINUM_OVERWORLD_CONFIGURED.withPlacement( public static PlacedFeature ORE_RUBY_OVERWORLD_PLACED = new PlacedFeature(
RegistryEntry.of(ORE_RUBY_OVERWORLD_CONFIGURED),
Arrays.asList(
CountPlacementModifier.of(8), // number of veins per chunk CountPlacementModifier.of(8), // number of veins per chunk
SquarePlacementModifier.of(), SquarePlacementModifier.of(),
HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(15)) HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(15))
); ));
public static void vpOres() { public static void vpOres() {
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier("vplus", "platinum_ore"), ORE_PLATINUM_OVERWORLD_CONFIGURED); Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier(modid, "platinum_ore"), ORE_PLATINUM_OVERWORLD_CONFIGURED);
Registry.register(BuiltinRegistries.PLACED_FEATURE, new Identifier("vplus", "platinum_ore"), ORE_PLATINUM_OVERWORLD_PLACED); Registry.register(BuiltinRegistries.PLACED_FEATURE, new Identifier(modid, "platinum_ore"), ORE_PLATINUM_OVERWORLD_PLACED);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier("vplus", "platinum_ore"))); BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(modid, "platinum_ore")));
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier("vplus", "ruby_ore"), ORE_RUBY_OVERWORLD_CONFIGURED); Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, new Identifier(modid, "ruby_ore"), ORE_RUBY_OVERWORLD_CONFIGURED);
Registry.register(BuiltinRegistries.PLACED_FEATURE, new Identifier("vplus", "ruby_ore"), ORE_RUBY_OVERWORLD_PLACED); Registry.register(BuiltinRegistries.PLACED_FEATURE, new Identifier(modid, "ruby_ore"), ORE_RUBY_OVERWORLD_PLACED);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier("vplus", "ruby_ore"))); BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, RegistryKey.of(Registry.PLACED_FEATURE_KEY, new Identifier(modid, "ruby_ore")));
} }
} }

View File

@ -1,26 +1,18 @@
package tech.nevets.vplus.tools; package tech.nevets.vplus.tools;
import java.util.function.Supplier;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.item.ToolMaterial; import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Lazy; import net.minecraft.util.Lazy;
import tech.nevets.vplus.items.VPItems; import tech.nevets.vplus.items.VPItems;
import java.util.function.Supplier;
public enum ToolMaterials implements ToolMaterial { public enum ToolMaterials implements ToolMaterial {
COPPER (2, 200, 5.0F, 3.0F, 20, () -> { COPPER (2, 200, 5.0F, 3.0F, 20, () -> Ingredient.ofItems(Items.COPPER_INGOT)),
return Ingredient.ofItems(new ItemConvertible[]{Items.COPPER_INGOT}); EMERALD(3, 750, 7.0F, 4.0F, 30, () -> Ingredient.ofItems(Items.EMERALD)),
}), PLATINUM(4, 3000, 10.0F, 6.0F, 40, () -> Ingredient.ofItems(VPItems.PLATINUMINGOT)),
EMERALD(3, 750, 7.0F, 4.0F, 30, () -> { RUBY(4, 5000, 12.0F, 10.0F, 100, () -> Ingredient.ofItems(VPItems.RUBY));
return Ingredient.ofItems(new ItemConvertible[]{Items.EMERALD});
}),
PLATINUM(4, 3000, 10.0F, 6.0F, 40, () -> {
return Ingredient.ofItems(new ItemConvertible[]{VPItems.PLATINUMINGOT});
}),
RUBY(4, 5000, 12.0F, 10.0F, 100, () -> {
return Ingredient.ofItems(new ItemConvertible[]{VPItems.RUBY});
});
private final int miningLevel; private final int miningLevel;
private final int itemDurability; private final int itemDurability;
@ -28,13 +20,13 @@ public enum ToolMaterials implements ToolMaterial {
private final float attackDamage; private final float attackDamage;
private final int enchantability; private final int enchantability;
private final Lazy<Ingredient> repairIngredient; private final Lazy<Ingredient> repairIngredient;
private ToolMaterials(int miningLevel, int itemDurability, float miningSpeed, float attackDamage, int enchantability, Supplier<Ingredient> repairIngredient) { ToolMaterials(int miningLevel, int itemDurability, float miningSpeed, float attackDamage, int enchantability, Supplier<Ingredient> repairIngredient) {
this.miningLevel = miningLevel; this.miningLevel = miningLevel;
this.itemDurability = itemDurability; this.itemDurability = itemDurability;
this.miningSpeed = miningSpeed; this.miningSpeed = miningSpeed;
this.attackDamage = attackDamage; this.attackDamage = attackDamage;
this.enchantability = enchantability; this.enchantability = enchantability;
this.repairIngredient = new Lazy(repairIngredient); this.repairIngredient = new Lazy<>(repairIngredient);
} }
public int getDurability() { public int getDurability() {
@ -58,6 +50,6 @@ public enum ToolMaterials implements ToolMaterial {
} }
public Ingredient getRepairIngredient() { public Ingredient getRepairIngredient() {
return (Ingredient)this.repairIngredient.get(); return this.repairIngredient.get();
} }
} }

View File

@ -3,6 +3,8 @@ package tech.nevets.vplus.tools;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import static tech.nevets.vplus.Main.modid;
public class VPTools { public class VPTools {
public static void vpTools() { public static void vpTools() {
@ -14,37 +16,37 @@ public class VPTools {
} }
public static void initializeAxes() { public static void initializeAxes() {
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_axe"), new AxeBase(ToolMaterials.COPPER)); Registry.register(Registry.ITEM, new Identifier(modid, "copper_axe"), new AxeBase(ToolMaterials.COPPER));
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_axe"), new AxeBase(ToolMaterials.EMERALD)); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_axe"), new AxeBase(ToolMaterials.EMERALD));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_axe"), new AxeBase(ToolMaterials.PLATINUM)); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_axe"), new AxeBase(ToolMaterials.PLATINUM));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_axe"), new AxeBase(ToolMaterials.RUBY)); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_axe"), new AxeBase(ToolMaterials.RUBY));
} }
public static void initializeHoes() { public static void initializeHoes() {
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_hoe"), new HoeBase(ToolMaterials.COPPER)); Registry.register(Registry.ITEM, new Identifier(modid, "copper_hoe"), new HoeBase(ToolMaterials.COPPER));
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_hoe"), new HoeBase(ToolMaterials.EMERALD)); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_hoe"), new HoeBase(ToolMaterials.EMERALD));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_hoe"), new HoeBase(ToolMaterials.PLATINUM)); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_hoe"), new HoeBase(ToolMaterials.PLATINUM));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_hoe"), new HoeBase(ToolMaterials.RUBY)); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_hoe"), new HoeBase(ToolMaterials.RUBY));
} }
public static void initializePickaxes() { public static void initializePickaxes() {
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_pickaxe"), new PickaxeBase(ToolMaterials.COPPER)); Registry.register(Registry.ITEM, new Identifier(modid, "copper_pickaxe"), new PickaxeBase(ToolMaterials.COPPER));
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_pickaxe"), new PickaxeBase(ToolMaterials.EMERALD)); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_pickaxe"), new PickaxeBase(ToolMaterials.EMERALD));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_pickaxe"), new PickaxeBase(ToolMaterials.PLATINUM)); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_pickaxe"), new PickaxeBase(ToolMaterials.PLATINUM));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_pickaxe"), new PickaxeBase(ToolMaterials.RUBY)); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_pickaxe"), new PickaxeBase(ToolMaterials.RUBY));
} }
public static void initializeShovels() { public static void initializeShovels() {
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_shovel"), new ShovelBase(ToolMaterials.COPPER)); Registry.register(Registry.ITEM, new Identifier(modid, "copper_shovel"), new ShovelBase(ToolMaterials.COPPER));
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_shovel"), new ShovelBase(ToolMaterials.EMERALD)); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_shovel"), new ShovelBase(ToolMaterials.EMERALD));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_shovel"), new ShovelBase(ToolMaterials.PLATINUM)); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_shovel"), new ShovelBase(ToolMaterials.PLATINUM));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_shovel"), new ShovelBase(ToolMaterials.RUBY)); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_shovel"), new ShovelBase(ToolMaterials.RUBY));
} }
public static void initializeSwords() { public static void initializeSwords() {
Registry.register(Registry.ITEM, new Identifier("vplus", "copper_sword"), new SwordBase(ToolMaterials.COPPER)); Registry.register(Registry.ITEM, new Identifier(modid, "copper_sword"), new SwordBase(ToolMaterials.COPPER));
Registry.register(Registry.ITEM, new Identifier("vplus", "emerald_sword"), new SwordBase(ToolMaterials.EMERALD)); Registry.register(Registry.ITEM, new Identifier(modid, "emerald_sword"), new SwordBase(ToolMaterials.EMERALD));
Registry.register(Registry.ITEM, new Identifier("vplus", "platinum_sword"), new SwordBase(ToolMaterials.PLATINUM)); Registry.register(Registry.ITEM, new Identifier(modid, "platinum_sword"), new SwordBase(ToolMaterials.PLATINUM));
Registry.register(Registry.ITEM, new Identifier("vplus", "ruby_sword"), new SwordBase(ToolMaterials.RUBY)); Registry.register(Registry.ITEM, new Identifier(modid, "ruby_sword"), new SwordBase(ToolMaterials.RUBY));
} }
} }

View File

@ -0,0 +1,8 @@
{
"variants": {
"facing=north": { "model": "block/mangrove_slab", "x": 90, "uvlock": true },
"facing=east": { "model": "block/mangrove_slab", "x": 90, "y": 90, "uvlock": true },
"facing=south": { "model": "block/mangrove_slab", "x": 90, "y": 180, "uvlock": true },
"facing=west": { "model": "block/mangrove_slab", "x": 90, "y": 270, "uvlock": true }
}
}

View File

@ -81,6 +81,7 @@
"block.vplus.vertical_dark_oak_slab":"Vertical Dark Oak Slab", "block.vplus.vertical_dark_oak_slab":"Vertical Dark Oak Slab",
"block.vplus.vertical_crimson_slab":"Vertical Crimson Slab", "block.vplus.vertical_crimson_slab":"Vertical Crimson Slab",
"block.vplus.vertical_warped_slab":"Vertical Warped Slab", "block.vplus.vertical_warped_slab":"Vertical Warped Slab",
"block.vplus.vertical_mangrove_slab":"Vertical Mangrove Slab",
"block.vplus.vertical_stone_slab":"Vertical Stone Slab", "block.vplus.vertical_stone_slab":"Vertical Stone Slab",
"block.vplus.vertical_smooth_stone_slab":"Vertical Smooth Stone Slab", "block.vplus.vertical_smooth_stone_slab":"Vertical Smooth Stone Slab",
"block.vplus.vertical_sandstone_slab":"Vertical Sandstone Slab", "block.vplus.vertical_sandstone_slab":"Vertical Sandstone Slab",

View File

@ -0,0 +1,8 @@
{
"parent": "vplus:block/vertical_slab",
"textures": {
"bottom": "minecraft:block/mangrove_planks",
"top": "minecraft:block/mangrove_planks",
"side": "minecraft:block/mangrove_planks"
}
}

View File

@ -0,0 +1,3 @@
{
"parent": "vplus:block/vertical_mangrove_slab"
}

View File

@ -0,0 +1,14 @@
{
"replace": false,
"values": [
"vplus:vertical_oak_slab",
"vplus:vertical_spruce_slab",
"vplus:vertical_birch_slab",
"vplus:vertical_jungle_slab",
"vplus:vertical_acacia_slab",
"vplus:vertical_dark_oak_slab",
"vplus:vertical_crimson_slab",
"vplus:vertical_warped_slab",
"vplus:vertical_mangrove_slab"
]
}

View File

@ -0,0 +1,39 @@
{
"replace": false,
"values": [
"vplus:platinum_block",
"vplus:platinum_ore",
"vplus:ruby_block",
"vplus:ruby_ore",
"vplus:vertical_stone_slab",
"vplus:vertical_smooth_stone_slab",
"vplus:vertical_sandstone_slab",
"vplus:vertical_cut_sandstone_slab",
"vplus:vertical_cobblestone_slab",
"vplus:vertical_brick_slab",
"vplus:vertical_stone_brick_slab",
"vplus:vertical_nether_brick_slab",
"vplus:vertical_quartz_slab",
"vplus:vertical_red_sandstone_slab",
"vplus:vertical_cut_red_sandstone_slab",
"vplus:vertical_purpur_slab",
"vplus:vertical_prismarine_slab",
"vplus:vertical_prismarine_brick_slab",
"vplus:vertical_dark_prismarine_slab",
"vplus:vertical_polished_granite_slab",
"vplus:vertical_mossy_stone_brick_slab",
"vplus:vertical_polished_diorite_slab",
"vplus:vertical_mossy_cobblestone_slab",
"vplus:vertical_end_stone_brick_slab",
"vplus:vertical_smooth_sandstone_slab",
"vplus:vertical_smooth_quartz_slab",
"vplus:vertical_granite_slab",
"vplus:vertical_andesite_slab",
"vplus:vertical_red_nether_brick_slab",
"vplus:vertical_polished_andesite_slab",
"vplus:vertical_diorite_slab",
"vplus:vertical_blackstone_slab",
"vplus:vertical_polished_blackstone_slab",
"vplus:vertical_polished_blackstone_brick_slab"
]
}

View File

@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"vplus:platinum_ore",
"vplus:ruby_ore"
]
}

View File

@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "vplus:vertical_mangrove_slab"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@ -0,0 +1,11 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:mangrove_slab"
}
],
"result": {
"item": "vplus:vertical_mangrove_slab"
}
}

View File

@ -9,6 +9,7 @@
"vplus:vertical_dark_oak_slab", "vplus:vertical_dark_oak_slab",
"vplus:vertical_crimson_slab", "vplus:vertical_crimson_slab",
"vplus:vertical_warped_slab", "vplus:vertical_warped_slab",
"vplus:vertical_mangrove_slab",
"vplus:vertical_stone_slab", "vplus:vertical_stone_slab",
"vplus:vertical_smooth_stone_slab", "vplus:vertical_smooth_stone_slab",
"vplus:vertical_sandstone_slab", "vplus:vertical_sandstone_slab",

View File

@ -39,7 +39,7 @@
"depends": { "depends": {
"fabricloader": ">=0.12.9", "fabricloader": ">=0.12.9",
"fabric": "*", "fabric": "*",
"minecraft": "1.18.x", "minecraft": "1.19.x",
"java": ">=17" "java": ">=17"
}, },
"suggests": { "suggests": {