Jump to content

Bennyboy1695

Members
  • Posts

    24
  • Joined

  • Last visited

Everything posted by Bennyboy1695

  1. Anyone have any clue or should i just give up ?
  2. Hi, im trying to make a modular server sided mod. And i need to be able to add the libs after the mod has loaded/while its loading into the classpath. But i can't find anything that would let me do that ? Basically i want to check the config and if the discord module is loaded add the jda jar thats been downloaded locally to the classpath so it can access the jda classes.
  3. I was trying to basically make a lootcrate mod using the loot tables as the base itemset. And wanted to be able to show a preview of all the items you can get
  4. I was wondering if there's a way to get all the loot that's possible to get in a loot table ? Like if i wanted to see all the items i could possible get in the end_city_treasure loot table for example
  5. Ok so im trying to track down what exactly is causing an nbt packet issue randomly on connection to a server. I thought the easiest way to do this would be to have a mod that's client side and just prints packet information. My question though is, is there anyway of getting what mod is sending the packet and what size it is ? So that i can compare to the packet causing the issue and then track it down further from that.
  6. I was just wondering while i was coding, no reasoning to it
  7. I know the server can read the mods a client has but was wondering can it be done the other way round ?
  8. Because i just wanted a simple and quick way to store a players true or false on this bit of code. It may be ugly but for my needs it fits. I have tried multiple ways of the boolean, still get the issue, this was just the latest way i tried. The playerpresent just gets whether the player is online. Here's the full part of that, its using some Sponge methods as its part Sponge and part Forge public void onBlockPlace(ChangeBlockEvent.Place event) { if (AdminUtilsSponge.getInstance().getWorldWarningBoolean()) { String world = event.getTargetWorld().getName(); String worldslist = String.join(", ", AdminUtilsSponge.getInstance().getWorldList()); Optional<Player> player = event.getCause().first(Player.class); Boolean playerpresent = player.isPresent(); String name = player.get().getName(); UUID uuid = player.get().getUniqueId(); EntityPlayer forgeplayer = FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayerByUUID(uuid); String block = event.getTransactions().get(0).getFinal().getState().getType().getName(); NBTTagCompound data = forgeplayer.getEntityData(); data.setTag("AdminUtils", new NBTTagCompound()); NBTTagCompound adminnbt = data.getCompoundTag("AdminUtils"); adminnbt.setTag("WorldWarnings", new NBTTagCompound()); NBTTagCompound worldwarnings = adminnbt.getCompoundTag("WorldWarnings"); Boolean warning = worldwarnings.getBoolean(world); if (playerpresent) { if (!(worldslist.contains(world))) { if (warning) { System.out.print(String.valueOf(worldwarnings.getBoolean(world))); } } } } }
  9. Ok so i have a boolean getting true or false from nbt of a player. When i run print on the boolen it clearly shows true or false but when using it in an if statement it doesnt seem to work. This is the part where im using the boolean - NBTTagCompound data = forgeplayer.getEntityData(); data.setTag("AdminUtils", new NBTTagCompound()); NBTTagCompound adminnbt = data.getCompoundTag("AdminUtils"); adminnbt.setTag("WorldWarnings", new NBTTagCompound()); NBTTagCompound worldwarnings = adminnbt.getCompoundTag("WorldWarnings"); Boolean warning = worldwarnings.getBoolean(world); if (playerpresent) { if (!(worldslist.contains(world))) { if (warning) { System.out.print(String.valueOf(warning); } } }
  10. I was already getting the usernames correctly just paraphrased it as a list in this, which was probably a mistake. But either way, once i've gotten the username/s how can i send them a message from the server/mod without them being the CommandSender
  11. That sends it to the CommandSender though, i don't want the commandsender to be sent the message. The message i want to be sent to a List of usernames/uuids.
  12. I haven't really tried anything as all i can find are ways to message the commandsender. Or am i just missing a optional parameter ?
  13. Im currently trying to make it so that if you run a command and a player thats in a list of strings is online it will message that player telling them what command you just ran, but i seem to be unable to find anyway of messaging that list of strings. any help would be greatful
  14. That worked thanks, don't usually deal with metadata so wasnt sure on the statements to use.
  15. So i'm having an issue, no matter how i try to do this i can't get it to work. I'm probably just completely being blind but thought i would just come here and ask instead. How do i give an ItemStack that contains properties for example new ItemStack(ModBlocks.compressedBlock.getDefaultState().withProperty(BlockCompressed.VARIANT, Type.GRAVEL), 1)
  16. I added the server side stuff just to see if it would throw any errors because something its doing was client side but it didnt. But yeah the only error it gives is when i join with a vanilla forge client it says i'm missing the mod. The code is almost a complete copy from 1.7 which worked fine so its kinda confusing
  17. Sure @Mod(modid = RefStrings.MOD_ID, name = RefStrings.MOD_NAME, version = RefStrings.VERSION) public class PJGSave { public static final String sessionID = Long.toString(System.currentTimeMillis()); public static HashSet loggedInPlayers = new HashSet(); public static HashSet loggedOffPlayers = new HashSet(); public static org.apache.logging.log4j.Logger logger; @SideOnly(Side.SERVER) @EventHandler public void preinit(FMLPreInitializationEvent event) { FMLLog.info("PJG-Save has been enabled, playerdata will be saved at the same time as the world from now on!", new Object[0]); MinecraftForge.EVENT_BUS.register(new WorldHandler()); FMLCommonHandler.instance().bus().register(new PlayerHandler()); logger = event.getModLog(); } }
  18. Ok so i have been trying to update my code for this tiny server side mod for a while but i can't figure out why im needing the mod client side when its all server side code. I probably just need a fresh set of eyes to see my issue heres a copy of the 2 main code handlers import net.minecraft.util.text.TextFormatting; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Iterator; public class WorldHandler { public static TextFormatting Color; public String prefix; public String pjgsave; public WorldHandler() { StringBuilder var10001 = new StringBuilder(); //TextFormatting var10002 = Color; var10001 = var10001.append(TextFormatting.WHITE).append("["); //var10002 = Color; var10001 = var10001.append(TextFormatting.DARK_BLUE).append("PJG"); //var10002 = Color; var10001 = var10001.append(TextFormatting.WHITE).append("-"); //var10002 = Color; var10001 = var10001.append(TextFormatting.GOLD).append("Save"); //var10002 = Color; this.prefix = var10001.append(TextFormatting.WHITE).append("]").toString(); var10001 = (new StringBuilder()).append(this.prefix); //var10002 = Color; this.pjgsave = var10001.append(TextFormatting.RED).append(" Saving PlayerData, Expect Minor Lag . . .").toString(); } } import net.minecraft.nbt.CompressedStreamTools; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.io.File; import java.io.FileInputStream; import java.io.IOException; public class PlayerHandler { @SideOnly(Side.SERVER) @SubscribeEvent public void playerJoined(PlayerEvent.PlayerLoggedInEvent event) { PJGSave.loggedInPlayers.add(event.player.getPersistentID().toString()); PJGSave.loggedOffPlayers.remove(event.player.getPersistentID().toString()); } }
  19. Thanks. It sorta works, the area its in needs to be static and its moaning about being static when i put it there
  20. I recently decided to update my mods to 1.10.2 and in a lot of my classes i use this line MinecraftServer.getServer().getConfigurationManager().sendChatMsg("") But that doesn't work in 1.10.2, I've been trying to find out what it is but had no luck so far. So thought better ask on here as someone will know
  21. It happens when the player clicks a gui button on a mod on their end of the mod.
  22. Its to Set a slot in there inventory to an item/delete an item
  23. Hi, i've been trying to find the server side equivalent of this line of code, but cant seem to get anything to work. A dual compatible line would be preferable but server only would work too Code - Minecraft.getMinecraft().thePlayer
×
×
  • Create New...

Important Information

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