-
[1.12.2] Custom player inventory
If that doesn't work then extend InventoryEffectRenderer.
-
[1.12.2] Custom player inventory
No, extend GuiInventory.
-
(Custom Bed) Player Lies on Wrong Place
Also, extend BlockHorizontal instead of BaseHarshenFacedBlock because trySleep() checks if the block is an instance of BlockHorizontal.
-
(Custom Bed) Player Lies on Wrong Place
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.
-
(Custom Bed) Player Lies on Wrong Place
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.
-
(Custom Bed) Player Lies on Wrong Place
Is there a difference if you right-click on the leg and head part of the bed? Could you record it?
-
(Custom Bed) Player Lies on Wrong Place
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);
-
(Custom Bed) Player Lies on Wrong Place
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.
-
(Custom Bed) Player Lies on Wrong Place
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?
-
[1.12.2] Custom player inventory
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.
-
[1.12.2] Custom player inventory
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.
-
(Custom Bed) Player Lies on Wrong Place
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);
-
[1.12.2] Weird ContainerGui
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 }
IPS spam blocked by CleanTalk.