Skip to content

Commit

Permalink
NeoForge 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yurisuika committed Dec 11, 2024
1 parent c27439b commit 732d924
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: temurin
- run: chmod +x gradlew
- run: ./gradlew build --stacktrace --info
Expand Down
4 changes: 2 additions & 2 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
before_install:
- export SDKMAN_DIR="/home/jitpack/.sdkman/"
- source "/home/jitpack/.sdkman/bin/sdkman-init.sh"
- sdk install java 17.0.11-open
- sdk use java 17.0.11-open
- sdk install java 21.0.3-open
- sdk use java 21.0.3-open
6 changes: 2 additions & 4 deletions src/main/java/dev/yurisuika/blossom/Blossom.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,8 @@ public static void registerItemColors(RegisterColorHandlersEvent.Item event) {
@SubscribeEvent
public static void registerCreativeModeTabs(BuildCreativeModeTabContentsEvent event) {
if (event.getTabKey() == CreativeModeTabs.NATURAL_BLOCKS) {
event.accept(BlossomBlocks.FRUITING_OAK_LEAVES.get());
event.getEntries().putAfter(Items.FLOWERING_AZALEA_LEAVES.getDefaultInstance(), BlossomItems.FRUITING_OAK_LEAVES.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
event.accept(BlossomBlocks.FLOWERING_OAK_LEAVES.get());
event.getEntries().putAfter(Items.FLOWERING_AZALEA_LEAVES.getDefaultInstance(), BlossomItems.FLOWERING_OAK_LEAVES.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
event.insertAfter(Items.FLOWERING_AZALEA_LEAVES.getDefaultInstance(), BlossomItems.FRUITING_OAK_LEAVES.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
event.insertAfter(Items.FLOWERING_AZALEA_LEAVES.getDefaultInstance(), BlossomItems.FLOWERING_OAK_LEAVES.get().getDefaultInstance(), CreativeModeTab.TabVisibility.PARENT_AND_SEARCH_TABS);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public boolean checkFilters() {

AtomicBoolean whitelist = new AtomicBoolean(false);
if (Option.getWhitelist()) {
Arrays.stream(Option.getDimensionWhitelist()).filter(entry -> entry.startsWith("#") && dimension.is(TagKey.create(Registries.DIMENSION_TYPE, new ResourceLocation(entry.substring(1)))) || Objects.equals(entry, dimension.unwrapKey().get().location().toString())).map(entry -> true).forEach(whitelist::set);
Arrays.stream(Option.getBiomeWhitelist()).filter(entry -> entry.startsWith("#") && biome.is(TagKey.create(Registries.BIOME, new ResourceLocation(entry.substring(1)))) || Objects.equals(entry, biome.unwrapKey().get().location().toString())).map(entry -> true).forEach(whitelist::set);
Arrays.stream(Option.getDimensionWhitelist()).filter(entry -> entry.startsWith("#") && dimension.is(TagKey.create(Registries.DIMENSION_TYPE, ResourceLocation.tryParse(entry.substring(1)))) || Objects.equals(entry, dimension.unwrapKey().get().location().toString())).map(entry -> true).forEach(whitelist::set);
Arrays.stream(Option.getBiomeWhitelist()).filter(entry -> entry.startsWith("#") && biome.is(TagKey.create(Registries.BIOME, ResourceLocation.tryParse(entry.substring(1)))) || Objects.equals(entry, biome.unwrapKey().get().location().toString())).map(entry -> true).forEach(whitelist::set);
}

AtomicBoolean blacklist = new AtomicBoolean(true);
if (Option.getBlacklist()) {
Arrays.stream(Option.getDimensionBlacklist()).filter(entry -> entry.startsWith("#") && dimension.is(TagKey.create(Registries.DIMENSION_TYPE, new ResourceLocation(entry.substring(1)))) || Objects.equals(entry, dimension.unwrapKey().get().location().toString())).map(entry -> false).forEach(blacklist::set);
Arrays.stream(Option.getBiomeBlacklist()).filter(entry -> entry.startsWith("#") && biome.is(TagKey.create(Registries.BIOME, new ResourceLocation(entry.substring(1)))) || Objects.equals(entry, biome.unwrapKey().get().location().toString())).map(entry -> false).forEach(blacklist::set);
Arrays.stream(Option.getDimensionBlacklist()).filter(entry -> entry.startsWith("#") && dimension.is(TagKey.create(Registries.DIMENSION_TYPE, ResourceLocation.tryParse(entry.substring(1)))) || Objects.equals(entry, dimension.unwrapKey().get().location().toString())).map(entry -> false).forEach(blacklist::set);
Arrays.stream(Option.getBiomeBlacklist()).filter(entry -> entry.startsWith("#") && biome.is(TagKey.create(Registries.BIOME, ResourceLocation.tryParse(entry.substring(1)))) || Objects.equals(entry, biome.unwrapKey().get().location().toString())).map(entry -> false).forEach(blacklist::set);
}

if (temperature >= Option.getTemperatureMin() && temperature <= Option.getTemperatureMax()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
Expand Down Expand Up @@ -266,6 +267,9 @@ public ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level
Item item = stack.getItem();
if (item instanceof ShearsItem) {
level.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.CROP_BREAK, SoundSource.NEUTRAL, 1.0F, 1.0F);
if (isMaxAge(state)) {
dropFruit(level, pos, getShearedItem(), (stack.isEnchanted() && EnchantmentHelper.getEnchantmentsForCrafting(stack).entrySet().contains(Enchantments.FORTUNE)) ? EnchantmentHelper.getItemEnchantmentLevel(level.registryAccess().lookupOrThrow(Registries.ENCHANTMENT).getOrThrow(Enchantments.FORTUNE), stack) : 0);
}
stack.hurtAndBreak(1, player, LivingEntity.getSlotForHand(hand));
if (!level.isClientSide()) {
player.awardStat(Stats.ITEM_USED.get(item));
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ config = "blossom.mixins.json"
[[dependencies.blossom]]
modId = "minecraft"
type = "required"
versionRange = "[1.20.5,1.20.6]"
versionRange = "[1.21,1.21.1]"
ordering = "NONE"
side = "BOTH"

[[dependencies.blossom]]
modId = "neoforge"
type = "required"
versionRange = "[20.5,)"
versionRange = "[21,)"
ordering = "NONE"
side = "BOTH"
2 changes: 1 addition & 1 deletion src/main/resources/blossom.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"minVersion": "0.8",
"package": "dev.yurisuika.blossom.mixin",
"refmap": "blossom.refmap.json",
"compatibilityLevel": "JAVA_17",
"compatibilityLevel": "JAVA_21",
"mixins": [
"world.entity.EntityAccessor",
"world.entity.EntityMixin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"predicates": {
"minecraft:enchantments": [
{
"enchantment": "minecraft:silk_touch",
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
Expand Down Expand Up @@ -93,7 +93,7 @@
"predicates": {
"minecraft:enchantments": [
{
"enchantment": "minecraft:silk_touch",
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"predicates": {
"minecraft:enchantments": [
{
"enchantment": "minecraft:silk_touch",
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
Expand Down Expand Up @@ -93,7 +93,7 @@
"predicates": {
"minecraft:enchantments": [
{
"enchantment": "minecraft:silk_touch",
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
Expand Down Expand Up @@ -152,7 +152,7 @@
"predicates": {
"minecraft:enchantments": [
{
"enchantment": "minecraft:silk_touch",
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"predicates": {
"minecraft:enchantments": [
{
"enchantment": "minecraft:silk_touch",
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
Expand Down Expand Up @@ -83,7 +83,7 @@
"predicates": {
"minecraft:enchantments": [
{
"enchantment": "minecraft:silk_touch",
"enchantments": "minecraft:silk_touch",
"levels": {
"min": 1
}
Expand Down

0 comments on commit 732d924

Please sign in to comment.