Add items per tick to the hopper configurations

By: md_5 <git@md-5.net>
This commit is contained in:
Spigot 2014-04-19 09:22:44 +10:00
parent f8ca6ed867
commit a7b041f721
12 changed files with 65 additions and 44 deletions

View file

@ -1,11 +1,12 @@
From c77ca033afa24023df24c824228bacfca7141f7e Mon Sep 17 00:00:00 2001
From 4abf7241f8d31fc5a9aa42f461c996f435f7c171 Mon Sep 17 00:00:00 2001
From: erocs <github@erocs.org>
Date: Sun, 8 Sep 2013 12:06:15 -0700
Subject: [PATCH] Hopper Cooldowns
Subject: [PATCH] Hopper Customisations
Allows editing hopper cooldowns and amount transferred per tick.
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index 48a882a..baa158b 100644
index 48a882a..e661462 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -189,12 +189,18 @@ public class TileEntityHopper extends TileEntity implements IHopper {
@ -28,6 +29,15 @@ index 48a882a..baa158b 100644
return false;
} else {
return false;
@@ -246,7 +252,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
if (this.getItem(j) != null) {
ItemStack itemstack = this.getItem(j).cloneItemStack();
// CraftBukkit start - Call event when pushing items into other inventories
- CraftItemStack oitemstack = CraftItemStack.asCraftMirror(this.splitStack(j, 1));
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(this.splitStack(j, world.spigotConfig.hopperAmount)); // Spigot
Inventory destinationInventory;
// Have to special case large chests as they work oddly
@@ -260,7 +266,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
this.getWorld().getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@ -37,6 +47,15 @@ index 48a882a..baa158b 100644
return false;
}
ItemStack itemstack1 = addItem(iinventory, CraftItemStack.asNMSCopy(event.getItem()), i);
@@ -379,7 +385,7 @@ public class TileEntityHopper extends TileEntity implements IHopper {
if (itemstack != null && canTakeItemFromInventory(iinventory, itemstack, i, j)) {
ItemStack itemstack1 = itemstack.cloneItemStack();
// CraftBukkit start - Call event on collection of items from inventories into the hopper
- CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.splitStack(i, 1));
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.splitStack(i, ihopper.getWorld().spigotConfig.hopperAmount)); // Spigot
Inventory sourceInventory;
// Have to special case large chests as they work oddly
@@ -396,9 +402,9 @@ public class TileEntityHopper extends TileEntity implements IHopper {
iinventory.setItem(i, itemstack1);
@ -59,25 +78,27 @@ index 48a882a..baa158b 100644
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 6421bf2..827e6f9 100644
index 6421bf2..956c628 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -164,4 +164,17 @@ public class SpigotWorldConfig
@@ -164,4 +164,19 @@ public class SpigotWorldConfig
otherTrackingRange = getInt( "entity-tracking-range.other", otherTrackingRange );
log( "Entity Tracking Range: Pl " + playerTrackingRange + " / An " + animalTrackingRange + " / Mo " + monsterTrackingRange + " / Mi " + miscTrackingRange + " / Other " + otherTrackingRange );
}
+
+ public int hopperTransfer = 8;
+ public int hopperCheck = 8;
+ public int hopperTransfer;
+ public int hopperCheck;
+ public int hopperAmount;
+ private void hoppers()
+ {
+ // Set the tick delay between hopper item movements
+ hopperTransfer = getInt( "ticks-per.hopper-transfer", hopperTransfer );
+ hopperTransfer = getInt( "ticks-per.hopper-transfer", 8 );
+ // Set the tick delay between checking for items after the associated
+ // container is empty. Default to the hopperTransfer value to prevent
+ // hopper sorting machines from becoming out of sync.
+ hopperCheck = getInt( "ticks-per.hopper-check", hopperTransfer );
+ log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck );
+ hopperAmount = getInt( "hopper-amount", 1 );
+ log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck + " Hopper Amount: " + hopperAmount );
+ }
}
--

View file

@ -1,4 +1,4 @@
From 3cafcf93720a49cb8ef7e81c7061f2b2aace758f Mon Sep 17 00:00:00 2001
From b42bf264aecbc8ba6c9fa45752ad7e30222cd3c7 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 22 Jun 2013 16:12:02 +1000
Subject: [PATCH] Allow Disabling of Random Lighting Updates
@ -31,12 +31,12 @@ index 508c059..932686f 100644
entityhuman = (EntityHuman) this.players.get(i);
j = MathHelper.floor(entityhuman.locX) + this.random.nextInt(11) - 5;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 827e6f9..adebd03 100644
index 956c628..8868ea3 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -177,4 +177,11 @@ public class SpigotWorldConfig
hopperCheck = getInt( "ticks-per.hopper-check", hopperTransfer );
log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck );
@@ -179,4 +179,11 @@ public class SpigotWorldConfig
hopperAmount = getInt( "hopper-amount", 1 );
log( "Hopper Transfer: " + hopperTransfer + " Hopper Check: " + hopperCheck + " Hopper Amount: " + hopperAmount );
}
+
+ public boolean randomLightUpdates;

View file

@ -1,4 +1,4 @@
From 973a2a6dd2f6c8dc8480e61b6dd915e112e593d0 Mon Sep 17 00:00:00 2001
From 39c62a4e08bff0439f9a6d8a95c6f21a86523151 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sat, 21 Sep 2013 12:33:09 +1000
Subject: [PATCH] Allow Disabling of 1.6.3 Structure Saving
@ -25,10 +25,10 @@ index 97308d0..4d336d8 100644
this.e = new PersistentStructure(this.a());
world.a(this.a(), (PersistentBase) this.e);
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index adebd03..9586c44 100644
index 8868ea3..48ae475 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -184,4 +184,16 @@ public class SpigotWorldConfig
@@ -186,4 +186,16 @@ public class SpigotWorldConfig
randomLightUpdates = getBoolean( "random-light-updates", false );
log( "Random Lighting Updates: " + randomLightUpdates );
}

View file

@ -1,4 +1,4 @@
From 6a3fa409b3105217da2dbdba5aad0638d1940363 Mon Sep 17 00:00:00 2001
From 1c45911173c468093a799eb5ed20080a9d10b2cb Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 22 Sep 2013 19:10:53 +1000
Subject: [PATCH] Item Despawn Rate
@ -18,10 +18,10 @@ index 95beb11..0f1bcc7 100644
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
this.age = 0;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 9586c44..82d59e7 100644
index 48ae475..6d31363 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -196,4 +196,11 @@ public class SpigotWorldConfig
@@ -198,4 +198,11 @@ public class SpigotWorldConfig
log( "*** WARNING *** Please use this option with caution, SpigotMC is not responsible for any issues this option may cause in the future!" );
}
}

View file

@ -1,4 +1,4 @@
From b483d47362aa2037c79bec0b19075964c33ac0a2 Mon Sep 17 00:00:00 2001
From edcaaf414c0734f22334becb94a8d82b7fb66e2a Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Mon, 14 Oct 2013 19:20:10 +1100
Subject: [PATCH] Arrow Despawn Rate
@ -18,10 +18,10 @@ index 3137bcf..13903e9 100644
}
} else {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 82d59e7..2ec047c 100644
index 6d31363..1814b4f 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -203,4 +203,11 @@ public class SpigotWorldConfig
@@ -205,4 +205,11 @@ public class SpigotWorldConfig
itemDespawnRate = getInt( "item-despawn-rate", 6000 );
log( "Item Despawn Rate: " + itemDespawnRate );
}

View file

@ -1,4 +1,4 @@
From 2faa824fc272a0284e67d48e04a56e824e7de987 Mon Sep 17 00:00:00 2001
From 291d52ba09c9f3c0d718845f8050406fd67f3298 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 16 May 2013 18:51:05 +1000
Subject: [PATCH] Orebfuscator
@ -345,7 +345,7 @@ index 0000000..8e69bff
+ }
+}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 2ec047c..2c0501d 100644
index 1814b4f..45b2aae 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -1,5 +1,6 @@
@ -355,7 +355,7 @@ index 2ec047c..2c0501d 100644
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
@@ -210,4 +211,36 @@ public class SpigotWorldConfig
@@ -212,4 +213,36 @@ public class SpigotWorldConfig
arrowDespawnRate = getInt( "arrow-despawn-rate", 1200 );
log( "Arrow Despawn Rate: " + arrowDespawnRate );
}

View file

@ -1,4 +1,4 @@
From 0550daf8c61dd5b0710f91a74b179eba18499cf1 Mon Sep 17 00:00:00 2001
From 683a618dad27ca90a3a10c1c955858db09326aeb Mon Sep 17 00:00:00 2001
From: Dylan Xaldin <Puremin0rez515@gmail.com>
Date: Thu, 12 Dec 2013 18:05:03 -0600
Subject: [PATCH] Allow Disabling Zombie Villager Aggression
@ -28,10 +28,10 @@ index ecb4abe..1eaac63 100644
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 2c0501d..042280d 100644
index 45b2aae..b8e144d 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -243,4 +243,11 @@ public class SpigotWorldConfig
@@ -245,4 +245,11 @@ public class SpigotWorldConfig
antiXrayInstance = new AntiXray( this );
}

