|
1443 | 1443 | textcomponenttranslation.func_150256_b().func_150238_a(TextFormatting.RED); |
1444 | 1444 | this.func_147359_a(new SPacketChat(textcomponenttranslation)); |
1445 | 1445 | } |
1446 | | -@@ -1029,47 +1464,313 @@ |
| 1446 | +@@ -1029,47 +1464,324 @@ |
1447 | 1447 | { |
1448 | 1448 | if (!ChatAllowedCharacters.func_71566_a(s.charAt(i))) |
1449 | 1449 | { |
|
1680 | 1680 | + this.field_147370_c.info(this.field_147369_b.func_70005_c_() + " issued server command: " + p_147361_1_); |
1681 | 1681 | + |
1682 | 1682 | + CraftPlayer player = this.getPlayer(); |
1683 | | -+ List<String> params = new ArrayList<>(List.of(p_147361_1_.split(" "))); |
1684 | | -+ ICommand iCommand = BukkitCommandWrapper.toNMSCommand(this.field_147369_b, params.removeFirst()); |
| 1683 | ++ List<String> params = new ArrayList<>(List.of(p_147361_1_.trim().split(" "))); |
| 1684 | ++ String commandWithNoArgs = params.removeFirst().replaceFirst("^/", ""); |
| 1685 | ++ ICommand iCommand = this.field_147367_d.func_71187_D().func_71555_a().get(commandWithNoArgs); |
| 1686 | ++ |
| 1687 | ++ if (iCommand == null) { |
| 1688 | ++ iCommand = BukkitCommandWrapper.toNMSCommand(this.field_147369_b, commandWithNoArgs); |
| 1689 | ++ } |
1685 | 1690 | + |
1686 | 1691 | + PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(player, p_147361_1_, new LazyPlayerSet(field_147367_d)); |
1687 | | -+ MinecraftForge.EVENT_BUS.post(new CommandEvent(iCommand, this.field_147369_b, params.toArray(new String[0]))); |
1688 | 1692 | + this.craftServer.getPluginManager().callEvent(event); |
1689 | 1693 | + |
1690 | 1694 | + if (event.isCancelled()) { |
1691 | 1695 | + org.bukkit.craftbukkit.v1_12_R1.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot |
1692 | 1696 | + return; |
1693 | 1697 | + } |
1694 | 1698 | + |
| 1699 | ++ CommandEvent forgeEvent = new CommandEvent(iCommand, this.field_147369_b, params.toArray(new String[0])); |
| 1700 | ++ |
| 1701 | ++ if (MinecraftForge.EVENT_BUS.post(forgeEvent)) { |
| 1702 | ++ org.bukkit.craftbukkit.v1_12_R1.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot |
| 1703 | ++ return; |
| 1704 | ++ } |
| 1705 | ++ |
1695 | 1706 | + try { |
1696 | 1707 | + if (this.craftServer.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) { |
1697 | 1708 | + org.bukkit.craftbukkit.v1_12_R1.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot |
|
1771 | 1782 | this.field_147369_b.func_143004_u(); |
1772 | 1783 |
|
1773 | 1784 | switch (p_147357_1_.func_180764_b()) |
1774 | | -@@ -1128,10 +1829,7 @@ |
| 1785 | +@@ -1128,10 +1840,7 @@ |
1775 | 1786 | break; |
1776 | 1787 | case START_FALL_FLYING: |
1777 | 1788 |
|
|
1783 | 1794 | { |
1784 | 1795 | ItemStack itemstack = this.field_147369_b.func_184582_a(EntityEquipmentSlot.CHEST); |
1785 | 1796 |
|
1786 | | -@@ -1151,10 +1849,10 @@ |
| 1797 | +@@ -1151,10 +1860,10 @@ |
1787 | 1798 | } |
1788 | 1799 | } |
1789 | 1800 |
|
|
1795 | 1806 | WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); |
1796 | 1807 | Entity entity = p_147340_1_.func_149564_a(worldserver); |
1797 | 1808 | this.field_147369_b.func_143004_u(); |
1798 | | -@@ -1162,41 +1860,83 @@ |
| 1809 | +@@ -1162,41 +1871,83 @@ |
1799 | 1810 | if (entity != null) |
1800 | 1811 | { |
1801 | 1812 | boolean flag = this.field_147369_b.func_70685_l(entity); |
|
1884 | 1895 | public void func_147342_a(CPacketClientStatus p_147342_1_) |
1885 | 1896 | { |
1886 | 1897 | PacketThreadUtil.func_180031_a(p_147342_1_, this, this.field_147369_b.func_71121_q()); |
1887 | | -@@ -1220,7 +1960,7 @@ |
| 1898 | +@@ -1220,7 +1971,7 @@ |
1888 | 1899 | return; |
1889 | 1900 | } |
1890 | 1901 |
|
|
1893 | 1904 |
|
1894 | 1905 | if (this.field_147367_d.func_71199_h()) |
1895 | 1906 | { |
1896 | | -@@ -1235,40 +1975,345 @@ |
| 1907 | +@@ -1235,40 +1986,345 @@ |
1897 | 1908 | } |
1898 | 1909 | } |
1899 | 1910 |
|
|
2251 | 2262 | { |
2252 | 2263 | 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)); |
2253 | 2264 | this.field_147369_b.field_71137_h = true; |
2254 | | -@@ -1278,15 +2323,15 @@ |
| 2265 | +@@ -1278,15 +2334,15 @@ |
2255 | 2266 | } |
2256 | 2267 | else |
2257 | 2268 | { |
|
2271 | 2282 | nonnulllist1.add(itemstack1); |
2272 | 2283 | } |
2273 | 2284 |
|
2274 | | -@@ -1296,39 +2341,46 @@ |
| 2285 | +@@ -1296,39 +2352,46 @@ |
2275 | 2286 | } |
2276 | 2287 | } |
2277 | 2288 |
|
|
2327 | 2338 |
|
2328 | 2339 | if (this.field_147369_b.field_71134_c.func_73083_d()) |
2329 | 2340 | { |
2330 | | -@@ -1356,7 +2408,46 @@ |
| 2341 | +@@ -1356,7 +2419,46 @@ |
2331 | 2342 | } |
2332 | 2343 |
|
2333 | 2344 | boolean flag1 = p_147344_1_.func_149627_c() >= 1 && p_147344_1_.func_149627_c() <= 45; |
|
2375 | 2386 |
|
2376 | 2387 | if (flag1 && flag2) |
2377 | 2388 | { |
2378 | | -@@ -1384,26 +2475,22 @@ |
| 2389 | +@@ -1384,26 +2486,22 @@ |
2379 | 2390 | } |
2380 | 2391 | } |
2381 | 2392 |
|
|
2405 | 2416 | this.field_147369_b.func_143004_u(); |
2406 | 2417 | WorldServer worldserver = this.field_147367_d.func_71218_a(this.field_147369_b.field_71093_bK); |
2407 | 2418 | BlockPos blockpos = p_147343_1_.func_179722_a(); |
2408 | | -@@ -1423,14 +2510,30 @@ |
| 2419 | +@@ -1423,14 +2521,30 @@ |
2409 | 2420 | if (!tileentitysign.func_145914_a() || tileentitysign.func_145911_b() != this.field_147369_b) |
2410 | 2421 | { |
2411 | 2422 | this.field_147367_d.func_71236_h("Player " + this.field_147369_b.func_70005_c_() + " just tried to change non-editable sign"); |
|
2437 | 2448 | } |
2438 | 2449 |
|
2439 | 2450 | tileentitysign.func_70296_d(); |
2440 | | -@@ -1438,9 +2541,9 @@ |
| 2451 | +@@ -1438,9 +2552,9 @@ |
2441 | 2452 | } |
2442 | 2453 | } |
2443 | 2454 |
|
|
2448 | 2459 | if (this.field_194403_g && p_147353_1_.func_149460_c() == this.field_194404_h) |
2449 | 2460 | { |
2450 | 2461 | int i = (int)(this.func_147363_d() - this.field_194402_f); |
2451 | | -@@ -1449,7 +2552,7 @@ |
| 2462 | +@@ -1449,7 +2563,7 @@ |
2452 | 2463 | } |
2453 | 2464 | else if (!this.field_147369_b.func_70005_c_().equals(this.field_147367_d.func_71214_G())) |
2454 | 2465 | { |
|
2457 | 2468 | } |
2458 | 2469 | } |
2459 | 2470 |
|
2460 | | -@@ -1458,36 +2561,44 @@ |
| 2471 | +@@ -1458,36 +2572,44 @@ |
2461 | 2472 | return System.nanoTime() / 1000000L; |
2462 | 2473 | } |
2463 | 2474 |
|
|
2511 | 2522 | public void func_147349_a(CPacketCustomPayload p_147349_1_) |
2512 | 2523 | { |
2513 | 2524 | PacketThreadUtil.func_180031_a(p_147349_1_, this, this.field_147369_b.func_71121_q()); |
2514 | | -@@ -1495,6 +2606,11 @@ |
| 2525 | +@@ -1495,6 +2617,11 @@ |
2515 | 2526 |
|
2516 | 2527 | if ("MC|BEdit".equals(s)) |
2517 | 2528 | { |
|
2523 | 2534 | PacketBuffer packetbuffer = p_147349_1_.func_180760_b(); |
2524 | 2535 |
|
2525 | 2536 | try |
2526 | | -@@ -1521,15 +2637,22 @@ |
| 2537 | +@@ -1521,15 +2648,22 @@ |
2527 | 2538 | if (itemstack.func_77973_b() == Items.field_151099_bA && itemstack.func_77973_b() == itemstack1.func_77973_b()) |
2528 | 2539 | { |
2529 | 2540 | itemstack1.func_77983_a("pages", itemstack.func_77978_p().func_150295_c("pages", 8)); |
|
2546 | 2557 | PacketBuffer packetbuffer1 = p_147349_1_.func_180760_b(); |
2547 | 2558 |
|
2548 | 2559 | try |
2549 | | -@@ -1569,12 +2692,14 @@ |
| 2560 | +@@ -1569,12 +2703,14 @@ |
2550 | 2561 | } |
2551 | 2562 |
|
2552 | 2563 | itemstack2.func_77983_a("pages", nbttaglist); |
|
2562 | 2573 | } |
2563 | 2574 | } |
2564 | 2575 | else if ("MC|TrSel".equals(s)) |
2565 | | -@@ -1592,19 +2717,20 @@ |
| 2576 | +@@ -1592,19 +2728,20 @@ |
2566 | 2577 | catch (Exception exception5) |
2567 | 2578 | { |
2568 | 2579 | field_147370_c.error("Couldn't select trade", (Throwable)exception5); |
|
2585 | 2596 | return; |
2586 | 2597 | } |
2587 | 2598 |
|
2588 | | -@@ -1617,9 +2743,7 @@ |
| 2599 | +@@ -1617,9 +2754,7 @@ |
2589 | 2600 |
|
2590 | 2601 | if (l == 0) |
2591 | 2602 | { |
|
2596 | 2607 |
|
2597 | 2608 | if (tileentity instanceof TileEntityCommandBlock) |
2598 | 2609 | { |
2599 | | -@@ -1646,29 +2770,30 @@ |
| 2610 | +@@ -1646,29 +2781,30 @@ |
2600 | 2611 |
|
2601 | 2612 | if (!flag2) |
2602 | 2613 | { |
|
2631 | 2642 | return; |
2632 | 2643 | } |
2633 | 2644 |
|
2634 | | -@@ -1695,39 +2820,21 @@ |
| 2645 | +@@ -1695,39 +2831,21 @@ |
2635 | 2646 |
|
2636 | 2647 | if (commandblockbaselogic != null) |
2637 | 2648 | { |
|
2675 | 2686 | } |
2676 | 2687 |
|
2677 | 2688 | tileentity2.func_145829_t(); |
2678 | | -@@ -1737,7 +2844,7 @@ |
| 2689 | +@@ -1737,7 +2855,7 @@ |
2679 | 2690 |
|
2680 | 2691 | if (!flag3) |
2681 | 2692 | { |
|
2684 | 2695 | } |
2685 | 2696 |
|
2686 | 2697 | tileentitycommandblock.func_184253_b(flag1); |
2687 | | -@@ -1745,13 +2852,14 @@ |
| 2698 | +@@ -1745,13 +2863,14 @@ |
2688 | 2699 |
|
2689 | 2700 | if (!net.minecraft.util.StringUtils.func_151246_b(s7)) |
2690 | 2701 | { |
|
2700 | 2711 | } |
2701 | 2712 | } |
2702 | 2713 | else if ("MC|Beacon".equals(s)) |
2703 | | -@@ -1778,6 +2886,7 @@ |
| 2714 | +@@ -1778,6 +2897,7 @@ |
2704 | 2715 | catch (Exception exception2) |
2705 | 2716 | { |
2706 | 2717 | field_147370_c.error("Couldn't set beacon", (Throwable)exception2); |
2707 | 2718 | + this.disconnect("Invalid beacon data!"); |
2708 | 2719 | } |
2709 | 2720 | } |
2710 | 2721 | } |
2711 | | -@@ -1848,37 +2957,37 @@ |
| 2722 | +@@ -1848,37 +2968,37 @@ |
2712 | 2723 | { |
2713 | 2724 | if (tileentitystructure.func_184419_m()) |
2714 | 2725 | { |
|
2753 | 2764 | } |
2754 | 2765 | } |
2755 | 2766 |
|
2756 | | -@@ -1889,6 +2998,7 @@ |
| 2767 | +@@ -1889,6 +3009,7 @@ |
2757 | 2768 | catch (Exception exception1) |
2758 | 2769 | { |
2759 | 2770 | field_147370_c.error("Couldn't set structure block", (Throwable)exception1); |
2760 | 2771 | + this.disconnect("Invalid structure data!"); |
2761 | 2772 | } |
2762 | 2773 | } |
2763 | 2774 | else if ("MC|PickItem".equals(s)) |
2764 | | -@@ -1899,22 +3009,50 @@ |
| 2775 | +@@ -1899,22 +3020,50 @@ |
2765 | 2776 | { |
2766 | 2777 | int j1 = packetbuffer6.func_150792_a(); |
2767 | 2778 | this.field_147369_b.field_71071_by.func_184430_d(j1); |
|
0 commit comments