Skip to content

Commit 5ec97e6

Browse files
authored
Merge pull request #10 from HaHaWTH/fix/simple-difficulty
Fix simple difficulty
2 parents 0e83f45 + 8b66a80 commit 5ec97e6

File tree

2 files changed

+38
-24
lines changed

2 files changed

+38
-24
lines changed

patches/minecraft/net/minecraft/server/management/PlayerList.java.patch

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@
644644
}
645645

646646
PlayerInteractionManager playerinteractionmanager;
647-
@@ -497,101 +742,226 @@
647+
@@ -497,101 +742,232 @@
648648
return new EntityPlayerMP(this.field_72400_f, this.field_72400_f.func_71218_a(0), p_148545_1_, playerinteractionmanager);
649649
}
650650

@@ -761,9 +761,8 @@
761761
else
762762
{
763763
- playerinteractionmanager = new PlayerInteractionManager(this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK));
764-
+ playerinteractionmanager = new PlayerInteractionManager(this.mcServer.getWorld(playerIn.dimension));
765-
}
766-
764+
- }
765+
-
767766
- EntityPlayerMP entityplayermp = new EntityPlayerMP(
768767
- this.field_72400_f, this.field_72400_f.func_71218_a(p_72368_1_.field_71093_bK), p_72368_1_.func_146103_bH(), playerinteractionmanager
769768
- );
@@ -774,9 +773,18 @@
774773
- entityplayermp.func_184819_a(p_72368_1_.func_184591_cq());
775774
-
776775
- for (String s : p_72368_1_.func_184216_O())
776+
+ playerinteractionmanager = new PlayerInteractionManager(this.mcServer.getWorld(playerIn.dimension));
777+
+ }
778+
+
777779
+ EntityPlayerMP entityplayermp = new EntityPlayerMP(this.mcServer, this.mcServer.getWorld(playerIn.dimension), playerIn.getGameProfile(), playerinteractionmanager);
778780
+ */
779781
+ EntityPlayerMP entityplayermp = playerIn;
782+
+ // CatRoom start - Call construct event and re-gather capabilities
783+
+ if (catserver.server.CatServer.getConfig().callConstructCapabilityEventOnRespawn) {
784+
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.entity.EntityEvent.EntityConstructing(entityplayermp));
785+
+ ((Entity) entityplayermp).capabilities = net.minecraftforge.event.ForgeEventFactory.gatherCapabilities(entityplayermp);
786+
+ }
787+
+ // CatRoom end - Call construct event and re-gather capabilities
780788
+ org.bukkit.World fromWorld = playerIn.getBukkitEntity().getWorld();
781789
+ playerIn.field_71136_j = false;
782790
+
@@ -940,7 +948,7 @@
940948
return entityplayermp;
941949
}
942950

943-
@@ -599,75 +969,147 @@
951+
@@ -599,75 +975,147 @@
944952
{
945953
GameProfile gameprofile = p_187243_1_.func_146103_bH();
946954
int i = this.func_152596_g(gameprofile) ? this.field_72414_i.func_187452_a(gameprofile) : 0;
@@ -1143,7 +1151,7 @@
11431151
{
11441152
BlockPos blockpos;
11451153

1146-
@@ -693,7 +1135,7 @@
1154+
@@ -693,7 +1141,7 @@
11471155

11481156
p_82448_3_.field_72984_F.func_76319_b();
11491157

@@ -1152,7 +1160,7 @@
11521160
{
11531161
p_82448_3_.field_72984_F.func_76320_a("placing");
11541162
d0 = (double)MathHelper.func_76125_a((int)d0, -29999872, 29999872);
1155-
@@ -702,7 +1144,8 @@
1163+
@@ -702,7 +1150,8 @@
11561164
if (p_82448_1_.func_70089_S())
11571165
{
11581166
p_82448_1_.func_70012_b(d0, p_82448_1_.field_70163_u, d1, p_82448_1_.field_70177_z, p_82448_1_.field_70125_A);
@@ -1162,7 +1170,7 @@
11621170
p_82448_4_.func_72838_d(p_82448_1_);
11631171
p_82448_4_.func_72866_a(p_82448_1_, false);
11641172
}
1165-
@@ -713,11 +1156,155 @@
1173+
@@ -713,11 +1162,155 @@
11661174
p_82448_1_.func_70029_a(p_82448_4_);
11671175
}
11681176

@@ -1319,7 +1327,7 @@
13191327
this.field_72408_o = 0;
13201328
}
13211329
}
1322-
@@ -726,9 +1313,27 @@
1330+
@@ -726,9 +1319,27 @@
13231331
{
13241332
for (int i = 0; i < this.field_72404_b.size(); ++i)
13251333
{
@@ -1350,7 +1358,7 @@
13501358

13511359
public void func_148537_a(Packet<?> p_148537_1_, int p_148537_2_)
13521360
{
1353-
@@ -795,11 +1400,11 @@
1361+
@@ -795,11 +1406,11 @@
13541362
s = s + ", ";
13551363
}
13561364

@@ -1364,7 +1372,7 @@
13641372
}
13651373
}
13661374

1367-
@@ -812,7 +1417,7 @@
1375+
@@ -812,7 +1423,7 @@
13681376

13691377
for (int i = 0; i < this.field_72404_b.size(); ++i)
13701378
{
@@ -1373,7 +1381,7 @@
13731381
}
13741382

13751383
return astring;
1376-
@@ -824,7 +1429,7 @@
1384+
@@ -824,7 +1435,7 @@
13771385

13781386
for (int i = 0; i < this.field_72404_b.size(); ++i)
13791387
{
@@ -1382,7 +1390,7 @@
13821390
}
13831391