View file

@ -1,4 +1,4 @@
From 73c3802943f52d19b4ea8ec90fe6d54d0dc79a21 Mon Sep 17 00:00:00 2001
From c1894b57a43af9b0b3cf069d03b82c990e27f08c Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Sun, 2 Feb 2014 16:55:46 +0000
Subject: [PATCH] Add Option to Nerf Mobs from Spawner's
@ -64,10 +64,10 @@ index b97ac4b..23f09f7 100644
// CraftBukkit end
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 042280d..558e9cd 100644
index b8e144d..d7766bb 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -250,4 +250,11 @@ public class SpigotWorldConfig
@@ -252,4 +252,11 @@ public class SpigotWorldConfig
zombieAggressiveTowardsVillager = getBoolean( "zombie-aggressive-towards-villager", true );
log( "Zombie Aggressive Towards Villager: " + zombieAggressiveTowardsVillager );
}

View file

@ -1,4 +1,4 @@
From 321688b2a2f43f5670346ffd8f1729eee12a096d Mon Sep 17 00:00:00 2001
From 919de398e8b96920768fd594d155ad9097f18620 Mon Sep 17 00:00:00 2001
From: Dmck2b <dmck2b+github@gmail.com>
Date: Mon, 20 Jan 2014 20:18:23 +0000
Subject: [PATCH] Allow toggling of ZombiePigmen spawning in portal blocks
@ -18,10 +18,10 @@ index 1356f13..b361775 100644
for (l = j; !World.a((IBlockAccess) world, i, l, k) && l > 0; --l) {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 558e9cd..ffdb33e 100644
index d7766bb..5c1d59c 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -257,4 +257,11 @@ public class SpigotWorldConfig
@@ -259,4 +259,11 @@ public class SpigotWorldConfig
nerfSpawnerMobs = getBoolean( "nerf-spawner-mobs", false );
log( "Nerfing mobs spawned from spawners: " + nerfSpawnerMobs );
}

View file

@ -1,4 +1,4 @@
From 19ab54c5f1481765f09e9d9e8b04cd827c32005d Mon Sep 17 00:00:00 2001
From 80b0379300d9010caf8a13499db2eb2746c6a614 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Tue, 28 Jan 2014 20:35:35 +1100
Subject: [PATCH] Allow Configuring Chunks per Packet
@ -18,10 +18,10 @@ index 367472d..d5a5426 100644
if (chunkcoordintpair != null) {
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index ffdb33e..1290829 100644
index 5c1d59c..744e1be 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -264,4 +264,11 @@ public class SpigotWorldConfig
@@ -266,4 +266,11 @@ public class SpigotWorldConfig
enableZombiePigmenPortalSpawns = getBoolean( "enable-zombie-pigmen-portal-spawns", true );
log( "Allow Zombie Pigmen to spawn from portal blocks: " + enableZombiePigmenPortalSpawns );
}

View file

@ -1,4 +1,4 @@
From 6dd165c327b68a2faa7be234b4e703ec2d2069df Mon Sep 17 00:00:00 2001
From d71c30736ed83ce5cc77cba983ac0d74c9a75bf5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 31 Jan 2014 11:18:34 -0500
Subject: [PATCH] Cap Entity Collisions
@ -46,10 +46,10 @@ index 4c3fd8a..f531103 100644
}
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index 1290829..b12a086 100644
index 744e1be..9745982 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -271,4 +271,11 @@ public class SpigotWorldConfig
@@ -273,4 +273,11 @@ public class SpigotWorldConfig
maxBulkChunk = getInt( "max-bulk-chunks", 5 );
log( "Sending up to " + maxBulkChunk + " chunks per packet" );
}

View file

@ -1,4 +1,4 @@
From c87300260fcc81bb2b17c85797f5fd4c7f9469bd Mon Sep 17 00:00:00 2001
From cb6e4ceea5ca3b59de192cdb001484832ff2282e Mon Sep 17 00:00:00 2001
From: drXor <mcyoungsota@gmail.com>
Date: Sat, 29 Mar 2014 13:44:25 -0400
Subject: [PATCH] Configurable dragon death and wither spawn sounds
@ -45,10 +45,10 @@ index 352f739..2c7d9f6 100644
this.s(i);
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index b12a086..312fa55 100644
index 9745982..3e6b1e6 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -278,4 +278,16 @@ public class SpigotWorldConfig
@@ -280,4 +280,16 @@ public class SpigotWorldConfig
maxCollisionsPerEntity = getInt( "max-entity-collisions", 8 );
log( "Max Entity Collisions: " + maxCollisionsPerEntity );
}