Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
if (this.func_176369_e(p_180650_1_, blockpos))
{
- p_180650_1_.func_175656_a(blockpos, Blocks.field_150480_ab.func_176223_P());
+ if (p_180650_1_.func_180495_p(blockpos) != Blocks.field_150480_ab) {
+ if (p_180650_1_.func_180495_p(blockpos).func_177230_c() != Blocks.field_150480_ab) { // CatRoom - Fix condition
+ if (CraftEventFactory.callBlockIgniteEvent(p_180650_1_, blockpos.func_177958_n(), blockpos.func_177956_o(), blockpos.func_177952_p(), p_180650_2_.func_177958_n(), p_180650_2_.func_177956_o(), p_180650_2_.func_177952_p()).isCancelled()) {
+ continue;
+ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
entityplayermp = this.field_75391_e.func_191993_do();
}

+ int experience = this.field_75390_d.func_70681_au().nextInt(7) + 1;
+ int experience = this.field_75390_d.func_70681_au().nextInt(catserver.server.utils.ModFixUtils.fixNetherAPI()) + 1; // CatRoom - Fix NetherAPI
+ org.bukkit.event.entity.EntityBreedEvent entityBreedEvent = org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callEntityBreedEvent(entityageable, field_75390_d, field_75391_e, entityplayermp, this.field_75390_d.breedItem, experience);
+ if (entityBreedEvent.isCancelled()) {
+ return;
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/catserver/server/utils/ModFixUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
public class ModFixUtils {
public static void doBlockCollisions() { }

/**
* Logic: NetherAPI transformer locates constant 7 in EntityAIMate#spawnBaby,
* and replace it with its own Hooks.spawnParticles call, which always returns 0.
* CraftBukkit inserted another constant 7 in Random instance for calculating experience drops,
* NetherAPI accidentally replaced it, leading to IllegalArgumentException.
*
* @see <a href="https://github.com/jbredwards/Nether-API/blob/1.12.2/src/main/java/git/jbredwards/nether_api/mod/asm/transformers/vanilla/Transformer_MC_10369.java#L230-L264">NetherAPI</a>
* @see net.minecraft.entity.ai.EntityAIMate#spawnBaby
*/
public static int fixNetherAPI() {
return 7;
}

public static void fixNetherex() {
if (Loader.instance().getIndexedModList().containsKey("netherex")) {
World netherWorld = DimensionManager.getWorld(-1);
Expand Down