spike_us

Untitled

Feb 15th, 2025
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. Auto-Generated Code:
  2. package net.mcreator.spikespurgatory.procedures;
  3. import net.minecraft.world.entity.Entity;
  4. import net.minecraft.commands.arguments.EntityArgument;
  5. import net.minecraft.commands.CommandSourceStack;
  6. import net.mcreator.spikespurgatory.network.SpikesPurgatoryModVariables;
  7. import com.mojang.brigadier.exceptions.CommandSyntaxException;
  8. import com.mojang.brigadier.arguments.BoolArgumentType;
  9. public class ResetInPurgatoryProcedure {
  10. public static void execute(CommandContext<CommandSourceStack> arguments) {
  11. {
  12. boolean _setval = BoolArgumentType.getBool(arguments, "new_ipg_val");
  13. (new Object() {
  14. public Entity getEntity() {
  15. try {
  16. return EntityArgument.getEntity(arguments, "player_target");
  17. } catch (CommandSyntaxException e) {
  18. e.printStackTrace();
  19. return null;
  20. }
  21. }
  22. }.getEntity()).getCapability(SpikesPurgatoryModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
  23. capability.ipg = _setval;
  24. capability.syncPlayerVariables((new Object() {
  25. public Entity getEntity() {
  26. try {
  27. return EntityArgument.getEntity(arguments, "player_target");
  28. } catch (CommandSyntaxException e) {
  29. e.printStackTrace();
  30. return null;
  31. }
  32. }
  33. }.getEntity()));
  34. });
  35. }
  36. }
  37. }
  38. Correct code:
  39. package net.mcreator.spikespurgatory.procedures;
  40. import net.minecraft.world.entity.Entity;
  41. import net.minecraft.commands.arguments.EntityArgument;
  42. import net.minecraft.commands.CommandSourceStack;
  43. import net.mcreator.spikespurgatory.network.SpikesPurgatoryModVariables;
  44. import com.mojang.brigadier.exceptions.CommandSyntaxException;
  45. import com.mojang.brigadier.arguments.BoolArgumentType;
  46. import com.mojang.brigadier.context.CommandContext; //THIS LINE IS MISSING, I had to add it manually.
  47. public class ResetInPurgatoryProcedure {
  48. public static void execute(CommandContext<CommandSourceStack> arguments) {
  49. {
  50. boolean _setval = BoolArgumentType.getBool(arguments, "new_ipg_val");
  51. (new Object() {
  52. public Entity getEntity() {
  53. try {
  54. return EntityArgument.getEntity(arguments, "player_target");
  55. } catch (CommandSyntaxException e) {
  56. e.printStackTrace();
  57. return null;
  58. }
  59. }
  60. }.getEntity()).getCapability(SpikesPurgatoryModVariables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> {
  61. capability.ipg = _setval;
  62. capability.syncPlayerVariables((new Object() {
  63. public Entity getEntity() {
  64. try {
  65. return EntityArgument.getEntity(arguments, "player_target");
  66. } catch (CommandSyntaxException e) {
  67. e.printStackTrace();
  68. return null;
  69. }
  70. }
  71. }.getEntity()));
  72. });
  73. }
  74. }
  75. }
  76.  
Advertisement
Add Comment
Please, Sign In to add comment