Jump to content

help 1.8 for why minecraft is not loading this item texture <SOLVED>


perromercenary00

Recommended Posts

good days

gues am i not the only one whith the swollen balls for the tink whit the json for the textures for blocks and items

google dont give a clear answr i been reading and interpreting code from diferents sources but no working texture yet

 

soo long i been reading lot of post about this but is something missing

http://www.minecraftforge.net/forum/index.php/topic,24263.0.html

 

 

the mod name is MODID = "modmercenario" , the folder is in

/home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/src/main/java/modMercenario/mercenarymod

 

the item is a steelIngot i steal the json from the iron ingot.

and i like to set everything in folders

 

public static Item aceroMercenario;

aceroMercenario  = new modMercenario.mercenarymod.items.materiales.aceroMercenario();

 

the texture is in

/home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/src/main/resources/assets/modmercenario/textures/items/materiales/aceromercenario.png

 

is a 64b texture but i alredy chage it to 16 soo thas was not the problem

 

mi json is in

 

/home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/src/main/resources/assets/modmercenario/models/item/aceromercenario.json

 

and inside looks identicaly to the one of the torch example in http://minecraft.gamepedia.com/Block_models

whith only diference is the route to the texture

 

//aceromercenario.json

_____________________

{

    "parent": "builtin/generated",

    "textures": {

        "layer0": "modmercenario:/items/materiales/aceromercenario"

    },

    "display": {

        "thirdperson": {

            "rotation": [ -90, 0, 0 ],

            "translation": [ 0, 1, -3 ],

            "scale": [ 0.55, 0.55, 0.55 ]

    },

        "firstperson": {

            "rotation": [ 0, -135, 25 ],

            "translation": [ 0, 4, 2 ],

            "scale": [ 1.7, 1.7, 1.7 ]

        }

    }

}

 

________________________________________

 

there is no errors in the console output

mi item acero mercenario is in the CreativeTabs.tabMisc but just and ugly purple black square in tghe steve hand is black purpole square and something rare happend in 3 view is a full 1M cubic block purple and black swalow the steve arm.

 

https://www.dropbox.com/s/rxg25rx0i5zbac1/Captura%20de%20pantalla%20de%202014-12-02%2020%3A21%3A24.png?dl=0

 

nop i dont any have idea what im missing

 

 

//aceroMercenario.java

//__________________________________

package modMercenario.mercenarymod.items.materiales;

 

import net.minecraft.client.Minecraft;

import net.minecraft.client.resources.model.ModelResourceLocation;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraft.item.ItemArmor.ArmorMaterial;

import net.minecraftforge.common.util.EnumHelper;

import net.minecraftforge.fml.common.registry.GameRegistry;

import modMercenario.mercenarymod.items.MercenaryModItems;

import modMercenario.mercenarymod.items.materiales.materialesMercenarios;

import modmercenario.mercenarymod.Mercenary;

 

public class aceroMercenario extends Item{

 

public static String name="aceromercenario";

 

 

public aceroMercenario(){

 

setUnlocalizedName(Mercenary.MODID + "_" + name);

GameRegistry.registerItem(this, name);

setCreativeTab(CreativeTabs.tabMisc);

//setTextureName(Mercenary.MODID + ":" + "materiales/" + name);

this.maxStackSize = 64;

//  this.setMaxDamage(500);

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.aceroMercenario, 0, new ModelResourceLocation("modmercenario:/items/materiales/aceromercenario", "inventory"));

 

}

public static ToolMaterial material(){

return materialesMercenarios.aceromadera();

}

public static ArmorMaterial materialArmadura(){

return materialesMercenarios.acero();

}

 

}

//_______________________________________________

 

//MercenaryModItems.java

//_______________________________________________

package modMercenario.mercenarymod.items;

 

import net.minecraft.block.Block;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.util.EnumHelper;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import modMercenario.mercenarymod.blocks.MercenaryModBlocks;

import modmercenario.mercenarymod.Mercenary;

 

 

public final class MercenaryModItems{

 

public static Item aceroMercenario;

 

public  static void init(){

 

 

aceroMercenario = new modMercenario.mercenarymod.items.materiales.aceroMercenario();

 

 

                          }

 

 

//################################################################################################################################################################################################

}//fin de la classe

 

 

 

 

 

Link to comment
Share on other sites

nop 

im stuck

 

that was one of first post i read and according to that i get it well

 

the mod name is MODID = "modmercenario" , the folder is in

/home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/src/main/java/modMercenario/mercenarymod

 

the item is a steelIngot i steal the json from the iron ingot.

and i like to set everything in folders

 

