Jump to content

Zetko

Members
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Zetko's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. If that doesn't work then extend InventoryEffectRenderer.
  2. Also, extend BlockHorizontal instead of BaseHarshenFacedBlock because trySleep() checks if the block is an instance of BlockHorizontal.
  3. Could you change if (state.getBlock() != HarshenBlocks.BLOODY_BED_HEAD) { return true; } into this: if (!(state.getBlock() instanceof this)) { return true; } Tell me if it works.
  4. Could you try creating a new BlockPos between lines 63 and 64, before you offset it, like this: BlockPos pos = pos; That might be the problem.
  5. Is there a difference if you right-click on the leg and head part of the bed? Could you record it?
  6. You should add a version of the vanilla bed offset code between lines 68 and 69 of your BaseBloodyBed class. The vanilla offset code: if (state.getValue(PART) != BlockBed.EnumPartType.HEAD) { pos = pos.offset((EnumFacing)state.getValue(FACING)); state = worldIn.getBlockState(pos); if (state.getBlock() != this) { return true; } } net.minecraft.world.WorldProvider.WorldSleepResult sleepResult = worldIn.provider.canSleepAt(playerIn, pos);
  7. So, let's start again: In your BaseBloodyBed class, you should offset the sleeping position in the FACING direction if the block you right-clicked on is an instance of BloodyBed. Then try to sleep again and tell me what happens.
  8. You should keep the bed part facing the same as in the vanilla bed, sorry if I confused you. I was only pointing this out because you were offsetting in both parts of the bed in the facing direction. I looked through your code and I don't see the offset code. Could you please point me where it is? Did you delete it?
  9. For the 1. and 2. question: You could create a Container which holds the vanilla player inventory and your custom slots. You could try extending the vanilla GuiInventory and change it as you want.
  10. If you want to change the vanilla inventory GUI you can do that by cancelling the GuiOpenEvent when the GUI is an instance of GuiInventory and opening your GUI after.
  11. I suspect the problem is that the sleep location depends on which part of the bed you click. You could test that by right-clicking on the bottom and the head part of the bed and see if your sleeping position changes. This is probably because both your parts of the bed are facing in the same direction, and you are offsetting the sleeping position in the same direction both times as both parts of the bed extend BaseBloodyBed. 73. pos = pos.offset((EnumFacing)state.getValue(FACING)); . . . 82. net.minecraft.world.WorldProvider.WorldSleepResult sleepResult = worldIn.provider.canSleepAt(playerIn, pos); I think you should try disabling the offset on the head part of the bed and see if that fixes your problem. You should also look at the vanilla code for a bed, it offsets the position only when the block is the bottom bed. if (state.getValue(PART) != BlockBed.EnumPartType.HEAD) { pos = pos.offset((EnumFacing)state.getValue(FACING)); state = worldIn.getBlockState(pos); if (state.getBlock() != this) { return true; } } net.minecraft.world.WorldProvider.WorldSleepResult sleepResult = worldIn.provider.canSleepAt(playerIn, pos);
  12. If you want to have the tinted background and the tooltips display override the drawScreen method: @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); //Add this super.drawScreen(mouseX, mouseY, partialTicks); this.renderHoveredToolTip(mouseX, mouseY); //Add this }
×
×
  • Create New...

Important Information

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