Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Trhod17 committed Oct 2, 2023
1 parent 7390498 commit b33fd53
Show file tree
Hide file tree
Showing 14 changed files with 281 additions and 231 deletions.
387 changes: 190 additions & 197 deletions build.gradle

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## V1.1.0

---

- Added log filter to remove conditional recipe spam.
18 changes: 11 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ mapping_version=2023.07.30-1.20.1

java_version=17

#This specifies what type of release it will be uploaded to CurseForge and Modrinth as
# options are: alpha, beta, release
release_type=release

junit_version=5.10.0
quicktheories_version=0.26

Expand Down Expand Up @@ -81,16 +85,16 @@ bookshelf_id=4714739
mod_id=flowerseeds
# The human-readable display name for the mod.
mod_name=Flower Seeds 2
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
# The licence of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=MIT
# The mod version. See https://semver.org/

mod_version=1.0.1
cyclic_version=1.0.1
roses_version=1.0.1
bop_version=1.0.1
byg_version=1.0.1
ff_version=1.0.1
mod_version=1.1.0
cyclic_version=1.1.0
roses_version=1.1.0
bop_version=1.1.0
byg_version=1.1.0
ff_version=1.1.0
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
2 changes: 1 addition & 1 deletion src/bop/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version="${mod_version}" #mandatory
# A display name for the mod
displayName="Flower Seeds 2 Biomes O Plenty Addon" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://docs.neoforged.net/docs/misc/updatechecker/
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
updateJSONURL="https://forge.curseupdate.com/908141/flower-seeds-2-biomes-o-plenty" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
Expand Down
3 changes: 1 addition & 2 deletions src/cyclic/java/flowerseeds/cyclic/FlowerSeedsCyclic.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static <T extends Block> RegistryObject<T> registerBlock(String name, Su
}

private static <T extends Block> void registerBlockItem(String name, RegistryObject<T> block) {
ITEMS.register(name, () -> new ItemNameBlockItem(block.get(), new Item.Properties()));
ITEMS.register(name, () -> new ItemNameBlockItem(block.get(), new Item.Properties()));
}

public FlowerSeedsCyclic()
Expand All @@ -94,7 +94,6 @@ private void commonSetup(final FMLCommonSetupEvent event)
for (RegistryObject<Block> block : BLOCKS.getEntries()) {
FlowerSeeds.compostable(block.get());
}

});

}
Expand Down
2 changes: 1 addition & 1 deletion src/cyclic/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version="${cyclic_addon_version}" #mandatory
# A display name for the mod
displayName="Flower Seeds 2 Cyclic Addon" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://docs.neoforged.net/docs/misc/updatechecker/
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
updateJSONURL="https://forge.curseupdate.com/908151/flower-seeds-2-cyclic" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ public MainCompatDataProvider(String modid, GatherDataEvent event) {
basicFlowerProcessing(BlockInit.OXEYE_DAISY_SEED.get(), Items.OXEYE_DAISY);
basicFlowerProcessing(BlockInit.WHITE_TULIP_SEED.get(), Items.WHITE_TULIP);
basicWitherFlowerProcessing(BlockInit.WITHER_ROSE_SEED.get(), Items.WITHER_ROSE);

//This is here to force it to generate all the files, otherwise the last few files don't get generated for some reason or other.
//This is here to force it to generate all the files, otherwise the last few files don't get generated for some reason or other.
//TODO: fix this in future (somehow?)
MEKANISM_CRUSHING.builder(toName(Blocks.AIR), Ingredient.of(Blocks.AIR.asItem()), new ResourceLocation("minecraft:air"), 0);
MEKANISM_CRUSHING.builder(toName(Blocks.AIR), Ingredient.of(Blocks.AIR.asItem()), new ResourceLocation("minecraft:air"), 0);

return CompletableFuture.completedFuture(null);
return CompletableFuture.completedFuture(null);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/fabulousflowers/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version="${ff_addon_version}" #mandatory
# A display name for the mod
displayName="Flower Seeds 2 Fabulous Flowers Addon" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://docs.neoforged.net/docs/misc/updatechecker/
#updateJSONURL="https://change.me.example.invalid/updates.json" #optional
updateJSONURL="https://forge.curseupdate.com/908145/flower-seeds-2-fabulous-flowers" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
Expand Down
24 changes: 23 additions & 1 deletion src/main/java/flowerseeds/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,38 @@ public class Config
private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();

private static final ForgeConfigSpec.BooleanValue WITHER_ROSE_TRADING = BUILDER
.comment("Allow Wither Rose seeds to be obtainable from master farmers?")
.comment("Allow Wither Rose seeds to be obtainable from Farmers?")
.define("witherrosetrading", false);

private static final ForgeConfigSpec.IntValue WITHER_ROSE_TRADE_LEVEL = BUILDER
.comment("Wither Rose Farmer Trade Level")
.defineInRange("witherrosettradelevel", 5, 1, 5);

private static final ForgeConfigSpec.BooleanValue WITHER_ROSE_TRADING_CLERIC = BUILDER
.comment("Allow Wither Rose seeds to be obtainable from master Clerics?")
.define("witherrosetradingcleric", false);

private static final ForgeConfigSpec.IntValue WITHER_ROSE_TRADE_LEVEL_CLERIC = BUILDER
.comment("Wither Rose Cleric Trade Level")
.defineInRange("witherrosettradelevelcleric", 5, 1, 5);

static final ForgeConfigSpec SPEC = BUILDER.build();

public static boolean allowWitherRoseTrading;
public static boolean allowWitherRoseTradingCleric;

public static int witherRoseTradeLevel;
public static int witherRoseTradeLevelCleric;


@SubscribeEvent
static void onLoad(final ModConfigEvent event)
{
allowWitherRoseTrading = WITHER_ROSE_TRADING.get();
allowWitherRoseTradingCleric = WITHER_ROSE_TRADING_CLERIC.get();

witherRoseTradeLevel = WITHER_ROSE_TRADE_LEVEL.get();
witherRoseTradeLevelCleric = WITHER_ROSE_TRADE_LEVEL_CLERIC.get();

}
}
21 changes: 7 additions & 14 deletions src/main/java/flowerseeds/FlowerSeeds.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,12 @@ public FlowerSeeds()

