diff --git a/build.gradle b/build.gradle index 354ab298b..d89a5cf84 100644 --- a/build.gradle +++ b/build.gradle @@ -49,9 +49,11 @@ def details = versionDetails() group 'com.cleanroommc' -version details.lastTag + (project.hasProperty("release") ? - "" : ("+build." + details.commitDistance + (project.hasProperty("run_number") ? - (".run." + props.run_number) : ""))) +//version details.lastTag + (project.hasProperty("release") ? +// "" : ("+build." + details.commitDistance + (project.hasProperty("run_number") ? +// (".run." + props.run_number) : ""))) + +version "0.2.1-alpha" def version_txt = new File(project.projectDir, "version.txt") version_txt.write(version.toString()) @@ -185,7 +187,7 @@ project(':cleanroom') { target.withWriter { def writer -> template.eachLine { def line -> - def newLine = line.replace("%VERSION%", versionDetails().lastTag) + def newLine = line.replace("%VERSION%", rootProject.version.toString()) .replace("%BUILD_VERSION%", rootProject.version.toString()) writer.write(newLine + "\n"); } @@ -435,7 +437,7 @@ project(':cleanroom') { installer "org.ow2.asm:asm-deprecated:$props.asm_deprecated" //installer "com.cleanroommc:bouncepad:$props.bouncepad_version" - installer "top.outlands:foundation:0.13.5" + installer "top.outlands:foundation:0.13.6" installer 'org.burningwave:jvm-driver:8.15.0' installer 'io.github.toolfactory:jvm-driver:9.7.0' installer 'io.github.toolfactory:narcissus:1.0.7' diff --git a/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch b/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch index 72df61b4a..4f753bae9 100644 --- a/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch +++ b/patches/minecraft/net/minecraft/advancements/PlayerAdvancements.java.patch @@ -27,7 +27,7 @@ - private final Set field_192759_g = Sets.newLinkedHashSet(); - private final Set field_192760_h = Sets.newLinkedHashSet(); - private final Set field_192761_i = Sets.newLinkedHashSet(); -+ private final Map field_192758_f = Maps.newLinkedHashMap(); ++ public final Map field_192758_f = Maps.newLinkedHashMap(); // CatServer - private -> public + private final Set field_192759_g = Sets.newLinkedHashSet(); + private final Set field_192760_h = Sets.newLinkedHashSet(); + private final Set field_192761_i = Sets.newLinkedHashSet(); diff --git a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch index 9be0bd4b8..c997c8068 100644 --- a/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch +++ b/patches/minecraft/net/minecraft/network/NetHandlerPlayServer.java.patch @@ -127,11 +127,10 @@ private double field_184349_l; private double field_184350_m; private double field_184351_n; -@@ -158,22 +209,65 @@ +@@ -158,22 +209,77 @@ private int field_184348_G; private ServerRecipeBookHelper field_194309_H = new ServerRecipeBookHelper(); -- public NetHandlerPlayServer(MinecraftServer p_i1530_1_, NetworkManager p_i1530_2_, EntityPlayerMP p_i1530_3_) + private final org.bukkit.craftbukkit.v1_12_R1.CraftServer craftServer; + private boolean processedDisconnect; + private int lastTick = MinecraftServer.currentTick; @@ -163,15 +162,7 @@ + private final NetworkDispatcher dispatcher; + + public NetHandlerPlayServer(MinecraftServer craftServer, NetworkManager networkManagerIn, EntityPlayerMP playerIn, NetworkDispatcher dispatcher) - { -- this.field_147367_d = p_i1530_1_; -- this.field_147371_a = p_i1530_2_; -- p_i1530_2_.func_150719_a(this); -- this.field_147369_b = p_i1530_3_; -- p_i1530_3_.field_71135_a = this; -- } -- -- @Override ++ { + this.field_147367_d = craftServer; + this.field_147371_a = networkManagerIn; + this.dispatcher = dispatcher; @@ -180,6 +171,21 @@ + playerIn.field_71135_a = this; + this.craftServer = field_147367_d == null ? (org.bukkit.craftbukkit.v1_12_R1.CraftServer)org.bukkit.Bukkit.getServer() : field_147367_d.server; + } ++ ++ // CatRoom - prevent plugin/mod NoSuchMethodError. + public NetHandlerPlayServer(MinecraftServer p_i1530_1_, NetworkManager p_i1530_2_, EntityPlayerMP p_i1530_3_) + { + this.field_147367_d = p_i1530_1_; + this.field_147371_a = p_i1530_2_; ++ this.dispatcher = null; + p_i1530_2_.func_150719_a(this); + this.field_147369_b = p_i1530_3_; + p_i1530_3_.field_71135_a = this; +- } +- +- @Override ++ this.craftServer = field_147367_d == null ? (org.bukkit.craftbukkit.v1_12_R1.CraftServer)org.bukkit.Bukkit.getServer() : field_147367_d.server; ++ } + // CatRoom End + + public CraftPlayer getPlayer() { @@ -190,7 +196,7 @@ { + // CatRoom start + // FORGE: sometimes the netqueue will tick while login is occurring, causing an NPE. We shouldn't tick until the connection is complete -+ if (dispatcher.state == NetworkDispatcher.ConnectionState.FINALIZING) ++ if (dispatcher != null && dispatcher.state == NetworkDispatcher.ConnectionState.FINALIZING) + { + dispatcher.completeServerSideConnection(NetworkDispatcher.ConnectionType.MODDED); + } @@ -204,7 +210,7 @@ ++this.field_147368_e; this.field_184348_G = this.field_184347_F; -@@ -181,8 +275,8 @@ +@@ -181,8 +287,8 @@ { if (++this.field_147365_f > 80) { @@ -215,7 +221,7 @@ return; } } -@@ -207,8 +301,8 @@ +@@ -207,8 +313,8 @@ { if (++this.field_184346_E > 80) { @@ -226,7 +232,7 @@ return; } } -@@ -228,42 +322,57 @@ +@@ -228,42 +334,57 @@ this.field_147367_d.field_71304_b.func_76320_a("keepAlive"); long i = this.func_147363_d(); @@ -298,7 +304,7 @@ { this.field_184349_l = this.field_147369_b.field_70165_t; this.field_184350_m = this.field_147369_b.field_70163_u; -@@ -278,28 +387,50 @@ +@@ -278,28 +399,50 @@ return this.field_147371_a; } @@ -361,7 +367,7 @@ public void func_147358_a(CPacketInput p_147358_1_) { PacketThreadUtil.func_180031_a(p_147358_1_, this, this.field_147369_b.func_71121_q()); -@@ -308,15 +439,9 @@ +@@ -308,15 +451,9 @@ private static boolean func_183006_b(CPacketPlayer p_183006_0_) { @@ -379,7 +385,7 @@ } else { -@@ -326,21 +451,16 @@ +@@ -326,21 +463,16 @@ private static boolean func_184341_b(CPacketVehicleMove p_184341_0_) { @@ -403,7 +409,7 @@ } else { -@@ -363,52 +483,134 @@ +@@ -363,52 +495,134 @@ double d9 = entity.field_70159_w * entity.field_70159_w + entity.field_70181_x * entity.field_70181_x + entity.field_70179_y * entity.field_70179_y; double d10 = d6 * d6 + d7 * d7 + d8 * d8; @@ -553,7 +559,7 @@ this.field_184359_v = entity.field_70165_t; this.field_184360_w = entity.field_70163_u; this.field_184361_x = entity.field_70161_v; -@@ -416,21 +618,13 @@ +@@ -416,21 +630,13 @@ } } @@ -577,7 +583,7 @@ if (this.field_147369_b.func_184850_K()) { -@@ -444,7 +638,6 @@ +@@ -444,7 +650,6 @@ } } @@ -585,7 +591,7 @@ public void func_191984_a(CPacketRecipeInfo p_191984_1_) { PacketThreadUtil.func_180031_a(p_191984_1_, this, this.field_147369_b.func_71121_q()); -@@ -460,7 +653,6 @@ +@@ -460,7 +665,6 @@ } } @@ -593,7 +599,7 @@ public void func_194027_a(CPacketSeenAdvancements p_194027_1_) { PacketThreadUtil.func_180031_a(p_194027_1_, this, this.field_147369_b.func_71121_q()); -@@ -477,20 +669,19 @@ +@@ -477,20 +681,19 @@ } } @@ -616,7 +622,7 @@ { if (this.field_147368_e == 0) { -@@ -502,14 +693,9 @@ +@@ -502,14 +705,9 @@ if (this.field_147368_e - this.field_184343_A > 20) { this.field_184343_A = this.field_147368_e; @@ -633,7 +639,7 @@ } else { -@@ -517,18 +703,19 @@ +@@ -517,18 +715,19 @@ if (this.field_147369_b.func_184218_aH()) { @@ -661,7 +667,7 @@ double d0 = this.field_147369_b.field_70165_t; double d1 = this.field_147369_b.field_70163_u; double d2 = this.field_147369_b.field_70161_v; -@@ -541,22 +728,14 @@ +@@ -541,22 +740,14 @@ double d7 = d4 - this.field_184349_l; double d8 = d5 - this.field_184350_m; double d9 = d6 - this.field_184351_n; @@ -687,7 +693,7 @@ } } else -@@ -564,76 +743,77 @@ +@@ -564,76 +755,77 @@ ++this.field_184347_F; int i = this.field_184347_F - this.field_184348_G; @@ -796,7 +802,7 @@ if (flag2 && (flag || !flag1)) { -@@ -642,11 +822,72 @@ +@@ -642,11 +834,72 @@ } } @@ -873,7 +879,7 @@ this.field_147369_b.field_70122_E = p_147347_1_.func_149465_i(); this.field_147367_d.func_184103_al().func_72358_d(this.field_147369_b); this.field_147369_b.func_71122_b(this.field_147369_b.field_70163_u - d3, p_147347_1_.func_149465_i()); -@@ -665,26 +906,98 @@ +@@ -665,26 +918,98 @@ this.func_175089_a(p_147364_1_, p_147364_3_, p_147364_5_, p_147364_7_, p_147364_8_, Collections.emptySet()); } @@ -991,7 +997,7 @@ if (++this.field_184363_z == Integer.MAX_VALUE) { -@@ -693,15 +1006,13 @@ +@@ -693,15 +1018,13 @@ this.field_184343_A = this.field_147368_e; this.field_147369_b.func_70080_a(this.field_184362_y.field_72450_a, this.field_184362_y.field_72448_b, this.field_184362_y.field_72449_c, f, f1); @@ -1009,7 +1015,7 @@ WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); BlockPos blockpos = p_147345_1_.func_179715_a(); this.field_147369_b.func_143004_u(); -@@ -712,8 +1023,18 @@ +@@ -712,8 +1035,18 @@ if (!this.field_147369_b.func_175149_v()) { @@ -1029,7 +1035,7 @@ this.field_147369_b.func_184611_a(EnumHand.MAIN_HAND, itemstack); } -@@ -722,6 +1043,21 @@ +@@ -722,6 +1055,21 @@ if (!this.field_147369_b.func_175149_v()) { @@ -1051,7 +1057,7 @@ this.field_147369_b.func_71040_bB(false); } -@@ -730,22 +1066,33 @@ +@@ -730,22 +1078,33 @@ if (!this.field_147369_b.func_175149_v()) { @@ -1089,7 +1095,7 @@ { return; } -@@ -763,7 +1110,15 @@ +@@ -763,7 +1122,15 @@ } else { @@ -1105,7 +1111,7 @@ } } else -@@ -791,10 +1146,10 @@ +@@ -791,10 +1158,10 @@ } } @@ -1117,7 +1123,7 @@ WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); EnumHand enumhand = p_184337_1_.func_187022_c(); ItemStack itemstack = this.field_147369_b.func_184586_b(enumhand); -@@ -802,34 +1157,25 @@ +@@ -802,34 +1169,25 @@ EnumFacing enumfacing = p_184337_1_.func_187024_b(); this.field_147369_b.func_143004_u(); @@ -1165,7 +1171,7 @@ textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED); this.field_147369_b.field_71135_a.func_147359_a(new SPacketChat(textcomponenttranslation, ChatType.GAME_INFO)); } -@@ -838,10 +1184,10 @@ +@@ -838,10 +1196,10 @@ this.field_147369_b.field_71135_a.func_147359_a(new SPacketBlockChange(worldserver, blockpos.func_177972_a(enumfacing))); } @@ -1177,7 +1183,7 @@ WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); EnumHand enumhand = p_147346_1_.func_187028_a(); ItemStack itemstack = this.field_147369_b.func_184586_b(enumhand); -@@ -849,11 +1195,49 @@ +@@ -849,11 +1207,49 @@ if (!itemstack.func_190926_b()) { @@ -1229,7 +1235,7 @@ public void func_175088_a(CPacketSpectate p_175088_1_) { PacketThreadUtil.func_180031_a(p_175088_1_, this, this.field_147369_b.func_71121_q()); -@@ -862,7 +1246,8 @@ +@@ -862,7 +1258,8 @@ { Entity entity = null; @@ -1239,7 +1245,7 @@ { if (worldserver != null) { -@@ -880,52 +1265,52 @@ +@@ -880,52 +1277,52 @@ this.field_147369_b.func_175399_e(this.field_147369_b); this.field_147369_b.func_184210_p(); @@ -1322,7 +1328,7 @@ public void func_184340_a(CPacketSteerBoat p_184340_1_) { PacketThreadUtil.func_180031_a(p_184340_1_, this, this.field_147369_b.func_71121_q()); -@@ -937,16 +1322,29 @@ +@@ -937,16 +1334,29 @@ } } @@ -1357,7 +1363,7 @@ if (this.field_147367_d.func_71264_H() && this.field_147369_b.func_70005_c_().equals(this.field_147367_d.func_71214_G())) { -@@ -973,6 +1371,13 @@ +@@ -973,6 +1383,13 @@ } } @@ -1371,7 +1377,7 @@ try { this.field_147371_a.func_179290_a(p_147359_1_); -@@ -992,30 +1397,47 @@ +@@ -992,30 +1409,47 @@ } } @@ -1405,6 +1411,8 @@ public void func_147354_a(CPacketChatMessage p_147354_1_) { - PacketThreadUtil.func_180031_a(p_147354_1_, this, this.field_147369_b.func_71121_q()); +- +- if (this.field_147369_b.func_147096_v() == EntityPlayer.EnumChatVisibility.HIDDEN) + // PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.player.getServerWorld()); + // CraftBukkit start - async chat + // SPIGOT-3638 @@ -1417,15 +1425,15 @@ + PacketThreadUtil.func_180031_a(p_147354_1_, this, this.field_147369_b.func_71121_q()); + } + // CraftBukkit end - - if (this.field_147369_b.func_147096_v() == EntityPlayer.EnumChatVisibility.HIDDEN) ++ ++ if (this.field_147369_b.field_70128_L || this.field_147369_b.func_147096_v() == EntityPlayer.EnumChatVisibility.HIDDEN) // CraftBukkit - dead men tell no tales { - TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("chat.cannotSend"); + TextComponentTranslation textcomponenttranslation = new TextComponentTranslation("chat.cannotSend", new Object[0]); textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED); this.func_147359_a(new SPacketChat(textcomponenttranslation)); } -@@ -1029,47 +1451,310 @@ +@@ -1029,47 +1463,310 @@ { if (!ChatAllowedCharacters.func_71566_a(s.charAt(i))) { @@ -1750,7 +1758,7 @@ this.field_147369_b.func_143004_u(); switch (p_147357_1_.func_180764_b()) -@@ -1128,10 +1813,7 @@ +@@ -1128,10 +1825,7 @@ break; case START_FALL_FLYING: @@ -1762,7 +1770,7 @@ { ItemStack itemstack = this.field_147369_b.func_184582_a(EntityEquipmentSlot.CHEST); -@@ -1151,10 +1833,10 @@ +@@ -1151,10 +1845,10 @@ } } @@ -1774,7 +1782,7 @@ WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); Entity entity = p_147340_1_.func_149564_a(worldserver); this.field_147369_b.func_143004_u(); -@@ -1162,41 +1844,83 @@ +@@ -1162,41 +1856,83 @@ if (entity != null) { boolean flag = this.field_147369_b.func_70685_l(entity); @@ -1863,7 +1871,7 @@ public void func_147342_a(CPacketClientStatus p_147342_1_) { PacketThreadUtil.func_180031_a(p_147342_1_, this, this.field_147369_b.func_71121_q()); -@@ -1220,7 +1944,7 @@ +@@ -1220,7 +1956,7 @@ return; } @@ -1872,7 +1880,7 @@ if (this.field_147367_d.func_71199_h()) { -@@ -1235,40 +1959,345 @@ +@@ -1235,40 +1971,345 @@ } } @@ -2230,7 +2238,7 @@ { this.field_147369_b.field_71135_a.func_147359_a(new SPacketConfirmTransaction(p_147351_1_.func_149548_c(), p_147351_1_.func_149547_f(), true)); this.field_147369_b.field_71137_h = true; -@@ -1278,15 +2307,15 @@ +@@ -1278,15 +2319,15 @@ } else { @@ -2250,7 +2258,7 @@ nonnulllist1.add(itemstack1); } -@@ -1296,39 +2325,46 @@ +@@ -1296,39 +2337,46 @@ } } @@ -2306,7 +2314,7 @@ if (this.field_147369_b.field_71134_c.func_73083_d()) { -@@ -1356,7 +2392,46 @@ +@@ -1356,7 +2404,46 @@ } boolean flag1 = p_147344_1_.func_149627_c() >= 1 && p_147344_1_.func_149627_c() <= 45; @@ -2354,7 +2362,7 @@ if (flag1 && flag2) { -@@ -1384,26 +2459,22 @@ +@@ -1384,26 +2471,22 @@ } } @@ -2384,7 +2392,7 @@ this.field_147369_b.func_143004_u(); WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); BlockPos blockpos = p_147343_1_.func_179722_a(); -@@ -1423,14 +2494,30 @@ +@@ -1423,14 +2506,30 @@ if (!tileentitysign.func_145914_a() || tileentitysign.func_145911_b() != this.field_147369_b) { this.field_147367_d.func_71236_h("Player " + this.field_147369_b.func_70005_c_() + " just tried to change non-editable sign"); @@ -2416,7 +2424,7 @@ } tileentitysign.func_70296_d(); -@@ -1438,9 +2525,9 @@ +@@ -1438,9 +2537,9 @@ } } @@ -2427,7 +2435,7 @@ if (this.field_194403_g && p_147353_1_.func_149460_c() == this.field_194404_h) { int i = (int)(this.func_147363_d() - this.field_194402_f); -@@ -1449,7 +2536,7 @@ +@@ -1449,7 +2548,7 @@ } else if (!this.field_147369_b.func_70005_c_().equals(this.field_147367_d.func_71214_G())) { @@ -2436,7 +2444,7 @@ } } -@@ -1458,36 +2545,44 @@ +@@ -1458,36 +2557,44 @@ return System.nanoTime() / 1000000L; } @@ -2490,7 +2498,7 @@ public void func_147349_a(CPacketCustomPayload p_147349_1_) { PacketThreadUtil.func_180031_a(p_147349_1_, this, this.field_147369_b.func_71121_q()); -@@ -1495,6 +2590,11 @@ +@@ -1495,6 +2602,11 @@ if ("MC|BEdit".equals(s)) { @@ -2502,7 +2510,7 @@ PacketBuffer packetbuffer = p_147349_1_.func_180760_b(); try -@@ -1521,15 +2621,22 @@ +@@ -1521,15 +2633,22 @@ if (itemstack.func_77973_b() == Items.field_151099_bA && itemstack.func_77973_b() == itemstack1.func_77973_b()) { itemstack1.func_77983_a("pages", itemstack.func_77978_p().func_150295_c("pages", 8)); @@ -2525,7 +2533,7 @@ PacketBuffer packetbuffer1 = p_147349_1_.func_180760_b(); try -@@ -1569,12 +2676,14 @@ +@@ -1569,12 +2688,14 @@ } itemstack2.func_77983_a("pages", nbttaglist); @@ -2541,7 +2549,7 @@ } } else if ("MC|TrSel".equals(s)) -@@ -1592,19 +2701,20 @@ +@@ -1592,19 +2713,20 @@ catch (Exception exception5) { field_147370_c.error("Couldn't select trade", (Throwable)exception5); @@ -2564,7 +2572,7 @@ return; } -@@ -1617,9 +2727,7 @@ +@@ -1617,9 +2739,7 @@ if (l == 0) { @@ -2575,7 +2583,7 @@ if (tileentity instanceof TileEntityCommandBlock) { -@@ -1646,29 +2754,30 @@ +@@ -1646,29 +2766,30 @@ if (!flag2) { @@ -2610,7 +2618,7 @@ return; } -@@ -1695,39 +2804,21 @@ +@@ -1695,39 +2816,21 @@ if (commandblockbaselogic != null) { @@ -2654,7 +2662,7 @@ } tileentity2.func_145829_t(); -@@ -1737,7 +2828,7 @@ +@@ -1737,7 +2840,7 @@ if (!flag3) { @@ -2663,7 +2671,7 @@ } tileentitycommandblock.func_184253_b(flag1); -@@ -1745,13 +2836,14 @@ +@@ -1745,13 +2848,14 @@ if (!net.minecraft.util.StringUtils.func_151246_b(s7)) { @@ -2679,7 +2687,7 @@ } } else if ("MC|Beacon".equals(s)) -@@ -1778,6 +2870,7 @@ +@@ -1778,6 +2882,7 @@ catch (Exception exception2) { field_147370_c.error("Couldn't set beacon", (Throwable)exception2); @@ -2687,7 +2695,7 @@ } } } -@@ -1848,37 +2941,37 @@ +@@ -1848,37 +2953,37 @@ { if (tileentitystructure.func_184419_m()) { @@ -2732,7 +2740,7 @@ } } -@@ -1889,6 +2982,7 @@ +@@ -1889,6 +2994,7 @@ catch (Exception exception1) { field_147370_c.error("Couldn't set structure block", (Throwable)exception1); @@ -2740,7 +2748,7 @@ } } else if ("MC|PickItem".equals(s)) -@@ -1899,22 +2993,50 @@ +@@ -1899,22 +3005,50 @@ { int j1 = packetbuffer6.func_150792_a(); this.field_147369_b.field_71071_by.func_184430_d(j1);