Jump to content

Recommended Posts

Posted

I've been trying to switch to Wuppy's advanced modding setup (http://www.wuppy29.com/minecraft/modding-tutorials/wuppys-minecraft-forge-modding-tutorials-for-1-7-set-up-part-2b-advanced-forge-setup/ and http://www.wuppy29.com/minecraft/modding-tutorials/wuppys-minecraft-forge-modding-tutorials-for-1-7-creating-your-own-mod-advanced-setup/), but I can't figure out where to put my resources folder in a place where it will be recognized. Does anyone know the right way to do it with this setup?

Posted

It still isn't working. Here's a picture of my file tree with relevant stuff opened.

ssfOWQQ.png

An example of a reference to one of said resources: new BlockLickable().setBlockName("blockLickable").setCreativeTab(CreativeTabs.tabBlock).setBlockTextureName(MODID + ":lickable");

MODID is darkfangsmod

Posted

Why are there two projects? There should be no 'Forge' project. Seriously guys STOP DOING THAT.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Ok, so I'll assume that the right way to have multiple mods is to use 2 different packages.

If that's the case, is there a way to disable/enable mods when I run the client so I can test 1 mod at a time?

Posted

Download Forge src

Make Folder called 'Mod1'

Unzip Forge src into 'Mod1'

Make Folder called 'Mod2'

Unzip Forge src into 'Mod2'

OMFG YOU HAVE TWO MODS OMG OMG OMG OMG GOMG OMGMGOMGKMKGMOGMOGMOMGOGJOGOGO

 

Seriously guys we've made this stupidly simple, quit complicating it.

If you want to have both mods in a single eclipse workspace that's slightly more complicated, but not really.

Just setup a workspace somewhere, anywhere. And then run the 'eclipse' task on both mods. Then input the eclipse projects... Seriously.. not hard.

  • Haha 1

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted
  On 2/23/2014 at 9:09 PM, diesieben07 said:

... Code goes into src/main/java (why on earth is that empty for you?), assets go into src/main/resources.

 

The src/main/java he's talking about is the one at the top.

 

If you want multiple mods in one project, declare them in packages and put them under the src/main/java at the top as stated above,

(if you're only doing one, follow the same pattern),

e.g., package com.darkfangs.darkfangsmod goes in path src/main/java/com/darkfangs/darkfangsmod,

and package com.darkfangs.lightfangsmod goes in path src/main/java/com/darkfangs/lightfangsmod.

 

Texture assets would go in src/main/resources/assets/darkfangsmod/textures

and src/main/resources/assets/lightfangsmod/textures.

 

They won't build as separate mod jars, but both mods will appear as separate mods in Minecraft when you load it.

Posted

Could of sworn I mentioned that you'd use your email.

like com.google.lexmanos

Or, get yourself a host :P

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

Alright, well I now have a question. I'm not having any errors, just a general question.

 

I still use a 'Forge' folder, but I do it so that my run configurations can run multiple mods at once (mini question, what's the advantage of using "Debug configurations" over "Run configurations"? Or, what's the difference?). I just set it so that each one runs Forge, then under 'User Entries' in the 'Classpath' tab of each configuration, I just add the java projects of the mods I want to run with it. I also like having a Forge folder and then making separate Java Projects for each mod because then the only things in that mod project is the code and the resources for it. I guess the one downside is that I have to install Gradle on my machine and copy over and change the build.gradle to make it work, but I've gotten that to work as well.

 

SO, the question is, is what I'm doing still wrong?

Posted
  On 2/25/2014 at 9:38 PM, Parker8283 said:
mini question, what's the advantage of using "Debug configurations" over "Run configurations"? Or, what's the difference?
Debug allows you to have breakpoints, hot swap, and the like, Normal run is a normal run uninstrimented.

 

  Quote
I just set it so that each one runs Forge, then under 'User Entries' in the 'Classpath' tab of each configuration, I just add the java projects of the mods I want to run with it.
That's fine, you can do that for whatever classpaths you want.

  Quote
I also like having a Forge folder and then making separate Java Projects for each mod because then the only things in that mod project is the code and the resources for it.
... The gradle wrapper is optional it's recomended so that users who grab your repo don't need to have gradle installed. Beyond that you shouldn't have anything else. So.. what exactly are you saving by doing it that way?

  Quote
I guess the one downside is that I have to install Gradle on my machine and copy over and change the build.gradle to make it work
The first aprt is exactly what the wrapper is ment to save you from, and the second part ... why edit shit multiple time?

  Quote
SO, the question is, is what I'm doing still wrong?
Short answer yes, I've explained in my video how to set things up. Forcing outsiders who see your mod to figure out how to setup gradle and how to edit a build.gradle is a bad idea. They SHOULD just clone your repo, run setup, and be good to go, no external installs.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

  • 3 months later...
Posted

OK, I just wanted to comment here - I set up my workspace via wuppy's advanced setup and IT WORKS GREAT. I have not installed gradle (nor even know exactly what it is), and I don't have to edit the build.gradle but once per project.

 

I understand that every setup has advantages and disadvantages, and that some people will fight tooth and nail for setups that make no sense to other people. It's like bracket placement rules or hard/soft tab arguments or even Mac vs. PC - both sides are valid and full of people that will never change. Use what you are used to and learn to use it properly.

 

Let me try explain how this advanced setup is supposed to make things work.

 

I have a single folder for all of my modding related stuff. In that folder are a folder for eclipse and related files (extracted zip), a folder for forge and related files (extracted zip) and a folder for my Eclpise workspace, in which I save my mods.

 

Once creating these folders and unzipping force src and eclipse into their respective folders, I ran "gradlew setupDecompWorkspace" and "gradlew eclipse" in the ~\modding\forge\ directory. I then ran Eclipse and selected ~\modding\workspace as my Eclipse workspace.

 

In Eclipse, when I want to make a new mod, such as my SpawnerCraft mod (made on this system), I make a new project in Eclipse called the mod name. I then make the build path for that project include Forge, and setup a new Run Configuration for Forge that includes the new project.

 

TADA, the mod has its own folder and I only ever have to install all the Forge files (386 MB) once. This is not that big of a deal, honestly, and new people should do the simple option of a new forge enviroment for each mod - it is simpler.

 

To publish (case study) Spawnercraft, I take the com.cad97.Spawnercraft package and copy it over to the src/main/java. I take the other files (excluding build.gradle if this isn't the first jar build) and put them in src/main/resources. I run my Run Config of just Forge (no other projects) to make sure the mod is working. If this is my first time building the mod, I will edit the build.gradle as appropriate. If not, I'll copy over the pre-existing one in the mod folder already and use it (checking that the forge version is the same, as I may have updated since the last build). I then "gradlew build" in ~\modding\forge and I have the .jar for the mod. Then I delete the new files out of the Forge project and carry on my way. If I feel it necessary to save myself the agonizing effort of editing three tags in build.gradle, I'll copy it over into the mod project to keep it for the future.

 

Then, I can repeat as necessary.

 

Advantages of this format:

  • If I were to use git or mercurial or whatever to mirror my mod to github or bitbucket or whatever, I would not be uploading the Minecraft/Forge source.
  • It is easy for me to see what files are directly pertaining to the mod in a nice small folder.
  • I have the same enviroment that I've been used to from previous projects that every project is (gasp) its own project.
  • When updating Forge I only have to do it once (taking several (>10 even) minutes on my old machine).
  • ???
  • Profit

 

Disadvanteges:

  • Some setup time to get the Run configs and the different folders.
  • People not being able to comprehend this setup.
  • Having to copy over files to export a project (which should only happen once per project if you're good).
  • If people are grabbing my mod source, they will have to realize that it needs to be built and ran through Forge rather than being self-contained (but really these are mods not programs).

 

Sorry for the rant, and just to clarify, everything here is opinion and as such could be very wrong to some people if they are of the opposite opinion.

 

Screengrab of my setup in Eclipse:

 

  Reveal hidden contents

 

 

Did I really just spend thirty minutes explaining an opinion on the internet. In a location where it has been discouraged. What am I doing with my time? (Waiting for a response on another topic.)

Posted

I havent read every comment but by what i can see you dont have you .java files in the right place to begin with they should be under the "src/main/java" and your texture files should be under "src/main/resources".

Posted
  On 6/13/2014 at 9:13 PM, drok0920 said:

I havent read every comment but by what i can see you dont have you .java files in the right place to begin with they should be under the "src/main/java" and your texture files should be under "src/main/resources".

 

The point of the setup is that they aren't. Yes, this is not the intended way of setting up your workspace. No, it does not not work. (not not = does)

 

For the gradlew build to work, the files have to be there, and to build a mod if I wish to release it I move them there. For writing, however, it works fine to have them in their own project AS LONG AS you actually set up the whole enviroment correctly, and messing one thing up could screw you over.

 

I set this up following wuppy's tutorial and just modifying a couple folder hierarchies to make it fit my organization style better.

 

Oh, and I should probably say this (I forgot it originally): I did set up a JAVA_HOME Environment Variable. I did not set up a PATH Environment Variable.

Posted

Because they can... Before ForgeGradle such a setup was nice. Now... It's just not needed.

We all stuff up sometimes... But I seem to be at the bottom of that pot.

Posted

Wuppy's  setup is a great setup, It makes everything a whole crapload easier. I've tried both ways.

Also, I've heard the normal setup does not work for some people due to eclipse freaking out.

Developer of the WIP Rubies mod.

Posted

Honestly guys we should let it rest. It's (somewhat) like Mac vs. PC vs. Linux, there's no real answer, just the best for each person.

 

As long as it works for you, it's fine. If it doesn't work, set it up by the "official" way before you complain to the people who want you to set it up that way xD

Posted

-.- Gunna lock this, cad97, this is not a PC vs Mac debate, this is a you're doing something extremely stupid by complicating the setup when the scripts do EXACTLY what you are trying to emulate for you, natively.

The other issue is you flat out have no idea how the system actually works as evidenced by this statement:

"I only ever have to install all the Forge files (386 MB) once."

 

Anyways locking before it becomes more of a bitchfest and bad information.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi! I'm trying to add my custom models/textures renderer like this: public class PonyPlayerWrapperRenderer extends EntityRenderer<Player> { // wrapper class under my LivingEntityRenderer class implementation private final PonyPlayerRenderer innerRenderer; private final PonyPlayerRenderer innerSlimRenderer; public PonyPlayerWrapperRenderer(final EntityRendererProvider.Context context) { super(context); System.out.println("creating new PonyPlayerWrapperRenderer"); this.innerRenderer = new PonyPlayerRenderer(context, false); this.innerSlimRenderer = new PonyPlayerRenderer(context, true); } @Override public void render(final Player entity, final float yaw, final float partialTicks, final PoseStack poseStack, final MultiBufferSource bufferSource, final int packedLight) { System.out.println("PonyPlayerWrapperRenderer render: " + entity.toString()); if (entity instanceof AbstractClientPlayer clientPlayer) { if (clientPlayer.getModelName().contains("slim")) { innerSlimRenderer.render(clientPlayer, yaw, partialTicks, poseStack, bufferSource, packedLight); } else { innerRenderer.render(clientPlayer, yaw, partialTicks, poseStack, bufferSource, packedLight); } } } @Override public ResourceLocation getTextureLocation(final Player player) { System.out.println("PonyPlayerWrapperRenderer getTextureLocation"); if (player instanceof AbstractClientPlayer clientPlayer) { return clientPlayer.getSkinTextureLocation(); } System.out.println("player instanceof AbstractClientPlayer is false"); return getDefaultSkin(player.getUUID()); } } public class PonyPlayerRenderer extends LivingEntityRenderer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> { private final PlayerModel<AbstractClientPlayer> earthModel; private final PlayerModel<AbstractClientPlayer> pegasusModel; private final PlayerModel<AbstractClientPlayer> unicornModel; public PonyPlayerRenderer(final EntityRendererProvider.Context context, final boolean slim) { super( context, slim ? new PonyModelSlim(context.bakeLayer(PonyModelSlim.LAYER_LOCATION)) : new PonyModel(context.bakeLayer(PonyModel.LAYER_LOCATION)), 0.5f ); System.out.println("creating new PonyPlayerRenderer"); this.earthModel = slim ? new PonyModelSlim(context.bakeLayer(PonyModelSlim.LAYER_LOCATION)) : new PonyModel(context.bakeLayer(PonyModel.LAYER_LOCATION)); this.pegasusModel = new PegasusModel(context.bakeLayer(PegasusModel.LAYER_LOCATION)); this.unicornModel = new UnicornModel(context.bakeLayer(UnicornModel.LAYER_LOCATION)); } @Override public void render(final AbstractClientPlayer player, final float entityYaw, final float partialTicks, final PoseStack poseStack, final MultiBufferSource buffer, final int packedLight) { final PonyRace race = player.getCapability(PONY_DATA) .map(data -> ofNullable(data.getRace()).orElse(PonyRace.EARTH)) .orElse(PonyRace.EARTH); this.model = switch (race) { case PEGASUS -> pegasusModel; case UNICORN -> unicornModel; case EARTH -> earthModel; }; super.render(player, entityYaw, partialTicks, poseStack, buffer, packedLight); } @Override public ResourceLocation getTextureLocation(final AbstractClientPlayer player) { final PonyRace race = player.getCapability(PONY_DATA) .map(data -> ofNullable(data.getRace()).orElse(PonyRace.EARTH)) .orElse(PonyRace.EARTH); return switch (race) { case EARTH -> fromNamespaceAndPath(MODID, "textures/entity/earth_pony.png"); case PEGASUS -> fromNamespaceAndPath(MODID, "textures/entity/pegasus.png"); case UNICORN -> fromNamespaceAndPath(MODID, "textures/entity/unicorn.png"); }; } } @Mod.EventBusSubscriber(modid = MODID, bus = MOD, value = CLIENT) public class ClientRenderers { // mod bus render registration config @SubscribeEvent public static void onRegisterLayerDefinitions(final EntityRenderersEvent.RegisterLayerDefinitions event) { event.registerLayerDefinition(PonyModel.LAYER_LOCATION, PonyModel::createBodyLayer); event.registerLayerDefinition(PonyModelSlim.LAYER_LOCATION, PonyModelSlim::createBodyLayer); event.registerLayerDefinition(PegasusModel.LAYER_LOCATION, PegasusModel::createBodyLayer); event.registerLayerDefinition(UnicornModel.LAYER_LOCATION, UnicornModel::createBodyLayer); event.registerLayerDefinition(InnerPonyArmorModel.LAYER_LOCATION, InnerPonyArmorModel::createBodyLayer); event.registerLayerDefinition(OuterPonyArmorModel.LAYER_LOCATION, OuterPonyArmorModel::createBodyLayer); } @SubscribeEvent public static void onRegisterRenderers(final EntityRenderersEvent.RegisterRenderers event) { event.registerEntityRenderer(EntityType.PLAYER, PonyPlayerWrapperRenderer::new); System.out.println("onRegisterRenderers end"); } } Method onRegisterRenderers() is called and I can see it being logged. But when I enter the world, my PonyWrapperRenderer render() method doesn't ever seem to be called. I also tried to put my renderer to EntityRenderDispatcher's playerRenderers via reflection: @Mod.EventBusSubscriber(modid = MODID, bus = MOD, value = CLIENT) public class ClientRenderers { @SubscribeEvent public static void onRegisterLayerDefinitions(final EntityRenderersEvent.RegisterLayerDefinitions event) { event.registerLayerDefinition(PonyModel.LAYER_LOCATION, PonyModel::createBodyLayer); event.registerLayerDefinition(PonyModelSlim.LAYER_LOCATION, PonyModelSlim::createBodyLayer); event.registerLayerDefinition(PegasusModel.LAYER_LOCATION, PegasusModel::createBodyLayer); event.registerLayerDefinition(UnicornModel.LAYER_LOCATION, UnicornModel::createBodyLayer); event.registerLayerDefinition(InnerPonyArmorModel.LAYER_LOCATION, InnerPonyArmorModel::createBodyLayer); event.registerLayerDefinition(OuterPonyArmorModel.LAYER_LOCATION, OuterPonyArmorModel::createBodyLayer); } @SubscribeEvent public static void onClientSetup(final FMLClientSetupEvent event) { event.enqueueWork(() -> { try { final EntityRenderDispatcher dispatcher = Minecraft.getInstance().getEntityRenderDispatcher(); final Field renderersField = getEntityRenderDispatcherField("playerRenderers"); final Field itemInHandRenderer = getEntityRenderDispatcherField("itemInHandRenderer"); @SuppressWarnings("unchecked") final Map<String, EntityRenderer<? extends Player>> playerRenderers = (Map<String, EntityRenderer<? extends Player>>)renderersField.get(dispatcher); final PonyPlayerWrapperRenderer renderer = new PonyPlayerWrapperRenderer( new EntityRendererProvider.Context( dispatcher, Minecraft.getInstance().getItemRenderer(), Minecraft.getInstance().getBlockRenderer(), (ItemInHandRenderer)itemInHandRenderer.get(dispatcher), Minecraft.getInstance().getResourceManager(), Minecraft.getInstance().getEntityModels(), Minecraft.getInstance().font ) ); playerRenderers.put("default", renderer); playerRenderers.put("slim", renderer); System.out.println("Player renderers replaced"); } catch (final Exception e) { throw new RuntimeException("Failed to replace player renderers", e); } }); } private static Field getEntityRenderDispatcherField(final String fieldName) throws NoSuchFieldException { final Field field = EntityRenderDispatcher.class.getDeclaredField(fieldName); field.setAccessible(true); return field; } } But I receive the error before Minecraft Client appears (RuntimeException: Failed to replace player renderers - from ClientRenderers onClientSetup() method - and its cause below): java.lang.IllegalArgumentException: No model for layer anotherlittlepony:earth_pony#main at net.minecraft.client.model.geom.EntityModelSet.bakeLayer(EntityModelSet.java:18) ~[forge-1.20.1-47.4.0_mapped_official_1.20.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.entity.EntityRendererProvider$Context.bakeLayer(EntityRendererProvider.java:69) ~[forge-1.20.1-47.4.0_mapped_official_1.20.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at com.thuggeelya.anotherlittlepony.client.renderer.pony.PonyPlayerRenderer.<init>(PonyPlayerRenderer.java:32) ~[main/:?] {re:classloading} at com.thuggeelya.anotherlittlepony.client.renderer.pony.PonyPlayerWrapperRenderer.<init>(PonyPlayerWrapperRenderer.java:24) ~[main/:?] {re:classloading} at com.thuggeelya.anotherlittlepony.client.renderer.ClientRenderers.lambda$onClientSetup$0(ClientRenderers.java:79) ~[main/:?] {re:classloading} ... 33 more Problem appears when EntityRendererProvider context tries to bakeLayer with my model layer location: new PonyModel(context.bakeLayer(PonyModel.LAYER_LOCATION)); // PonyPlayerRenderer.java:32 public class PonyModel extends PlayerModel<AbstractClientPlayer> { // the model class itself public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( ResourceLocation.fromNamespaceAndPath(MODID, "earth_pony"), "main" ); public PonyModel(final ModelPart root) { super(root, false); } public static LayerDefinition createBodyLayer() { // some CubeListBuilder stuff for model appearance } } Textures PNGs are placed at: resources/assets/[my mod id]/textures/entity. My forge version is 1.20.1. Would appreciate any help.
    • Well, a bit more information about what you're trying to do would be helpful. e.g. why you're trying to use "INVOKE_ASSIGN" instead of "INVOKE". "INVOKE_ASSIGN" calls your code after the "target" is called and its value is stored, if applicable. "INVOKE" calls your code before the target is called. "target" expects a fully qualified name, as per the SpongePowered docs, if that name is going to be remapped (which it will be if your injecting into Minecraft itself and not another mod). For more information on fully qualified names versus canonical names, see the Java specifications. Here's an example of a working "@At" from my own code that targets the "getClosestsVulnerablePlayerToEntity" call inside a mob's logic: @At(value = "INVOKE_ASSIGN", target = "net.minecraft.world.World.getClosestVulnerablePlayerToEntity(Lnet/minecraft/entity/Entity;D)Lnet/minecraft/entity/player/EntityPlayer;") Hope this helps!
    • Ran it one more time just to check, and there's no errors this time on the log??? Log : https://mclo.gs/LnuaAiu I tried allocating more memory to the modpack, around 8000MB and it's still the same; stopping at "LOAD_REGISTRIES". Are some of the mods clashing, maybe? I have no clue what to do LOL
    • Tried removing some biome generation mods and test ran it again, but it's still the same; still not responding as soon as it gets to "LOAD_REGISTRIES". This time with more errors though. Log : https://mclo.gs/uygZzD8 Is there too little memory allocated to the modpack maybe? Can someone help please.    (T.T)💔
    • This is sad. Over 3300 people have checked the thread and no one is able to help or give any ideas :(.
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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