Jump to content

bajtix

Members
  • Posts

    31
  • Joined

  • Last visited

Everything posted by bajtix

  1. Thanks to all people who answered, I'm going to give the solutions a try tommorow. I am going to rewrite it to deffered registries. I thought I'd do it later, but i think i should do it ASAP.
  2. Hi, I have a problem with my blockmodels or maybe it's in my code. I am trying to add a transparent texture to my blockmodels, so it has two layers. However, ingame, the transparent parts become black. Here's a screenshot: //Block implementation public static Block candle = new VaseBlocks(Block.Properties.create(Material.ROCK) .hardnessAndResistance(2.0f, 3.0f) .sound(SoundType.STONE) .lightValue(10) ).setRegistryName(MainClass.location("candle")); //VaseBlock class //The candles use the same class for my vases package com.bajtix.onesblocks.blocks; import com.bajtix.onesblocks.lists.BlockItemList; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalBlock; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.DirectionProperty; import net.minecraft.state.IntegerProperty; import net.minecraft.state.StateContainer; import net.minecraft.util.*; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.shapes.IBooleanFunction; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; import java.util.Optional; import java.util.stream.Stream; public class VaseBlocks extends Block { public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; private static final Optional<VoxelShape> SHAPE = Stream.of( Block.makeCuboidShape(2, 0, 2, 14, 5, 14) ).reduce((v1, v2) -> { return VoxelShapes.combineAndSimplify(v1, v2, IBooleanFunction.OR); }); public static IntegerProperty COUNT = ModBlockStateProperties.VASE_COUNT; public VaseBlocks(Properties p_i48440_1_) { super(p_i48440_1_); this.setDefaultState(this.getStateContainer().getBaseState().with(FACING, Direction.NORTH).with(COUNT, 1)); } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { return SHAPE.get(); } @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override public BlockState rotate(BlockState state, Rotation rotation) { return state.with(FACING, rotation.rotate(state.get(FACING))); } @Override public BlockState mirror(BlockState state, Mirror mirrorIn) { return state.rotate(mirrorIn.toRotation(state.get(FACING))); } @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(FACING); builder.add(COUNT); } @Override public ActionResultType func_225533_a_(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult result) { if (!worldIn.isRemote) { ServerWorld serverWorld = (ServerWorld) worldIn; if (state.get(COUNT) < 3 && player.getHeldItem(hand).getItem() == BlockItemList.vase) { if (!player.isCreative()) player.inventory.getCurrentItem().setCount(player.inventory.getCurrentItem().getCount() - 1); serverWorld.setBlockState(pos, state.with(COUNT, state.get(COUNT) + 1)); } } return ActionResultType.SUCCESS; } }
  3. Yes, I've read them but yesterday i was so tired that for my brain it was jibberish. Anyway, I've checked them today again and I've found the error Basically, i wrote the arguments in //Count range config: [Vein count] [Min height] [Min height] [Max height] ConfiguredPlacement mossyStoneConfig = Placement.COUNT_RANGE.func_227446_a_(new CountRangeConfig(10, 20, 20, 100)); in the wrong order, forcing the ore to spawn on negative Y. Thanks to everyone for help!
  4. The function this enum's description highlights is the create() one but i have no idea on what the arguments should be. Here's the crash report crash-2020-04-07_07.24.09-server.txt
  5. The game crashes as soon as i generate a world. I'm trying to register BlockList.moss_stone as the block the ore should generate in. I don't really understand how to work with net.minecraftforge.common.IExtensibleEnum and I don't know how to add an entry to the enum.
  6. So I want to generate an ore inside of my custom stone, generated earlier. How could I add this block to the FillerBlockType? Currently I am trying to use the FillerBlockType.create() method, but I can't get it to work. Here is my code: ConfiguredPlacement elfiumOreConfig = Placement.COUNT_RANGE.func_227446_a_(new CountRangeConfig(10,20,20,10)); biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.func_225566_b_( new OreFeatureConfig( OreFeatureConfig.FillerBlockType.create("FillerBlockType","MOSS_STONE",new BlockMatcher(Blocks.DIRT)), BlockList.elfium_ore.getDefaultState(), 6 //per vein ) ).func_227228_a_(elfiumOreConfig) );
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.