Jump to content

wannabeuk

Members
  • Posts

    10
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

wannabeuk's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hey guys, Thanks for the replies. I managed to get it working using blockbench as suggested above.
  2. I would have posted the model json, but since it dosn't do anything about the internal faces (because i don't know how) i didn't see much point. I have no code for it since i don't know how to do it in code either. I'll take a look at blockbench see if i can work something out with that, Cheers.
  3. So i'm trying to make a block that has one transparent side that allows players to walk inside of it. Thanks to some help on here i've got the colliders working and i'm not working on the textures. The issue is the inside of the blocks are culled, so looking through the transparent side lets you see through the block. Also entering the block fills the screen with the default purple/black checkboard. i can't seem to understand how to make them render correctly. I was advised this was something i can do in my json model, but after reading the wiki 3-4 times i still have no idea how i would do that. Could someone give me some pointers?
  4. Thanks voidwalker that worked perfectly.
  5. Thanks for the reply, I was aware it was two blocks it's just so much has changed since I last started modding that i was completely lost. I've managed to get my block to place correctly so it's two high. Now i'm trying to work on collisions. This is what i have : static double AXIS_MIN_MIN = 0, AXIS_MIN_MAX = 0.1, AXIS_MAX_MIN = 0.9, AXIS_MAX_MAX = 1, AXIS_FLOOR_MIN = -0.01, AXIS_FLOOR_MAX = 0; @Override public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, Entity entityIn, boolean isActualState) { if(entityIn == null) { return; } List<AxisAlignedBB> axis = new ArrayList<AxisAlignedBB>(); EnumFacing facing = worldIn.getBlockState(pos).getValue(FACING); int x = pos.getX(); int y = pos.getY(); int z = pos.getZ(); //TODO : Work out how to do upper / lower block if(facing == EnumFacing.NORTH) { axis.add(new AxisAlignedBB(new BlockPos(x, y, z + AXIS_MAX_MIN), new BlockPos(x + 1, y + 1, z + AXIS_MAX_MAX))); // south axis.add(new AxisAlignedBB(new BlockPos(x + AXIS_MAX_MIN, y, z), new BlockPos(x + AXIS_MAX_MAX, y + 1, z + 1))); // east axis.add(new AxisAlignedBB(new BlockPos(x + AXIS_MIN_MIN, y, z), new BlockPos(x + AXIS_MIN_MAX, y + 1, z + 1))); // west } else if (facing == EnumFacing.SOUTH) { axis.add(new AxisAlignedBB(new BlockPos(x, y, z + AXIS_MIN_MIN), new BlockPos(x + 1, y + 1, z + AXIS_MIN_MAX))); // north axis.add(new AxisAlignedBB(new BlockPos(x + AXIS_MAX_MIN, y, z), new BlockPos(x + AXIS_MAX_MAX, y + 1, z + 1))); // east axis.add(new AxisAlignedBB(new BlockPos(x + AXIS_MIN_MIN, y, z), new BlockPos(x + AXIS_MIN_MAX, y + 1, z + 1))); // west } else if (facing == EnumFacing.EAST) { axis.add(new AxisAlignedBB(new BlockPos(x + AXIS_MIN_MIN, y, z), new BlockPos(x + AXIS_MIN_MAX, y + 1, z + 1))); // west axis.add(new AxisAlignedBB(new BlockPos(x, y, z + AXIS_MIN_MIN), new BlockPos(x + 1, y + 1, z + AXIS_MIN_MAX))); // north axis.add(new AxisAlignedBB(new BlockPos(x, y, z + AXIS_MAX_MIN), new BlockPos(x + 1, y + 1, z + AXIS_MAX_MAX))); // south } else if (facing == EnumFacing.WEST) { axis.add(new AxisAlignedBB(new BlockPos(x + AXIS_MAX_MIN, y, z), new BlockPos(x + AXIS_MAX_MAX, y + 1, z + 1))); // east axis.add(new AxisAlignedBB(new BlockPos(x, y, z + AXIS_MIN_MIN), new BlockPos(x + 1, y + 1, z + AXIS_MIN_MAX))); // north axis.add(new AxisAlignedBB(new BlockPos(x, y, z + AXIS_MAX_MIN), new BlockPos(x + 1, y + 1, z + AXIS_MAX_MAX))); // south } for(AxisAlignedBB a : axis) { if(a != null && entityBox.intersects(a)) { collidingBoxes.add(a); } } } it seems to have no effect on the collisions so i'm not sure if my code is just wrong. or if i'm missing something
  6. Hi all, I'm trying to create a block that is 2x1 (like a door) which has only three sides, allowing the player to walk inside it (like a booth). But I simply can't get my head around how to do the collisions. I've found a good example from a old mod (1.7) but i can't seem to work out how you would do this in 1.12. Does anyone know any uptodate examples or is willing to give me some pointers? Thanks.
  7. Well that's pretty much as perfect as I could ask for thanks
  8. Hey, I've been getting back into modding again after a long break. Noticed that it's changed quite a bit. However i'm running into an issue with the tutorials i've been using. They all seem to break best practise rules that are mentioned time and time again on here and other places (Proxies, IHasModel e.c.t) So i'm looking for a good (hopefully simple) open source example of a mod (on github) that follows these best practises, so i can learn from that. Could anyone point me in the right direction? Thanks
  9. Ok, so since people dont seem to be able to answer, perhaps my question wasn't clear enough. I have made some headway but i still suffer from a lack of understanding, I have the following two functions. now this works on some orientations however on others it simple moves the hidge to the opposite side, at which point open and close happen the wrong way around. Could anyone clear this up for me? what part of understand am i missing private void CloseDoor(World world, int x, int y, int z, BlockDoor door) { MinecraftServer.getServer().getConfigurationManager().func_92027_k(String.format("[%s] %s", new Object[] {"SERVER", "Closing Door:"})); //Open or close the door (opens if closed, closes if open) int direction = door.getFullMetadata(world, x, y, z); MinecraftServer.getServer().getConfigurationManager().func_92027_k(String.format("[%s] %s", new Object[] {"SERVER", "Metadata = " + direction})); int state = 6; // int var11 = direction & 7; //var11 ^= 4; //direction ^= 4; if(direction == 4 || direction == 12) { state = 0; } else if (direction == 5 || direction == 13) { state = 1; } else if (direction == 6 || direction == 14) { state = 2; } else if (direction == 7 || direction == 15) { state = 3; } MinecraftServer.getServer().getConfigurationManager().func_92027_k(String.format("[%s] %s", new Object[] {"SERVER", "State = " + state})); if ((direction & == 0) { world.setBlockMetadataWithNotify(x, y, z, state); world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); } else { world.setBlockMetadataWithNotify(x, y - 1, z, state); world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z); } } private void OpenDoor(World world, int x, int y, int z, BlockDoor door) { MinecraftServer.getServer().getConfigurationManager().func_92027_k(String.format("[%s] %s", new Object[] {"SERVER", "Opening Door:"})); //Open or close the door (opens if closed, closes if open) int direction = door.getFullMetadata(world, x, y, z); MinecraftServer.getServer().getConfigurationManager().func_92027_k(String.format("[%s] %s", new Object[] {"SERVER", "Metadata = " + direction})); int state = 6; // int var11 = direction & 7; //var11 ^= 4; //direction ^= 4; if(direction == 0 || direction == { state = 4; } else if (direction == 1 || direction == 9) { state = 5; } else if (direction == 2 || direction == 10) { state = 6; } else if (direction == 3 || direction == 11) { state = 7; } MinecraftServer.getServer().getConfigurationManager().func_92027_k(String.format("[%s] %s", new Object[] {"SERVER", "State = " + state})); if ((direction & == 0) { world.setBlockMetadataWithNotify(x, y, z, state); world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); } else { world.setBlockMetadataWithNotify(x, y - 1, z, state); world.markBlockRangeForRenderUpdate(x, y - 1, z, x, y, z); } }
  10. Hey guys, I'm having serious issues wrapping my head around the opening and closing of a door, i do not understand bitwise programming. What i'm looking to do, is separate the standard onBlockActivated of BlockDoor into a function that will only open a door and another that will only close it. Rather than the standard open/close toggle. However its been a long week of searching and im not closer to understanding. Could anyone help me out? Cheers
×
×
  • Create New...

Important Information

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