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.

Edivad99

Members
  • Joined

Everything posted by Edivad99

  1. I am using the latest version of forge for 1.14.4(28.2.0) on both the server and the client. The first time I enter the world I don't get this error, as soon as I go out and try to reconnect, this happens. How can I solve it? My github for the code is this: https://github.com/Edivad99/DimStorage
  2. But is it right how I set up the class?
  3. Good evening everyone, I have this class that reads a string through buf.readString(). I did a test to see if my mod had server-side problems and I had this error. The class in question is at this link: https://github.com/Edivad99/DimStorage/blob/1.14.x/src/main/java/edivad/dimstorage/network/packet/UpdateBlock.java I went to see the PacketBuffer::readString () method what it did and I saw that it is callable only on the client side. How do I solve the problem?
  4. But if I put my block near the edge of the chunk, then I will not get the blocks that are in another chunk?
  5. Is there a quick way to recover all TE within an area? I created this code, but I would like to know if there is something more efficient private void checkNeighbors(int area) { int range = area / 2; int X = getPos().getX(); int Z = getPos().getZ(); for(int x = X - range; x <= X + range; x++) { for(int z = Z - range; z <= Z + range; z++) { BlockPos pos = new BlockPos.MutableBlockPos(x, getPos().getY(), z); BlockState block = world.getBlockState(pos); if(block.hasTileEntity()) { TileEntity te = world.getTileEntity(pos); } } } }
  6. I solved it using the JEI API https://github.com/Edivad99/DimStorage/commit/3aa02ff68f56be891b7c62ec14c72a162c0a060e
  7. It doesn't work, if I change xSize I move the gui all the way to the right and it gets messed up. I was looking for a solution to move the elements like termal or mekanism does.
  8. Here is my Github: https://github.com/Edivad99/DimStorage
  9. I can't find a way to move the objects shown by the JEI. I wish that when I open the configuration panel the objects of the JEI would move further to the right Can somebody help me?
  10. In short, I'm looking for people who like to create mods on minecraft. I am currently developing DimStorage, but with the university I am not having much time. If you want to participate in the project, write me below. Have a good time
  11. Can anyone help me convert this class to a class that uses World Saved Data cabability for 1.14.4? https://mcforge.readthedocs.io/en/1.14.x/datastorage/worldsaveddata/ package edivad.dimstorage.manager; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import com.google.common.collect.ImmutableMap; import edivad.dimstorage.api.AbstractDimStorage; import edivad.dimstorage.api.DimStoragePlugin; import edivad.dimstorage.api.Frequency; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.server.MinecraftServer; import net.minecraft.world.dimension.DimensionType; import net.minecraftforge.event.entity.player.PlayerEvent; import net.minecraftforge.event.world.WorldEvent.Load; import net.minecraftforge.event.world.WorldEvent.Save; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.LogicalSide; import net.minecraftforge.fml.LogicalSidedProvider; public class DimStorageManager { public static class DimStorageSaveHandler { @SubscribeEvent public void onWorldLoad(Load event) { if(event.getWorld().getWorld().isRemote) reloadManager(true); } @SubscribeEvent public void onWorldSave(Save event) { if(!event.getWorld().getWorld().isRemote && instance(false) != null) instance(false).save(false); } @SubscribeEvent public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) { instance(false).sendClientInfo(event.getPlayer()); } @SubscribeEvent public void onPlayerChangedDimension(PlayerEvent.PlayerChangedDimensionEvent event) { instance(false).sendClientInfo(event.getPlayer()); } } private static DimStorageManager serverManager; private static DimStorageManager clientManager; private static HashMap<String, DimStoragePlugin> plugins = new HashMap<>(); private Map<String, AbstractDimStorage> storageMap; private Map<String, List<AbstractDimStorage>> storageList; public final boolean client; private File saveDir; private File[] saveFiles; private int saveTo; private List<AbstractDimStorage> dirtyStorage; private CompoundNBT saveTag; public DimStorageManager(boolean client) { this.client = client; storageMap = Collections.synchronizedMap(new HashMap<String, AbstractDimStorage>()); storageList = Collections.synchronizedMap(new HashMap<String, List<AbstractDimStorage>>()); dirtyStorage = Collections.synchronizedList(new LinkedList<AbstractDimStorage>()); for(String key : plugins.keySet()) this.storageList.put(key, new ArrayList<AbstractDimStorage>()); if(!client) load(); } private void sendClientInfo(PlayerEntity player) { for(Map.Entry<String, DimStoragePlugin> plugin : plugins.entrySet()) { plugin.getValue().sendClientInfo(player, storageList.get(plugin.getKey())); } } private void load() { MinecraftServer server = LogicalSidedProvider.INSTANCE.get(LogicalSide.SERVER); this.saveDir = new File(server.getWorld(DimensionType.OVERWORLD).getSaveHandler().getWorldDirectory(), "DimStorage"); try { if(!this.saveDir.exists()) this.saveDir.mkdirs(); this.saveFiles = new File [] { new File(saveDir, "data1.dat"), new File(saveDir, "data2.dat"), new File(saveDir, "lock.dat") }; if(this.saveFiles[2].exists() && this.saveFiles[2].length() > 0) { FileInputStream fin = new FileInputStream(this.saveFiles[2]); this.saveTo = fin.read() ^ 1; fin.close(); if(this.saveFiles[this.saveTo ^ 1].exists()) { DataInputStream din = new DataInputStream(new FileInputStream(this.saveFiles[this.saveTo ^ 1])); this.saveTag = CompressedStreamTools.readCompressed(din); din.close(); } else saveTag = new CompoundNBT(); } else saveTag = new CompoundNBT(); } catch(Exception e) { throw new RuntimeException(String.format("DimStorage was unable to read it's data, please delete the 'DimStorage' folder Here: %s and start the server again.", saveDir), e); } } private void save(boolean force) { if(!this.dirtyStorage.isEmpty() || force) { for(AbstractDimStorage inv : this.dirtyStorage) { saveTag.put(inv.freq + ",type=" + inv.type(), inv.saveToTag()); inv.setClean(); } dirtyStorage.clear(); try { File saveFile = saveFiles[saveTo]; if(!saveFile.exists()) saveFile.createNewFile(); DataOutputStream dout = new DataOutputStream(new FileOutputStream(saveFile)); CompressedStreamTools.writeCompressed(saveTag, dout); dout.close(); FileOutputStream fout = new FileOutputStream(saveFiles[2]); fout.write(saveTo); fout.close(); saveTo ^= 1; } catch(Exception e) { throw new RuntimeException(e); } } } public static void reloadManager(boolean client) { DimStorageManager newManager = new DimStorageManager(client); if(client) clientManager = newManager; else serverManager = newManager; } public File getSaveDir() { return saveDir; } public static DimStorageManager instance(boolean client) { DimStorageManager manager = client ? clientManager : serverManager; if(manager == null) { reloadManager(client); manager = client ? clientManager : serverManager; } return manager; } public AbstractDimStorage getStorage(Frequency freq, String type) { String key = freq + ",type=" + type; AbstractDimStorage storage = storageMap.get(key); if(storage == null) { storage = plugins.get(type).createDimStorage(this, freq); if(!client && saveTag.contains(key)) storage.loadFromTag(saveTag.getCompound(key)); storageMap.put(key, storage); storageList.get(type).add(storage); } return storage; } public static void registerPlugin(DimStoragePlugin plugin) { plugins.put(plugin.identifer(), plugin); if(serverManager != null) serverManager.storageList.put(plugin.identifer(), new ArrayList<AbstractDimStorage>()); if(clientManager != null) clientManager.storageList.put(plugin.identifer(), new ArrayList<AbstractDimStorage>()); } public static DimStoragePlugin getPlugin(String identifier) { return plugins.get(identifier); } public static Map<String, DimStoragePlugin> getPlugins() { return ImmutableMap.copyOf(plugins); } public void requestSave(AbstractDimStorage storage) { dirtyStorage.add(storage); } }
  12. @Override public boolean isSolid(BlockState state) { return false; } @Override public boolean isVariableOpacity() { return false; } I entered this code and now everything works
  13. I was updating my mod from 12.2.2 to 1.14.4 and while I was adjusting the stuff related to the rendering of the block, I did some tests and the block is rendered with dark textures. Anyone know how to solve?
  14. Hi everyone, I'm porting my mod from 1.12.2 to 1.14.4. In 1.12.2 to access the directory of the world this command was sufficient DimensionManager.getCurrentSaveRootDirectory (), now in 1.14.4 is there an equivalent command?
  15. Ok, I open my DimChest, select a frequency and then insert an object into the DimChest inventory. The object disappears, and if I return to the frequency of before the object reappears. I synchronized the TE with the server but obviously something is wrong. I leave the github code of the project, hoping you can help me https://github.com/Edivad99/DimStorage
  16. I just wanted to ask when we have news for Forge for Minecraft 1.15. I know that Minecraft wrote this in its release notes:
  17. Yes, but I can't find anything ...
  18. I'm doing a gui, where there is a button that opens a pop-up menu, the problem is that once opened it is hidden by the jei. Does anyone know how to solve it? I wanted to do something similar to the gui of thermal machinery.
  19. Does anyone know why I can't do it, right click and sneak on the block? In 1.13.2 it works... package edivad.solargeneration.items; import edivad.solargeneration.Main; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorldReader; public class Wrench extends Item { public Wrench() { super(new Properties().group(Main.solarGenerationTab).maxStackSize(1)); setRegistryName(new ResourceLocation(Main.MODID, "wrench")); } @Override public boolean doesSneakBypassUse(ItemStack stack, IWorldReader world, BlockPos pos, PlayerEntity player) { return true; } } @Override public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if(!worldIn.isRemote) { //TODO: Fix this bug if(player.isSneaking()) { if(ItemStack.areItemsEqual(player.getHeldItemMainhand(), new ItemStack(ModItems.wrench, 1))) { dismantleBlock(worldIn, pos); return true; } } TileEntity tileEntity = worldIn.getTileEntity(pos); if(tileEntity instanceof INamedContainerProvider) { NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tileEntity, tileEntity.getPos()); return true; } else { throw new IllegalStateException("Our named container provider is missing!"); } } return false; }
  20. Thanks for answering me, I can't understand what you mean by point 1. I don't know how to fix point 4, could you help me out?
  21. Hi, when I start my mod on the server, and try to place a block in the world, I get this error. [21:55:23] [Server thread/FATAL] [minecraft/MinecraftServer]: Error executing task java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: net/minecraft/client/gui/inventory/GuiContainer at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_212] at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_212] at net.minecraft.util.Util.runTask(Util.java:54) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:798) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:415) [DedicatedServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:743) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:592) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_212] Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/gui/inventory/GuiContainer at com.edivad.solargeneration.blocks.SolarPanel.createNewTileEntity(SolarPanel.java:210) ~[SolarPanel.class:?] at net.minecraft.block.Block.createTileEntity(Block.java:1517) ~[Block.class:?] at net.minecraft.world.chunk.Chunk.createNewTileEntity(Chunk.java:839) ~[Chunk.class:?] at net.minecraft.world.chunk.Chunk.getTileEntity(Chunk.java:857) ~[Chunk.class:?] at net.minecraft.world.World.getTileEntity(World.java:2613) ~[World.class:?] at mcp.mobius.waila.network.MessageRequestTile$Handler.lambda$onMessage$0(MessageRequestTile.java:69) ~[MessageRequestTile$Handler.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_212] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_212] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 5 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.gui.inventory.GuiContainer at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212] at com.edivad.solargeneration.blocks.SolarPanel.createNewTileEntity(SolarPanel.java:210) ~[SolarPanel.class:?] at net.minecraft.block.Block.createTileEntity(Block.java:1517) ~[Block.class:?] at net.minecraft.world.chunk.Chunk.createNewTileEntity(Chunk.java:839) ~[Chunk.class:?] at net.minecraft.world.chunk.Chunk.getTileEntity(Chunk.java:857) ~[Chunk.class:?] at net.minecraft.world.World.getTileEntity(World.java:2613) ~[World.class:?] at mcp.mobius.waila.network.MessageRequestTile$Handler.lambda$onMessage$0(MessageRequestTile.java:69) ~[MessageRequestTile$Handler.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_212] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_212] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 5 more Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@5c82cd4f from coremod FMLCorePlugin at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:260) ~[forgeSrc-1.12.2-14.23.5.2838.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212] at com.edivad.solargeneration.blocks.SolarPanel.createNewTileEntity(SolarPanel.java:210) ~[SolarPanel.class:?] at net.minecraft.block.Block.createTileEntity(Block.java:1517) ~[Block.class:?] at net.minecraft.world.chunk.Chunk.createNewTileEntity(Chunk.java:839) ~[Chunk.class:?] at net.minecraft.world.chunk.Chunk.getTileEntity(Chunk.java:857) ~[Chunk.class:?] at net.minecraft.world.World.getTileEntity(World.java:2613) ~[World.class:?] at mcp.mobius.waila.network.MessageRequestTile$Handler.lambda$onMessage$0(MessageRequestTile.java:69) ~[MessageRequestTile$Handler.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_212] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_212] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 5 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/gui/inventory/GuiContainer for invalid side SERVER at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62) ~[forgeSrc-1.12.2-14.23.5.2838.jar:?] at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:256) ~[forgeSrc-1.12.2-14.23.5.2838.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212] at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_212] at com.edivad.solargeneration.blocks.SolarPanel.createNewTileEntity(SolarPanel.java:210) ~[SolarPanel.class:?] at net.minecraft.block.Block.createTileEntity(Block.java:1517) ~[Block.class:?] at net.minecraft.world.chunk.Chunk.createNewTileEntity(Chunk.java:839) ~[Chunk.class:?] at net.minecraft.world.chunk.Chunk.getTileEntity(Chunk.java:857) ~[Chunk.class:?] at net.minecraft.world.World.getTileEntity(World.java:2613) ~[World.class:?] at mcp.mobius.waila.network.MessageRequestTile$Handler.lambda$onMessage$0(MessageRequestTile.java:69) ~[MessageRequestTile$Handler.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_212] at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_212] at net.minecraft.util.Util.runTask(Util.java:53) ~[Util.class:?] ... 5 more This is the project repository: https://github.com/Edivad99/SolarGeneration Does anyone know how to solve this problem, because I'm really freaking out

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.