public static Item aceroMercenario;

aceroMercenario = new modMercenario.mercenarymod.items.materiales.aceroMercenario();

 

the texture is in

/home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/src/main/resources/assets/modmercenario/textures/items/materiales/aceromercenario.png

 

is a 64b texture but i alredy chage it to 16 soo thas was not the problem

 

mi json is in

 

/home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/src/main/resources/assets/modmercenario/models/item/aceromercenario.json

 

and inside looks identicaly to the one of the torch example in http://minecraft.gamepedia.com/Block_models

whith only diference is the route to the texture

 

_____________________

{

    "parent": "builtin/generated",

    "textures": {

        "layer0": "modmercenario:/items/materiales/aceromercenario"

    },

    "display": {

        "thirdperson": {

            "rotation": [ -90, 0, 0 ],

            "translation": [ 0, 1, -3 ],

            "scale": [ 0.55, 0.55, 0.55 ]

    },

        "firstperson": {

            "rotation": [ 0, -135, 25 ],

            "translation": [ 0, 4, 2 ],

            "scale": [ 1.7, 1.7, 1.7 ]

        }

    }

}

 

________________________________________

 

there is no errors in the console output

mi item acero mercenario is in the CreativeTabs.tabMisc but just and ugly purple black square in tghe steve hand is black purpole square and something rare happend in 3 view is a full 1M cubic block purple and black swalow the steve arm.

 

https://www.dropbox.com/s/rxg25rx0i5zbac1/Captura%20de%20pantalla%20de%202014-12-02%2020%3A21%3A24.png?dl=0

 

nop i dont any have idea what im missing

 

 

 

 

Link to comment
Share on other sites

Change

"modmercenario:/items/materiales/aceromercenario"

to

"modmercenario:materiales/aceromercenario"

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

eee

nop

thi s cause the error

 

[22:29:55] [Client thread/ERROR]: Using missing texture, unable to load modmercenario:textures/materiales/aceromercenario.png

java.io.FileNotFoundException: modmercenario:textures/materiales/aceromercenario.png

 

and now i just notice this

 

[22:29:47] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[22:29:47] [Client thread/INFO] [FML]: Searching /home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/eclipse/mods for mods

[22:29:47] [Client thread/INFO] [modmercenario]: Mod modmercenario is missing the required element 'name'. Substituting modmercenario

 

seting back to

 

"layer0": "modmercenario:items/materiales/aceromercenario"

 

and error disapear.

soo i conclude thath the png file and the json file are in the rigth places

 

this is the output whit modmercenario:items/materiales/aceromercenario

 

 

 

 

 

 

 

 

 

22:32:58] [main/INFO] [GradleStart]: Extra: []

[22:32:58] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --accessToken, {REDACTED}, --assetIndex, 1.8, --assetsDir, /home/tenchi/.gradle/caches/minecraft/assets, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker]

