Skip to content

Commit

Permalink
Merge branch '1.21'
Browse files Browse the repository at this point in the history
* 1.21:
  NeoForge creative tab fix
  2.0.13
  rascal spawn improvements
  Fixed errors from BC
  • Loading branch information
Faboslav committed Jul 13, 2024
2 parents e8a3d11 + 58e38c2 commit c8ea086
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

steps:
- name: "Checkout repository"
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
fetch-depth: 0
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:

- name: "Setup gradle and run build"
if: steps.check-mod-loader.outputs.is_mod_loader_supported == 'true'
uses: gradle/gradle-build-action@v2.11.1
uses: gradle/gradle-build-action@v3
with:
cache-read-only: true
generate-job-summary: false
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.0.13

- Rascal spawn condition improvements
- NeoForge beta breaking change fix

## 2.0.12

- Fixed oak beehive crafting recipe
Expand Down
2 changes: 0 additions & 2 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ loom {
dependencies {
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation("me.shedaniel.cloth:cloth-config-fabric:${cloth_config_version}")

implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixin_extras_version}"))
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.StructureTags;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundEvent;
Expand Down Expand Up @@ -92,6 +93,15 @@ public static boolean canSpawn(
if (
blockPos.getY() > 63
|| serverWorldAccess.isSkyVisible(blockPos)
|| serverWorldAccess.getLightLevel(blockPos, 0) == 0
|| (
!serverWorldAccess.getBlockState(blockPos.down()).isIn(BlockTags.PLANKS)
&& !serverWorldAccess.getBlockState(blockPos.up()).isIn(BlockTags.PLANKS)
&& !serverWorldAccess.getBlockState(blockPos.north()).isIn(BlockTags.PLANKS)
&& !serverWorldAccess.getBlockState(blockPos.west()).isIn(BlockTags.PLANKS)
&& !serverWorldAccess.getBlockState(blockPos.south()).isIn(BlockTags.PLANKS)
&& !serverWorldAccess.getBlockState(blockPos.east()).isIn(BlockTags.PLANKS)
)
) {
return false;
}
Expand Down Expand Up @@ -411,7 +421,7 @@ public void addToCaughtCount() {
}

public boolean shouldGiveReward() {
return this.getCaughtCount() >= 3;
return this.getCaughtCount() == 3;
}

public boolean disableAmbientSounds() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ public static void postInit() {

private static void addToItemGroups() {
RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, COPPER_GOLEM_SPAWN_EGG.get(), Items.CAVE_SPIDER_SPAWN_EGG);
RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, GLARE_SPAWN_EGG.get(), COPPER_GOLEM_SPAWN_EGG.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, GLARE_SPAWN_EGG.get(), Items.CAVE_SPIDER_SPAWN_EGG);
RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, ICEOLOGER_SPAWN_EGG.get(), Items.HORSE_SPAWN_EGG);
RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, ILLUSIONER_SPAWN_EGG.get(), ICEOLOGER_SPAWN_EGG.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, ILLUSIONER_SPAWN_EGG.get(), Items.HORSE_SPAWN_EGG);
RegistryHelper.addToItemGroupAfter(ItemGroups.SPAWN_EGGS, MAULER_SPAWN_EGG.get(), Items.MAGMA_CUBE_SPAWN_EGG);
RegistryHelper.addToItemGroupBefore(ItemGroups.SPAWN_EGGS, MOOBLOOM_SPAWN_EGG.get(), Items.MOOSHROOM_SPAWN_EGG);
RegistryHelper.addToItemGroupBefore(ItemGroups.SPAWN_EGGS, TUFF_GOLEM_SPAWN_EGG.get(), Items.TURTLE_SPAWN_EGG);
Expand All @@ -114,32 +114,32 @@ private static void addToItemGroups() {
RegistryHelper.addToItemGroupAfter(ItemGroups.NATURAL, BUTTERCUP.get(), Items.DANDELION);

RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, SPRUCE_BEEHIVE.get(), Items.BEEHIVE);
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, BAMBOO_BEEHIVE.get(), SPRUCE_BEEHIVE.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, BIRCH_BEEHIVE.get(), BAMBOO_BEEHIVE.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, JUNGLE_BEEHIVE.get(), BIRCH_BEEHIVE.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, ACACIA_BEEHIVE.get(), JUNGLE_BEEHIVE.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, DARK_OAK_BEEHIVE.get(), ACACIA_BEEHIVE.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, MANGROVE_BEEHIVE.get(), DARK_OAK_BEEHIVE.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, CHERRY_BEEHIVE.get(), MANGROVE_BEEHIVE.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, CRIMSON_BEEHIVE.get(), CHERRY_BEEHIVE.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, WARPED_BEEHIVE.get(), CRIMSON_BEEHIVE.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, BAMBOO_BEEHIVE.get(), Items.BEEHIVE);
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, BIRCH_BEEHIVE.get(), Items.BEEHIVE);
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, JUNGLE_BEEHIVE.get(), Items.BEEHIVE);
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, ACACIA_BEEHIVE.get(), Items.BEEHIVE);
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, DARK_OAK_BEEHIVE.get(), Items.BEEHIVE);
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, MANGROVE_BEEHIVE.get(), Items.BEEHIVE);
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, CHERRY_BEEHIVE.get(), Items.BEEHIVE);
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, CRIMSON_BEEHIVE.get(), Items.BEEHIVE);
RegistryHelper.addToItemGroupAfter(ItemGroups.FUNCTIONAL, WARPED_BEEHIVE.get(), Items.BEEHIVE);


RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, COPPER_BUTTON.get(), Items.STONE_BUTTON);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, EXPOSED_COPPER_BUTTON.get(), COPPER_BUTTON.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WEATHERED_COPPER_BUTTON.get(), EXPOSED_COPPER_BUTTON.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, OXIDIZED_COPPER_BUTTON.get(), WEATHERED_COPPER_BUTTON.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_COPPER_BUTTON.get(), OXIDIZED_COPPER_BUTTON.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_EXPOSED_COPPER_BUTTON.get(), WAXED_COPPER_BUTTON.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_WEATHERED_COPPER_BUTTON.get(), WAXED_EXPOSED_COPPER_BUTTON.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_OXIDIZED_COPPER_BUTTON.get(), WAXED_WEATHERED_COPPER_BUTTON.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, EXPOSED_COPPER_BUTTON.get(), Items.STONE_BUTTON);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WEATHERED_COPPER_BUTTON.get(), Items.STONE_BUTTON);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, OXIDIZED_COPPER_BUTTON.get(), Items.STONE_BUTTON);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_COPPER_BUTTON.get(), Items.STONE_BUTTON);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_EXPOSED_COPPER_BUTTON.get(), Items.STONE_BUTTON);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_WEATHERED_COPPER_BUTTON.get(), Items.STONE_BUTTON);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_OXIDIZED_COPPER_BUTTON.get(), Items.STONE_BUTTON);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, EXPOSED_LIGHTNING_ROD.get(), Items.LIGHTNING_ROD);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WEATHERED_LIGHTNING_ROD.get(), EXPOSED_LIGHTNING_ROD.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, OXIDIZED_LIGHTNING_ROD.get(), WEATHERED_LIGHTNING_ROD.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_LIGHTNING_ROD.get(), WEATHERED_LIGHTNING_ROD.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_EXPOSED_LIGHTNING_ROD.get(), WAXED_LIGHTNING_ROD.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_WEATHERED_LIGHTNING_ROD.get(), WAXED_EXPOSED_LIGHTNING_ROD.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_OXIDIZED_LIGHTNING_ROD.get(), WAXED_WEATHERED_LIGHTNING_ROD.get());
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WEATHERED_LIGHTNING_ROD.get(), Items.LIGHTNING_ROD);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, OXIDIZED_LIGHTNING_ROD.get(), Items.LIGHTNING_ROD);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_LIGHTNING_ROD.get(), Items.LIGHTNING_ROD);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_EXPOSED_LIGHTNING_ROD.get(), Items.LIGHTNING_ROD);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_WEATHERED_LIGHTNING_ROD.get(), Items.LIGHTNING_ROD);
RegistryHelper.addToItemGroupAfter(ItemGroups.REDSTONE, WAXED_OXIDIZED_LIGHTNING_ROD.get(), Items.LIGHTNING_ROD);

