Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • AntiRix

AntiRix

Members
 View Profile  See their activity
  • Content Count

    69
  • Joined

    October 25, 2018
  • Last visited

    January 24

Community Reputation

1 Neutral

About AntiRix

  • Rank
    Stone Miner

Recent Profile Visitors

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

  1. AntiRix started following [1.9] Preventing block breaking on a server, Gui Screen Buttons, [1.12] Preventing block breaking on a server and and 1 other May 21, 2020
  2. AntiRix

    Gui Screen Buttons

    AntiRix posted a topic in Modder Support

    I'm upgrading my mod from 1.9 to 1.15.2 which involves quite a lot of differences, and I'm having trouble getting my custom GUI to render. I've got keybinds working so it displays the gui, which I can tell because it displays the cursor ready for interaction, but the gui isn't being rendered so it's completely transparent. Any idea why this could be? ModGUI gui = new ModGUI(); mc.displayGuiScreen(gui); ... public ModGUI() { super(new StringTextComponent("ModGUI")); buttons.add(new Button(32, 32, 32, 100, "Click Me", (button) -> { System.out.println("Clicked"); })); }
    • May 21, 2020
    • 1 reply
  3. AntiRix

    [1.12] Preventing block breaking on a server

    AntiRix replied to AntiRix's topic in Modder Support

    I didn't lie. It's going to be the same process for both 1.12.2 and 1.9, but my mod is 1.9. Even if you don't support 1.9 code, you by default support the concept by saying you support 1.12.2, even if you won't provide 1.9-compatible code. To put it more simply, you are able to help me without the need for code whatsoever, by just telling me what I'm doing wrong. For example, "You could set both results to DENY for PlayerInteractEvent.LeftClickBlock and cancel the event on the client to prevent the left-click interaction.". This tells me what to do, without any code. This essentially means the help you provide is version-agnostic. It is not reasonable to refuse people help unless they rewrite thousands of lines of code.
    • November 18, 2019
    • 5 replies
  4. AntiRix

    [1.12] Preventing block breaking on a server

    AntiRix replied to AntiRix's topic in Modder Support

    That's not a reasonable request. Here's the jar in my build path, proving the project is 1.12.2:
    • November 18, 2019
    • 5 replies
  5. AntiRix

    [1.12] Preventing block breaking on a server

    AntiRix posted a topic in Modder Support

    Hi, I'm using the following code to prevent the player breaking carrots which aren't fully-grown, but it's not preventing the block breaking even though all of the conditions have been met. Why could this be? @SubscribeEvent public void onBlockBreak(PlayerInteractEvent.LeftClickBlock event) { if (!event.getWorld().isRemote) return; IBlockState state = event.getWorld().getBlockState(event.getPos()); for (Object o : state.getProperties().entrySet()) { Map.Entry e = (Map.Entry)o; if (e.getKey() instanceof PropertyInteger) { PropertyInteger prop = (PropertyInteger)e.getKey(); if (prop.getName().equals("age")) { int age = state.getValue(prop); if (age < 7) { event.setUseBlock(Result.DENY); event.setUseItem(Result.DENY); event.setCanceled(true); } return; } } } }
    • November 18, 2019
    • 5 replies
  6. AntiRix

    [1.12] Preventing block breaking on a server

    AntiRix replied to AntiRix's topic in Modder Support

    If I have the following at the beginning of the method, nothing happens. if (!mc.theWorld.isRemote) return; If I have the following, properties are retrieved but it still doesn't cancel the breaking, even though age < 7 is true: if (mc.theWorld.isRemote) return; This makes no sense considering what you just said
    • November 18, 2019
    • 11 replies
  7. AntiRix

    [1.12] Preventing block breaking on a server

    AntiRix replied to AntiRix's topic in Modder Support

    I've adjusted the code, but now it seems the block doesn't even have any properties. @SubscribeEvent public void onBlockBreak(PlayerInteractEvent.LeftClickBlock event) { IBlockState state = mc.theWorld.getBlockState(event.getPos()); mc.thePlayer.addChatMessage(new TextComponentString("onBlockBreak")); for (Object o : state.getProperties().entrySet()) { Map.Entry e = (Map.Entry)o; if (e.getKey() instanceof PropertyInteger) { PropertyInteger prop = (PropertyInteger)e.getKey(); mc.thePlayer.addChatMessage(new TextComponentString(prop.getName() + ": " + state.getValue(prop))); if (prop.getName().equals("age")) { int age = state.getValue(prop); if (age < 7) { event.setUseBlock(Result.DENY); event.setUseItem(Result.DENY); event.setCanceled(true); } return; } } } }
    • November 18, 2019
    • 11 replies
  8. AntiRix

    [1.12] Preventing block breaking on a server

    AntiRix replied to AntiRix's topic in Modder Support

    Ok, so how should I approach cancelling block break events with a client-side mod only, on multiplayer?
    • November 18, 2019
    • 11 replies
  9. AntiRix

    [1.12] Preventing block breaking on a server

    AntiRix replied to AntiRix's topic in Modder Support

    Does that include the internal server? It works fine on singleplayer.
    • November 18, 2019
    • 11 replies
  10. AntiRix

    [1.12] Preventing block breaking on a server

    AntiRix replied to AntiRix's topic in Modder Support

    I had 1.12.2 already set up so might as well go with that. The mod isn't for the server itself, it's a client-side mod, but one which isn't working on multiplayer for some reason.
    • November 18, 2019
    • 11 replies
  11. AntiRix

    [1.12] Preventing block breaking on a server

    AntiRix posted a topic in Modder Support

    Hi, I'm using the following code to prevent the player breaking carrots which aren't fully-grown. It works fine on singleplayer, but not at all on multiplayer, in fact on multiplayer the event isn't being fired at all. Why could this be? @SubscribeEvent public void onBlockBreak(BreakEvent event) { IBlockState state = event.getState(); net.minecraft.block.Block block = state.getBlock(); for (Object o : state.getProperties().entrySet()) { Map.Entry e = (Map.Entry)o; if (e.getKey() instanceof PropertyInteger) { PropertyInteger prop = (PropertyInteger)e.getKey(); if (prop.getName().equals("age")) { int age = state.getValue(prop); if (age < 7) event.setCanceled(true); } } } }
    • November 18, 2019
    • 11 replies
  12. AntiRix

    [1.9] Preventing block breaking on a server

    AntiRix posted a topic in Modder Support

    Hi, I'm using the following code to prevent the player breaking carrots which aren't fully-grown. It works fine on singleplayer, but not at all on multiplayer. Why could this be? @SubscribeEvent public void onBlockBreak(BreakEvent event) { IBlockState state = event.getState(); net.minecraft.block.Block block = state.getBlock(); for (Object o : state.getProperties().entrySet()) { Map.Entry e = (Map.Entry)o; if (e.getKey() instanceof PropertyInteger) { PropertyInteger prop = (PropertyInteger)e.getKey(); if (prop.getName().equals("age")) { int age = state.getValue(prop); if (age < 7) event.setCanceled(true); } } } }
    • November 18, 2019
    • 1 reply
  13. AntiRix

    Moving items between inventories

    AntiRix replied to AntiRix's topic in Modder Support

    Figured it out. My original code is correct so I didn't need to do any of what you suggested. There was just a logical error in my code where the window ID was being reset to 0, so it was trying to perform the click on the wrong inventory.
    • August 15, 2019
    • 8 replies
  14. AntiRix

    Moving items between inventories

    AntiRix replied to AntiRix's topic in Modder Support

    If you have no further insight, it would be courteous to say that so I'm not waiting for a week.
    • August 15, 2019
    • 8 replies
  15. AntiRix

    Moving items between inventories

    AntiRix replied to AntiRix's topic in Modder Support

    Getting sick of this now. func_187098_a clicks the slot client-side. It also sends a CPacketClickWindow to the server. What else do I have to do?
    • August 15, 2019
    • 8 replies
  16. AntiRix

    Moving items between inventories

    AntiRix replied to AntiRix's topic in Modder Support

    Bump
    • August 14, 2019
    • 8 replies
  • All Activity
  • Home
  • AntiRix
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community