Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Gaprosys

Members
  • Joined

  • Last visited

Everything posted by Gaprosys

  1. Sorry, I have thinked, the embed tag where the right been for code. That is then a mistake from me.
  2. Hi, thanks for the reply. My current code looks like so: IndustriousMageWorldSaveData: [embed=425,349] package de.gaprosys.industriousmage.handler_network; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.io.IOException; import java.util.Map; import java.util.Set; import de.gaprosys.industriousmage.IndustriousMage; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; import net.minecraft.world.WorldSavedData; import net.minecraft.world.storage.MapStorage; public class IndustriousMageWorldSaveData extends WorldSavedData { final static String key = "IndustriousMageSaveData"; public IndustriousMageWorldSaveData(String key) { super(key); } public IndustriousMageWorldSaveData() { super(key); } public static IndustriousMageWorldSaveData get(World world) { MapStorage storage = world.mapStorage; IndustriousMageWorldSaveData result; try { result = (IndustriousMageWorldSaveData)storage.loadData(IndustriousMageWorldSaveData.class, key); } catch(NullPointerException ex) { result = new IndustriousMageWorldSaveData(); storage.setData(key, result); } return result; } public static void saveData(World world) { try { world.mapStorage.loadData(IndustriousMageWorldSaveData.class, key).setDirty(true); } catch(Exception ex) {} } @Override public void readFromNBT(NBTTagCompound nbt) { long maxIMP; long currentIMP; int id; String s; NBTTagList tagList = nbt.getTagList("Player", 10); for(int i = 0; i < tagList.tagCount(); i++) { NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i); s = tag.getString("playerName"); id = tag.getInteger("playerID"); currentIMP = tag.getLong("playerCurrentIMP"); maxIMP = tag.getLong("playerMaxIMP"); IndustriousMage.impTransfer.addPlayerToNetworks(s); IndustriousMage.impTransfer.setPlayerIMPNetworkId(s, id); IndustriousMage.impTransfer.addMaxIMPtoPlayer(s, maxIMP); IndustriousMage.impTransfer.addCurrentIMPtoPlayer(s, currentIMP); System.out.println(); System.out.println(s); System.out.println(id); System.out.println(currentIMP); System.out.println(maxIMP); } } @Override public void writeToNBT(NBTTagCompound nbt) { NBTTagList tagList = new NBTTagList(); ArrayList<String> network = new ArrayList<String>(); network = IndustriousMage.impTransfer.getPlayerIds(); String s; for(int i = 0; i <= network.size(); i++) { s = (String)network.get(i); NBTTagCompound tag = new NBTTagCompound(); tag.setString("playerName", s); tag.setInteger("playerID", i); tag.setLong("playerCurrentIMP", IndustriousMage.impTransfer.getPlayerCurrentIMPNetwork(s)); tag.setLong("playerMaxIMP", IndustriousMage.impTransfer.getPlayerMaxIMPNetwork(s)); System.out.println(); System.out.println(s); System.out.println(i); System.out.println(IndustriousMage.impTransfer.getPlayerCurrentIMPNetwork(s)); System.out.println(IndustriousMage.impTransfer.getPlayerMaxIMPNetwork(s)); tagList.appendTag(tag); } nbt.setTag("Player", tagList); } } [/embed] the System.out.println is for me, To look, what they read. I use just a try to initialize the WorldSavedData Class from me, because, they throw often an NullPointerException by loading a world. The used Events to load and save the datas: [embed=425,349] @SubscribeEvent public void LoadPlayerList(WorldEvent.Load event) { if(!event.world.isRemote) { IndustriousMageWorldSaveData worldsave; worldsave = IndustriousMageWorldSaveData.get(event.world); } } @SubscribeEvent public void UnloadPlayerList(WorldEvent.Unload event) { if(!event.world.isRemote) { IndustriousMageWorldSaveData.saveData(event.world); } } @SubscribeEvent public void SavePlayerList(WorldEvent.Save event) { if(!event.world.isRemote) { IndustriousMageWorldSaveData.saveData(event.world); } } [/embed] with the LoadPlayer- function I try to load the player list. what they actually not do. With the UnloadPlayerList and SavePlayerList I saved the lists. - Gaprosys
  3. Hi, How can I save costum informations per world? I founded WorldSavedData, but it looks like, they load not the datas. I loaded the datas per WorldEvent.Load, .Unload and .Save. I hope anybody can help. - Gaprosys
  4. Hi, how can I override the world type event. I brought this because if I start the a provider from me, by they I change the world provider from nether and overworld, the default is after the use from my world type the same as my world type.They shouldn't so work. I hope everyone has an idea. Sorry for my bad english, - Gaprosys
  5. Hi, I brought help with my Mod. how can I add a world generator how start in the nether. I want, that someone can access the world generator to, as example, "Netherworld" and they start then in Nether and can then go to the End. I hope, everyone understand that and can help. - Gaprosys
  6. Thanks for this reply and answer. There is then no more questions. I closed it then here.
  7. Hi, I make a mod and try to make a crusher, who give me 1/4 of a dust(1 Dust = 1 Ingot)of Iron or Gold if I put 32 Cobblestone in it. A friend of me mean, that thas is overpowerd. Is this right or not? Is there a site in the web, who list the standard for this? Sorry for my bad english, I live in Germany. Have a nice saturday. - Gaprosys

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.