Jump to content

How can I build a new "clean" jar having my changes as well?


Recommended Posts

Posted

I have made many changes to the "clean" project available from Forge.  I can't use a forge build because many of my changes have no available hooks or ability to do it with Forge.

 

How do I build a jar with my changes?  I have tried "gradlew clean:jar" and it said it was successful.  But I don't see that it did anything.

Posted
  On 12/31/2019 at 9:06 PM, MrChoke said:

I have made many changes to the "clean" project available from Forge.

Expand  

And you did everything wrong. Congradulations.

 

The whole point of the "clean" project is that it's fucking clean. Exactly what vanilla shipped so that patch files can be generated correctly. You are not meant to touch the clean project in any way and Forge does not support or condone building it.

  • Sad 1

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.

Posted (edited)

Yeah, thanks the rude response.  Typical of most of you people on this forum.  I am modding for me, not you or anybody else.  You tell me how I can use forge to make all the mos climb ladders, open trap doors, open/break fences and a bunch of other cool stuff then maybe I'll "do it right".  Until then, too bad.

 

I figure it out anyway at least for the sever.  I didn't do the client yet.    Thanks again for nothing.

 

BTW, why is there a clean jar and clean release task in the project?  I wouldn't have even asked if I didn't see those.  Why have them if clowns like me try to use them right?

 

 

Edited by MrChoke
Posted
  On 12/31/2019 at 9:50 PM, MrChoke said:

BTW, why is there a clean jar and clean release task in the project?  I wouldn't have even asked if I didn't see those.  Why have them if clowns like me try to use them right?

Expand  

I already answered that:

  On 12/31/2019 at 9:43 PM, Draco18s said:

so that patch files can be generated correctly

Expand  

This is specific to contributing to Forge not making mods.

 

And if you want to make a mod for yourself without using Forge, then you can get help elsewhere. We only help people who use Forge and you are not using Forge (instead you are explicitly going around Forge). Therefore I don't particularly care if I am rude (see my signature).

 

  On 12/31/2019 at 9:50 PM, MrChoke said:

You tell me how I can use forge to make all the mos climb ladders, open trap doors, open/break fences and a bunch of other cool stuff then maybe I'll "do it right".

Expand  

All of that would be covered by entity tasks.

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.

Posted
  On 12/31/2019 at 9:50 PM, MrChoke said:

BTW, why is there a clean jar and clean release task in the project?  I wouldn't have even asked if I didn't see those.  Why have them if clowns like me try to use them right?

Expand  

They are used to develop and distribute Forge. As a user of Forge you should not use such tasks.

 

  On 12/31/2019 at 9:50 PM, MrChoke said:

You tell me how I can use forge to make all the mos climb ladders, open trap doors, open/break fences and a bunch of other cool stuff then maybe I'll "do it right".  Until then, too bad.

Expand  

Check out how such behaviors are implemented in the player, then apply them to your entity via tasks.

 

Users of Forge should not modify the Forge codebase at all, as doing so is fundamentally breaking Forge’s design, and will not work on any Forge versions. Even if Forge does not have hooks to features you wanted (which is not your case), it would be way better to submit a PR or use ASM.

Some tips:

  Reveal hidden contents

 

Posted

Like I say, I have no intention of distributing these mods in any way, my work is only for me.  I wanted a jar to run on my laptop as well as my desktop PC, that was the need.  

 

As far as using Forge I am not sure what an entity task is exactly.  Is that a forge construct??  I know what tasks and goals are for the AI in vanilla.  My mod for example allows ALL mobs to go up ladders.  I had to make core changes to LivingEntity travel() among other core areas.  Sure I can create my own versions of all of the mobs in the game, copy tons of code into my own versions of it,  then turn off all of the vanilla mobs (I assume I can do that with forge).  Fine, yeah.  If I want to publish my mod someday maybe I'll do that

 

Anyway, sorry I asked.  I have been burned so many times asking questions here and and on Discord you'd think I would have learned my lesson by now.

 

Posted
  On 1/1/2020 at 3:06 PM, MrChoke said:

As far as using Forge I am not sure what an entity task is exactly.  Is that a forge construct??

Expand  

No. Its a vanilla thing. The net.minecraft.entity.ai package contains various AI tasks, such as ZombieAttackGoalMoveThroughVillageGoal, and NearestAttackableTargetGoal. If you were to look at any given entity and the method applyEntityAI(), you'd find these.

 

Previously these were stored in an array list type structure called tasks (its now called goals or goalSelector).

  On 1/1/2020 at 3:06 PM, MrChoke said:

(I assume I can do that with forge)

Expand  

You can. But there's no need if all you're doing is changing the entity goals. You can just alter their goals (goalSelector is public and has both add and remove methods), rather than replicating their entire class's code just to give it different goals.

  On 1/1/2020 at 3:06 PM, MrChoke said:

I had to make core changes to LivingEntity travel()

Expand  

I don't see why, the code already checks for ladders and does appropriate things. The only thing you should have to do is give mobs a different pathfinder so that the pathfinder knows about ladders.

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.

Posted

Ok, you do mean the ai tasks and goals.  I have used those a ton including making my own.  "Brain" and the sensors I am learning now but that is all new to 1.14 and I had not done this stuff since since 1.13.  For example I have them opening trapdoors and fences.  Those are new goals I created for the AI.  Note you still need to update pathfnding for this too.  TRapdoors and fences each have their own PathNodeTypes but the pthfinding is hard-coded to treat them a certain way.  An AI task or goal can't change this.  ALl it can do is call tryTOMoveXYZ() to the pathfinder code.

 

As far as going up ladders I assure you it is not that simple either.  The vanilla pathfinder does not path search up or down ladders.  The heart of it is WalkNodeProcessor and findPathOptions.  It doesn't check up or down when calling getSafePoint().  And once you get the pathfinding to work you still have to get the mob to actually move up or down.  That is harder part.  I had to change MoveController and travel.  The vanilla code in travel has hard coded 0.2 upward movement on a ladder (that is why you see him use a ladder on accident sometimes) and nothing for down except it stops free fall if you are on the ladder.  Non-flying mobs use MoveController to set the "moveForward" and rotationYaw" which travel uses.  "moveVertical" exists too however a walking mob never uses it, only flying ones do (it uses FlyingMoveController).  travel never gets anything but 0 for moveVertical unless all of the code for a flying mob gets executed.

 

I have learned this code very very well back in 1.1.3  I had fixed numerous bugs too.  One in 1.15 that people reported is mobs spinning on scaffolidng and not path finding over it.  Not my mod, not anymore.  I fixed it.  That fix was easy compared to most of the other stuff I have achieved.

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

    • You are using Create 6 - some addons are not compatible with it Remove all addons and add these one by one littlecontraptions is mentioned - keep this one removed
    • Different problem now. https://paste.ee/p/iDo8lS35
    • I would like to have a BoP sapling drop from my block if it is also installed. I think I have done everything and I cannot pinpoint the problem, which is the error in the logs that appears when joining a world:   [Worker-Main-11/ERROR] [ne.mi.co.ForgeHooks/]: Couldn't parse element loot_tables:grasses:blocks/leaves_block com.google.gson.JsonSyntaxException: Expected name to be an item, was unknown string 'biomesoplenty:magic_sapling' My code:   LootItemConditions.CONDITIONS.register(modEventBus); public class LootItemConditions { public static final DeferredRegister<LootItemConditionType> CONDITIONS = DeferredRegister.create(Registries.LOOT_CONDITION_TYPE, Grasses.MOD_ID); public static final RegistryObject<LootItemConditionType> IS_MOD_LOADED = CONDITIONS.register("is_mod_loaded", () -> new LootItemConditionType(new IsModLoaded.ConditionSerializer())); } public class IsModLoaded implements LootItemCondition { private final boolean exists; private final String modID; public IsModLoaded(String modID) { this.exists = ModList.get().isLoaded(modID); this.modID = modID; } @Override public LootItemConditionType getType() { return LootItemConditions.IS_MOD_LOADED.get(); } @Override public boolean test(LootContext context) { return this.exists; } public static LootItemCondition.Builder builder(String modid) { return () -> new IsModLoaded(modid); } public static class ConditionSerializer implements Serializer<IsModLoaded> { @Override public void serialize(JsonObject json, IsModLoaded instance, JsonSerializationContext ctx) { json.addProperty("modid", instance.modID); } @Override public IsModLoaded deserialize(JsonObject json, JsonDeserializationContext ctx) { return new IsModLoaded(GsonHelper.getAsString(json, "modid")); } } } protected LootTable.Builder createLeavesDropsWithModIDCheck(Block selfBlock, Item sapling, Property<?>[] properties, String modIDToCheck, float... chances) { CopyBlockState.Builder blockStateCopyBuilder = CopyBlockState.copyState(selfBlock); for(Property<?> property : properties) { blockStateCopyBuilder.copy(property); } return LootTable.lootTable() .withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)) .add(LootItem.lootTableItem(selfBlock) .when(HAS_SHEARS_OR_SILK_TOUCH) .apply(blockStateCopyBuilder))) .withPool(LootPool.lootPool().setRolls(ConstantValue.exactly(1.0F)) .add(this.applyExplosionCondition(selfBlock, LootItem.lootTableItem(sapling)) .when(IsModLoaded.builder(modIDToCheck))) .when(BonusLevelTableCondition.bonusLevelFlatChance(Enchantments.BLOCK_FORTUNE, chances)) .when(HAS_NO_SHEARS_OR_SILK_TOUCH)) .withPool(LootPool.lootPool().name("sticks").setRolls(ConstantValue.exactly(1.0F)) .add(this.applyExplosionDecay(selfBlock, LootItem.lootTableItem(Items.STICK). apply(SetItemCountFunction.setCount(UniformGenerator.between(1.0F, 2.0F)))) .when(BonusLevelTableCondition.bonusLevelFlatChance(Enchantments.BLOCK_FORTUNE, NORMAL_LEAVES_STICK_CHANCES)) .when(HAS_NO_SHEARS_OR_SILK_TOUCH))); } I don't know. Am I making a mistake somewhere? Am I forgetting something? Should there be something else?
  • Topics

×
×
  • Create New...

Important Information

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