
Bennyboy1695
Members-
Posts
24 -
Joined
-
Last visited
Everything posted by Bennyboy1695
-
[1.16.5] Adding External Jar into classpath
Bennyboy1695 replied to Bennyboy1695's topic in Modder Support
Anyone have any clue or should i just give up ? -
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.
-
Getting all loot possible in a loot table
Bennyboy1695 replied to Bennyboy1695's topic in Modder Support
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 -
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
-
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.
-
I was just wondering while i was coding, no reasoning to it
-
I know the server can read the mods a client has but was wondering can it be done the other way round ?
-
[1.10.2] [Solved} Boolean Won't work, 100% confused as to why
Bennyboy1695 replied to Bennyboy1695's topic in Modder Support
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))); } } } } } -
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); } } }
-
[1.10.2] [Solved] Give ItemStack containing properties
Bennyboy1695 replied to Bennyboy1695's topic in Modder Support
That worked thanks, don't usually deal with metadata so wasnt sure on the statements to use. -
[1.10.2] [Solved] Give ItemStack containing properties
Bennyboy1695 posted a topic in Modder Support
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) -
[1.10.2] Can't see whats the issue/ serverside coding issues
Bennyboy1695 replied to Bennyboy1695's topic in Modder Support
Thanks, that fixed it -
[1.10.2] Can't see whats the issue/ serverside coding issues
Bennyboy1695 replied to Bennyboy1695's topic in Modder Support
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 -
[1.10.2] Can't see whats the issue/ serverside coding issues
Bennyboy1695 replied to Bennyboy1695's topic in Modder Support
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(); } } -
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()); } }
-
Thanks. It sorta works, the area its in needs to be static and its moaning about being static when i put it there
-
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
-
[1.9] Server equivalent or dual compatible
Bennyboy1695 replied to Bennyboy1695's topic in Modder Support
It happens when the player clicks a gui button on a mod on their end of the mod. -
[1.9] Server equivalent or dual compatible
Bennyboy1695 replied to Bennyboy1695's topic in Modder Support
Its to Set a slot in there inventory to an item/delete an item -
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