Jump to content

Elite_Puddle

Members
  • Posts

    9
  • Joined

  • Last visited

Elite_Puddle's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I have been going through the redstone torch trying to understand how the redstone inverter works so i can use get similar functionality out of a single block.
  2. yes I know, im trying to condense all the logic gates into single blocks and NOT seemed like the easiest to start with
  3. Im trying to create a block that produces power from the north face unless it receives power from the south face, I have managed to create a block that Redstone connects to but Im struggling to progress further, I know the canConnectRedstone() function exists but Im not sure how to work with it. below is the code i have so far: @SubscribeEvent public static void onRegisterBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll( setup(new Not_Block(Block.Properties.create(Material.ROCK) .hardnessAndResistance(3.0F,3.0F).sound(SoundType.STONE)) , "not_block")); } public class Not_Block extends RedstoneDiodeBlock { public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; public static final IntegerProperty DELAY = BlockStateProperties.DELAY_1_4; public static final BooleanProperty POWERED = BlockStateProperties.POWERED; public Not_Block(Properties properties) { super(properties); this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); } protected int getDelay(BlockState state) { return state.get(DELAY) * 2; } //sets the block to always be placed facing the player @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override protected void fillStateContainer(Builder<Block, BlockState> builder) { builder.add(FACING); } }
  4. Im trying to create a block that faces the player when placed, if I get rid of the "facing" the block always faces north and with them there the texture errors: Blockstate/not_block.json { "variants": { "": { "model": "minecraftedu:block/not_block"} "facing=north": { "model": "minecraftedu:block/not_block"} "facing=south": { "model": "minecraftedu:block/not_block", "y": 180 } "facing=east": { "model": "minecraftedu:block/not_block", "y": 270 } "facing=west": { "model": "minecraftedu:block/not_block", "y": 90 } } } not_block public class Not_Block extends Block { public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; public Not_Block(Properties properties) { super(properties); this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); } //sets the block to always be placed facing the player @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override protected void fillStateContainer(Builder<Block, BlockState> builder) { builder.add(FACING); } }
  5. I want to make my block face the player when it is placed here is the block code: public class Not_Block extends Block { public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; public Not_Block(Properties properties) { super(properties); this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); } //sets the block to always be placed facing the player @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override protected void fillStateContainer(Builder<Block, BlockState> builder) { builder.add(FACING); } } here is the line in EventBusSubscriber @SubscribeEvent public static void onRegisterBlocks(RegistryEvent.Register<Block> event) { event.getRegistry().registerAll( setup(new Not_Block(Block.Properties.create(Material.ROCK) .hardnessAndResistance(3.0F,3.0F).sound(SoundType.STONE)) , "not_block")); } here is the blockstates json { "variants": { "facing=north": { "model": "minecraftedu:block/not_block"} "facing=south": { "model": "minecraftedu:block/not_block", "y": 180 } "facing=east": { "model": "minecraftedu:block/not_block", "y": 270 } "facing=west": { "model": "minecraftedu:block/not_block", "y": 90 } } } and here is the block json { "parent": "block/cube", "textures": { "particle": "minecraftedu:block/not_block", "all": "minecraftedu:block/not_block" }, "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "down" }, "up": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "up" }, "north": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "north" }, "south": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "south" }, "west": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "west" }, "east": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "east" } } } ] }
  6. I've tried what the link you posted suggested and it's still not working { "parent": "block/cube_all", "textures": { "all": "minecraftedu:block/not_block" }, "elements": [ { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "down": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "down" }, "up": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "up" }, "north": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "north" }, "south": { "uv": [0,8, 16,16], "texture": "#all", "cullface": "south" }, "west": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "west" }, "east": { "uv": [0,0, 16,8], "texture": "#all", "cullface": "east" }, } } ] }
  7. where are they, ive been looking for hours and can only find the classes
  8. Im able to create a block with the same texture on every side but I can't figure out why my json's won't create a block with unique textures on the north and south sides. I can't find any good examples online or in the forge project. Code " { "parent": "block/cube_all", "textures": { "all": "minecraftedu:block/edu_default_block" "north": "minecraftedu:block/not_block" "south": "minecraftedu:block/not_block" } } " " { "variants": { "": { "model": "minecraftedu:block/edu_default_block" } "north": { "model": "minecraftedu:block/not_block" } "south": { "model": "minecraftedu:block/not_block" } } } "
×
×
  • Create New...

Important Information

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