private void commonSetup(final FMLCommonSetupEvent event)
{
event.enqueueWork(() -> {
compostable(BlockInit.DANDELION_SEED.get());
compostable(BlockInit.ALLIUM_SEED.get());
compostable(BlockInit.AZURE_BLUET_SEED.get());
compostable(BlockInit.CORNFLOWER_SEED.get());
compostable(BlockInit.BLUE_ORCHID_SEED.get());
compostable(BlockInit.LILY_OF_THE_VALLEY_SEED.get());
compostable(BlockInit.ORANGE_TULIP_SEED.get());
compostable(BlockInit.PINK_TULIP_SEED.get());
compostable(BlockInit.POPPY_SEED.get());
compostable(BlockInit.RED_TULIP_SEED.get());
compostable(BlockInit.OXEYE_DAISY_SEED.get());
compostable(BlockInit.WHITE_TULIP_SEED.get());
compostable(BlockInit.WITHER_ROSE_SEED.get());
LogFilter.apply();

event.enqueueWork(() -> {
for (RegistryObject<Block> block : BlockInit.BLOCKS.getEntries()) {
FlowerSeeds.compostable(block.get());
}
});
}

Expand All @@ -85,4 +76,6 @@ public static void registerItemColor(RegisterColorHandlersEvent.Item event) {





}
29 changes: 29 additions & 0 deletions src/main/java/flowerseeds/LogFilter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package flowerseeds;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.Logger;
import org.apache.logging.log4j.core.config.plugins.Plugin;
import org.apache.logging.log4j.core.filter.AbstractFilter;
import org.apache.logging.log4j.message.Message;

import java.util.regex.Pattern;

@Plugin(name = "Log4jFilter", category = "Core", elementType = "filter", printObject = true)
public final class LogFilter extends AbstractFilter {
@Override
public Result filter(final LogEvent event) {
Message m = event.getMessage();
String s = m.getFormattedMessage();
if (s.contains("Skipping loading recipe flowerseeds")) {
//FlowerSeeds.LOGGER.info("Removing Log Message");
return Result.DENY;
}

return null;
}

public static void apply() {
((Logger) LogManager.getRootLogger()).addFilter(new LogFilter());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ public static void onVillagerTrades(VillagerTradesEvent pEvent) {
}

if (Config.allowWitherRoseTrading) {
trades.get(5).add((trader, rand) -> addTrade(BlockInit.WITHER_ROSE_SEED.get()));
trades.get(Config.witherRoseTradeLevel).add((trader, rand) -> addTrade(BlockInit.WITHER_ROSE_SEED.get()));
}
}

if (pEvent.getType().equals(VillagerProfession.CLERIC)) {
Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = pEvent.getTrades();

if (Config.allowWitherRoseTradingCleric) {
trades.get(Config.witherRoseTradeLevelCleric).add((trader, rand) -> addTrade(BlockInit.WITHER_ROSE_SEED.get()));
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version="${version}" #mandatory
# A display name for the mod
displayName="Flower Seeds 2" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://docs.neoforged.net/docs/misc/updatechecker/
#updateJSONURL="https://forge.curseupdate.com/445955/flowerseeds" #optional
updateJSONURL="https://forge.curseupdate.com/445955/flowerseeds" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
Expand Down
2 changes: 1 addition & 1 deletion src/roses/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version="${roses_addon_version}" #mandatory
# A display name for the mod
displayName="Flower Seeds 2 Roses Addon" #mandatory
# A URL to query for updates for this mod. See the JSON update specification https://docs.neoforged.net/docs/misc/updatechecker/
#updateJSONURL="" #optional
updateJSONURL="https://forge.curseupdate.com/908150/flower-seeds-2-roses" #optional
# A URL for the "homepage" for this mod, displayed in the mod UI
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional
# A file name (in the root of the mod JAR) containing a logo for display
Expand Down

0 comments on commit b33fd53

Please sign in to comment.