-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A set of three patches to JAFF which together serve to implement vanilla spawning mechanics. * Removes JAFF's own spawn loop * Register vanilla spawns and placement types * Implement EntityFish#isNotColliding, overriding EntityAnimal's implementation which prevents spawning in water.
- Loading branch information
Showing
7 changed files
with
216 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package tv.darkosto.sevpatches.core; | ||
|
||
import com.tmtravlr.jaff.entities.*; | ||
import net.minecraft.entity.EntityLiving; | ||
import net.minecraft.entity.EntitySpawnPlacementRegistry; | ||
import net.minecraft.entity.EnumCreatureType; | ||
import net.minecraft.world.biome.Biome; | ||
import net.minecraftforge.common.BiomeDictionary; | ||
import net.minecraftforge.fml.common.registry.EntityRegistry; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public class FishHook { | ||
public static void registerPlacement() { | ||
SevPatchesLoadingPlugin.LOGGER.info("JAFFA Phase 1"); | ||
EntitySpawnPlacementRegistry.setPlacementType(EntityFishCod.class, EntityLiving.SpawnPlacementType.IN_WATER); | ||
EntitySpawnPlacementRegistry.setPlacementType(EntityFishClownfish.class, EntityLiving.SpawnPlacementType.IN_WATER); | ||
EntitySpawnPlacementRegistry.setPlacementType(EntityFishPufferfish.class, EntityLiving.SpawnPlacementType.IN_WATER); | ||
EntitySpawnPlacementRegistry.setPlacementType(EntityFishSalmon.class, EntityLiving.SpawnPlacementType.IN_WATER); | ||
} | ||
|
||
public static void registerSpawns() { | ||
SevPatchesLoadingPlugin.LOGGER.info("JAFFA Phase 2"); | ||
|
||
Set<Biome> waterBiomes = new HashSet<>(); | ||
waterBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.RIVER)); | ||
waterBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.SWAMP)); | ||
waterBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.OCEAN)); | ||
|
||
Set<Biome> landWaterBiomes = new HashSet<>(); | ||
landWaterBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.RIVER)); | ||
landWaterBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.SWAMP)); | ||
|
||
EntityRegistry.addSpawn(EntityFishCod.class, 40, 4, 4, EnumCreatureType.WATER_CREATURE, waterBiomes.toArray(new Biome[0])); | ||
EntityRegistry.addSpawn(EntityFishClownfish.class, 12, 4, 4, EnumCreatureType.WATER_CREATURE, BiomeDictionary.getBiomes(BiomeDictionary.Type.OCEAN).toArray(new Biome[0])); | ||
EntityRegistry.addSpawn(EntityFishPufferfish.class, 8, 1, 1, EnumCreatureType.WATER_CREATURE, BiomeDictionary.getBiomes(BiomeDictionary.Type.OCEAN).toArray(new Biome[0])); | ||
EntityRegistry.addSpawn(EntityFishSalmon.class, 4, 4, 4, EnumCreatureType.WATER_CREATURE, BiomeDictionary.getBiomes(BiomeDictionary.Type.OCEAN).toArray(new Biome[0])); | ||
EntityRegistry.addSpawn(EntityFishSalmon.class, 40, 4, 4, EnumCreatureType.WATER_CREATURE, landWaterBiomes.toArray(new Biome[0])); | ||
|
||
SevPatchesLoadingPlugin.LOGGER.info(EntitySpawnPlacementRegistry.getPlacementForEntity(EntityFishCod.class)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters