1
0
Fork 0

Updated forge

kcx-1614
Prototik 2015-05-08 16:29:14 +07:00
parent 975fe84d43
commit 66f77f8314
14 changed files with 90 additions and 57 deletions

2
.gitmodules vendored
View File

@ -3,5 +3,5 @@
url = https://github.com/gamerforEA/Bukkit.git
[submodule "forge"]
path = forge
url = https://github.com/gamerforEA/MinecraftForge.git
url = https://github.com/MinecraftForge/MinecraftForge.git
branch = 1.7.10

View File

@ -43,10 +43,10 @@ minecraft {
group = 'net.minecraftforge'
ext.mcVersion = "1.7.10"
ext.cauldronVersion = "1"
ext.forgeVersion = "1388"
ext.cauldronVersion = "2"
ext.forgeVersion = "1403"
ext.bukkitVersion = "1"
version = "${mcVersion}-${cauldronVersion}.${forgeVersion}.${bukkitVersion}.0"
version = "${mcVersion}-${cauldronVersion}.${forgeVersion}.${bukkitVersion}.47"
jenkins {
job = 'Cauldron'
@ -64,10 +64,10 @@ tasks.packageUniversal.manifest {
attributes([
'Implementation-Vendor': 'Cauldron',
'Implementation-Title': 'Cauldron',
'Implementation-Version': 'git-Cauldron-Reloaded-'+project.version,
'Forge-Version': '10.13.3.1388',
'Implementation-Version': 'KCauldron-'+project.version,
'Forge-Version': '10.13.3.1403',
'Specification-Vendor': 'Bukkit Team',
'Specification-Title': 'Bukkit',
'Specification-Version': '1.7.10-R0.1-SNAPSHOT'
])
}
}

2
forge

@ -1 +1 @@
Subproject commit 1f7d7dc306db650cd0e647100c9225b6c33a9d5b
Subproject commit 4270f0fb4a7bf97888451b27e48f60d79ce10d1f

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Fri May 08 13:12:57 KRAT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip

2
gradlew vendored Normal file → Executable file
View File

@ -65,7 +65,7 @@ cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/forge/fml/gradle/wrapper/gradle-wrapper.jar
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then

2
gradlew.bat vendored
View File

@ -69,7 +69,7 @@ set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\forge\fml\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

View File

@ -8,7 +8,7 @@
import net.minecraft.world.WorldProviderEnd;
import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.WorldSettings;
@@ -2644,7 +2645,14 @@
@@ -2656,7 +2657,14 @@
if (integratedserver != null)
{

View File

@ -1818,7 +1818,7 @@
finally
{
@@ -1135,19 +2442,18 @@
{
if (itemstack.getItem() == Items.written_book && itemstack1.getItem() == Items.writable_book)
{
- itemstack1.setTagInfo("author", new NBTTagString(this.playerEntity.getCommandSenderName()));

View File

@ -1,11 +1,11 @@
--- ../src-base/minecraft/net/minecraft/network/rcon/RConThreadClient.java
+++ ../src-work/minecraft/net/minecraft/network/rcon/RConThreadClient.java
@@ -53,6 +53,8 @@
@@ -52,6 +52,8 @@
BufferedInputStream bufferedinputstream = new BufferedInputStream(this.clientSocket.getInputStream());
int i = bufferedinputstream.read(this.buffer, 0, 1460);
+
+ if (i == -1) this.running = false; // Cauldron
+
if (10 <= i)
if (10 > i)
{
byte b0 = 0;

View File

@ -1,6 +1,6 @@
--- ../src-base/minecraft/net/minecraft/world/gen/ChunkProviderServer.java
+++ ../src-work/minecraft/net/minecraft/world/gen/ChunkProviderServer.java
@@ -32,23 +32,40 @@
@@ -32,23 +32,41 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -38,6 +38,7 @@
+ public List loadedChunks = new ArrayList(); // Cauldron - vanilla compatibility
public WorldServer worldObj;
private Set<Long> loadingChunks = com.google.common.collect.Sets.newHashSet();
+ public LongHashMap field_73244_f = new LongHashMap(); // Cauldron - vanilla/mystcraft compatibility
private static final String __OBFID = "CL_00001436";
public ChunkProviderServer(WorldServer p_i1520_1_, IChunkLoader p_i1520_2_, IChunkProvider p_i1520_3_)
@ -46,7 +47,7 @@
this.defaultEmptyChunk = new EmptyChunk(p_i1520_1_, 0, 0);
this.worldObj = p_i1520_1_;
this.currentChunkLoader = p_i1520_2_;
@@ -57,10 +74,10 @@
@@ -57,10 +75,10 @@
public boolean chunkExists(int p_73149_1_, int p_73149_2_)
{
@ -59,7 +60,7 @@
{
return this.loadedChunks;
}
@@ -74,20 +91,39 @@
@@ -74,20 +92,39 @@
int l = p_73241_2_ * 16 + 8 - chunkcoordinates.posZ;
short short1 = 128;
@ -102,7 +103,7 @@
while (iterator.hasNext())
{
@@ -103,9 +139,9 @@
@@ -103,9 +140,9 @@
public Chunk loadChunk(int par1, int par2, Runnable runnable)
{
@ -115,7 +116,7 @@
AnvilChunkLoader loader = null;
if (this.currentChunkLoader instanceof AnvilChunkLoader)
@@ -113,6 +149,8 @@
@@ -113,6 +150,8 @@
loader = (AnvilChunkLoader) this.currentChunkLoader;
}
@ -124,7 +125,7 @@
// We can only use the queue for already generated chunks
if (chunk == null && loader != null && loader.chunkExists(this.worldObj, par1, par2))
{
@@ -142,18 +180,19 @@
@@ -142,18 +181,19 @@
public Chunk originalLoadChunk(int p_73158_1_, int p_73158_2_)
{
@ -149,7 +150,7 @@
if (chunk == null)
{
chunk = this.safeLoadChunk(p_73158_1_, p_73158_2_);
@@ -176,18 +215,39 @@
@@ -176,18 +216,40 @@
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Exception generating new chunk");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Chunk to be generated");
crashreportcategory.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(p_73158_1_), Integer.valueOf(p_73158_2_)}));
@ -169,6 +170,7 @@
- chunk.onChunkLoad();
+ this.loadedChunkHashMap.put(LongHash.toLong(p_73158_1_, p_73158_2_), chunk); // CraftBukkit
+ this.loadedChunks.add(chunk); // Cauldron - vanilla compatibility
+ this.field_73244_f.add(ChunkCoordIntPair.chunkXZ2Int(p_73158_1_, p_73158_2_), chunk); // Cauldron - vanilla/mystcraft compatibility
+ loadingChunks.remove(LongHash.toLong(p_73158_1_, p_73158_2_)); // Cauldron - LongHash
+
+ if (chunk != null)
@ -194,7 +196,7 @@
}
return chunk;
@@ -195,11 +255,29 @@
@@ -195,11 +257,29 @@
public Chunk provideChunk(int p_73154_1_, int p_73154_2_)
{
@ -209,14 +211,14 @@
+ return chunk;
+ }
+
+ if (p_73154_1_ != chunk.xPosition || p_73154_2_ != chunk.zPosition)
+ /*if (p_73154_1_ != chunk.xPosition || p_73154_2_ != chunk.zPosition)
+ {
+ logger.error("Chunk (" + chunk.xPosition + ", " + chunk.zPosition + ") stored at (" + p_73154_1_ + ", " + p_73154_2_ + ") in world '" + worldObj.getWorld().getName() + "'");
+ logger.error(chunk.getClass().getName());
+ Throwable ex = new Throwable();
+ ex.fillInStackTrace();
+ ex.printStackTrace();
+ }
+ }*/ // Cauldron - workaroung of console spamming for mystcraft
+ chunk.lastAccessedTick = MinecraftServer.getServer().getTickCounter(); // Cauldron
+ return chunk;
+ // CraftBukkit end
@ -227,7 +229,7 @@
{
if (this.currentChunkLoader == null)
{
@@ -209,6 +287,7 @@
@@ -209,6 +289,7 @@
{
try
{
@ -235,7 +237,7 @@
Chunk chunk = this.currentChunkLoader.loadChunk(this.worldObj, p_73239_1_, p_73239_2_);
if (chunk != null)
@@ -217,8 +296,11 @@
@@ -217,8 +298,11 @@
if (this.currentChunkProvider != null)
{
@ -247,7 +249,7 @@
}
return chunk;
@@ -231,7 +313,7 @@
@@ -231,7 +315,7 @@
}
}
@ -256,7 +258,7 @@
{
if (this.currentChunkLoader != null)
{
@@ -246,7 +328,7 @@
@@ -246,7 +330,7 @@
}
}
@ -265,7 +267,7 @@
{
if (this.currentChunkLoader != null)
{
@@ -254,15 +336,18 @@
@@ -254,15 +338,18 @@
{
p_73242_1_.lastSaveTime = this.worldObj.getTotalWorldTime();
this.currentChunkLoader.saveChunk(this.worldObj, p_73242_1_);
@ -285,7 +287,7 @@
}
}
@@ -277,6 +362,35 @@
@@ -277,6 +364,35 @@
if (this.currentChunkProvider != null)
{
this.currentChunkProvider.populate(p_73153_1_, p_73153_2_, p_73153_3_);
@ -321,7 +323,7 @@
GameRegistry.generateWorld(p_73153_2_, p_73153_3_, worldObj, currentChunkProvider, p_73153_1_);
chunk.setChunkModified();
}
@@ -286,11 +400,13 @@
@@ -286,11 +402,13 @@
public boolean saveChunks(boolean p_73151_1_, IProgressUpdate p_73151_2_)
{
int i = 0;
@ -338,7 +340,7 @@
if (p_73151_1_)
{
@@ -325,36 +441,60 @@
@@ -325,36 +443,61 @@
{
if (!this.worldObj.levelSaving)
{
@ -406,6 +408,7 @@
+ // this.unloadQueue.remove(olong);
+ this.loadedChunkHashMap.remove(chunkcoordinates); // CraftBukkit
+ this.loadedChunks.remove(chunk); // Cauldron - vanilla compatibility
+ this.field_73244_f.remove(ChunkCoordIntPair.chunkXZ2Int(LongHash.msw(chunkcoordinates), LongHash.lsw(chunkcoordinates))); // Cauldron - vanilla/mystcraft compatibility
+ ForgeChunkManager.putDormantChunk(chunkcoordinates, chunk);
+ if(this.loadedChunkHashMap.size() == 0 && ForgeChunkManager.getPersistentChunksFor(this.worldObj).size() == 0 && !DimensionManager.shouldLoadSpawn(this.worldObj.provider.dimensionId)){
+ DimensionManager.unloadWorld(this.worldObj.provider.dimensionId);
@ -419,23 +422,21 @@
if (this.currentChunkLoader != null)
{
this.currentChunkLoader.chunkTick();
@@ -371,7 +511,8 @@
@@ -371,7 +514,7 @@
public String makeString()
{
- return "ServerChunkCache: " + this.loadedChunkHashMap.getNumHashElements() + " Drop: " + this.chunksToUnload.size();
+ // CraftBukkit - this.chunks.count() -> .values().size()
+ return "ServerChunkCache: " + this.loadedChunkHashMap.values().size() + " Drop: " + this.chunksToUnload.size();
+ return "ServerChunkCache: " + this.loadedChunkHashMap.size() + " Drop: " + this.chunksToUnload.size(); // Cauldron
}
public List getPossibleCreatures(EnumCreatureType p_73155_1_, int p_73155_2_, int p_73155_3_, int p_73155_4_)
@@ -386,8 +527,32 @@
@@ -386,8 +529,31 @@
public int getLoadedChunkCount()
{
- return this.loadedChunkHashMap.getNumHashElements();
+ // CraftBukkit - this.chunks.count() -> .values().size()
+ return this.loadedChunkHashMap.values().size();
+ return this.loadedChunkHashMap.size(); // Cauldron
}
public void recreateStructures(int p_82695_1_, int p_82695_2_) {}

View File

@ -5,7 +5,7 @@
public static final int revisionVersion = 3;
//This number is incremented every time Jenkins builds Forge, and never reset. Should always be 0 in the repo code.
- public static final int buildVersion = 0;
+ public static final int buildVersion = 1388; // Cauldron
+ public static final int buildVersion = 1403; // Cauldron
private static Status status = PENDING;
private static String target = null;

View File

@ -10,13 +10,14 @@
class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChunk, net.minecraft.world.chunk.Chunk, Runnable, RuntimeException> {
private final AtomicInteger threadNumber = new AtomicInteger(1);
@@ -41,13 +44,20 @@
@@ -41,13 +44,21 @@
queuedChunk.loader.loadEntities(queuedChunk.world, queuedChunk.compound.getCompoundTag("Level"), chunk);
MinecraftForge.EVENT_BUS.post(new ChunkDataEvent.Load(chunk, queuedChunk.compound)); // Don't call ChunkDataEvent.Load async
chunk.lastSaveTime = queuedChunk.provider.worldObj.getTotalWorldTime();
- queuedChunk.provider.loadedChunkHashMap.add(ChunkCoordIntPair.chunkXZ2Int(queuedChunk.x, queuedChunk.z), chunk);
+ queuedChunk.provider.loadedChunkHashMap.put(LongHash.toLong(queuedChunk.x, queuedChunk.z), chunk);
queuedChunk.provider.loadedChunks.add(chunk);
+ queuedChunk.provider.field_73244_f.add(ChunkCoordIntPair.chunkXZ2Int(queuedChunk.x, queuedChunk.z), chunk); // Cauldron - vanilla/mystcraft compatibility
chunk.onChunkLoad();
if (queuedChunk.provider.currentChunkProvider != null) {

View File

@ -205,16 +205,9 @@ public class LongObjectHashMap<V> implements Cloneable, Serializable {
* this reason it should be avoided if at all possible.
*
* @return Set of Entry objects
* @deprecated
*/
@Deprecated
public Set<Map.Entry<Long, V>> entrySet() {
HashSet<Map.Entry<Long, V>> set = new HashSet<Map.Entry<Long, V>>();
for (long key : keySet()) {
set.add(new Entry(key, get(key)));
}
return set;
return new EntrySet();
}
public Object clone() throws CloneNotSupportedException {
@ -413,14 +406,9 @@ public class LongObjectHashMap<V> implements Cloneable, Serializable {
private class Entry implements Map.Entry<Long, V> {
private final Long key;
private Long key;
private V value;
Entry(long k, V v) {
key = k;
value = v;
}
public Long getKey() {
return key;
}
@ -435,5 +423,42 @@ public class LongObjectHashMap<V> implements Cloneable, Serializable {
put(key, v);
return old;
}
private void bind(long key, V value) {
this.key = key;
this.value = value;
}
}
private class EntrySet extends AbstractSet<Map.Entry<Long, V>> {
@Override
public Iterator<Map.Entry<Long, V>> iterator() {
return new Iterator<Map.Entry<Long, V>>() {
final Entry entry = new Entry();
final ValueIterator valueIterator = new ValueIterator();
@Override
public boolean hasNext() {
return valueIterator.hasNext();
}
@Override
public LongObjectHashMap<V>.Entry next() {
V value = valueIterator.next();
entry.bind(valueIterator.prevKey, value);
return entry;
}
@Override
public void remove() {
valueIterator.remove();
}
};
}
@Override
public int size() {
return LongObjectHashMap.this.size;
}
}
}