13841392
return agameprofile;
1385-
@@ -845,12 +1450,20 @@
1393+
@@ -845,12 +1456,20 @@
13861394
int i = this.field_72400_f.func_110455_j();
13871395
this.field_72414_i.func_152687_a(new UserListOpsEntry(p_152605_1_, this.field_72400_f.func_110455_j(), this.field_72414_i.func_183026_b(p_152605_1_)));
13881396
this.func_187245_a(this.func_177451_a(p_152605_1_.getId()), i);
@@ -1403,7 +1411,7 @@
14031411
}
14041412

14051413
private void func_187245_a(EntityPlayerMP p_187245_1_, int p_187245_2_)
1406-
@@ -883,11 +1496,7 @@
1414+
@@ -883,11 +1502,7 @@
14071415

14081416
public boolean func_152596_g(GameProfile p_152596_1_)
14091417
{
@@ -1416,7 +1424,7 @@
14161424
}
14171425

14181426
@Nullable
1419-
@@ -904,19 +1513,17 @@
1427+
@@ -904,19 +1519,17 @@
14201428
return null;
14211429
}
14221430

@@ -1443,7 +1451,7 @@
14431451

14441452
if (entityplayermp != p_148543_1_ && entityplayermp.field_71093_bK == p_148543_10_)
14451453
{
1446-
@@ -976,25 +1583,29 @@
1454+
@@ -976,25 +1589,29 @@
14471455

14481456
public void func_72354_b(EntityPlayerMP p_72354_1_, WorldServer p_72354_2_)
14491457
{
@@ -1480,7 +1488,7 @@
14801488
p_72385_1_.field_71135_a.func_147359_a(new SPacketHeldItemChange(p_72385_1_.field_71071_by.field_70461_c));
14811489
}
14821490

1483-
@@ -1010,13 +1621,7 @@
1491+
@@ -1010,13 +1627,7 @@
14841492

14851493
public String[] func_72373_m()
14861494
{
@@ -1495,7 +1503,7 @@
14951503
}
14961504

14971505
public void func_72371_a(boolean p_72371_1_)
1498-
@@ -1026,7 +1631,7 @@
1506+
@@ -1026,7 +1637,7 @@
14991507

15001508
public List<EntityPlayerMP> func_72382_j(String p_72382_1_)
15011509
{
@@ -1504,7 +1512,7 @@
15041512

15051513
for (EntityPlayerMP entityplayermp : this.field_72404_b)
15061514
{
1507-
@@ -1082,9 +1687,15 @@
1515+
@@ -1082,9 +1693,15 @@
15081516

15091517
public void func_72392_r()
15101518
{
@@ -1523,7 +1531,7 @@
15231531
}
15241532
}
15251533

1526-
@@ -1092,7 +1703,10 @@
1534+
@@ -1092,7 +1709,10 @@
15271535
{
15281536
this.field_72400_f.func_145747_a(p_148544_1_);
15291537
ChatType chattype = p_148544_2_ ? ChatType.SYSTEM : ChatType.CHAT;
@@ -1535,7 +1543,7 @@
15351543
}
15361544

15371545
public void func_148539_a(ITextComponent p_148539_1_)
1538-
@@ -1100,10 +1714,11 @@
1546+
@@ -1100,10 +1720,11 @@
15391547
this.func_148544_a(p_148539_1_, true);
15401548
}
15411549

@@ -1548,7 +1556,7 @@
15481556

15491557
if (statisticsmanagerserver == null)
15501558
{
1551-
@@ -1128,6 +1743,8 @@
1559+
@@ -1128,6 +1749,8 @@
15521560
return statisticsmanagerserver;
15531561
}
15541562

@@ -1557,7 +1565,7 @@
15571565
public PlayerAdvancements func_192054_h(EntityPlayerMP p_192054_1_)
15581566
{
15591567
UUID uuid = p_192054_1_.func_110124_au();
1560-
@@ -1151,7 +1768,7 @@
1568+
@@ -1151,7 +1774,7 @@
15611569

15621570
if (this.field_72400_f.field_71305_c != null)
15631571
{
@@ -1566,7 +1574,7 @@
15661574
{
15671575
if (worldserver != null)
15681576
{
1569-
@@ -1183,5 +1800,11 @@
1577+
@@ -1183,5 +1806,11 @@
15701578
{
15711579
playeradvancements.func_193766_b();
15721580
}

src/main/java/catserver/server/CatServerConfig.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public class CatServerConfig {
6262
public boolean disableAsyncCatchWarn = false;
6363
public boolean versionCheck = true;
6464

65+
public boolean callConstructCapabilityEventOnRespawn = false;
66+
6567
public boolean enableAffinity = false;
6668
public BitSet affinity = Affinity.getAffinity();
6769

@@ -114,6 +116,10 @@ public void loadConfig() {
114116
// Event bridge // CatRoom start - Handle mod explosion event
115117
bridgeForgeExplosionEventToBukkit = getOrWriteBooleanConfig("event-bridge.bridgeForgeExplosionEventToBukkit", bridgeForgeExplosionEventToBukkit);
116118
// CatRoom end - Handle mod explosion event
119+
// CatRoom start - Call construct and capability event on respawn
120+
// compatibility
121+
callConstructCapabilityEventOnRespawn = getOrWriteBooleanConfig("compatibility.callConstructCapabilityEventOnRespawn", callConstructCapabilityEventOnRespawn);
122+
// CatRoom end - Call construct and capability event on respawn
117123
// general
118124
disableUpdateGameProfile = getOrWriteBooleanConfig("disableUpdateGameProfile", disableUpdateGameProfile);
119125
disableAsyncCatchWarn = getOrWriteBooleanConfig("disableAsyncCatchWarn", disableAsyncCatchWarn);

0 commit comments

Comments
 (0)