@@ -1,4 +1,4 @@
|
||||
From 9ce8fe366d6c6f3fb6d9f358782bd67f7286f869 Mon Sep 17 00:00:00 2001
|
||||
From b602c4203e83e437284f7716e1b6535e22a3af2b Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <md_5@live.com.au>
|
||||
Date: Sat, 23 Mar 2013 09:46:33 +1100
|
||||
Subject: [PATCH] Merge tweaks and configuration
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Merge tweaks and configuration
|
||||
This allows the merging of Experience orbs, as well as the configuration of the merge radius of items. Additionally it refactors the merge algorithm to be a better experience for players.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
|
||||
index 0225f53..67567fa 100644
|
||||
index 0225f53..048e8fa 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityItem.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityItem.java
|
||||
@@ -114,7 +114,10 @@ public class EntityItem extends Entity {
|
||||
@@ -15,7 +15,7 @@ index 0225f53..67567fa 100644
|
||||
private void g() {
|
||||
- Iterator iterator = this.world.a(EntityItem.class, this.boundingBox.grow(0.5D, 0.0D, 0.5D)).iterator();
|
||||
+ // Spigot start
|
||||
+ float radius = world.spigotConfig.itemMerge;
|
||||
+ double radius = world.spigotConfig.itemMerge;
|
||||
+ Iterator iterator = this.world.a(EntityItem.class, this.boundingBox.grow(radius, radius, radius)).iterator();
|
||||
+ // Spigot end
|
||||
|
||||
@@ -41,7 +41,7 @@ index 0225f53..67567fa 100644
|
||||
}
|
||||
} else {
|
||||
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
||||
index afe3e4d..d7e5301 100644
|
||||
index afe3e4d..97da2cd 100644
|
||||
--- a/src/main/java/net/minecraft/server/World.java
|
||||
+++ b/src/main/java/net/minecraft/server/World.java
|
||||
@@ -957,6 +957,23 @@ public abstract class World implements IBlockAccess {
|
||||
@@ -51,7 +51,7 @@ index afe3e4d..d7e5301 100644
|
||||
+ // Spigot start
|
||||
+ else if (entity instanceof EntityExperienceOrb) {
|
||||
+ EntityExperienceOrb xp = (EntityExperienceOrb) entity;
|
||||
+ float radius = spigotConfig.expMerge;
|
||||
+ double radius = spigotConfig.expMerge;
|
||||
+ if (radius > 0) {
|
||||
+ List<Entity> entities = this.getEntities(entity, entity.boundingBox.grow(radius, radius, radius));
|
||||
+ for (Entity e : entities) {
|
||||
@@ -69,25 +69,25 @@ index afe3e4d..d7e5301 100644
|
||||
if (event != null && (event.isCancelled() || entity.dead)) {
|
||||
entity.dead = true;
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
index 8954c99..799bbc8 100644
|
||||
index 899f86c..1101361 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||||
@@ -93,4 +93,18 @@ public class SpigotWorldConfig
|
||||
@@ -99,4 +99,18 @@ public class SpigotWorldConfig
|
||||
wheatModifier = getInt( "growth.wheat-modifier", wheatModifier );
|
||||
log( "Cactus Growth Modifier: " + cactusModifier + "%" );
|
||||
}
|
||||
+
|
||||
+ public float itemMerge = 2.5F;
|
||||
+ public double itemMerge;
|
||||
+ private void itemMerge()
|
||||
+ {
|
||||
+ itemMerge = getFloat( "merge-radius.item", itemMerge );
|
||||
+ itemMerge = getDouble("merge-radius.item", 2.5 );
|
||||
+ log( "Item Merge Radius: " + itemMerge );
|
||||
+ }
|
||||
+
|
||||
+ public float expMerge = 3.0F;
|
||||
+ public double expMerge;
|
||||
+ private void expMerge()
|
||||
+ {
|
||||
+ expMerge = getFloat( "merge-radius.exp", expMerge );
|
||||
+ expMerge = getDouble("merge-radius.exp", 3.0 );
|
||||
+ log( "Experience Merge Radius: " + expMerge );
|
||||
+ }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user