Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Scourrge

Members
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Scourrge

  • Rank
    Tree Puncher

Recent Profile Visitors

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

  1. Seems like it. I tried to run further from spawn and it seems working. My bad. Spawn protection was last thing that came to my mind
  2. I don't think there is a problem with code. Because in Singleplayer everything works fine. On dedicated server for OP players everything works fine. The only case when modification doesn't behave as expected is when you are not OP and you try to place modification block it immediately disappears. And when you try to use modification block (when placed) to open GUI nothing happens (onBlockActivated method is not even called). So it seems like server is somehow blocking modification for non-OPed players. Biggest portion of my implementation is taken straight from this example https:/
  3. Hi, today I tried to run my modification on dedicated server and encountered an anomaly when Block's ContainerScreen displays only when player has administration rights (OP) otherwise nothing happens. Could you please point me where could be a problem? In singleplayer opening of Screens works fine. Also on dedicated server if player has OP rights. I don't check if player has OP rights anywhere in my code. EDIT: I debugged a little bit more and found out that when I am not OP I can't even place the block it immediatelly disappears. Moreover when trying to use block while I am n
  4. Hi, is it possible to prevent closing ContainerScreen on InventoryButton? Because I have a text field in my container screen and I need to be able to write characters from range a-z in it, but as soon as inventory button is pressed, the screen closes. Is it somehow possible to prevent this behavior? Thank you.
  5. Hi, I would like to ask, what is the best way of creating global, world-scoped variables. In the official documentation is said something about WorldSavedData. But the documentation seems outdated and described instructions doesn't work anymore. Thanks for response.
  6. Hi, I would like to ask. Is it possible to create listbox within screen window? By listbox i mean scrollable area with selectable item(s). When I was exploring Minecraft's source codes I found some abstract classes like AbstractList and AbstractOptionsList etc. But since the code seems to be obfuscated it is hard to understand how exactly I should implement these classes and it is hard to understand it without comments. Don't somebody have some sample implementation of such GUI component?
  7. Hi, I would like to ask what is the best way to replace taken stack from container for a new one. I've tried to do it in 2 ways. 1. Implement it within removeStackFromSlot like this: @Override public ItemStack removeStackFromSlot(int index) { int maxPossibleItemStackSize = contents.getSlotLimit(index); ItemStack newStack = new ItemStack(CommonEvents.keysItem); CompoundNBT nbt = newStack.getOrCreateTag(); if(!KeysItem.hasKeysGenerated(nbt)){ KeysItem.generateKeys(nbt); } ItemStack takenStack
  8. Hi, I would like to ask, is it possible to store custom data into item stack's nbt when the stack is created? Because currently I'm filling my custom data in addInformation method which if I understand correctly is called when tooltips should be displayed. This method works, but I don't find it that clean, so I would like to add these data the moment when the item stack is created. Is this possible somehow? Thank you.
  9. Hi I got textbox and button working. So I will post the code for future for people who would want to achieve something similar as I do. public class InventoryBlockScreen extends ContainerScreen<InventoryBlockContainer> { private static final ResourceLocation BACKGROUND_TEXTURE = new ResourceLocation("bitcoinmod", "textures/gui/inventory_block_gui.png"); private String test = "test"; TextFieldWidget textField; public InventoryBlockScreen(InventoryBlockContainer blockContainer, PlayerInventory playerInventory, ITextComponent title) { super(blockContaine
  10. Okay, so after some digging I've managed to get textfield working, but the textfield is rendering in the bad position (outside of the GUI window). I know, that this is because rendering of the textfield uses global coordinates (from topleft of the MC window) and rendering of the GUI window foreground uses relative coordinates. But I don't know how to fix it at the moment. I would like to achieve this . This is what I managed to get so far: public class InventoryBlockScreen extends ContainerScreen<InventoryBlockContainer> { private static final ResourceLocation BACKGROUND_
  11. public class InventoryBlockScreen extends ContainerScreen<InventoryBlockContainer> { private static final ResourceLocation BACKGROUND_TEXTURE = new ResourceLocation("bitcoinmod", "textures/gui/inventory_block_gui.png"); private String test = "test"; public InventoryBlockScreen(InventoryBlockContainer blockContainer, PlayerInventory playerInventory, ITextComponent title) { super(blockContainer, playerInventory, title); // Set the width and height of the gui. Should match the size of the texture! xSize = 176; ySize = 133; } public voi
  12. Hi. I would like to ask if it is possible (and how if it is) to display textbox and button inside of ContainerScreen GUI window. Because I created demo based on this example on github. But I would like to extend it and try to add textbox and button. I tried to add textfieldwidget in ContainerScreen class constructor, but it didn't work. Thanks for responses in advance
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.