[22:32:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[22:32:58] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker

[22:32:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

[22:32:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker

[22:32:58] [main/INFO] [FML]: Forge Mod Loader version 8.0.12.1251 for Minecraft 1.8 loading

[22:32:58] [main/INFO] [FML]: Java is Java HotSpot 64-Bit Server VM, version 1.7.0_71, running on Linux:amd64:3.2.0-4-amd64, installed at /opt/oracle/jre1.7.0_71

[22:32:58] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[22:32:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

[22:32:58] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin

[22:32:58] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[22:32:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[22:32:58] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[22:32:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[22:32:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker

[22:32:58] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[22:32:58] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[22:32:59] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[22:32:59] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper

[22:32:59] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker

[22:33:00] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker

[22:33:00] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker

[22:33:00] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[22:33:02] [Client thread/INFO]: Setting user: Player490

[22:33:06] [Client thread/INFO]: LWJGL Version: 2.9.1

[22:33:06] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[22:33:06] [Client thread/INFO] [FML]: MinecraftForge v11.14.0.1251 Initialized

[22:33:07] [Client thread/INFO] [FML]: Replaced 215 ore recipies

[22:33:07] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[22:33:07] [Client thread/INFO] [FML]: Searching /home/tenchi/Modding/forge-1.8-11.14.0.1251-1.8-src/eclipse/mods for mods

[22:33:07] [Client thread/INFO] [modmercenario]: Mod modmercenario is missing the required element 'name'. Substituting modmercenario

[22:33:10] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load

[22:33:11] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, examplemod, modmercenario] at CLIENT

[22:33:11] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, examplemod, modmercenario] at SERVER

[22:33:11] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Example Mod, FMLFileResourcePack:modmercenario

[22:33:11] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[22:33:11] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations

[22:33:11] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[22:33:11] [Client thread/INFO] [FML]: Applying holder lookups

[22:33:11] [Client thread/INFO] [FML]: Holder lookups applied

[22:33:12] [Client thread/INFO] [sTDOUT]: [tv.twitch.StandardCoreAPI:<init>:16]: If on Windows, make sure to provide all of the necessary dll's as specified in the twitchsdk README. Also, make sure to set the PATH environment variable to point to the directory containing the dll's.

[22:33:12] [Client thread/ERROR]: Couldn't initialize twitch stream

[22:33:12] [sound Library Loader/INFO]: Starting up SoundSystem...

[22:33:12] [Thread-7/INFO]: Initializing LWJGL OpenAL

[22:33:12] [Thread-7/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[22:33:12] [Thread-7/INFO]: OpenAL initialized.

[22:33:12] [sound Library Loader/INFO]: Sound engine started

[22:33:17] [Client thread/INFO]: Created: 512x512 textures-atlas

[22:33:18] [Client thread/INFO] [sTDOUT]: [com.example.examplemod.ExampleMod:init:18]: DIRT BLOCK >> tile.dirt

[22:33:18] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods

[22:33:18] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Example Mod, FMLFileResourcePack:modmercenario

[22:33:18] [Client thread/INFO]: SoundSystem shutting down...

[22:33:18] [Client thread/WARN]: Author: Paul Lamb, www.paulscode.com

[22:33:18] [sound Library Loader/INFO]: Starting up SoundSystem...

[22:33:18] [Thread-9/INFO]: Initializing LWJGL OpenAL

[22:33:18] [Thread-9/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[22:33:19] [Thread-9/INFO]: OpenAL initialized.

[22:33:19] [sound Library Loader/INFO]: Sound engine started

[22:33:20] [Client thread/INFO]: Created: 512x512 textures-atlas

[22:33:30] [server thread/INFO]: Starting integrated minecraft server version 1.8

[22:33:30] [server thread/INFO]: Generating keypair

[22:33:31] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

[22:33:31] [server thread/INFO] [FML]: Applying holder lookups

[22:33:31] [server thread/INFO] [FML]: Holder lookups applied

[22:33:31] [server thread/INFO] [FML]: Loading dimension 0 (Beta) (net.minecraft.server.integrated.IntegratedServer@6419955a)

[22:33:31] [server thread/INFO] [FML]: Loading dimension 1 (Beta) (net.minecraft.server.integrated.IntegratedServer@6419955a)

[22:33:31] [server thread/INFO] [FML]: Loading dimension -1 (Beta) (net.minecraft.server.integrated.IntegratedServer@6419955a)

[22:33:31] [server thread/INFO]: Preparing start region for level 0

[22:33:32] [server thread/INFO]: Preparing spawn area: 50%

[22:33:33] [server thread/INFO]: Changing view distance to 6, from 10

[22:33:33] [Netty Local Client IO #0/INFO] [FML]: Server protocol version 1

[22:33:33] [Netty Server IO #1/INFO] [FML]: Client protocol version 1

[22:33:33] [Netty Server IO #1/INFO] [FML]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected]

[22:33:33] [Netty Local Client IO #0/INFO] [FML]: [Netty Local Client IO #0] Client side modded connection established

[22:33:33] [server thread/INFO] [FML]: [server thread] Server side modded connection established

[22:33:33] [server thread/INFO]: Player490[local:E:26ea92cd] logged in with entity id 139 at (-42.4476285082479, 72.0, 252.7210353814158)

[22:33:34] [server thread/INFO]: Player490 joined the game

[22:33:34] [server thread/INFO]: Saving and pausing game...

[22:33:34] [server thread/INFO]: Saving chunks for level 'Beta'/Overworld

[22:33:35] [server thread/INFO]: Saving chunks for level 'Beta'/Nether

[22:33:35] [server thread/INFO]: Saving chunks for level 'Beta'/The End

Link to comment
Share on other sites

 

the think is that

 

Minecraft.getMinecraft().getRenderItem().

 

goes into the init() of the principal class not in the item class aceromercenario, and you must create an item of the kind to put it in youritem register(YourItem, metadata, 

that wass my second error i declared it like MercenaryModItems.aceroMercenario

well i have some weirdness whit the look of the ingot but seems more like a design issue.

next i have to resolv Items whit multiTextures.

 

 

    @Mod.EventHandler

    public void init(FMLInitializationEvent event) {

       

    Item acero = MercenaryModItems.aceroMercenario;

    Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(acero, 0, new ModelResourceLocation("modmercenario:aceromercenario" , "inventory"));

 

    }

Link to comment
Share on other sites

While I would not want to backseat mod here:

 

May you use code-tags next time because that would make it mor readable.

If my post helped you, please press that "Thank You"-button to show your appreciation.

 

Also if you don't know Java, I would suggest you read the official tutorials by Oracle to get an idea of how to do this. Thanks, and good modding!

 

Also if you haven't, set up a Git repo for your mod not only for convinience but also to make it easier to help you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • TECHNOCRATE RECOVERY becomes an unstoppable force in the fight against online fraud. Working alongside actual hackers opened my eyes to the myriad tricks employed by fraudsters to steal funds. One common method involves the creation of fake investment companies or the impersonation of financial professionals. These scammers cloak themselves in credibility, duping unsuspecting victims into parting with their hard-earned money. But TECHNOCRATE RECOVERY stands as a bastion of defense against such malfeasance. With their unparalleled expertise and unwavering dedication, they dismantle the facade of deception, exposing the true nature of fraudulent schemes and reclaiming what is rightfully ours. My journey with TECHNOCRATE RECOVERY was not just a transactional experience—it was a partnership forged in adversity. They didn't just recover my lost funds; they restored my faith in the digital landscape and empowered me to navigate its treacherous waters with confidence. To anyone who finds themselves ensnared in the web of online fraud, take heed: TECHNOCRATE RECOVERY is not just a beacon of hope; they are a lifeline in the storm. Trust in their expertise, heed their guidance, and reclaim what is rightfully yours. In the battle against deception, TECHNOCRATE RECOVERY stands as integrity and a testament to the power of resilience in the face of adversity. Send Mail: technocratrecovery(at)contractor(dot)net Website Homepage: www (.)technocraterecovery(.)site
    • Try removing Geckolib and any mods which are dependent on it. Geckolib is asking Minecraft to do something with a bunch of numbers, but those numbers are invalid. That was supposed to be a metaphor, but it turn s out to be reality. (Because the numbers may represent non-numeric data) Next time, make a new post instead of replying to this one.
    • I have a tool that harvests multiple crops at once, that either replants or harvests the crops depending on an enchant on the tool. The harvesting and loot dropping works fine, but when it comes to updating what block is rendering, only the clicked block is updated properly, while the others drop the loot but appear to say as the fully grown crop, until right clicked again. The normal path for the tool is to just break the crop, as if the player harvested the crop. The other path is to reset the growth of the crop and drop the crop's loot, minus one seed. I have already tried all combinations of method parameters for setBlock() and destroyBlock(), and the updateing of the crop blocks still does not happen.  The code thus far: public class ScytheItem extends HoeItem { public ScytheItem(Tier tier, int atkBase, float atkSpeed) { super(tier, atkBase, atkSpeed, new Item.Properties().stacksTo(1)); } @Override public @NotNull InteractionResult useOn(@NotNull UseOnContext context) { Level level = context.getLevel(); Player player = context.getPlayer(); InteractionHand hand = context.getHand(); ItemStack stack = context.getItemInHand(); if (!level.isClientSide() && player != null) { BlockPos pos = context.getClickedPos(); Block block = level.getBlockState(pos).getBlock(); if(block instanceof CropBlock) { level.playSound(null, pos, block.getSoundType(level.getBlockState(pos), level, pos, player).getBreakSound(), SoundSource.BLOCKS, 1.0F, AOTMain.RANDOM.nextFloat()); Map<Enchantment, Integer> enchantments = stack.getAllEnchantments(); int harvestSize = 1 + enchantments.getOrDefault(EnchantmentInit.HARVESTING_SIZE.get(), 0); for (int xOff = -harvestSize; xOff <= harvestSize; xOff++) { for (int zOff = -harvestSize; zOff <= harvestSize; zOff++) { BlockPos newPos = pos.offset(xOff, 0, zOff); Block blockAt = level.getBlockState(newPos).getBlock(); if (blockAt instanceof CropBlock crop) { if (crop.isMaxAge(level.getBlockState(newPos))) { if (enchantments.containsKey(EnchantmentInit.AUTO_PLANTER.get())) { dropLoot(level, newPos, level.getBlockState(newPos), block); level.setBlock(newPos, crop.getStateForAge(0), Block.UPDATE_CLIENTS); // the broken bit } else level.destroyBlock(newPos, true); // the broken bit } } } } stack.hurtAndBreak(1, player, (p) -> p.broadcastBreakEvent(hand)); } } return super.useOn(context); } private void dropLoot(@NotNull Level level, @NotNull BlockPos pos, @NotNull BlockState state, @NotNull Block block) { List<ItemStack> drops = getDrops(level, pos, state); findSeeds(block, drops).ifPresent(seed -> seed.shrink(1)); drops.forEach((drop) -> Block.popResource(level, pos, drop)); } private List<ItemStack> getDrops(@NotNull Level level, @NotNull BlockPos pos, @NotNull BlockState state) { return Block.getDrops(state, (ServerLevel) level, pos, null); } private Optional<ItemStack> findSeeds(@NotNull Block block, final Collection<ItemStack> stacks) { Item seedsItem = block.asItem(); return stacks.stream().filter((stack) -> stack.getItem() == seedsItem).findAny(); } }  
    • Hello!  After I build e my mod in .jar, then when starting minecraft, it gives me an error that the dependency was not found. In the minecraft log the following is written:   java.lang.NoClassDefFoundError: org/json/simple/parser/JSONParser at com.example.examplemod.JsonUtil.getConfig(JsonUtil.java:14) In build.gradle I have next dependencies: dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation 'com.googlecode.json-simple:json-simple:1.1.1' } But if I run minecraft from IDE (using the runClient), then these dependencies are installed, and my mod is work. Please, help me with this problem. UPD: Full build.gradle file   plugins { id 'eclipse' id 'idea' id 'maven-publish' id 'net.minecraftforge.gradle' version '[6.0,6.2)' } version = mod_version group = mod_group_id base { archivesName = mod_id } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. java.toolchain.languageVersion = JavaLanguageVersion.of(8) println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" minecraft { mappings channel: mapping_channel, version: mapping_version copyIdeResources = true runs { // applies to all the run configs below configureEach { workingDirectory project.file('run') property 'forge.logging.markers', 'REGISTRIES' property 'forge.logging.console.level', 'debug' mods { "${mod_id}" { source sourceSets.main } } } client { // this block needs to be here for runClient to exist } server { args '--nogui' } data { // example of overriding the workingDirectory set in configureEach above workingDirectory project.file('run-data') // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') } } } // Include resources generated by data generators. sourceSets.main.resources { srcDir 'src/generated/resources' } repositories { } dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" implementation 'com.googlecode.json-simple:json-simple:1.1.1' } tasks.named('processResources', ProcessResources).configure { var replaceProperties = [ minecraft_version: minecraft_version, minecraft_version_range: minecraft_version_range, forge_version: forge_version, forge_version_range: forge_version_range, loader_version_range: loader_version_range, mod_id: mod_id, mod_name: mod_name, mod_license: mod_license, mod_version: mod_version, mod_authors: mod_authors, mod_description: mod_description, ] inputs.properties replaceProperties filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { expand replaceProperties + [project: project] } } tasks.named('jar', Jar).configure { manifest { attributes([ 'Specification-Title' : mod_id, 'Specification-Vendor' : mod_authors, 'Specification-Version' : '1', // We are version 1 of ourselves 'Implementation-Title' : project.name, 'Implementation-Version' : project.jar.archiveVersion, 'Implementation-Vendor' : mod_authors, 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } finalizedBy 'reobfJar' } //tasks.named('publish').configure { // dependsOn 'reobfJar' //} publishing { publications { register('mavenJava', MavenPublication) { artifact jar } } repositories { maven { url "file://${project.projectDir}/mcmodsrepo" } } } tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation }  
    • I want to render shapes through blocks. I found this code in minecraft source  public static void renderShape(PoseStack poseStack, VertexConsumer vertexConsumer, VoxelShape shape, double minX, double minY, double minZ, float red, float green, float blue, float alpha) { PoseStack.Pose pose = poseStack.last(); shape.forAllEdges((x1, y1, z1, x2, y2, z2) -> { float dx = (float)(x2 - x1); float dy = (float)(y2 - y1); float dz = (float)(z2 - z1); float length = Mth.sqrt(dx * dx + dy * dy + dz * dz); dx /= length; dy /= length; dz /= length; vertexConsumer.vertex(pose.pose(), (float)(x1 + minX), (float)(y1 + minY), (float)(z1 + minZ)).color(red, green, blue, alpha).normal(pose.normal(), dx, dy, dz).endVertex(); vertexConsumer.vertex(pose.pose(), (float)(x2 + minX), (float)(y2 + minY), (float)(z2 + minZ)).color(red, green, blue, alpha).normal(pose.normal(), dx, dy, dz).endVertex(); }); } that draws a rectangle around the block, but it is not visible through other blocks. Could someone point me in the right direction on how one renders things through blocks? Thanks in advance 🙏
  • Topics

×
×
  • Create New...

Important Information

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