Skip to content

Commit

Permalink
Fixed spawn issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Faboslav committed Aug 30, 2022
1 parent 88e2447 commit 6ff9d4c
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 30 deletions.
6 changes: 3 additions & 3 deletions .github/versions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"1.19.2": "1.5.8",
"1.19.1": "1.5.8",
"1.19": "1.5.8",
"1.19.2": "1.5.9",
"1.19.1": "1.5.9",
"1.19": "1.5.9",
"1.18.2": "1.4.5",
"1.18.1": "1.2.5",
"1.18": "1.2.5"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## mc1.19.2-1.5.9, August 30, 2022

- Fixed all spawning related issues (mob not spawning at all)

## mc1.19.2-1.5.8, August 28, 2022

- Fixed the critical crash related to the bees and mooblooms from the previous release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class FriendsAndFoesConfig implements Config
public boolean enableMaulerSpawn = true;

@Description("Spawn weight in desert biome")
public int maulerDesertSpawnWeight = 32;
public int maulerDesertSpawnWeight = 8;

@Description("Minimal spawn group size in desert biome")
public int maulerDesertSpawnMinGroupSize = 1;
Expand All @@ -54,7 +54,7 @@ public final class FriendsAndFoesConfig implements Config
public int maulerDesertSpawnMaxGroupSize = 1;

@Description("Spawn weight in badlands biome")
public int maulerBadlandsSpawnWeight = 32;
public int maulerBadlandsSpawnWeight = 16;

@Description("Minimal spawn group size in badlands biome")
public int maulerBadlandsSpawnMinGroupSize = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ public static boolean canSpawn(
BlockState blockState = serverWorldAccess.getBlockState(blockPos.down());

boolean isBelowSurfaceLevel = blockPos.getY() < 63;
boolean isSkyVisible = serverWorldAccess.isSkyVisible(blockPos);
boolean isBlockPosDarkSpot = serverWorldAccess.getBaseLightLevel(blockPos, 0) <= 3;
boolean isSkyHidden = serverWorldAccess.isSkyVisible(blockPos) == false;
boolean isBlockPosLightEnough = serverWorldAccess.getBaseLightLevel(blockPos, 0) > 3;
boolean isRelatedBlock = blockState.isIn(FriendsAndFoesTags.GLARES_SPAWNABLE_ON);

return isBelowSurfaceLevel
&& isRelatedBlock
&& isSkyVisible == false
&& isBlockPosDarkSpot == false;
&& isSkyHidden
&& isBlockPosLightEnough;
}

protected void initGoals() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public final class CustomSpawnGroup
{
public static final String GLARES_INTERNAL_NAME = "GLARES";
public static final String NAME = "glares";
public static final int SPAWN_CAP = 10;
public static final int SPAWN_CAP = 15;
public static final boolean PEACEFUL = true;
public static final boolean RARE = false;
public static final int IMMEDIATE_DESPAWN_RANGE = 128;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"minecraft:grass",
"minecraft:small_dripleaf",
"minecraft:big_dripleaf",
"minecraft:clay"
"minecraft:clay",
"minecraft:stone"
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"values": [
"#minecraft:is_savanna"
"#minecraft:is_savanna",
{
"id": "#forge:is_savanna",
"required": false
},
{
"id": "#c:savanna",
"required": false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static void friendsandfoes_addCustomSpawnGroup(CallbackInfo ci) {
var glaresSpawnGroup = newSpawnGroup(
CustomSpawnGroup.GLARES_INTERNAL_NAME,
lastSpawnGroup.ordinal() + 1,
FriendsAndFoes.makeStringID(CustomSpawnGroup.NAME),
CustomSpawnGroup.NAME,
CustomSpawnGroup.SPAWN_CAP,
CustomSpawnGroup.PEACEFUL,
CustomSpawnGroup.RARE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
package com.faboslav.friendsandfoes.platform.forge;

import com.faboslav.friendsandfoes.FriendsAndFoes;
import com.faboslav.friendsandfoes.platform.CustomSpawnGroup;
import net.minecraft.entity.SpawnGroup;

public final class CustomSpawnGroupImpl
{
public static SpawnGroup GLARES;

/**
* @see CustomSpawnGroup#getGlaresCategory()
*/
public static SpawnGroup getGlaresCategory() {
var spawnGroup = SpawnGroup.byName(CustomSpawnGroup.GLARES_INTERNAL_NAME);
var spawnGroup = SpawnGroup.byName(CustomSpawnGroup.NAME);

if (spawnGroup == null) {
spawnGroup = SpawnGroup.create(
CustomSpawnGroup.GLARES_INTERNAL_NAME,
FriendsAndFoes.makeStringID(CustomSpawnGroup.NAME),
CustomSpawnGroup.NAME,
CustomSpawnGroup.NAME,
CustomSpawnGroup.SPAWN_CAP,
CustomSpawnGroup.PEACEFUL,
CustomSpawnGroup.RARE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"type": "forge:add_spawns",
"biomes": "#friendsandfoes:has_badlands_mauler",
"spawn": {
"spawners": {
"type": "friendsandfoes:mauler",
"minCount": 1,
"maxCount": 1,
"weight": 32
"weight": 16
},
"category": "creature"
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"type": "forge:add_spawns",
"biomes": "#friendsandfoes:has_desert_mauler",
"spawn": {
"spawners": {
"type": "friendsandfoes:mauler",
"minCount": 1,
"maxCount": 1,
"weight": 32
"weight": 8
},
"category": "creature"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "friendsandfoes:mob_spawns",
"type": "forge:add_spawns",
"biomes": "#friendsandfoes:has_glare",
"spawn": {
"spawners": {
"type": "friendsandfoes:glare",
"minCount": 1,
"maxCount": 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "forge:add_spawns",
"biomes": "#friendsandfoes:less_moobloom",
"spawn": {
"biomes": "#friendsandfoes:has_less_mooblooms",
"spawners": {
"type": "friendsandfoes:moobloom",
"minCount": 2,
"maxCount": 4,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "forge:add_spawns",
"biomes": "#friendsandfoes:more_moobloom",
"spawn": {
"biomes": "#friendsandfoes:has_more_mooblooms",
"spawners": {
"type": "friendsandfoes:moobloom",
"minCount": 2,
"maxCount": 4,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "forge:add_spawns",
"biomes": "#friendsandfoes:has_savanna_mauler",
"spawn": {
"spawners": {
"type": "friendsandfoes:mauler",
"minCount": 1,
"maxCount": 1,
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.configureondemand=false
# Mod
mod_name=Friends&Foes
mod_id=friendsandfoes
mod_version=1.5.8
mod_version=1.5.9
mod_author=Faboslav
mod_description=Adds all eliminated mobs from the minecraft mob votes along with the forgotten mobs like the Illusioner.
maven_group=com.faboslav.friendsandfoes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static void friendsandfoes_addCustomSpawnGroup(CallbackInfo ci) {
var glaresSpawnGroup = newSpawnGroup(
CustomSpawnGroup.GLARES_INTERNAL_NAME,
lastSpawnGroup.ordinal() + 1,
FriendsAndFoes.makeStringID(CustomSpawnGroup.NAME),
CustomSpawnGroup.NAME,
CustomSpawnGroup.SPAWN_CAP,
CustomSpawnGroup.PEACEFUL,
CustomSpawnGroup.RARE,
Expand Down

0 comments on commit 6ff9d4c

Please sign in to comment.