RegistryHelper.addToItemGroupAfter(ItemGroups.INGREDIENTS, WILDFIRE_CROWN_FRAGMENT.get(), Items.TURTLE_SCUTE);
RegistryHelper.addToItemGroupAfter(ItemGroups.COMBAT, WILDFIRE_CROWN.get(), Items.TURTLE_HELMET);
Expand Down
3 changes: 0 additions & 3 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modApi "net.fabricmc.fabric-api:fabric-api:${fabric_api_version}"

// Mixin extras (https://github.com/LlamaLad7/MixinExtras)
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${mixin_extras_version}")))

// Mod menu (https://modrinth.com/mod/modmenu)
modImplementation("com.terraformersmc:modmenu:${mod_menu_version}") { transitive = false }

Expand Down
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.caching=true
# Mod
mod_name=Friends&Foes
mod_id=friendsandfoes
mod_version=2.0.12
mod_version=2.0.13
mod_author=Faboslav
mod_description=Adds outvoted and forgotten mobs from the mob votes in a believable vanilla plus style.
maven_group=com.faboslav.friendsandfoes
Expand All @@ -23,7 +23,6 @@ yarn_mappings_patch=1.21+build.4
enabled_platforms=fabric,neoforge

# Dependencies
mixin_extras_version=0.3.6
devauth_version=1.2.0
cloth_config_version=15.0.127
mod_menu_version=11.0.1
Expand All @@ -36,4 +35,4 @@ fabric_loader_version=0.15.11
fabric_api_version=0.100.4+1.21

# Neoforge https://projects.neoforged.net/neoforged/neoforge
neoforge_version=21.0.42-beta
neoforge_version=21.0.86-beta
4 changes: 0 additions & 4 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ dependencies {
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false }

// Mixin extras (https://github.com/LlamaLad7/MixinExtras)
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixin_extras_version}"))
implementation(include("io.github.llamalad7:mixinextras-neoforge:${mixin_extras_version}"))

// Curios (https://www.curseforge.com/minecraft/mc-mods/curios)
// modCompileOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+${minecraft_version}:api")
// modRuntimeOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+${minecraft_version}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ private static void addItemsToTabs(BuildCreativeModeTabContentsEvent event) {
RegistryHelperImpl.ITEMS_TO_ADD_BEFORE.forEach((itemGroup, itemPairs) -> {
if (event.getTabKey() == itemGroup) {
itemPairs.forEach((item, before) -> {
event.getEntries().putBefore(before.getDefaultStack(), item.getDefaultStack(), ItemGroup.StackVisibility.PARENT_AND_SEARCH_TABS);
event.insertBefore(before.getDefaultStack(), item.getDefaultStack(), ItemGroup.StackVisibility.PARENT_AND_SEARCH_TABS);
});
}
});

RegistryHelperImpl.ITEMS_TO_ADD_AFTER.forEach((itemGroup, itemPairs) -> {
if (event.getTabKey() == itemGroup) {
itemPairs.forEach((item, after) -> {
event.getEntries().putAfter(after.getDefaultStack(), item.getDefaultStack(), ItemGroup.StackVisibility.PARENT_AND_SEARCH_TABS);
event.insertAfter(after.getDefaultStack(), item.getDefaultStack(), ItemGroup.StackVisibility.PARENT_AND_SEARCH_TABS);
});
}
});
Expand Down

0 comments on commit c8ea086

Please sign in to comment.