Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. private void place(BlockPos pos, final EnumFacing face) {
  2. if (face == EnumFacing.UP) {
  3. pos = pos.add(0, -1, 0);
  4. } else if (face == EnumFacing.NORTH) {
  5. pos = pos.add(0, 0, 1);
  6. } else if (face == EnumFacing.EAST) {
  7. pos = pos.add(-1, 0, 0);
  8. } else if (face == EnumFacing.SOUTH) {
  9. pos = pos.add(0, 0, -1);
  10. } else if (face == EnumFacing.WEST) {
  11. pos = pos.add(1, 0, 0);
  12. }
  13. if (getBlockInHotbar() != -1 && (getBlockInHotbar() != -1 || mc.thePlayer.getHeldItem() == null)) {
  14. switchItem();
  15. mc.thePlayer.swingItem();
  16. if (mc.theWorld.getBlockState(pos) != null && mc.theWorld.getBlockState(pos).getBlock() == Blocks.air) {
  17. mc.playerController.onPlayerRightClick(mc.thePlayer, mc.theWorld, mc.thePlayer.getCurrentEquippedItem(), pos, face, new Vec3(pos));
  18. mc.thePlayer.swingItem();
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement