mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Option Ocelot Spawn Under Sea Level
This commit is contained in:
committed by
granny
parent
b8520cb85d
commit
ebcfbeacc5
@@ -1,39 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
||||||
Date: Fri, 21 Jul 2023 11:04:47 -0500
|
|
||||||
Subject: [PATCH] Option Ocelot Spawn Under Sea Level
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/net/minecraft/world/entity/animal/Ocelot.java b/net/minecraft/world/entity/animal/Ocelot.java
|
|
||||||
index be818af35d6e9495ce4d3d3fc8212f7a22ebae92..79db05362cddbef624e5f5e19e11faa951b6f81c 100644
|
|
||||||
--- a/net/minecraft/world/entity/animal/Ocelot.java
|
|
||||||
+++ b/net/minecraft/world/entity/animal/Ocelot.java
|
|
||||||
@@ -288,7 +288,7 @@ public class Ocelot extends Animal {
|
|
||||||
if (world.isUnobstructed(this) && !world.containsAnyLiquid(this.getBoundingBox())) {
|
|
||||||
BlockPos blockposition = this.blockPosition();
|
|
||||||
|
|
||||||
- if (blockposition.getY() < world.getSeaLevel()) {
|
|
||||||
+ if (!level().purpurConfig.ocelotSpawnUnderSeaLevel && blockposition.getY() < world.getSeaLevel()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
index 9847f58a029901a765df3809b24d56b8e2e50f02..8031960ec1d83a26cac92f6f01d76b9e328624e2 100644
|
|
||||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
||||||
@@ -2159,6 +2159,7 @@ public class PurpurWorldConfig {
|
|
||||||
public int ocelotBreedingTicks = 6000;
|
|
||||||
public boolean ocelotTakeDamageFromWater = false;
|
|
||||||
public boolean ocelotAlwaysDropExp = false;
|
|
||||||
+ public boolean ocelotSpawnUnderSeaLevel = false;
|
|
||||||
private void ocelotSettings() {
|
|
||||||
ocelotRidable = getBoolean("mobs.ocelot.ridable", ocelotRidable);
|
|
||||||
ocelotRidableInWater = getBoolean("mobs.ocelot.ridable-in-water", ocelotRidableInWater);
|
|
||||||
@@ -2173,6 +2174,7 @@ public class PurpurWorldConfig {
|
|
||||||
ocelotBreedingTicks = getInt("mobs.ocelot.breeding-delay-ticks", ocelotBreedingTicks);
|
|
||||||
ocelotTakeDamageFromWater = getBoolean("mobs.ocelot.takes-damage-from-water", ocelotTakeDamageFromWater);
|
|
||||||
ocelotAlwaysDropExp = getBoolean("mobs.ocelot.always-drop-exp", ocelotAlwaysDropExp);
|
|
||||||
+ ocelotSpawnUnderSeaLevel = getBoolean("mobs.ocelot.spawn-below-sea-level", ocelotSpawnUnderSeaLevel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean pandaRidable = false;
|
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
--- a/net/minecraft/world/entity/animal/Ocelot.java
|
||||||
|
+++ b/net/minecraft/world/entity/animal/Ocelot.java
|
||||||
|
@@ -232,7 +_,7 @@
|
||||||
|
public boolean checkSpawnObstruction(LevelReader level) {
|
||||||
|
if (level.isUnobstructed(this) && !level.containsAnyLiquid(this.getBoundingBox())) {
|
||||||
|
BlockPos blockPos = this.blockPosition();
|
||||||
|
- if (blockPos.getY() < level.getSeaLevel()) {
|
||||||
|
+ if (!level().purpurConfig.ocelotSpawnUnderSeaLevel && blockPos.getY() < level.getSeaLevel()) { // Purpur - Option Ocelot Spawn Under Sea Level
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -2158,6 +2158,7 @@ public class PurpurWorldConfig {
|
|||||||
public int ocelotBreedingTicks = 6000;
|
public int ocelotBreedingTicks = 6000;
|
||||||
public boolean ocelotTakeDamageFromWater = false;
|
public boolean ocelotTakeDamageFromWater = false;
|
||||||
public boolean ocelotAlwaysDropExp = false;
|
public boolean ocelotAlwaysDropExp = false;
|
||||||
|
public boolean ocelotSpawnUnderSeaLevel = false;
|
||||||
private void ocelotSettings() {
|
private void ocelotSettings() {
|
||||||
ocelotRidable = getBoolean("mobs.ocelot.ridable", ocelotRidable);
|
ocelotRidable = getBoolean("mobs.ocelot.ridable", ocelotRidable);
|
||||||
ocelotRidableInWater = getBoolean("mobs.ocelot.ridable-in-water", ocelotRidableInWater);
|
ocelotRidableInWater = getBoolean("mobs.ocelot.ridable-in-water", ocelotRidableInWater);
|
||||||
@@ -2172,6 +2173,7 @@ public class PurpurWorldConfig {
|
|||||||
ocelotBreedingTicks = getInt("mobs.ocelot.breeding-delay-ticks", ocelotBreedingTicks);
|
ocelotBreedingTicks = getInt("mobs.ocelot.breeding-delay-ticks", ocelotBreedingTicks);
|
||||||
ocelotTakeDamageFromWater = getBoolean("mobs.ocelot.takes-damage-from-water", ocelotTakeDamageFromWater);
|
ocelotTakeDamageFromWater = getBoolean("mobs.ocelot.takes-damage-from-water", ocelotTakeDamageFromWater);
|
||||||
ocelotAlwaysDropExp = getBoolean("mobs.ocelot.always-drop-exp", ocelotAlwaysDropExp);
|
ocelotAlwaysDropExp = getBoolean("mobs.ocelot.always-drop-exp", ocelotAlwaysDropExp);
|
||||||
|
ocelotSpawnUnderSeaLevel = getBoolean("mobs.ocelot.spawn-below-sea-level", ocelotSpawnUnderSeaLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean pandaRidable = false;
|
public boolean pandaRidable = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user