From 4ac2fb8ae925014b275109d13e85907a72f7038f Mon Sep 17 00:00:00 2001 From: Jamesp1989SL Date: Wed, 7 Jan 2026 19:07:52 +0000 Subject: [PATCH 1/4] additional examples added ( incursion, hunt drop item, potion) * updates the target version of the mod to 1.1.1 * Introduces ExampleBiome ExampleIncursionBiome and ExampleIncursionLevel classes for custom incursion functionality. * Adds a new hunt incursion item ExampleHuntIncursionMaterialItem * adds ExamplePotionItem which uses the ExampleBuff class @DrFair I have also added a template file for people who want to make art for the incursion tablets or potions to this PR but feel free not to use that if you don't think its needed --- art resources/incursiontabletblank.xcf | Bin 0 -> 4757 bytes art resources/potiontemplate.xcf | Bin 0 -> 4318 bytes build.gradle | 4 +- src/main/java/examplemod/ExampleMod.java | 16 ++- .../examplemod/examples/ExampleBiome.java | 34 ++++++ .../examples/ExampleIncursionBiome.java | 98 ++++++++++++++++++ .../examples/ExampleIncursionLevel.java | 87 ++++++++++++++++ .../ExampleHuntIncursionMaterialItem.java | 11 ++ .../{ => items}/ExampleMaterialItem.java | 2 +- .../examples/items/ExamplePotionItem.java | 11 ++ .../items/examplehuntincursionitem.png | Bin 0 -> 317 bytes .../items/exampleincursiontablet.png | Bin 0 -> 420 bytes .../resources/items/examplepotionitem.png | Bin 0 -> 601 bytes src/main/resources/locale/en.lang | 11 +- 14 files changed, 269 insertions(+), 5 deletions(-) create mode 100644 art resources/incursiontabletblank.xcf create mode 100644 art resources/potiontemplate.xcf create mode 100644 src/main/java/examplemod/examples/ExampleBiome.java create mode 100644 src/main/java/examplemod/examples/ExampleIncursionBiome.java create mode 100644 src/main/java/examplemod/examples/ExampleIncursionLevel.java create mode 100644 src/main/java/examplemod/examples/items/ExampleHuntIncursionMaterialItem.java rename src/main/java/examplemod/examples/{ => items}/ExampleMaterialItem.java (83%) create mode 100644 src/main/java/examplemod/examples/items/ExamplePotionItem.java create mode 100644 src/main/resources/items/examplehuntincursionitem.png create mode 100644 src/main/resources/items/exampleincursiontablet.png create mode 100644 src/main/resources/items/examplepotionitem.png diff --git a/art resources/incursiontabletblank.xcf b/art resources/incursiontabletblank.xcf new file mode 100644 index 0000000000000000000000000000000000000000..79e665c9f3c118697b2887c8e6bae7ee3aaf77be GIT binary patch literal 4757 zcmeHKO>Y}T7~b)w37gbSw`o8~SQ;-7rwD(AiUyPqHxYFzVG*~f+El%)?XkUzch}k- zmxKdGs8TK*xRe7wgP(vnapFI4MVu>@XnAIL*4dDx3FQDneXYmy%=^AGJM--L&7@=5 zeY)Fh)5oQ9S%Far!M_7^fDnAm0I#imt0)4ntH2mA1-ve~$eV@xSG1Qqm^yFSW{2fF zp4Ea&L7cof@AJJLqrTg-TGuA$+nuJ{bG=Cln-3{9?&PYuwcJhG?ztv6X!%2GJSx55 zvrsBMx^csxrE8e5@i!)n28J`gh{~CF{l3|>oDMCQ@SMFPJ=w_*9E(%SX?B^9oL#rw z_8G^*ke}cYJ(?^8dcO+MHa)k=S_6-*yH4Bc+!;9ew$)?#zSGIG-M;Jbe9!cGENE`t zayavPCI(T*#gm$@-S?R9TdqStLcg)oY0c%eZ(F()E7JH0!kC_~5d~WeBt=_I}VtGQYtBEsdGj6s_ zZb}(b#ii9ueWS;Iq!d5EINL{Y`G0qz`-bra1k%HXsj$1N2CApMjqJx zf=Dc!DB4o-@ZF1Jldub3)S3J-YN!851VMF{=u>b3Q7$iTnGO7==$hNwLsuCGL|F}h ztl+C(;TxqF5PmVnkQ|NjmgK@O&bY`CMuC{Wm*ApY$Nq~6o=)&-aPhp@CP2g(@vL_x zN29zWcmPBDc7n%$8ZN+>u<{HRCMc&f z2jxs=DoAC>6U`@2QW*{Y=kPrV`y`A{gmL0)4@sDFV&6|An#zQ+b8!7(lzUoBHZb3Y zoG-!E4eg;S{YkEezJr-eM&H2BW+s9_n^gjBB6veN30g3tOaXJj5k(fD$bwX4AByZt zMc~^H`%nZt+~qzL*@hy>IkE4j5gjRVCfB#6BB!*ZiutN?z64jR+O{hFNv?;!gLx=Y zg(CA%tmH?>y^s7z*yw~4MeR# z)JiC77RM}$W0nmT)7gW?Y!=5XOP*>&@-&sjG0Q%O?`ha4VH}G>oD4OSggGbnhiODp z*)VnvuA5QrX)UQ?zM7mb!PS~(s?wk2dgwbSXR~?@J1axfo3r)cCPb}cO?B1Q_EbA{ zjFX01Ck@CNwo&}JkJN*$vHG*EdVNb^tbTw7qShg5eJ-df=|Bgj6+K7;Q_5_h{R0fi zEm0Pz1VMXgR8Ki~Z8-i{6*VO`bZAq*9P$yPU;?tDPW=WR8wC-7U6k=x6*aD|uPW-R ziYh92qKYPYvWh18zgkg;sh>`%pHqq&5QRvnsJBP^RZ#?}gs7YsZZ};Atr8cRm%WOL zIsR)`QB^GJ&~)vPj~E3LkcCkfSKZhshyYAqj#@<-5?u*4hN<5pRvoe0hy{YdsKoSL z)?-ca{}rv7{*DO6bvTxL2wztCS4H&fo4?4RKs-g_5U)n`# l!mfymJ(ZBLD{^IFS{y^?%KgxTuc7j@q6M=rfg$-u`4fgD_J05X literal 0 HcmV?d00001 diff --git a/art resources/potiontemplate.xcf b/art resources/potiontemplate.xcf new file mode 100644 index 0000000000000000000000000000000000000000..9862502737b87d34e0da6a845bc5b3cdd56168bb GIT binary patch literal 4318 zcmd5;&u<&Y72erdkv1inW*M1w+ryS=A;&0}QVKL_A=0Rg#t71&rsK4!kRDdtCAH{s zmszg7Bo9(g2I7OD2!s$`%v%9L@WDPP00Cd6OHsfV{R6q`W5?;+vBe~~a)=x06)hMAj`1@sysV` zeOe=4=;W3x!<7xIyr?%2)3hsRks&|&G zT*WZ;T-~bX^k&_5+?=U4+^C?_R}IV69aF_3*|M=y*{;QXTOGaRE-uv;EY&baY20OPpwK^T5tF^? z=&Flqc!s+u-}?B|+mOf0_0G_ltm&?*sjeE9QOwU>Z`Mrtp6>9v6{csEnQ2+K%C?4% z7p6bI`%&)0>FdSBT(q!=BRl7+RoPN&dLjFJ+_myCKkmv6!)@HwozK)--PE(i4`uw# z-N5`W?HAl$v|U@d$=?p2;lV>Chm!N6^Jh+%anvhDvygR-N+l~VIc6cd z=(_da=JQrVQ8jx(S8y=${Bj;m&1Z{q`N8T}I`T!WuJAzRwMCoDpY)y|o1rnb5IEgZ+%->wm{DVqu);>#`xnB>Z#;^K;E(_>f@{ zzBYu%hw#J@o*cqSV7^~8;s87s-|H74#w7flV}^nG-60%(4k);x5p#x|2+9E5Lanh? z;AqGI+%RJQ2xdW85&k96&X0w$&SfFqxg?zHOaZfPsq-UYA~Xu0b7CinSaF*h=}Zbz zM*?QB39J#f6Pi2Nypig zFwWAjl#pb}Gb|OxO$l+9fvpJtNtPJn}2U;}$-f3H~05h77G=W_RChg-D)Ab zpWBb-JlA&$i_D>tL3I1MpXJ%Je!tb)g~n)C(vEdr^fxzKt(_q)qime-g*{`P1H|p_ zw%aIBM3PO?4@z`Wp!h2VJMp7ZQxr5P^tj&)?n`J4MJwWdJ5ua?dkS`qq3`qP`#kzS z&;Cm1kIM7&==(e|$paDSz?`2q%?A(g3uk$4ZEtUXe{F3UefJK&jofdkhrWAcpKOt* zWMA^ocaN>o0Ykl`RnJ4;IkQJJx2*=R~b}P7Ql$l<%(b ztY@&uA$l(xo~LQZ?&tQSInVW-!Xk61WDxB=_p>~Gy0xWgd(ar|O1zlzVryeV)Aon7 zjIwC4$14$24iLAu=XoelM3N1%6_n_tK=D@!cH&2+rYLAoX!IRL;l6~%P_!cMw*!6m z(09-8dkK9nWmv3q^run@Jui{F#1erHzABaO-nFb!>8mMr^v#nel#wUw8??N8^j+wE zN4w~FmoRcjjtLMt-er&IfI;k|ZWkTzVs)SH!+>AsBS#-%kCCZQ!kAHx__CUzW4!}EuG>XnA`(aUkQXPqamwODg^F-c+Bk0j)}p&uFQEYxC6D`MM`yd}Z1)=b z6rb0h_@CI|`^dkM+|t4rqp)N+PhyV4#s@QH34u`xCb09E@gD=CD4P_HNeEv getExtractionItems(IncursionData data) { + return Collections.singleton(ItemRegistry.getItem("tungstenore")); + } + + /** + * Loot dropped from mobs during hunt-type incursion objectives. + * This example returns a custom item to demonstrate adding new drops. + */ + @Override + public LootTable getHuntDrop(IncursionData incursionData) { + return new LootTable(new LootItemInterface[] { + (LootItemInterface) new ChanceLootItem(0.66F, "examplehuntincursionitem") + }); + } + + // Defines which incursion types are available and their relative chances + @Override + public TicketSystemList> getAvailableIncursions(int tabletTier, IncursionData incursionData) { + TicketSystemList> system = new TicketSystemList(); + + // Base ticket weights for each incursion type + int huntTickets = 100; + int extractionTickets = 100; + + // Apply modifiers from the previous incursion, if present + if (incursionData != null) { + huntTickets = (int)(huntTickets * ((Float)incursionData.nextIncursionModifiers + .getModifier(IncursionDataModifiers.MODIFIER_HUNT_DROPS)).floatValue()); + extractionTickets = (int)(extractionTickets * ((Float)incursionData.nextIncursionModifiers + .getModifier(IncursionDataModifiers.MODIFIER_EXTRACTION_DROPS)).floatValue()); + } + + // Register hunt and extraction incursions with their calculated weights + system.addObject(huntTickets, () -> new BiomeHuntIncursionData(1.0F, this, tabletTier)); + system.addObject(extractionTickets, () -> new BiomeExtractionIncursionData(1.0F, this, tabletTier)); + return system; + } + + // Creates a new incursion level instance when players enter through the fallen altar + @Override + public IncursionLevel getNewIncursionLevel(FallenAltarObjectEntity altar, LevelIdentifier identifier, + BiomeMissionIncursionData incursion, Server server, + WorldEntity world, AltarData altarData) { + return new ExampleIncursionLevel(identifier, incursion, world, altarData); + } + + /** + * Colors used for the glowing gateway lights on the fallen altar. + * IncursionBiome requires this method; at least 4 colors are needed. + */ + @Override + public ArrayList getFallenAltarGatewayColorsForBiome() { + ArrayList colors = new ArrayList<>(); + // Repeat colors to satisfy the altar rendering requirements + colors.add(new Color(181, 80, 120)); + colors.add(new Color(215, 42, 52)); + colors.add(new Color(181, 92, 59)); + colors.add(new Color(181, 80, 120)); + colors.add(new Color(215, 42, 52)); + colors.add(new Color(181, 92, 59)); + return colors; + } +} diff --git a/src/main/java/examplemod/examples/ExampleIncursionLevel.java b/src/main/java/examplemod/examples/ExampleIncursionLevel.java new file mode 100644 index 0000000..8835d6d --- /dev/null +++ b/src/main/java/examplemod/examples/ExampleIncursionLevel.java @@ -0,0 +1,87 @@ +package examplemod.examples; + +import necesse.engine.GameEvents; +import necesse.engine.events.GameEvent; +import necesse.engine.events.PreventableGameEvent; +import necesse.engine.events.worldGeneration.GenerateCaveLayoutEvent; +import necesse.engine.events.worldGeneration.GeneratedCaveOresEvent; +import necesse.engine.registries.BiomeRegistry; +import necesse.engine.registries.ObjectRegistry; +import necesse.engine.util.LevelIdentifier; +import necesse.engine.world.WorldEntity; +import necesse.level.maps.IncursionLevel; +import necesse.level.maps.Level; +import necesse.level.maps.generationModules.CaveGeneration; +import necesse.level.maps.generationModules.PresetGeneration; +import necesse.level.maps.incursion.AltarData; +import necesse.level.maps.incursion.BiomeExtractionIncursionData; +import necesse.level.maps.incursion.BiomeMissionIncursionData; +import necesse.level.maps.incursion.IncursionBiome; + +/** + * Example incursion level. + * Demonstrates what is required for a working incursion: + * cave generation, entrance creation, and ore placement. + */ +public class ExampleIncursionLevel extends IncursionLevel { + + /** + * this constructor has to be formed in this way and present otherwise the game wont register the level to the registry + */ + public ExampleIncursionLevel(LevelIdentifier identifier, int width, int height, WorldEntity worldEntity) { + super(identifier, width, height, worldEntity); + this.baseBiome = BiomeRegistry.getBiome("exampleincursion"); + this.isCave = true; + } + + /** + * Constructor used when an incursion is entered. + * Creates a fixed-size level and immediately generates its contents. + */ + public ExampleIncursionLevel(LevelIdentifier identifier, BiomeMissionIncursionData incursionData, WorldEntity worldEntity, AltarData altarData) { + super(identifier, 150, 150, incursionData, worldEntity); + this.baseBiome = BiomeRegistry.getBiome("exampleincursion"); + this.isCave = true; + generateLevel(incursionData, altarData); + } + + public void generateLevel(BiomeMissionIncursionData incursionData, AltarData altarData) { + + // Create the cave generator using deep rock tiles for floors and walls + CaveGeneration cg = new CaveGeneration(this, "deeprocktile", "deeprock"); + + // Seed the generator so this incursion layout is deterministic per mission + cg.random.setSeed(incursionData.getUniqueID()); + + // Fire the cave layout generation event, allowing mods or perks to modify + // or cancel cave generation before the default logic runs + GameEvents.triggerEvent( + (PreventableGameEvent) new GenerateCaveLayoutEvent(this, cg), + e -> cg.generateLevel(0.38F, 4, 3, 6) + ); + + // Used to reserve space so later generation steps avoid overwriting the entrance + PresetGeneration entranceAndPerkPresets = new PresetGeneration(this); + + // Generate a incursion entrance that clears terrain, + // blends edges, reserves space, and places the return portal + IncursionBiome.generateEntrance( + this, + entranceAndPerkPresets, + cg.random, + 32, + cg.rockTile, + "exampletile", + "exampletile", + "exampleobject" + ); + + // For extraction incursions, guarantee tungsten ore veins for objectives + if (incursionData instanceof BiomeExtractionIncursionData) { + cg.generateGuaranteedOreVeins(40, 4, 8, ObjectRegistry.getObjectID("tungstenoredeeprock")); + } + + // Notify listeners that cave ore generation has completed + GameEvents.triggerEvent((GameEvent) new GeneratedCaveOresEvent((Level) this, cg)); + } +} \ No newline at end of file diff --git a/src/main/java/examplemod/examples/items/ExampleHuntIncursionMaterialItem.java b/src/main/java/examplemod/examples/items/ExampleHuntIncursionMaterialItem.java new file mode 100644 index 0000000..8c15c37 --- /dev/null +++ b/src/main/java/examplemod/examples/items/ExampleHuntIncursionMaterialItem.java @@ -0,0 +1,11 @@ +package examplemod.examples.items; + +import necesse.inventory.item.matItem.MatItem; + +public class ExampleHuntIncursionMaterialItem extends MatItem { + + public ExampleHuntIncursionMaterialItem() { + super(100, Rarity.RARE); + } + +} diff --git a/src/main/java/examplemod/examples/ExampleMaterialItem.java b/src/main/java/examplemod/examples/items/ExampleMaterialItem.java similarity index 83% rename from src/main/java/examplemod/examples/ExampleMaterialItem.java rename to src/main/java/examplemod/examples/items/ExampleMaterialItem.java index 347d2f2..a20ddb6 100644 --- a/src/main/java/examplemod/examples/ExampleMaterialItem.java +++ b/src/main/java/examplemod/examples/items/ExampleMaterialItem.java @@ -1,4 +1,4 @@ -package examplemod.examples; +package examplemod.examples.items; import necesse.inventory.item.matItem.MatItem; diff --git a/src/main/java/examplemod/examples/items/ExamplePotionItem.java b/src/main/java/examplemod/examples/items/ExamplePotionItem.java new file mode 100644 index 0000000..87dcd4d --- /dev/null +++ b/src/main/java/examplemod/examples/items/ExamplePotionItem.java @@ -0,0 +1,11 @@ +package examplemod.examples.items; +import necesse.inventory.item.Item; +import necesse.inventory.item.placeableItem.consumableItem.potionConsumableItem.SimplePotionItem; +import examplemod.examples.ExampleBuff; + +public class ExamplePotionItem extends SimplePotionItem { + public ExamplePotionItem() { + super(100,Rarity.COMMON,"examplebuff",100, new String[] { "examplepotionitemtip" }); + } + +} \ No newline at end of file diff --git a/src/main/resources/items/examplehuntincursionitem.png b/src/main/resources/items/examplehuntincursionitem.png new file mode 100644 index 0000000000000000000000000000000000000000..d05149eae91a7340817c289fbc42e783a908097f GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%C&rs6b?Si}mUKs7M+SzC z{oH>NSwSk3J%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6MiAk#PtJR*x37`TN&n2}-D90{Nxdx@v7EBh-(HYPJYQ@=HTfI^L)E{-7) zhm#W|Se0cB9!>o1&%b*HTQbL=^n`?j6%U1%ta8mdKI;Vst065QL-T(jq literal 0 HcmV?d00001 diff --git a/src/main/resources/items/exampleincursiontablet.png b/src/main/resources/items/exampleincursiontablet.png new file mode 100644 index 0000000000000000000000000000000000000000..5e6bfd2602798970135ff179aac3c0a403f1b178 GIT binary patch literal 420 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%C&rs6b?Si}mUKs7M+SzC z{oH>NSwSk3J%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6MiAk#PtJR*x37`TN&n2}-D90{Nxdx@v7EBh-(CIKaufZ0K2K%p0&E{-7) zhm#W|UN%gez!VvI^#2oyKR-U!x+PsP=(@YBY2bxR`ZB}D(V`Ruqh$(OSX~hKeGlQqApUXO@geCyw3z8xL literal 0 HcmV?d00001 diff --git a/src/main/resources/items/examplepotionitem.png b/src/main/resources/items/examplepotionitem.png new file mode 100644 index 0000000000000000000000000000000000000000..c7eeadda6cea4e288485044439d9a6f225da76a5 GIT binary patch literal 601 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%C&rs6b?Si}mUKs7M+SzC z{oH>NSwSk3J%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-G$*2g9^jfA5ZIF0!26rJR*x37`TN&n2}-D90{Nxdx@v7EBh-(b|Fs5!tKv*0bMZH z)5S3);&5_;#LI?>F}<#VjsGY9tUY~ga;n(n3EYe`&R4d~kdy!dkta()l*GE23ZF0! zo(hf)6IMAM(V5r?1P3pkoerWO?w4@+b9B;Kfn%G#@*LJ?S#>IX(UP)uiH`H~#r?jy!)+Gh^wJCERK?h5X(1F?Pq&1b0c86>E4gKlw4~Rp$qw zjjXzyLYo&}@?O}e$tkFM(^*58|9SbJ$litfnp8!cWurPh(n@)_U;XFr{37ghH(oC7 zk~4$m{D0{Q2?-zWPCtDB2tM2^G?I&7+$yK7+y%%owfL6f0I`zr9npYMBmTz zhdlPWaCAE#{5wOjQI{p*6~|FqU+0EZYm>f+30D1Puw9an`foy};KZ1D3)?y7#h92x d9bL@8VBy*Qyz)#=GBEBKJYD@<);T3K0RT8=>7M`q literal 0 HcmV?d00001 diff --git a/src/main/resources/locale/en.lang b/src/main/resources/locale/en.lang index 741a504..9b9f320 100644 --- a/src/main/resources/locale/en.lang +++ b/src/main/resources/locale/en.lang @@ -6,14 +6,23 @@ exampleobject=Example Object [item] exampleitem=Example Item +examplehuntincursionitem=Example Hunt Incursion Item +examplepotionitem=Example Potion examplesword=Example Sword examplestaff=Example Staff [itemtooltip] examplestafftip=Shoots a homing, piercing projectile +examplepotionitemtip= An example potion [mob] examplemob=Example Mob [buff] -examplebuff=Example Buff \ No newline at end of file +examplebuff=Example Buff + +[biome] +exampleincursion=Example Incursion + +[incursion] +exampleincursion=Example Incursion \ No newline at end of file From e43e4c55345ea9d1ca7a4dfe2d72ec25cdd0c727 Mon Sep 17 00:00:00 2001 From: Jamesp1989SL Date: Wed, 7 Jan 2026 19:39:58 +0000 Subject: [PATCH 2/4] Remove unused XCF art resources Deleted incursiontabletblank.xcf and potiontemplate.xcf from the art resources directory as they are no longer needed. --- art resources/incursiontabletblank.xcf | Bin 4757 -> 0 bytes art resources/potiontemplate.xcf | Bin 4318 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 art resources/incursiontabletblank.xcf delete mode 100644 art resources/potiontemplate.xcf diff --git a/art resources/incursiontabletblank.xcf b/art resources/incursiontabletblank.xcf deleted file mode 100644 index 79e665c9f3c118697b2887c8e6bae7ee3aaf77be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4757 zcmeHKO>Y}T7~b)w37gbSw`o8~SQ;-7rwD(AiUyPqHxYFzVG*~f+El%)?XkUzch}k- zmxKdGs8TK*xRe7wgP(vnapFI4MVu>@XnAIL*4dDx3FQDneXYmy%=^AGJM--L&7@=5 zeY)Fh)5oQ9S%Far!M_7^fDnAm0I#imt0)4ntH2mA1-ve~$eV@xSG1Qqm^yFSW{2fF zp4Ea&L7cof@AJJLqrTg-TGuA$+nuJ{bG=Cln-3{9?&PYuwcJhG?ztv6X!%2GJSx55 zvrsBMx^csxrE8e5@i!)n28J`gh{~CF{l3|>oDMCQ@SMFPJ=w_*9E(%SX?B^9oL#rw z_8G^*ke}cYJ(?^8dcO+MHa)k=S_6-*yH4Bc+!;9ew$)?#zSGIG-M;Jbe9!cGENE`t zayavPCI(T*#gm$@-S?R9TdqStLcg)oY0c%eZ(F()E7JH0!kC_~5d~WeBt=_I}VtGQYtBEsdGj6s_ zZb}(b#ii9ueWS;Iq!d5EINL{Y`G0qz`-bra1k%HXsj$1N2CApMjqJx zf=Dc!DB4o-@ZF1Jldub3)S3J-YN!851VMF{=u>b3Q7$iTnGO7==$hNwLsuCGL|F}h ztl+C(;TxqF5PmVnkQ|NjmgK@O&bY`CMuC{Wm*ApY$Nq~6o=)&-aPhp@CP2g(@vL_x zN29zWcmPBDc7n%$8ZN+>u<{HRCMc&f z2jxs=DoAC>6U`@2QW*{Y=kPrV`y`A{gmL0)4@sDFV&6|An#zQ+b8!7(lzUoBHZb3Y zoG-!E4eg;S{YkEezJr-eM&H2BW+s9_n^gjBB6veN30g3tOaXJj5k(fD$bwX4AByZt zMc~^H`%nZt+~qzL*@hy>IkE4j5gjRVCfB#6BB!*ZiutN?z64jR+O{hFNv?;!gLx=Y zg(CA%tmH?>y^s7z*yw~4MeR# z)JiC77RM}$W0nmT)7gW?Y!=5XOP*>&@-&sjG0Q%O?`ha4VH}G>oD4OSggGbnhiODp z*)VnvuA5QrX)UQ?zM7mb!PS~(s?wk2dgwbSXR~?@J1axfo3r)cCPb}cO?B1Q_EbA{ zjFX01Ck@CNwo&}JkJN*$vHG*EdVNb^tbTw7qShg5eJ-df=|Bgj6+K7;Q_5_h{R0fi zEm0Pz1VMXgR8Ki~Z8-i{6*VO`bZAq*9P$yPU;?tDPW=WR8wC-7U6k=x6*aD|uPW-R ziYh92qKYPYvWh18zgkg;sh>`%pHqq&5QRvnsJBP^RZ#?}gs7YsZZ};Atr8cRm%WOL zIsR)`QB^GJ&~)vPj~E3LkcCkfSKZhshyYAqj#@<-5?u*4hN<5pRvoe0hy{YdsKoSL z)?-ca{}rv7{*DO6bvTxL2wztCS4H&fo4?4RKs-g_5U)n`# l!mfymJ(ZBLD{^IFS{y^?%KgxTuc7j@q6M=rfg$-u`4fgD_J05X diff --git a/art resources/potiontemplate.xcf b/art resources/potiontemplate.xcf deleted file mode 100644 index 9862502737b87d34e0da6a845bc5b3cdd56168bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4318 zcmd5;&u<&Y72erdkv1inW*M1w+ryS=A;&0}QVKL_A=0Rg#t71&rsK4!kRDdtCAH{s zmszg7Bo9(g2I7OD2!s$`%v%9L@WDPP00Cd6OHsfV{R6q`W5?;+vBe~~a)=x06)hMAj`1@sysV` zeOe=4=;W3x!<7xIyr?%2)3hsRks&|&G zT*WZ;T-~bX^k&_5+?=U4+^C?_R}IV69aF_3*|M=y*{;QXTOGaRE-uv;EY&baY20OPpwK^T5tF^? z=&Flqc!s+u-}?B|+mOf0_0G_ltm&?*sjeE9QOwU>Z`Mrtp6>9v6{csEnQ2+K%C?4% z7p6bI`%&)0>FdSBT(q!=BRl7+RoPN&dLjFJ+_myCKkmv6!)@HwozK)--PE(i4`uw# z-N5`W?HAl$v|U@d$=?p2;lV>Chm!N6^Jh+%anvhDvygR-N+l~VIc6cd z=(_da=JQrVQ8jx(S8y=${Bj;m&1Z{q`N8T}I`T!WuJAzRwMCoDpY)y|o1rnb5IEgZ+%->wm{DVqu);>#`xnB>Z#;^K;E(_>f@{ zzBYu%hw#J@o*cqSV7^~8;s87s-|H74#w7flV}^nG-60%(4k);x5p#x|2+9E5Lanh? z;AqGI+%RJQ2xdW85&k96&X0w$&SfFqxg?zHOaZfPsq-UYA~Xu0b7CinSaF*h=}Zbz zM*?QB39J#f6Pi2Nypig zFwWAjl#pb}Gb|OxO$l+9fvpJtNtPJn}2U;}$-f3H~05h77G=W_RChg-D)Ab zpWBb-JlA&$i_D>tL3I1MpXJ%Je!tb)g~n)C(vEdr^fxzKt(_q)qime-g*{`P1H|p_ zw%aIBM3PO?4@z`Wp!h2VJMp7ZQxr5P^tj&)?n`J4MJwWdJ5ua?dkS`qq3`qP`#kzS z&;Cm1kIM7&==(e|$paDSz?`2q%?A(g3uk$4ZEtUXe{F3UefJK&jofdkhrWAcpKOt* zWMA^ocaN>o0Ykl`RnJ4;IkQJJx2*=R~b}P7Ql$l<%(b ztY@&uA$l(xo~LQZ?&tQSInVW-!Xk61WDxB=_p>~Gy0xWgd(ar|O1zlzVryeV)Aon7 zjIwC4$14$24iLAu=XoelM3N1%6_n_tK=D@!cH&2+rYLAoX!IRL;l6~%P_!cMw*!6m z(09-8dkK9nWmv3q^run@Jui{F#1erHzABaO-nFb!>8mMr^v#nel#wUw8??N8^j+wE zN4w~FmoRcjjtLMt-er&IfI;k|ZWkTzVs)SH!+>AsBS#-%kCCZQ!kAHx__CUzW4!}EuG>XnA`(aUkQXPqamwODg^F-c+Bk0j)}p&uFQEYxC6D`MM`yd}Z1)=b z6rb0h_@CI|`^dkM+|t4rqp)N+PhyV4#s@QH34u`xCb09E@gD=CD4P_HNeEv Date: Fri, 16 Jan 2026 03:35:36 +0000 Subject: [PATCH 3/4] initial commit --- src/main/java/examplemod/ExampleMod.java | 16 ++- .../examplemod/examples/ExampleBiome.java | 34 ++++++ .../examples/ExampleIncursionBiome.java | 98 ++++++++++++++++++ .../examples/ExampleIncursionLevel.java | 87 ++++++++++++++++ .../ExampleHuntIncursionMaterialItem.java | 11 ++ .../examples/items/ExampleMaterialItem.java | 11 ++ .../examples/items/ExamplePotionItem.java | 11 ++ .../items/examplehuntincursionitem.png | Bin 0 -> 317 bytes .../items/exampleincursiontablet.png | Bin 0 -> 420 bytes .../resources/items/examplepotionitem.png | Bin 0 -> 601 bytes src/main/resources/locale/en.lang | 11 +- 11 files changed, 277 insertions(+), 2 deletions(-) create mode 100644 src/main/java/examplemod/examples/ExampleBiome.java create mode 100644 src/main/java/examplemod/examples/ExampleIncursionBiome.java create mode 100644 src/main/java/examplemod/examples/ExampleIncursionLevel.java create mode 100644 src/main/java/examplemod/examples/items/ExampleHuntIncursionMaterialItem.java create mode 100644 src/main/java/examplemod/examples/items/ExampleMaterialItem.java create mode 100644 src/main/java/examplemod/examples/items/ExamplePotionItem.java create mode 100644 src/main/resources/items/examplehuntincursionitem.png create mode 100644 src/main/resources/items/exampleincursiontablet.png create mode 100644 src/main/resources/items/examplepotionitem.png diff --git a/src/main/java/examplemod/ExampleMod.java b/src/main/java/examplemod/ExampleMod.java index 349a9e3..9ca66a4 100644 --- a/src/main/java/examplemod/ExampleMod.java +++ b/src/main/java/examplemod/ExampleMod.java @@ -1,5 +1,6 @@ package examplemod; + import examplemod.examples.*; import necesse.engine.commands.CommandsManager; import necesse.engine.modLoader.annotations.ModEntry; @@ -9,6 +10,7 @@ import necesse.inventory.recipe.Recipe; import necesse.inventory.recipe.Recipes; import necesse.level.maps.biomes.Biome; +import examplemod.examples.items.*; @ModEntry public class ExampleMod { @@ -16,6 +18,13 @@ public class ExampleMod { public void init() { System.out.println("Hello world from my example mod!"); + // Register a simple biome that will not appear in natural world gen. + BiomeRegistry.registerBiome("exampleincursion", new ExampleBiome(), false); + // Register the incursion biome with tier requirement 1. + IncursionBiomeRegistry.registerBiome("exampleincursion", new ExampleIncursionBiome(), 1); + // Register the level class used for the incursion. + LevelRegistry.registerLevel("exampleincursionlevel", ExampleIncursionLevel.class); + // Register our tiles TileRegistry.registerTile("exampletile", new ExampleTile(), 1, true); @@ -24,8 +33,11 @@ public void init() { // Register our items ItemRegistry.registerItem("exampleitem", new ExampleMaterialItem(), 10, true); + ItemRegistry.registerItem("examplehuntincursionitem", new ExampleHuntIncursionMaterialItem(), 50, true); ItemRegistry.registerItem("examplesword", new ExampleSwordItem(), 20, true); ItemRegistry.registerItem("examplestaff", new ExampleProjectileWeapon(), 30, true); + ItemRegistry.registerItem("examplepotionitem", new ExamplePotionItem(), 10, true); + // Register our mob MobRegistry.registerMob("examplemob", ExampleMob.class, true); @@ -37,6 +49,8 @@ public void init() { BuffRegistry.registerBuff("examplebuff", new ExampleBuff()); PacketRegistry.registerPacket(ExamplePacket.class); + + } public void initResources() { @@ -80,7 +94,7 @@ public void postInit() { } ).showAfter("exampleitem")); // Show the recipe after example item recipe - // Add out example mob to default cave mobs. + // Add our example mob to default cave mobs. // Spawn tables use a ticket/weight system. In general, common mobs have about 100 tickets. Biome.defaultCaveMobs .add(100, "examplemob"); diff --git a/src/main/java/examplemod/examples/ExampleBiome.java b/src/main/java/examplemod/examples/ExampleBiome.java new file mode 100644 index 0000000..7b2516c --- /dev/null +++ b/src/main/java/examplemod/examples/ExampleBiome.java @@ -0,0 +1,34 @@ +package examplemod.examples; + +import necesse.engine.AbstractMusicList; +import necesse.engine.MusicList; +import necesse.engine.registries.MusicRegistry; +import necesse.entity.mobs.PlayerMob; +import necesse.level.maps.Level; +import necesse.level.maps.biomes.Biome; +import necesse.level.maps.biomes.MobSpawnTable; + +// A minimalist biome used solely for the ExampleIncursion +// the Example Mob is used here as the spawn +public class ExampleBiome extends Biome { + public static MobSpawnTable critters = (new MobSpawnTable()) + .include(Biome.defaultCaveCritters); + public static MobSpawnTable mobs = new MobSpawnTable() + .add(100,"examplemob"); + + @Override + public AbstractMusicList getLevelMusic(Level level, PlayerMob perspective) { + return new MusicList(MusicRegistry.ForestPath); + } + + @Override + public MobSpawnTable getCritterSpawnTable(Level level) { + return critters; + } + + @Override + public MobSpawnTable getMobSpawnTable(Level level) { + + return mobs; + } +} \ No newline at end of file diff --git a/src/main/java/examplemod/examples/ExampleIncursionBiome.java b/src/main/java/examplemod/examples/ExampleIncursionBiome.java new file mode 100644 index 0000000..8d42083 --- /dev/null +++ b/src/main/java/examplemod/examples/ExampleIncursionBiome.java @@ -0,0 +1,98 @@ +package examplemod.examples; + +import necesse.engine.network.server.Server; +import necesse.engine.registries.ItemRegistry; +import necesse.engine.util.LevelIdentifier; +import necesse.engine.util.TicketSystemList; +import necesse.engine.world.WorldEntity; +import necesse.entity.objectEntity.FallenAltarObjectEntity; +import necesse.inventory.item.Item; +import necesse.inventory.lootTable.LootItemInterface; +import necesse.inventory.lootTable.lootItem.ChanceLootItem; +import necesse.level.maps.IncursionLevel; +import necesse.level.maps.incursion.*; +import necesse.inventory.lootTable.LootTable; + +import java.util.Collection; +import java.util.Collections; +import java.util.function.Supplier; +import java.awt.Color; +import java.util.ArrayList; + +/** + * An example incursion biome. + * This class defines how the incursion behaves: rewards, available objectives, + * altar appearance, and which level class is used. + */ +public class ExampleIncursionBiome extends IncursionBiome { + + // String ID passed to the IncursionBiome base class + public ExampleIncursionBiome() { + super("reaper"); + } + + // Items required to be obtained when completing an extraction objective in this incursion + @Override + public Collection getExtractionItems(IncursionData data) { + return Collections.singleton(ItemRegistry.getItem("tungstenore")); + } + + /** + * Loot dropped from mobs during hunt-type incursion objectives. + * This example returns a custom item to demonstrate adding new drops. + */ + @Override + public LootTable getHuntDrop(IncursionData incursionData) { + return new LootTable(new LootItemInterface[] { + (LootItemInterface) new ChanceLootItem(0.66F, "examplehuntincursionitem") + }); + } + + // Defines which incursion types are available and their relative chances + @Override + public TicketSystemList> getAvailableIncursions(int tabletTier, IncursionData incursionData) { + TicketSystemList> system = new TicketSystemList(); + + // Base ticket weights for each incursion type + int huntTickets = 100; + int extractionTickets = 100; + + // Apply modifiers from the previous incursion, if present + if (incursionData != null) { + huntTickets = (int)(huntTickets * ((Float)incursionData.nextIncursionModifiers + .getModifier(IncursionDataModifiers.MODIFIER_HUNT_DROPS)).floatValue()); + extractionTickets = (int)(extractionTickets * ((Float)incursionData.nextIncursionModifiers + .getModifier(IncursionDataModifiers.MODIFIER_EXTRACTION_DROPS)).floatValue()); + } + + // Register hunt and extraction incursions with their calculated weights + system.addObject(huntTickets, () -> new BiomeHuntIncursionData(1.0F, this, tabletTier)); + system.addObject(extractionTickets, () -> new BiomeExtractionIncursionData(1.0F, this, tabletTier)); + return system; + } + + // Creates a new incursion level instance when players enter through the fallen altar + @Override + public IncursionLevel getNewIncursionLevel(FallenAltarObjectEntity altar, LevelIdentifier identifier, + BiomeMissionIncursionData incursion, Server server, + WorldEntity world, AltarData altarData) { + return new ExampleIncursionLevel(identifier, incursion, world, altarData); + } + + /** + * Colors used for the glowing gateway lights on the fallen altar. + * IncursionBiome requires this method; at least 4 colors are needed. + */ + @Override + public ArrayList getFallenAltarGatewayColorsForBiome() { + ArrayList colors = new ArrayList<>(); + // Repeat colors to satisfy the altar rendering requirements + colors.add(new Color(181, 80, 120)); + colors.add(new Color(215, 42, 52)); + colors.add(new Color(181, 92, 59)); + colors.add(new Color(181, 80, 120)); + colors.add(new Color(215, 42, 52)); + colors.add(new Color(181, 92, 59)); + return colors; + } +} diff --git a/src/main/java/examplemod/examples/ExampleIncursionLevel.java b/src/main/java/examplemod/examples/ExampleIncursionLevel.java new file mode 100644 index 0000000..8835d6d --- /dev/null +++ b/src/main/java/examplemod/examples/ExampleIncursionLevel.java @@ -0,0 +1,87 @@ +package examplemod.examples; + +import necesse.engine.GameEvents; +import necesse.engine.events.GameEvent; +import necesse.engine.events.PreventableGameEvent; +import necesse.engine.events.worldGeneration.GenerateCaveLayoutEvent; +import necesse.engine.events.worldGeneration.GeneratedCaveOresEvent; +import necesse.engine.registries.BiomeRegistry; +import necesse.engine.registries.ObjectRegistry; +import necesse.engine.util.LevelIdentifier; +import necesse.engine.world.WorldEntity; +import necesse.level.maps.IncursionLevel; +import necesse.level.maps.Level; +import necesse.level.maps.generationModules.CaveGeneration; +import necesse.level.maps.generationModules.PresetGeneration; +import necesse.level.maps.incursion.AltarData; +import necesse.level.maps.incursion.BiomeExtractionIncursionData; +import necesse.level.maps.incursion.BiomeMissionIncursionData; +import necesse.level.maps.incursion.IncursionBiome; + +/** + * Example incursion level. + * Demonstrates what is required for a working incursion: + * cave generation, entrance creation, and ore placement. + */ +public class ExampleIncursionLevel extends IncursionLevel { + + /** + * this constructor has to be formed in this way and present otherwise the game wont register the level to the registry + */ + public ExampleIncursionLevel(LevelIdentifier identifier, int width, int height, WorldEntity worldEntity) { + super(identifier, width, height, worldEntity); + this.baseBiome = BiomeRegistry.getBiome("exampleincursion"); + this.isCave = true; + } + + /** + * Constructor used when an incursion is entered. + * Creates a fixed-size level and immediately generates its contents. + */ + public ExampleIncursionLevel(LevelIdentifier identifier, BiomeMissionIncursionData incursionData, WorldEntity worldEntity, AltarData altarData) { + super(identifier, 150, 150, incursionData, worldEntity); + this.baseBiome = BiomeRegistry.getBiome("exampleincursion"); + this.isCave = true; + generateLevel(incursionData, altarData); + } + + public void generateLevel(BiomeMissionIncursionData incursionData, AltarData altarData) { + + // Create the cave generator using deep rock tiles for floors and walls + CaveGeneration cg = new CaveGeneration(this, "deeprocktile", "deeprock"); + + // Seed the generator so this incursion layout is deterministic per mission + cg.random.setSeed(incursionData.getUniqueID()); + + // Fire the cave layout generation event, allowing mods or perks to modify + // or cancel cave generation before the default logic runs + GameEvents.triggerEvent( + (PreventableGameEvent) new GenerateCaveLayoutEvent(this, cg), + e -> cg.generateLevel(0.38F, 4, 3, 6) + ); + + // Used to reserve space so later generation steps avoid overwriting the entrance + PresetGeneration entranceAndPerkPresets = new PresetGeneration(this); + + // Generate a incursion entrance that clears terrain, + // blends edges, reserves space, and places the return portal + IncursionBiome.generateEntrance( + this, + entranceAndPerkPresets, + cg.random, + 32, + cg.rockTile, + "exampletile", + "exampletile", + "exampleobject" + ); + + // For extraction incursions, guarantee tungsten ore veins for objectives + if (incursionData instanceof BiomeExtractionIncursionData) { + cg.generateGuaranteedOreVeins(40, 4, 8, ObjectRegistry.getObjectID("tungstenoredeeprock")); + } + + // Notify listeners that cave ore generation has completed + GameEvents.triggerEvent((GameEvent) new GeneratedCaveOresEvent((Level) this, cg)); + } +} \ No newline at end of file diff --git a/src/main/java/examplemod/examples/items/ExampleHuntIncursionMaterialItem.java b/src/main/java/examplemod/examples/items/ExampleHuntIncursionMaterialItem.java new file mode 100644 index 0000000..8c15c37 --- /dev/null +++ b/src/main/java/examplemod/examples/items/ExampleHuntIncursionMaterialItem.java @@ -0,0 +1,11 @@ +package examplemod.examples.items; + +import necesse.inventory.item.matItem.MatItem; + +public class ExampleHuntIncursionMaterialItem extends MatItem { + + public ExampleHuntIncursionMaterialItem() { + super(100, Rarity.RARE); + } + +} diff --git a/src/main/java/examplemod/examples/items/ExampleMaterialItem.java b/src/main/java/examplemod/examples/items/ExampleMaterialItem.java new file mode 100644 index 0000000..a20ddb6 --- /dev/null +++ b/src/main/java/examplemod/examples/items/ExampleMaterialItem.java @@ -0,0 +1,11 @@ +package examplemod.examples.items; + +import necesse.inventory.item.matItem.MatItem; + +public class ExampleMaterialItem extends MatItem { + + public ExampleMaterialItem() { + super(100, Rarity.UNCOMMON); + } + +} diff --git a/src/main/java/examplemod/examples/items/ExamplePotionItem.java b/src/main/java/examplemod/examples/items/ExamplePotionItem.java new file mode 100644 index 0000000..87dcd4d --- /dev/null +++ b/src/main/java/examplemod/examples/items/ExamplePotionItem.java @@ -0,0 +1,11 @@ +package examplemod.examples.items; +import necesse.inventory.item.Item; +import necesse.inventory.item.placeableItem.consumableItem.potionConsumableItem.SimplePotionItem; +import examplemod.examples.ExampleBuff; + +public class ExamplePotionItem extends SimplePotionItem { + public ExamplePotionItem() { + super(100,Rarity.COMMON,"examplebuff",100, new String[] { "examplepotionitemtip" }); + } + +} \ No newline at end of file diff --git a/src/main/resources/items/examplehuntincursionitem.png b/src/main/resources/items/examplehuntincursionitem.png new file mode 100644 index 0000000000000000000000000000000000000000..d05149eae91a7340817c289fbc42e783a908097f GIT binary patch literal 317 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%C&rs6b?Si}mUKs7M+SzC z{oH>NSwSk3J%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6MiAk#PtJR*x37`TN&n2}-D90{Nxdx@v7EBh-(HYPJYQ@=HTfI^L)E{-7) zhm#W|Se0cB9!>o1&%b*HTQbL=^n`?j6%U1%ta8mdKI;Vst065QL-T(jq literal 0 HcmV?d00001 diff --git a/src/main/resources/items/exampleincursiontablet.png b/src/main/resources/items/exampleincursiontablet.png new file mode 100644 index 0000000000000000000000000000000000000000..5e6bfd2602798970135ff179aac3c0a403f1b178 GIT binary patch literal 420 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%C&rs6b?Si}mUKs7M+SzC z{oH>NSwSk3J%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6MiAk#PtJR*x37`TN&n2}-D90{Nxdx@v7EBh-(CIKaufZ0K2K%p0&E{-7) zhm#W|UN%gez!VvI^#2oyKR-U!x+PsP=(@YBY2bxR`ZB}D(V`Ruqh$(OSX~hKeGlQqApUXO@geCyw3z8xL literal 0 HcmV?d00001 diff --git a/src/main/resources/items/examplepotionitem.png b/src/main/resources/items/examplepotionitem.png new file mode 100644 index 0000000000000000000000000000000000000000..c7eeadda6cea4e288485044439d9a6f225da76a5 GIT binary patch literal 601 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%C&rs6b?Si}mUKs7M+SzC z{oH>NSwSk3J%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-G$*2g9^jfA5ZIF0!26rJR*x37`TN&n2}-D90{Nxdx@v7EBh-(b|Fs5!tKv*0bMZH z)5S3);&5_;#LI?>F}<#VjsGY9tUY~ga;n(n3EYe`&R4d~kdy!dkta()l*GE23ZF0! zo(hf)6IMAM(V5r?1P3pkoerWO?w4@+b9B;Kfn%G#@*LJ?S#>IX(UP)uiH`H~#r?jy!)+Gh^wJCERK?h5X(1F?Pq&1b0c86>E4gKlw4~Rp$qw zjjXzyLYo&}@?O}e$tkFM(^*58|9SbJ$litfnp8!cWurPh(n@)_U;XFr{37ghH(oC7 zk~4$m{D0{Q2?-zWPCtDB2tM2^G?I&7+$yK7+y%%owfL6f0I`zr9npYMBmTz zhdlPWaCAE#{5wOjQI{p*6~|FqU+0EZYm>f+30D1Puw9an`foy};KZ1D3)?y7#h92x d9bL@8VBy*Qyz)#=GBEBKJYD@<);T3K0RT8=>7M`q literal 0 HcmV?d00001 diff --git a/src/main/resources/locale/en.lang b/src/main/resources/locale/en.lang index 741a504..9b9f320 100644 --- a/src/main/resources/locale/en.lang +++ b/src/main/resources/locale/en.lang @@ -6,14 +6,23 @@ exampleobject=Example Object [item] exampleitem=Example Item +examplehuntincursionitem=Example Hunt Incursion Item +examplepotionitem=Example Potion examplesword=Example Sword examplestaff=Example Staff [itemtooltip] examplestafftip=Shoots a homing, piercing projectile +examplepotionitemtip= An example potion [mob] examplemob=Example Mob [buff] -examplebuff=Example Buff \ No newline at end of file +examplebuff=Example Buff + +[biome] +exampleincursion=Example Incursion + +[incursion] +exampleincursion=Example Incursion \ No newline at end of file From e4f5c254042fca3a2a8410ac2700ea7945e28067 Mon Sep 17 00:00:00 2001 From: Jamesp1989SL Date: Fri, 16 Jan 2026 04:14:28 +0000 Subject: [PATCH 4/4] pushed food item and new assets as well as removing duplicate class --- src/main/java/examplemod/ExampleMod.java | 14 +++++++++- .../examples/ExampleMaterialItem.java | 11 -------- .../examples/items/ExampleFoodItem.java | 25 ++++++++++++++++++ src/main/resources/items/examplefooditem.png | Bin 0 -> 529 bytes src/main/resources/locale/en.lang | 1 + 5 files changed, 39 insertions(+), 12 deletions(-) delete mode 100644 src/main/java/examplemod/examples/ExampleMaterialItem.java create mode 100644 src/main/java/examplemod/examples/items/ExampleFoodItem.java create mode 100644 src/main/resources/items/examplefooditem.png diff --git a/src/main/java/examplemod/ExampleMod.java b/src/main/java/examplemod/ExampleMod.java index 9ca66a4..53c6967 100644 --- a/src/main/java/examplemod/ExampleMod.java +++ b/src/main/java/examplemod/ExampleMod.java @@ -37,7 +37,7 @@ public void init() { ItemRegistry.registerItem("examplesword", new ExampleSwordItem(), 20, true); ItemRegistry.registerItem("examplestaff", new ExampleProjectileWeapon(), 30, true); ItemRegistry.registerItem("examplepotionitem", new ExamplePotionItem(), 10, true); - + ItemRegistry.registerItem("examplefooditem", new ExampleFoodItem(),15, true); // Register our mob MobRegistry.registerMob("examplemob", ExampleMob.class, true); @@ -94,6 +94,18 @@ public void postInit() { } ).showAfter("exampleitem")); // Show the recipe after example item recipe + // Example food item recipe + Recipes.registerModRecipe(new Recipe( + "examplefooditem", + 1, + RecipeTechRegistry.COOKING_POT, + new Ingredient[]{ + new Ingredient("bread", 1), + new Ingredient("strawberry", 2), + new Ingredient("sugar", 1) + } + )); + // Add our example mob to default cave mobs. // Spawn tables use a ticket/weight system. In general, common mobs have about 100 tickets. Biome.defaultCaveMobs diff --git a/src/main/java/examplemod/examples/ExampleMaterialItem.java b/src/main/java/examplemod/examples/ExampleMaterialItem.java deleted file mode 100644 index 347d2f2..0000000 --- a/src/main/java/examplemod/examples/ExampleMaterialItem.java +++ /dev/null @@ -1,11 +0,0 @@ -package examplemod.examples; - -import necesse.inventory.item.matItem.MatItem; - -public class ExampleMaterialItem extends MatItem { - - public ExampleMaterialItem() { - super(100, Rarity.UNCOMMON); - } - -} diff --git a/src/main/java/examplemod/examples/items/ExampleFoodItem.java b/src/main/java/examplemod/examples/items/ExampleFoodItem.java new file mode 100644 index 0000000..130f01b --- /dev/null +++ b/src/main/java/examplemod/examples/items/ExampleFoodItem.java @@ -0,0 +1,25 @@ +package examplemod.examples.items; + +import necesse.engine.modifiers.ModifierValue; +import necesse.entity.mobs.buffs.BuffModifiers; +import necesse.inventory.item.Item; +import necesse.inventory.item.placeableItem.consumableItem.food.FoodConsumableItem; +import necesse.level.maps.levelData.settlementData.settler.Settler; + +public class ExampleFoodItem extends FoodConsumableItem { + public ExampleFoodItem() { + super( + 250, // stack size + Item.Rarity.COMMON, // rarity + Settler.FOOD_FINE, // food tier + 20, // nutrition + 480, // buff duration in seconds + new ModifierValue<>(BuffModifiers.MAX_HEALTH_FLAT, 10), + new ModifierValue<>(BuffModifiers.SPEED, 0.05f) + ); + + // Configure additional properties after super() + this.spoilDuration(480); // spoil duration in minutes + this.addGlobalIngredient("anycookedfood");// NOTE: returns Item + } +} \ No newline at end of file diff --git a/src/main/resources/items/examplefooditem.png b/src/main/resources/items/examplefooditem.png new file mode 100644 index 0000000000000000000000000000000000000000..fbb1243636735d2df87c01f5af36cc9f9f99c850 GIT binary patch literal 529 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%C&rs6b?Si}mUKs7M+SzC z{oH>NSwSk3J%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-G$*2g9^jfA5ZIF0!26rJR*x37`TN&n2}-D90{Nxdx@v7EBh-(0TymGg(itcpbJ7h zT^vIq4ksr_ur5wm!t7Qv$u>~x|H?$qlbfV1-Xkoe!8;6%LGeiAUM2B z^!SE07G=X}^DWD|b-aDoT;Z^4Vx7-u(0!3tNlakz{LYa003jw7%LivRMvFxDz2T?{ zJmGYrq2L1dyk<$VL{jGGH5tztX7neDNq3&Od-Rb;YLKkc7G{A! z#Zw1>;KIGjCCqBucP;T_z8ScAQlF;qYYw%nBgq<*l08^mtPga3G