• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Okay, I did some poking around with AtlasTexture, and I think I figured out how to do what I need to. I'm going to record it here for future generations, and as a second post because it just doesn't make sense to me to combine this with the above, since they're mostly unrelated (and the separation will help identify this as me explaining what I think I need to do).   AtlasTexture texture = new AtlasTexture(new ResourceLocation(MODID, "atlas")); Stream<ResourceLocation> stream = list.stream(); //We get a stream of all of the textures we want, probably using Collection#stream() SheetData data = texture.func_229220_a_((IResourceManager) Minecraft.getInstance().getTextureManager(), stream, Minecraft.getInstance().getProfiler(), 0); //Last argument is mipmap level, we use 0 map.upload(data); So, first I must actually create a new AtlasTexture, passing in a ResourceLocation which will act as a registry name. Then, to actually generate the stitched texture, I must call AtlasTexture#func229220_a_. It seems I should pass in Minecraft.getInstance().getTextureManager() (which I can do because I'm specifically doing this on Dist.CLIENT) for the first argument, a Stream containing the ResourceLocation's of all of the textures I want to stitch (so this will be done after all of the nodes are registered, no surprise there), an IProfiler (whatever that is, it seems to be used to track the progress of the texture stitching), and an integer mipmapping level (I would assume I'd use either 0 or 1, since I won't need mipmapping for a GUI I don't think). I would capture the output of this and pass it to AtlasTexture#upload, which would actually create the texture information I would then use for drawing. At this point, the AtlasTexture is ready for use.   if (!RenderSystem.isOnRenderThread()) { RenderSystem.recordRenderCall(() -> { manager.func_229263_a(texture.func_229223_g_(), texture); texture.func_229148_d_(); }); } else { textureManager.func_229263_a(texture.func_229223_g_(), texture); texture.func_229148_d(); } When we first start drawing, we have to bind the texture. First, we must ensure we are actually on the rendering thread, and ask the rendering thread to do it if we aren't. Then we call TextureManager#func_229263_a, which takes two arguments, a ResourceLocation we want to use as a key for our AtlasTexture and the AtlasTexture itself.  We can cheat the first argument here by calling AtlasTexture#func_229223_g_, which is essentially getRegistryName. This will set up our texture so it's ready to be bound to OpenGL (the above is ripped directly from TextureManager#bindTexture). We then call Texture#func229148_d, which actually binds the texture.   ((I would provide a code example, except that Screen doesn't seem to provide any way to draw textures using UV coordinates which is all TextureAtlasSprite provides, and directly drawing via OpenGL requires calling Tessellator to get a BufferBuilder, and none of the methods in BufferBuilder (or, for that matter, Screen) have been deobfuscated yet.))   Now, in order to draw a texture from the Atlas onto the GUI, we call AtlasTexture#getSprite and pass in the key for the particular texture we want. That returns a TextureAtlasSprite, which contains the coordinates of our texture on the Atlas in absolute pixels as well as the relative min/max UV coordinates of our texture. Asking OpenGL to draw the part of the texture from min UV to max UV will draw our chosen texture and only that texture.
    • Ok so a while back i have made my own modpack. When i'm in my survival world it freezes after a while of being in the world. The RAM usage in the top right corner starts gradually going up really fast and then it will start freezing and then unfreezing every so often. I don't know what mod is causing it. But i do know that there is a mod that is causing it but i don't know which one is doing it. When it hard freezes it will make my CPU spike up to 100% for a few seconds which is not normal at all because i'm rarely able to max out my CPU playing a game. This issue had me puzzled for a while now i can't seem to figure out what is causing it.   My computer specs are this if you're wondering if you want to know if it's a lack of processing power that is causing the issue which it is not. CPU: Ryzen 9 3950X RAM: 128GB DDR4 3600Mhz RAM GPU: Founders edition Nvidia RTX 2070 Motherboard: Gigabyte X570 AORUS Master   If it would help you know which mod is causing this HUGE memory leak which is causing Hard freezes. Then my logs are below. I had to send it as a discord download for the logs file because it was too big for pastebin and hastebin. https://cdn.discordapp.com/attachments/698388511534874684/715084840923299921/2020-05-26-4.log My mod list is below. If anyone has any ideas which mod or mods in the list below is causing HUGE Memory leaks please tell me.   Botania (by Vazkii) MrTJPCore (by MrTJP) Flux Networks (by sonar_sonic) Reliquary v1.3 (by P3pp3rF1y) MysticalLib (by EpicSquid319) Ding (by ohaiiChun) Trumpet Skeleton (by jamieswhiteshirt_) Integrated Tunnels (by kroeser) Extreme Reactors (by ZeroNoRyouki) AbyssalCraft (by Shinoow) Snad (by TheRoBrit) iChunUtil (by ohaiiChun) Mantle (by mDiyo) Morph (by ohaiiChun) Portal Gun (by ohaiiChun) Solar Flux Reborn (by Zeitheron) RFTools (by McJty) BdLib (by bdew) Binnie's Mods (by _ForgeUser9116757) More Furnaces (by cubex2) Bibliotheca (by EwyBoy) VanillaFix (by Runemoro) Less Lag (by Sharkske) Common Capabilities (by kroeser) AutoRegLib (by Vazkii) Brandon's Core (by brandon3055) Draconic Evolution (by brandon3055) Immersive Petroleum (by Flaxbeard) Just Enough Petroleum (by BordListian) Wawla - What Are We Looking At (by DarkhaxDev) Compact Drawers (by samtrion) AE2 Wireless Terminal Library (by TheRealp455w0rd) Thermal Innovation (by TeamCoFH) Storage Drawers Extras (by Texelsaur) Quick Leaf Decay (by Lumien231) Enchantment Descriptions (by DarkhaxDev) Advanced Generators (by bdew) Thaumcraft (by Azanor13) ExtraCells2 (by Destroyer7128) Cyclic (by Lothrazar) Tinker's JEI (by Possible_triangle) Industrial Craft (by sfPlayer1) ShetiPhianCore (by ShetiPhian) Redstone Arsenal (by TeamCoFH) Cooking for Blockheads (by BlayTheNinth) Biomes O' Plenty (by Forstride) Simple Generators (by ValkyrieofNight) Advanced Solar Panels (by Chocohead) Immersive Cables (by SanAndreasP) Blood Magic (by WayofTime) JustEnoughIDs (by Runemoro) Just Enough Energistics (JEE) (by TheRealp455w0rd) FTB Utilities (by LatvianModder) Iron Backpacks (by gr8pefish) Just Enough Items (JEI) (by mezz) Ore Prospectors (by Lothrazar) LootBags (by Malorolam) GunpowderLib (by Jackyy) Expanded Equivalence (by Zeitheron) Aroma1997Core (by Aroma1997) Tinkers Construct (by mDiyo) FTB Library (by LatvianModder) Akashic Tome (by Vazkii) Buildcraft (by Covert_Jaguar) Chicken Chunks 1.8.+ (by covers1624) EverlastingAbilities (by kroeser) Sonar Core (by sonar_sonic) Psi (by Vazkii) MCMultiPart (by amadornes) Applied Energistics 2 (by AlgorithmX2) Chameleon (by Texelsaur) JEI Bees (by bdew) Forge MultiPart CBE (by covers1624) Thermal Cultivation (by TeamCoFH) JEI Villagers (by Buuz135) EnderTanks (by ShetiPhian) Cyclops Core (by kroeser) Angel Ring To Bauble (by Portablejim) Astral Sorcery (by HellFirePvP) Neat (by Vazkii) Storage Drawers (by Texelsaur) Mystical Agradditions (by BlakeBr0) More Chickens (by GenDeathrow) Simply Jetpacks 2 (by Tomson124) Redstone Flux (by TeamCoFH) Just Enough Resources (JER) (by way2muchnoise) Inventory Sorter (by cpw) Shadowfacts' Forgelin (by ShadowfactsDev) Mekanism (by bradyaidanc) Better Builder's Wands (by Portablejim) Mekanism Generators (by bradyaidanc) Mekanism Tools (by bradyaidanc) Immersive Tech (by FerroO2000) CXLibrary (by cubex2) Actually Additions (by Ellpeck) Woot (by Ipsis) Hammer (Lib) Core (by Zeitheron) Farming for Blockheads (by BlayTheNinth) Forestry (by _ForgeUser7678633) Ender Storage 1.8.+ (by covers1624) QuantumStorage (by GigaBit101) Practical Logistics 2 (by sonar_sonic) RFTools Control (by McJty) p455w0rd's Library (by TheRealp455w0rd) Too Many Efficiency Losses (by jamiebrassel__) Calculator (by sonar_sonic) Chest Transporter (by cubex2) The One Probe (by McJty) Embers (by EpicSquid319) Thermal Foundation (by TeamCoFH) WanionLib (by WanionCane) MJRLegends Lib (by MJRLegends) Random Things (by Lumien231) Integrated Dynamics (by kroeser) OpenBlocks Elevator (by vsngarcia) GraveStone Mod (by henkelmax) OreLib (by OreCruncher) The Aether (by GildedGames) ConnectedTexturesMod (by tterrag1098) Ranged Pumps (by raoulvdberge) ElecCore (by Elec332) Tiny Progressions (by Kashdeya) EnderCore (by tterrag1098) XNet (by McJty) Thaumic JEI (by Buuz135) Bookshelf (by DarkhaxDev) Industrial Foregoing (by Buuz135) Chickens (by setycz) Block Drops (JEI Addon) (by KidsDontPlay) AE2 Stuff (by bdew) Mob Grinding Utils (by vadis365) Just A Raft Mod (by Mrbysco) Refined Storage (by raoulvdberge) Ore Excavation (by Funwayguy) Pam's HarvestCraft (by pamharvestcraft) Environmental Materials (by ValkyrieofNight) Thermal Dynamics (by TeamCoFH) Roost (by timrwood) Forgiving Void (by BlayTheNinth) Torchmaster (by xalcon) Chisel (by tterrag1098) Patchouli (by Vazkii) OpenComputers (by Sangar_) Immersive Engineering (by BluSunrize) QuantumFlux (by FantasyTeddy) Tinkers' Tool Leveling (by bonusboni) UniDict (by WanionCane) Equivalent Bees (by crankysupertoon) McJtyLib (by McJty) ProjectE (by SinKillerJ) Iron Jetpacks (by BlakeBr0) Item Scroller (by masady) RFTools Dimensions (by McJty) AppleSkin (by squeek502) Compact Machines (by davenonymous) Mod Name Tooltip (by mezz) Aquaculture 2 (by Shadowclaimer) Environmental Tech (by ValkyrieofNight) Not Enough Items 1.8.+ (by covers1624) Translocators 1.8.+ (by covers1624) LibVulpes (by zmaster587) Advanced Rocketry (by zmaster587) ValkyrieLib (by ValkyrieofNight) Bonsai Trees 2 (by davenonymous) Reborn Storage (by modmuss50) Refined Storage Addons (by raoulvdberge) Thaumcraft 6 Aspects for JEI (by zabi94) Actually Baubles (by Jackyy) Mouse Tweaks (by YaLTeR) Iron Chests (by ProgWML6) The Twilight Forest (by Benimatic) Aroma1997s Dimensional World (by Aroma1997) Compact Solars (by ProgWML6) Mystical Agriculture (by BlakeBr0) Cucumber Library (by BlakeBr0) Ender IO (by CrazyPants_MC) Industrial Wires (by malte0811) Ender Utilities (by masady) Integration Foregoing (by Jackyy) Dark Utilities (by DarkhaxDev) Old Combat Mechanics (by chylex) OpenModsLib (by OpenMods) OpenBlocks (by OpenMods) Guide-API (by TehNut) Just Enough HarvestCraft (JEHC) (by mrAppleXZ) Magic Bees (by MysteriousAges) Bad Wither No Cookie - Reloaded (by Kreezxil) Chisels & Bits (by AlgorithmX2) Advanced Machines (by Chocohead) JourneyMap (by techbrew) Hwyla (by TehNut) MeeCreeps (by McJty) Not Enough Wands (by romelo333) CoFH Core (by TeamCoFH) Thermal Expansion (by TeamCoFH) FTB Backups (by LatvianModder) Open Glider (by gr8pefish) Light Level Overlay Reloaded (by oldjunyi) Placebo (by Shadows_of_Fire) Tesla Core Lib (by face_of_cat) Extra Utilities (by RWTema) Wireless Crafting Terminal (by TheRealp455w0rd) The Monk Mod (by RWTema) Deep Resonance (by McJty) ZeroCore (by ZeroNoRyouki) Building Gadgets (by Direwolf20) CoFH World (by TeamCoFH) The Beneath (by Shinoow) AppleCore (by squeek502) PTRLib (by RazzleberryFox) /dank/null (by TheRealp455w0rd) Schematica (by Lunatrius) Avaritia 1.1x (by brandon3055) LunatriusCore (by Lunatrius) Waila Harvestability (by squeek502) Reborn Core (by modmuss50) Ore Excavation Integration (by BloodWorkXGaming) Immersive Craft (by McJty) RF Lux (by romelo333)
    • I don't know of any tutorials which really lay it out for 1.15, but the Forge docs are helpful. First thing you'll need is a class which implements IRecipe<C extends IInventory>. When you create the recipe JSON (i.e. a crafting table recipe), that JSON will get converted into one of these objects. All the JSON says is what should be used as inputs and what should be used as outputs. Your object is a code representation of that data, which provides methods for getting the input list, checking if a given inventory matches your crafting requirements, getting the result of the crafting, and so on. Once you have that, you will need a factory which will take the provided JSON and convert it into your IRecipe object. The factory should extend ForgeRegistryEntry<IRecipeSerializer<?>> and implement IRecipeSerializer<((whatever your IRecipe class is))>. The factory will have methods for getting the recipe from either JSON or from the network, and will produce your IRecipe object.   I hope I've helped to clarify some. As I said, the docs are a great resource (when they actually have what you're looking for, that is), and a lot of what my code is based on what I've read from the docs, examples I've found online, or just trolling through Minecraft's code until I find what I'm looking for.
    • That's what I'm doing, sorry I didn't make that clear. As part of the node's data I've got the position and the resource location for the appropriate texture. My main concern was that since I won't know where the node will be located until it gets registered I can't just include the path as part of the background texture, so I would have to dynamically draw it.   I suspected this would be the case, but thanks for confirming it. I assume I can still use Screen for a convenient way to access the GUI, and then override the various rendering methods in order to actually draw what I need? Side note: how did you code-ify `Screen`?
    • You could specify the position of the node as part of its data, which should be part of the instance you use as the registry entry, and draw each node according to its position data. This allows you (as well as other mods that use your mod) to have more control over where the newly added nodes should appear. This also circumvents the "dynamically position the node and draw line between" problem.   Directly using OpenGL should be the easier approach, as it has more flexibility (and Screen uses OpenGL anyways). Create a texture of a line and scale/rotate it to point it to other nodes. Some trigonometry will be needed.
  • Topics

  • Who's Online (See full list)