mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2025-02-22 23:31:42 +01:00
Sidestreams updated
It looks like that for 2 purpur patches we need to update the upstream. Updated also the script and now we have `yatopia tup`, which will only update tuinity.
This commit is contained in:
parent
05c29a3951
commit
a24d3fc1a7
2
.gitignore
vendored
2
.gitignore
vendored
@ -26,4 +26,4 @@ target/site/surefire-report.html
|
||||
!/patches/Rainforest/api.txt
|
||||
!/patches/Origami/server.txt
|
||||
!/patches/Origami/api.txt
|
||||
yatopia-1.16.1-paperclip.jar
|
||||
yatopia-1.16.2-paperclip.jar
|
||||
|
2
Akarin
2
Akarin
@ -1 +1 @@
|
||||
Subproject commit 3cd947fb6ea6678dc160c33907b5dcb8bb5d5f16
|
||||
Subproject commit 3abf7a7eb8e47bfcea033e59f5d782a636a1dea5
|
@ -1 +1 @@
|
||||
Subproject commit 27b18f0d50df76e7bd56e11a985dd4d9ec43e961
|
||||
Subproject commit 6231ef066e60b26b109b841fc7c1056a50a6700e
|
2
Origami
2
Origami
@ -1 +1 @@
|
||||
Subproject commit f5d6cd6942b0700d4a4cece187b26b769516cc52
|
||||
Subproject commit 71e7cd37ec36dbcedabcce74d49509b7aacba6cf
|
@ -19,6 +19,8 @@ # Patches
|
||||
| api | Add getLastTickMs api | tr7zw | |
|
||||
| server | Add getLastTickMs api | tr7zw | |
|
||||
| server | Add more dupe options | Mariell Hoversholm | |
|
||||
| server | Add no-tick block list | William Blake Galbreath | |
|
||||
| server | Add option to disable dolphin treasure searching | William Blake Galbreath | |
|
||||
| server | Add option to disable saving projectiles to disk | William Blake Galbreath | |
|
||||
| server | Add permission for F3+N debug | William Blake Galbreath | |
|
||||
| server | Akarin Updated Save json list async | tsao chi | |
|
||||
|
2
Purpur
2
Purpur
@ -1 +1 @@
|
||||
Subproject commit a55a51bf42e54992fa5d11e9cf473e6ec0d50255
|
||||
Subproject commit 2b4fe114201c3a4f1208461eb24b310634f98663
|
@ -1 +1 @@
|
||||
Subproject commit 49a491862f6363837c84c5e4f9f33dc72cbe0484
|
||||
Subproject commit b463a4c44163701bd69a1110d583454a689d1ef0
|
@ -1 +0,0 @@
|
||||
1.16.1--8c602452d2ded22cb7322c41de5c78395b5f1348
|
@ -192,7 +192,7 @@ index 8428d4bd05075e86b281312fa38106882c54735b..00000000000000000000000000000000
|
||||
-
|
||||
- public static boolean teleportingOfVehiclesWithPassenger = true;
|
||||
diff --git a/src/main/java/net/minecraft/server/BehaviorInteractDoor.java b/src/main/java/net/minecraft/server/BehaviorInteractDoor.java
|
||||
index 685351f11497a33ef4ba99055fa7da3a8de18af2..f65449b147c856522cc196e18ead2c8b8ad5dea0 100644
|
||||
index 685351f11497a33ef4ba99055fa7da3a8de18af2..dba7cbb02b16dfc6b45efea7c3dd3304693d0ac7 100644
|
||||
--- a/src/main/java/net/minecraft/server/BehaviorInteractDoor.java
|
||||
+++ b/src/main/java/net/minecraft/server/BehaviorInteractDoor.java
|
||||
@@ -127,13 +127,23 @@ public class BehaviorInteractDoor extends Behavior<EntityLiving> {
|
||||
@ -213,7 +213,7 @@ index 685351f11497a33ef4ba99055fa7da3a8de18af2..f65449b147c856522cc196e18ead2c8b
|
||||
+
|
||||
+ boolean match = false;
|
||||
+ for (EntityLiving entityliving1 : behaviorcontroller.getMemory(MemoryModuleType.MOBS).get()) {
|
||||
+ if (entityliving1.getEntityType() == entityliving.getEntityType() && blockposition.a((IPosition) entityliving1.getPositionVector(), 2.0D)) {
|
||||
+ if (entityliving1.getEntityType() == entityliving.getEntityType() && blockposition.a(entityliving1.getPositionVector(), 2.0D)) {
|
||||
+ match = b(worldserver, entityliving1, blockposition);
|
||||
+ if (match) {
|
||||
+ break;
|
||||
@ -292,7 +292,7 @@ index 738aa0c089e2d1f1d8ecb983d3d6351a1d4f690c..00000000000000000000000000000000
|
||||
- }
|
||||
-
|
||||
diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
index bdbb716a91cd320dd9ab39ed6b7442388c92d074..bfae77f129859fba5e0f53723ba62a1626773b7c 100644
|
||||
index bdbb716a91cd320dd9ab39ed6b7442388c92d074..51eae26e05439cfcc16a3adbb01eed35aaf3f1e3 100644
|
||||
--- a/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
+++ b/src/main/java/net/minecraft/server/BiomeBase.java
|
||||
@@ -516,13 +516,13 @@ public final class BiomeBase {
|
||||
@ -300,14 +300,14 @@ index bdbb716a91cd320dd9ab39ed6b7442388c92d074..bfae77f129859fba5e0f53723ba62a16
|
||||
|
||||
static {
|
||||
- Map<String, Precipitation> map = new HashMap<>();
|
||||
+ Map<String, Precipitation> map = new java.util.HashMap<>();
|
||||
+ Map<String, Precipitation> map = new java.util.HashMap<>(); // Yatopia
|
||||
for (Precipitation biomebase_precipitation : values()) {
|
||||
if (map.put(biomebase_precipitation.b(), biomebase_precipitation) != null) {
|
||||
throw new IllegalStateException("Duplicate key");
|
||||
}
|
||||
}
|
||||
- e = (Map) map;
|
||||
+ e = map;
|
||||
+ e = map; // Yatopia
|
||||
}
|
||||
|
||||
private final String f;
|
||||
@ -316,14 +316,14 @@ index bdbb716a91cd320dd9ab39ed6b7442388c92d074..bfae77f129859fba5e0f53723ba62a16
|
||||
|
||||
static {
|
||||
- Map<String, Geography> map = new HashMap<>();
|
||||
+ Map<String, Geography> map = new java.util.HashMap<>();
|
||||
+ Map<String, Geography> map = new java.util.HashMap<>(); // Yatopia
|
||||
for (Geography biomebase_geography : values()) {
|
||||
if (map.put(biomebase_geography.b(), biomebase_geography) != null) {
|
||||
throw new IllegalStateException("Duplicate key");
|
||||
}
|
||||
}
|
||||
- s = (Map) map;
|
||||
+ s = map;
|
||||
+ s = map; // Yatopia
|
||||
}
|
||||
|
||||
private final String t;
|
||||
@ -451,10 +451,10 @@ index 4cc30faacb1ee173cbc546cc57ff4ce032024587..00000000000000000000000000000000
|
||||
-
|
||||
- iblockdata.dropNaturally(world, blockposition, itemstack);
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java
|
||||
index da37a0207571c3eeb324c7f07daf2af90bb870c8..0396bbc0a5e1315e2a6d09f72690f103163e2bc6 100644
|
||||
index 4641832a2d6d4b29a3a0e635f01f398900fd2589..5dda0a2d039d194c97a11898297aafcfe391aea0 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockBase.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockBase.java
|
||||
@@ -713,9 +713,14 @@ public abstract class BlockBase {
|
||||
@@ -715,9 +715,14 @@ public abstract class BlockBase {
|
||||
}
|
||||
|
||||
this.b = block.c(iblockdata, BlockAccessAir.INSTANCE, BlockPosition.ZERO, VoxelShapeCollision.a());
|
||||
@ -463,7 +463,7 @@ index da37a0207571c3eeb324c7f07daf2af90bb870c8..0396bbc0a5e1315e2a6d09f72690f103
|
||||
- });
|
||||
+ boolean result = false;
|
||||
+ for (EnumDirection.EnumAxis enumdirection_enumaxis : EnumDirection.EnumAxis.values()) {
|
||||
+ if (this.b.b(enumdirection_enumaxis) < 1.0D || this.b.c(enumdirection_enumaxis) > 1.0D) {
|
||||
+ if (this.b.b(enumdirection_enumaxis) < 0.0D || this.b.c(enumdirection_enumaxis) > 1.0D) {
|
||||
+ result = true;
|
||||
+ break;
|
||||
+ }
|
||||
@ -497,6 +497,23 @@ index 4e6f3d695d5c1a888fe73ea81e936642f3667f48..00000000000000000000000000000000
|
||||
- this.d = new boolean[6];
|
||||
- EnumDirection[] aenumdirection1 = f;
|
||||
- int k = aenumdirection1.length;
|
||||
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
index 2291135eaef64c403183724cb6e413cd7e472672..6fcc7ed7c129e6a33386d65b37cbba4a44e96f0f 100644
|
||||
--- a/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
|
||||
@@ -56,6 +56,12 @@ public class BlockPosition extends BaseBlockPosition {
|
||||
this(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ());
|
||||
}
|
||||
|
||||
+ // Yatopia start - helper method
|
||||
+ public BlockPosition(Entity entity) {
|
||||
+ this(entity.locX(), entity.locY(), entity.locZ());
|
||||
+ }
|
||||
+ // Yatopia end
|
||||
+
|
||||
public static long getAdjacent(int baseX, int baseY, int baseZ, EnumDirection enumdirection) { return asLong(baseX + enumdirection.getAdjacentX(), baseY + enumdirection.getAdjacentY(), baseZ + enumdirection.getAdjacentZ()); } // Paper
|
||||
public static long a(long i, EnumDirection enumdirection) {
|
||||
return a(i, enumdirection.getAdjacentX(), enumdirection.getAdjacentY(), enumdirection.getAdjacentZ());
|
||||
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
index dde38e0222e658b5a841a32af3fc5153ecb02392..5af513cb052382c34e157110265f80a1a2efef15 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@ -608,10 +625,10 @@ index 2317638f225d0ccba97020c4e739d7dea99b78db..00000000000000000000000000000000
|
||||
-
|
||||
- // CraftBukkit start
|
||||
diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java
|
||||
index b0b49904e9590b91743ebafb7983a392a6c95083..66586a0799d669ed860880862173c6ebd0fa76ef 100644
|
||||
index b0b49904e9590b91743ebafb7983a392a6c95083..2cbfef98508bcb07db1ad1e5bdafc4cc2bff1393 100644
|
||||
--- a/src/main/java/net/minecraft/server/CraftingManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/CraftingManager.java
|
||||
@@ -124,15 +124,24 @@ public class CraftingManager extends ResourceDataJson {
|
||||
@@ -124,15 +124,22 @@ public class CraftingManager extends ResourceDataJson {
|
||||
}
|
||||
|
||||
public Optional<? extends IRecipe<?>> getRecipe(MinecraftKey minecraftkey) {
|
||||
@ -634,9 +651,7 @@ index b0b49904e9590b91743ebafb7983a392a6c95083..66586a0799d669ed860880862173c6eb
|
||||
- }).collect(Collectors.toSet());
|
||||
+ Set<IRecipe<?>> set = new HashSet<>();
|
||||
+ for (Object2ObjectLinkedOpenHashMap<MinecraftKey, IRecipe<?>> map : this.recipes.values()) {
|
||||
+ for (IRecipe<?> iRecipe : map.values()) {
|
||||
+ set.add(iRecipe);
|
||||
+ }
|
||||
+ set.addAll(map.values());
|
||||
+ }
|
||||
+ return set;
|
||||
}
|
||||
@ -715,7 +730,7 @@ index 8347faf8a7ee62d27cf5eb9f285695fddadfa624..00000000000000000000000000000000
|
||||
-
|
||||
- AttributeDefaults.a();
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index e04eec35e9dfe5c77274f2e1c198f4c18a9b3167..960ab2a7c65a77e22acad2280f39a79a1556813e 100644
|
||||
index e04eec35e9dfe5c77274f2e1c198f4c18a9b3167..93e1b01b97b52c53a7c912faf9bb6454ef57f340 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -441,7 +441,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@ -731,7 +746,7 @@ index e04eec35e9dfe5c77274f2e1c198f4c18a9b3167..960ab2a7c65a77e22acad2280f39a79a
|
||||
return MathHelper.c(f * f + f1 * f1 + f2 * f2);
|
||||
}
|
||||
|
||||
+ public double getDistanceSquared(Entity other) { return getDistanceSquared(other.locX(), other.locY(), other.locZ()); } // Yatopia - OBFHELPER
|
||||
+ public double getDistanceSq(Entity entity) { return getDistanceSquared(entity.locX(), entity.locY(), entity.locZ()); } // Yatopia - helper method
|
||||
public double getDistanceSquared(double x, double y, double z) { return h(x, y, z); } // Paper - OBFHELPER
|
||||
public double h(double d0, double d1, double d2) {
|
||||
double d3 = this.locX() - d0;
|
||||
@ -749,7 +764,7 @@ index e04eec35e9dfe5c77274f2e1c198f4c18a9b3167..960ab2a7c65a77e22acad2280f39a79a
|
||||
}
|
||||
|
||||
- }
|
||||
+ });
|
||||
+ }); // Yatopia
|
||||
}
|
||||
}
|
||||
|
||||
@ -770,10 +785,10 @@ index 6bf65fd7655f888bde6a21048e6f3bfbd7b5b5d4..00000000000000000000000000000000
|
||||
- // CraftBukkit end
|
||||
- }
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
index 91731cd5fbcea9d644cfb030f55db2027cbdadff..0e48d2a9a9e1aa2b9369e16ed1c8b8a99e0f3d43 100644
|
||||
index 91731cd5fbcea9d644cfb030f55db2027cbdadff..b3b3626c706c638cc4e1278c218a5a1f1b07101e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityCow.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityCow.java
|
||||
@@ -71,11 +71,81 @@ public class EntityCow extends EntityAnimal {
|
||||
@@ -71,11 +71,80 @@ public class EntityCow extends EntityAnimal {
|
||||
|
||||
entityhuman.a(enumhand, itemstack1);
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
@ -844,13 +859,12 @@ index 91731cd5fbcea9d644cfb030f55db2027cbdadff..0e48d2a9a9e1aa2b9369e16ed1c8b8a9
|
||||
+ }
|
||||
+ for (int i = 0; i < 15; i++) {
|
||||
+ ((WorldServer) world).sendParticles(((WorldServer) world).players, null, Particles.HAPPY_VILLAGER,
|
||||
+ locX() + random.nextFloat(), locY() + (random.nextFloat() * 2), locZ() + random.nextFloat(), 1,
|
||||
+ locX() + random.nextFloat(), locY() + (random.nextFloat() * 2), locZ() + random.nextFloat(), 1,
|
||||
+ random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, random.nextGaussian() * 0.05D, 0, true);
|
||||
+ }
|
||||
+ return EnumInteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
+
|
||||
@Override
|
||||
public EntityCow createChild(WorldServer worldserver, EntityAgeable entityageable) {
|
||||
@ -964,10 +978,10 @@ index db64e0f6a9ae2efda926ac13ce2cbb4a3baa2f6b..9e68cb9284ad1e65d0166b6eeff1e2a6
|
||||
// Purpur end
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderCrystal.java b/src/main/java/net/minecraft/server/EntityEnderCrystal.java
|
||||
index f726a3585f8c3006bed86c45881a3e88899a53ca..74119450b75792dbeea26c393215a1021167beaf 100644
|
||||
index f726a3585f8c3006bed86c45881a3e88899a53ca..653028712fb663abca95a6c7339eaa7560a4f759 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderCrystal.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityEnderCrystal.java
|
||||
@@ -63,14 +63,14 @@ public class EntityEnderCrystal extends Entity {
|
||||
@@ -63,7 +63,7 @@ public class EntityEnderCrystal extends Entity {
|
||||
}
|
||||
|
||||
if (targetPhantom == null) {
|
||||
@ -976,14 +990,6 @@ index f726a3585f8c3006bed86c45881a3e88899a53ca..74119450b75792dbeea26c393215a102
|
||||
if (phantom.hasLineOfSight(this)) {
|
||||
attackPhantom(phantom);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
- setBeamTarget(new BlockPosition(targetPhantom).add(0, -2, 0));
|
||||
+ setBeamTarget(new BlockPosition(targetPhantom.locX(), targetPhantom.locY(), targetPhantom.locZ()).add(0, -2, 0));
|
||||
if (--phantomBeamTicks > 0 && targetPhantom.isAlive()) {
|
||||
phantomDamageCooldown--;
|
||||
if (targetPhantom.hasLineOfSight(this)) {
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
index 6b2c5e8d4640e19d33cbfe76d2399e6100890dbc..8b8ebffb89f11cfbc51b470e77171ea490a9aa18 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityEnderDragon.java
|
||||
@ -1012,7 +1018,7 @@ index a8d2be07d45549cf7a8ac048b44284c4c0a96686..00000000000000000000000000000000
|
||||
-
|
||||
- }
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
index b04f061859f2db52cdefb0192883f2a7c5117fea..7ce648e38b18c4decdba6d9dff81f833dcfb6454 100644
|
||||
index b04f061859f2db52cdefb0192883f2a7c5117fea..080635ce047d25bd76baf371298d4f45375aa681 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityFox.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityFox.java
|
||||
@@ -31,9 +31,9 @@ public class EntityFox extends EntityAnimal {
|
||||
@ -1048,10 +1054,11 @@ index b04f061859f2db52cdefb0192883f2a7c5117fea..7ce648e38b18c4decdba6d9dff81f833
|
||||
}
|
||||
|
||||
private List<UUID> fa() {
|
||||
@@ -263,6 +269,29 @@ public class EntityFox extends EntityAnimal {
|
||||
@@ -262,6 +268,29 @@ public class EntityFox extends EntityAnimal {
|
||||
list.add((this.datawatcher.get(EntityFox.SECOND_TRUSTED_PLAYER)).orElse(null)); // CraftBukkit - decompile error
|
||||
return list;
|
||||
}
|
||||
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public EnumInteractionResult b(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
@ -1074,10 +1081,9 @@ index b04f061859f2db52cdefb0192883f2a7c5117fea..7ce648e38b18c4decdba6d9dff81f833
|
||||
+ return super.b(entityhuman, enumhand);
|
||||
+ }
|
||||
+ // Purpur end
|
||||
+
|
||||
|
||||
private void b(@Nullable UUID uuid) {
|
||||
if (((Optional) this.datawatcher.get(EntityFox.FIRST_TRUSTED_PLAYER)).isPresent()) {
|
||||
this.datawatcher.set(EntityFox.SECOND_TRUSTED_PLAYER, Optional.ofNullable(uuid));
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityFox.java.rej b/src/main/java/net/minecraft/server/EntityFox.java.rej
|
||||
deleted file mode 100644
|
||||
index 641f24b3e166d895d795c73d46cdc26a7d87f0df..0000000000000000000000000000000000000000
|
||||
@ -1147,10 +1153,10 @@ index 641f24b3e166d895d795c73d46cdc26a7d87f0df..00000000000000000000000000000000
|
||||
- protected org.bukkit.event.entity.EntityDeathEvent d(DamageSource damagesource) { // Paper
|
||||
- ItemStack itemstack = this.getEquipment(EnumItemSlot.MAINHAND).cloneItemStack(); // Paper
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
index e53d22447b8978a5389f03a438faf260e41bfa0d..ac19100d48aa96ccae9db1b0112b84933dc77245 100644
|
||||
index e53d22447b8978a5389f03a438faf260e41bfa0d..e7455fe56c2479a226b794354328546ce67e84cf 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
||||
@@ -4,6 +4,9 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
@@ -4,8 +4,61 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
|
||||
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@ -1159,12 +1165,6 @@ index e53d22447b8978a5389f03a438faf260e41bfa0d..ac19100d48aa96ccae9db1b0112b8493
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -19,4 +22,54 @@ public class EntityGiantZombie extends EntityMonster {
|
||||
public float a(BlockPosition blockposition, IWorldReader iworldreader) {
|
||||
return super.a(blockposition, iworldreader); // Purpur - fix light requirements for natural spawns
|
||||
}
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ protected void initPathfinder() {
|
||||
@ -1187,10 +1187,10 @@ index e53d22447b8978a5389f03a438faf260e41bfa0d..ac19100d48aa96ccae9db1b0112b8493
|
||||
+
|
||||
+ @Override
|
||||
+ public GroupDataEntity prepare(WorldAccess world, DifficultyDamageScaler difficulty, EnumMobSpawn enummobspawn, GroupDataEntity groupDataEntity, NBTTagCompound nbt) {
|
||||
+ GroupDataEntity groupData = super.prepare(world, difficulty, enummobspawn, groupDataEntity, nbt);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MAX_HEALTH).setValue(world.getMinecraftWorld().purpurConfig.giantMaxHealth);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MOVEMENT_SPEED).setValue(world.getMinecraftWorld().purpurConfig.giantMovementSpeed);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.ATTACK_DAMAGE).setValue(world.getMinecraftWorld().purpurConfig.giantAttackDamage);
|
||||
+ GroupDataEntity groupData = super.prepare(world, difficulty, enummobspawn, groupDataEntity, nbt);
|
||||
+ if (groupData == null) {
|
||||
+ setEquipmentBasedOnDifficulty(difficulty);
|
||||
+ setEnchantmentBasedOnDifficulty(difficulty);
|
||||
@ -1214,7 +1214,10 @@ index e53d22447b8978a5389f03a438faf260e41bfa0d..ac19100d48aa96ccae9db1b0112b8493
|
||||
+ return world.purpurConfig.giantJumpHeight;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
+
|
||||
@Override
|
||||
protected float b(EntityPose entitypose, EntitySize entitysize) {
|
||||
return 10.440001F;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java.rej b/src/main/java/net/minecraft/server/EntityGiantZombie.java.rej
|
||||
deleted file mode 100644
|
||||
index 5e6b776924e7dd4080ccd465f2d52f572aa556c2..0000000000000000000000000000000000000000
|
||||
@ -1293,7 +1296,7 @@ index 5e6b776924e7dd4080ccd465f2d52f572aa556c2..00000000000000000000000000000000
|
||||
- protected float b(EntityPose entitypose, EntitySize entitysize) {
|
||||
- return 10.440001F;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityHoglin.java b/src/main/java/net/minecraft/server/EntityHoglin.java
|
||||
index cf64c8ca2c5348782bf65a13f210564856b69311..77e4fa44201782b64ad8ca1662835be5abadfa9d 100644
|
||||
index cf64c8ca2c5348782bf65a13f210564856b69311..5e3094198ce5b720a17db704ab295b1cd5a99ce9 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHoglin.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHoglin.java
|
||||
@@ -13,7 +13,7 @@ public class EntityHoglin extends EntityAnimal implements IMonster, IOglin {
|
||||
@ -1329,7 +1332,7 @@ index cf64c8ca2c5348782bf65a13f210564856b69311..77e4fa44201782b64ad8ca1662835be5
|
||||
@Override
|
||||
protected SoundEffect getSoundAmbient() {
|
||||
- return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse((Object) null);
|
||||
+ return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse(null);
|
||||
+ return this.world.isClientSide ? null : (SoundEffect) HoglinAI.b(this).orElse(null); // Yatopia - decompile fix
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1353,7 +1356,7 @@ index be7a4b07540f6cc29c9ed76668bc1eaf9850013c..00000000000000000000000000000000
|
||||
- if (this.eO()) {
|
||||
- ++this.bz;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
index 7b2c459adc489702137944602627e0fc54af26e8..328675d894ecf5054337a0015128fdf10e0681f8 100644
|
||||
index 7b2c459adc489702137944602627e0fc54af26e8..6b4fad730cc43bf2c70e499adbf9bf28d8d111d7 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java
|
||||
@@ -19,17 +19,6 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
||||
@ -1374,18 +1377,20 @@ index 7b2c459adc489702137944602627e0fc54af26e8..328675d894ecf5054337a0015128fdf1
|
||||
@Override
|
||||
protected void initPathfinder() {
|
||||
super.initPathfinder();
|
||||
@@ -54,6 +43,9 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
||||
@@ -54,6 +43,11 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan
|
||||
@Override
|
||||
public GroupDataEntity prepare(WorldAccess worldaccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
||||
this.setSlot(EnumItemSlot.MAINHAND, new ItemStack(Items.BOW));
|
||||
+ // Purpur start
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MOVEMENT_SPEED).setValue(world.purpurConfig.illusionerMovementSpeed);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.FOLLOW_RANGE).setValue(world.purpurConfig.illusionerFollowRange);
|
||||
+ getAttributeMap().getAttribute(GenericAttributes.MAX_HEALTH).setValue(world.purpurConfig.illusionerMaxHealth);
|
||||
+ // Purpur end
|
||||
return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
index 59696d93cf546c5f43648ddde19327de6a62f18c..a3657a2e7d0d8eccc3ff3339adba425ff1ee70a0 100644
|
||||
index 59696d93cf546c5f43648ddde19327de6a62f18c..393a5b127b2f04cf89ff1dbcc2d9bb16a0fed9b2 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
|
||||
@@ -53,7 +53,7 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@ -1397,7 +1402,7 @@ index 59696d93cf546c5f43648ddde19327de6a62f18c..a3657a2e7d0d8eccc3ff3339adba425f
|
||||
public boolean aware = true; // CraftBukkit
|
||||
|
||||
protected EntityInsentient(EntityTypes<? extends EntityInsentient> entitytypes, World world) {
|
||||
@@ -242,14 +242,39 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@@ -242,15 +242,41 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
@Override
|
||||
public void entityBaseTick() {
|
||||
super.entityBaseTick();
|
||||
@ -1407,6 +1412,8 @@ index 59696d93cf546c5f43648ddde19327de6a62f18c..a3657a2e7d0d8eccc3ff3339adba425f
|
||||
this.m();
|
||||
this.F();
|
||||
}
|
||||
|
||||
- this.world.getMethodProfiler().exit();
|
||||
+ incrementTicksSinceLastInteraction(); // Purpur
|
||||
+ //this.world.getMethodProfiler().exit(); // Akarin - remove caller
|
||||
+ }
|
||||
@ -1427,19 +1434,19 @@ index 59696d93cf546c5f43648ddde19327de6a62f18c..a3657a2e7d0d8eccc3ff3339adba425f
|
||||
+ if (ticksSinceLastInteraction > world.purpurConfig.entityLifeSpan) {
|
||||
+ this.dead = true;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
- this.world.getMethodProfiler().exit();
|
||||
+ @Override
|
||||
+ public boolean damageEntity(DamageSource damagesource, float f) {
|
||||
+ if (damagesource.getEntity() instanceof EntityPlayer) this.ticksSinceLastInteraction = 0;
|
||||
+ return super.damageEntity(damagesource, f);
|
||||
}
|
||||
+ }
|
||||
+ // Purpur end
|
||||
|
||||
+
|
||||
@Override
|
||||
protected void c(DamageSource damagesource) {
|
||||
@@ -754,30 +779,30 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
this.m();
|
||||
@@ -754,30 +780,30 @@ public abstract class EntityInsentient extends EntityLiving {
|
||||
return;
|
||||
}
|
||||
// Paper end
|
||||
@ -1540,7 +1547,7 @@ index 75ab781ad76caedf56f0a2da3a0a4eaa4500aea7..00000000000000000000000000000000
|
||||
- protected void c(DamageSource damagesource) {
|
||||
- this.eJ();
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index fa7d210dbd4f509418402e664b55e9e567bba4cf..150075f5e78fca681e9e1d0582d7d92b904cd121 100644
|
||||
index fa7d210dbd4f509418402e664b55e9e567bba4cf..f24f7f1230a380f46112e886fb5dff7c33edb2ce 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -80,7 +80,7 @@ public abstract class EntityLiving extends Entity {
|
||||
@ -1552,6 +1559,15 @@ index fa7d210dbd4f509418402e664b55e9e567bba4cf..150075f5e78fca681e9e1d0582d7d92b
|
||||
public float aB;
|
||||
public float aC;
|
||||
public float aD;
|
||||
@@ -365,7 +365,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.aD = this.aC;
|
||||
this.lastYaw = this.yaw;
|
||||
this.lastPitch = this.pitch;
|
||||
- this.world.getMethodProfiler().exit();
|
||||
+ //this.world.getMethodProfiler().exit(); // Akarin - remove caller
|
||||
}
|
||||
|
||||
public boolean cM() {
|
||||
@@ -2503,10 +2503,10 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
@ -1566,6 +1582,15 @@ index fa7d210dbd4f509418402e664b55e9e567bba4cf..150075f5e78fca681e9e1d0582d7d92b
|
||||
|
||||
while (this.yaw - this.lastYaw < -180.0F) {
|
||||
this.lastYaw -= 360.0F;
|
||||
@@ -2540,7 +2540,7 @@ public abstract class EntityLiving extends Entity {
|
||||
this.aD += 360.0F;
|
||||
}
|
||||
|
||||
- this.world.getMethodProfiler().exit();
|
||||
+ //this.world.getMethodProfiler().exit(); // Akarin - remove caller
|
||||
this.aL += f2;
|
||||
if (this.isGliding()) {
|
||||
++this.be;
|
||||
@@ -2741,19 +2741,19 @@ public abstract class EntityLiving extends Entity {
|
||||
}
|
||||
|
||||
@ -1638,7 +1663,7 @@ index 0f120b3a48c150e4120198e0b5a49e25291ac46d..00000000000000000000000000000000
|
||||
- public float aJ;
|
||||
- public float aK;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
index 7a3f41bd8d5dbee9b0b045564f1bd3e9c3d0d50b..01d9a1287684856db0d9daaf3841652187e55d9f 100644
|
||||
index 7a3f41bd8d5dbee9b0b045564f1bd3e9c3d0d50b..dac7f4a76bfbbae33202142afd4d51f1a0603c82 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPhantom.java
|
||||
@@ -9,9 +9,10 @@ import javax.annotation.Nullable;
|
||||
@ -1655,7 +1680,7 @@ index 7a3f41bd8d5dbee9b0b045564f1bd3e9c3d0d50b..01d9a1287684856db0d9daaf38416521
|
||||
|
||||
public EntityPhantom(EntityTypes<? extends EntityPhantom> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -239,13 +240,13 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@@ -239,7 +240,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
@Override
|
||||
public boolean a() { // shouldExecute
|
||||
double range = maxTargetRange();
|
||||
@ -1664,45 +1689,6 @@ index 7a3f41bd8d5dbee9b0b045564f1bd3e9c3d0d50b..01d9a1287684856db0d9daaf38416521
|
||||
if (crystals.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
crystals.sort(comparator);
|
||||
crystal = crystals.get(0);
|
||||
- if (phantom.getDistanceSq(crystal) > range * range) {
|
||||
+ if (phantom.getDistanceSquared(crystal) > range * range) { // Yatopia
|
||||
crystal = null;
|
||||
return false;
|
||||
}
|
||||
@@ -258,7 +259,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
return false;
|
||||
}
|
||||
double range = maxTargetRange();
|
||||
- return phantom.getDistanceSq(crystal) <= (range * range) * 2;
|
||||
+ return phantom.getDistanceSquared(crystal) <= (range * range) * 2; // Yatopia
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -285,7 +286,7 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
}
|
||||
|
||||
public int compare(Entity entity1, Entity entity2) {
|
||||
- return Double.compare(entity.getDistanceSq(entity1), entity.getDistanceSq(entity2));
|
||||
+ return Double.compare(entity.getDistanceSquared(entity1), entity.getDistanceSquared(entity2)); // Yatopia
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -334,11 +335,11 @@ public class EntityPhantom extends EntityFlying implements IMonster {
|
||||
if (phantom.getHomeOffset().c(phantom.locX(), phantom.locY(), phantom.locZ()) < 4.0D) {
|
||||
updateOffset();
|
||||
}
|
||||
- if (phantom.getHomeOffset().y < phantom.locY() && !phantom.world.isEmpty((new BlockPosition(phantom)).down(1))) {
|
||||
+ if (phantom.getHomeOffset().y < phantom.locY() && !phantom.world.isEmpty((new BlockPosition(phantom.locX(), phantom.locY(), phantom.locZ())).down(1))) {
|
||||
this.verticalChange = Math.max(1.0F, this.verticalChange);
|
||||
updateOffset();
|
||||
}
|
||||
- if (phantom.getHomeOffset().y > phantom.locY() && !phantom.world.isEmpty((new BlockPosition(phantom)).up(1))) {
|
||||
+ if (phantom.getHomeOffset().y > phantom.locY() && !phantom.world.isEmpty((new BlockPosition(phantom.locX(), phantom.locY(), phantom.locZ())).up(1))) {
|
||||
this.verticalChange = Math.min(-1.0F, this.verticalChange);
|
||||
updateOffset();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java.rej b/src/main/java/net/minecraft/server/EntityPhantom.java.rej
|
||||
deleted file mode 100644
|
||||
index bf6c6ecea998206d783fe42b96f34144123d48d6..0000000000000000000000000000000000000000
|
||||
@ -1725,10 +1711,10 @@ index bf6c6ecea998206d783fe42b96f34144123d48d6..00000000000000000000000000000000
|
||||
- public EntityPhantom(EntityTypes<? extends EntityPhantom> entitytypes, World world) {
|
||||
- super(entitytypes, world);
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||
index 13a2af03fc5a511f13a9be28a813e7275448d09d..cf52e4a350968095e67e704c4a65e01594619165 100644
|
||||
index 13a2af03fc5a511f13a9be28a813e7275448d09d..aa9687f47bf30ef13f9ab90eb3d11212b5996a90 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPigZombie.java
|
||||
@@ -103,15 +103,16 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable {
|
||||
@@ -103,15 +103,15 @@ public class EntityPigZombie extends EntityZombie implements IEntityAngerable {
|
||||
double d0 = this.b(GenericAttributes.FOLLOW_RANGE);
|
||||
AxisAlignedBB axisalignedbb = AxisAlignedBB.a(this.getPositionVector()).grow(d0, 10.0D, d0);
|
||||
|
||||
@ -1741,7 +1727,6 @@ index 13a2af03fc5a511f13a9be28a813e7275448d09d..cf52e4a350968095e67e704c4a65e015
|
||||
- }).forEach((entitypigzombie) -> {
|
||||
- entitypigzombie.setGoalTarget(this.getGoalTarget(), org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_NEARBY_ENTITY, true); // CraftBukkit
|
||||
- });
|
||||
+ // CraftBukkit
|
||||
+ for (EntityPigZombie entitypigzombie : this.world.b(EntityPigZombie.class, axisalignedbb)) {
|
||||
+ if (entitypigzombie != this) {
|
||||
+ if (entitypigzombie.getGoalTarget() == null) {
|
||||
@ -2054,7 +2039,7 @@ index 1137eb4819b638cd04d630ec1692b67ec40c740f..00000000000000000000000000000000
|
||||
- private PathfinderGoalEatTile bz;
|
||||
-
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
index 94842538189abd5a1df3ac208d1f145c0a3953db..210f6b995565af5a299d6ba855a1de224102150b 100644
|
||||
index 94842538189abd5a1df3ac208d1f145c0a3953db..d32581ec7f521ec53692517811c8e01dc405afbb 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
@@ -175,9 +175,13 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
@ -2064,7 +2049,7 @@ index 94842538189abd5a1df3ac208d1f145c0a3953db..210f6b995565af5a299d6ba855a1de22
|
||||
- this.world.getMethodProfiler().enter("villagerBrain");
|
||||
+ //this.world.getMethodProfiler().enter("villagerBrain"); // Akarin - remove caller
|
||||
+ // Purpur start
|
||||
+ boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
|
||||
+ boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
|
||||
+ if (world.getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick)
|
||||
+ // Purpur end
|
||||
if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper
|
||||
@ -2092,19 +2077,11 @@ index 68f0fc0230a4148ab9fc4181736ce93297c7e1b9..00000000000000000000000000000000
|
||||
- if (this.bM) {
|
||||
- this.bM = false;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
|
||||
index 74c2d89af516ffc252032d5cbd12b489ea46813e..1846e65d1a86144044dc1ae95132b49ca84d4228 100644
|
||||
index 74c2d89af516ffc252032d5cbd12b489ea46813e..fe37627cf10fe3e5cbc5da00e154581dc1f661dc 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java
|
||||
@@ -2,7 +2,6 @@ package net.minecraft.server;
|
||||
|
||||
import java.util.EnumSet;
|
||||
import javax.annotation.Nullable;
|
||||
-// CraftBukkit start
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe;
|
||||
import org.bukkit.entity.AbstractVillager;
|
||||
@@ -47,6 +46,13 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
|
||||
this.goalSelector.a(10, new PathfinderGoalLookAtPlayer(this, EntityInsentient.class, 8.0F));
|
||||
@@ -20,6 +20,13 @@ public class EntityVillagerTrader extends EntityVillagerAbstract {
|
||||
this.attachedToPlayer = true;
|
||||
}
|
||||
|
||||
+ // Purpur - start
|
||||
@ -2114,9 +2091,9 @@ index 74c2d89af516ffc252032d5cbd12b489ea46813e..1846e65d1a86144044dc1ae95132b49c
|
||||
+ }
|
||||
+ // Purpur - end
|
||||
+
|
||||
@Nullable
|
||||
@Override
|
||||
public EntityAgeable createChild(WorldServer worldserver, EntityAgeable entityageable) {
|
||||
protected void initPathfinder() {
|
||||
this.goalSelector.a(0, new PathfinderGoalFloat(this));
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java.rej b/src/main/java/net/minecraft/server/EntityVillagerTrader.java.rej
|
||||
deleted file mode 100644
|
||||
index c432902ff89c1cb6d8e6f8f334828b96cd76e1b6..0000000000000000000000000000000000000000
|
||||
@ -2139,7 +2116,7 @@ index c432902ff89c1cb6d8e6f8f334828b96cd76e1b6..00000000000000000000000000000000
|
||||
- @Override
|
||||
- public EntityAgeable createChild(EntityAgeable entityageable) {
|
||||
diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java
|
||||
index 193932e990ac25b3820bb7438c56a75a43cfdb25..20848d73efdf3e214ee7875398f1931f822614fd 100644
|
||||
index 375f974e391f0f233ad5f0bd755471ec68d7bf6d..27a67512d93e82b24175f4d1d2497faebed779f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/Explosion.java
|
||||
+++ b/src/main/java/net/minecraft/server/Explosion.java
|
||||
@@ -105,7 +105,7 @@ public class Explosion {
|
||||
@ -2147,35 +2124,35 @@ index 193932e990ac25b3820bb7438c56a75a43cfdb25..20848d73efdf3e214ee7875398f1931f
|
||||
int j;
|
||||
|
||||
- if (this.a || this.b != Effect.NONE) { // EMC - don't run block processing if neither flag is set
|
||||
+ if (this.b || this.c != Effect.NONE) { // EMC - don't run block processing if neither flag is set
|
||||
+ if (this.b || this.c != Effect.NONE) { // EMC - don't run block processing if neither flag is set // Yatopia - fix
|
||||
for (int k = 0; k < 16; ++k) {
|
||||
for (i = 0; i < 16; ++i) {
|
||||
for (j = 0; j < 16; ++j) {
|
||||
@@ -218,7 +218,7 @@ public class Explosion {
|
||||
boolean flag1 = this.c != Explosion.Effect.NONE;
|
||||
@@ -284,7 +284,7 @@ public class Explosion {
|
||||
if (!iblockdata.isAir() && iblockdata.isDestroyable()) { // Paper
|
||||
BlockPosition blockposition1 = blockposition.immutableCopy();
|
||||
|
||||
if (flag) {
|
||||
- if (this.size >= 2.0F && flag1) {
|
||||
+ if (this.size >= 2.0F/* && flag1*/) { // EMC - don't care about block breaks flag for animation
|
||||
this.world.addParticle(Particles.EXPLOSION_EMITTER, this.posX, this.posY, this.posZ, 1.0D, 0.0D, 0.0D);
|
||||
} else {
|
||||
this.world.addParticle(Particles.EXPLOSION, this.posX, this.posY, this.posZ, 1.0D, 0.0D, 0.0D);
|
||||
- this.world.getMethodProfiler().enter("explosion_blocks");
|
||||
+ //this.world.getMethodProfiler().enter("explosion_blocks"); // Akarin - remove caller
|
||||
if (block.a(this) && this.world instanceof WorldServer) {
|
||||
TileEntity tileentity = block.isTileEntity() ? this.world.getTileEntity(blockposition) : null;
|
||||
LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).a(this.world.random).set(LootContextParameters.ORIGIN, Vec3D.a((BaseBlockPosition) blockposition)).set(LootContextParameters.TOOL, ItemStack.b).setOptional(LootContextParameters.BLOCK_ENTITY, tileentity).setOptional(LootContextParameters.THIS_ENTITY, this.source);
|
||||
diff --git a/src/main/java/net/minecraft/server/Explosion.java.rej b/src/main/java/net/minecraft/server/Explosion.java.rej
|
||||
deleted file mode 100644
|
||||
index 8d0039b05a5d20762707857770927e2f7e30b7ff..0000000000000000000000000000000000000000
|
||||
index 98a910fa6bfc9542b1d1cb56b6621809acd6b279..0000000000000000000000000000000000000000
|
||||
--- a/src/main/java/net/minecraft/server/Explosion.java.rej
|
||||
+++ /dev/null
|
||||
@@ -1,10 +0,0 @@
|
||||
-diff a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java (rejected hunks)
|
||||
-@@ -215,7 +217,7 @@ public class Explosion {
|
||||
- boolean flag1 = this.b != Explosion.Effect.NONE;
|
||||
-@@ -281,7 +281,7 @@ public class Explosion {
|
||||
- if (!iblockdata.isAir() && iblockdata.isDestroyable()) { // Paper
|
||||
- BlockPosition blockposition1 = blockposition.immutableCopy();
|
||||
-
|
||||
- if (flag) {
|
||||
-- if (this.size >= 2.0F && flag1) {
|
||||
-+ if (this.size >= 2.0F/* && flag1*/) { // EMC - don't care about block breaks flag for animation
|
||||
- this.world.addParticle(Particles.EXPLOSION_EMITTER, this.posX, this.posY, this.posZ, 1.0D, 0.0D, 0.0D);
|
||||
- } else {
|
||||
- this.world.addParticle(Particles.EXPLOSION, this.posX, this.posY, this.posZ, 1.0D, 0.0D, 0.0D);
|
||||
-- this.world.getMethodProfiler().enter("explosion_blocks");
|
||||
-+ //this.world.getMethodProfiler().enter("explosion_blocks"); // Akarin - remove caller
|
||||
- if (block.a(this) && this.world instanceof WorldServer) {
|
||||
- TileEntity tileentity = block.isTileEntity() ? this.world.getTileEntity(blockposition) : null;
|
||||
- LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).a(this.world.random).set(LootContextParameters.POSITION, blockposition).set(LootContextParameters.TOOL, ItemStack.b).setOptional(LootContextParameters.BLOCK_ENTITY, tileentity).setOptional(LootContextParameters.THIS_ENTITY, this.source);
|
||||
diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java.rej b/src/main/java/net/minecraft/server/LightEngineThreaded.java.rej
|
||||
deleted file mode 100644
|
||||
index 74d10212e547adf96762155adb03c0158df00a16..0000000000000000000000000000000000000000
|
||||
@ -2309,36 +2286,9 @@ index 8ac9dfb13e32d5304dd925ed97facbf962e2a7b5..00000000000000000000000000000000
|
||||
-
|
||||
- if (this.packetListener instanceof PlayerConnection) {
|
||||
diff --git a/src/main/java/net/minecraft/server/PiglinAI.java b/src/main/java/net/minecraft/server/PiglinAI.java
|
||||
index 0407fa1751d89a037da8cb01f5ceef9b9833dd18..9a87894f851ecebb6772b9c87948730d17787be8 100644
|
||||
index 0407fa1751d89a037da8cb01f5ceef9b9833dd18..65abc7fbddf78662c4eb2a918848f775a0cd2eb0 100644
|
||||
--- a/src/main/java/net/minecraft/server/PiglinAI.java
|
||||
+++ b/src/main/java/net/minecraft/server/PiglinAI.java
|
||||
@@ -12,7 +12,7 @@ import java.util.Set;
|
||||
|
||||
public class PiglinAI {
|
||||
|
||||
- public static final Item a = Items.GOLD_INGOT;
|
||||
+ public static final Item a = net.minecraft.server.Items.GOLD_INGOT;
|
||||
private static final IntRange b = TimeRange.a(30, 120);
|
||||
private static final IntRange c = TimeRange.a(10, 40);
|
||||
private static final IntRange d = TimeRange.a(10, 30);
|
||||
@@ -134,7 +134,7 @@ public class PiglinAI {
|
||||
ItemStack itemstack;
|
||||
|
||||
// CraftBukkit start
|
||||
- if (entityitem.getItemStack().getItem() == Items.GOLD_NUGGET && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(entitypiglin, entityitem, 0, false).isCancelled()) {
|
||||
+ if (entityitem.getItemStack().getItem() == net.minecraft.server.Items.GOLD_NUGGET && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(entitypiglin, entityitem, 0, false).isCancelled()) {
|
||||
entitypiglin.receive(entityitem, entityitem.getItemStack().getCount());
|
||||
itemstack = entityitem.getItemStack();
|
||||
entityitem.die();
|
||||
@@ -288,7 +288,7 @@ public class PiglinAI {
|
||||
} else {
|
||||
boolean flag = entitypiglin.l(itemstack);
|
||||
|
||||
- return item == Items.GOLD_NUGGET ? flag : (c(item) ? !u(entitypiglin) && flag : (!a(item) ? entitypiglin.o(itemstack) : z(entitypiglin) && flag));
|
||||
+ return item == net.minecraft.server.Items.GOLD_NUGGET ? flag : (c(item) ? !u(entitypiglin) && flag : (!a(item) ? entitypiglin.o(itemstack) : z(entitypiglin) && flag));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,16 +359,17 @@ public class PiglinAI {
|
||||
public static void a(EntityHuman entityhuman, boolean flag) {
|
||||
List<EntityPiglinAbstract> list = entityhuman.world.a(EntityPiglin.class, entityhuman.getBoundingBox().g(16.0D)); // CraftBukkit - decompile error
|
||||
@ -2627,13 +2577,14 @@ index 7c9d7ae5f875ba36b13d6b9b76581be0df903b49..00000000000000000000000000000000
|
||||
- playerconnection.sendPacket(new PacketPlayOutAbilities(entityplayer.abilities));
|
||||
- playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex));
|
||||
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
index 62edfda9cc326a428cd267227054f03d94d22dce..b74888e554674caac8dfc3d8e00f5961e6527d8b 100644
|
||||
index 62edfda9cc326a428cd267227054f03d94d22dce..5dce3c862166783e1fc479cd4ecce8b80daa90b2 100644
|
||||
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
@@ -23,15 +23,21 @@ public class PortalTravelAgent {
|
||||
@@ -22,16 +22,21 @@ public class PortalTravelAgent {
|
||||
// int i = flag ? 16 : 128;
|
||||
// CraftBukkit end
|
||||
|
||||
villageplace.a(this.world, blockposition, i);
|
||||
- villageplace.a(this.world, blockposition, i);
|
||||
- Optional<VillagePlaceRecord> optional = villageplace.b((villageplacetype) -> {
|
||||
- return villageplacetype == VillagePlaceType.v;
|
||||
- }, blockposition, i, VillagePlace.Occupancy.ANY).sorted(Comparator.comparingDouble((VillagePlaceRecord villageplacerecord) -> { // CraftBukkit - decompile error
|
||||
@ -2875,22 +2826,6 @@ index c632cd030e36d8abfd92a14948e4893d885823ad..00000000000000000000000000000000
|
||||
- public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) {
|
||||
- if (!this.isClientSide) {
|
||||
- IBlockData iblockdata = this.getType(blockposition);
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldDataServer.java b/src/main/java/net/minecraft/server/WorldDataServer.java
|
||||
index a7e623044aece1f46e2d039cd2dcf710120ac267..e9da64d5745b12bc1144b1f55dc45b6125083b8f 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldDataServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldDataServer.java
|
||||
@@ -122,7 +122,10 @@ public class WorldDataServer implements IWorldDataServer, SaveData {
|
||||
private void a(IRegistryCustom iregistrycustom, NBTTagCompound nbttagcompound, @Nullable NBTTagCompound nbttagcompound1) {
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
|
||||
- this.C.stream().map(NBTTagString::a).forEach(nbttaglist::add);
|
||||
+ for (String s : this.C) {
|
||||
+ NBTTagString a = NBTTagString.a(s);
|
||||
+ nbttaglist.add(a);
|
||||
+ }
|
||||
nbttagcompound.set("ServerBrands", nbttaglist);
|
||||
nbttagcompound.setBoolean("WasModded", this.D);
|
||||
NBTTagCompound nbttagcompound2 = new NBTTagCompound();
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldDataServer.java.rej b/src/main/java/net/minecraft/server/WorldDataServer.java.rej
|
||||
deleted file mode 100644
|
||||
index ce6a0e3807550ef3652d4e1ab8695f7afe9fc8f8..0000000000000000000000000000000000000000
|
||||
@ -2940,7 +2875,7 @@ index 3a35169eaf680c45fe42922eb5f0014fa422c31c..00000000000000000000000000000000
|
||||
- }
|
||||
- // Spigot Start
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 23137e430dc6f74b1638776eb28638f8c5e54c83..ebf4ceb084d9e7bd3eac3e0c90ba064bd9d0a8a7 100644
|
||||
index 201e577d2e53b04532180553b72f6ae80f1cfb00..af87989796198229fbdf6fc5cf6da42bf2eeec98 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -869,11 +869,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
@ -3141,16 +3076,30 @@ index 6b024f18ebc32034d1d81ef98f7117944bc0cd0a..00000000000000000000000000000000
|
||||
- }
|
||||
-
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
index 00c7c90639f030ebb17476711dec813d7ec3cc22..95ad182ebbbdf733bec496fe12cb0dcb783a8dd8 100644
|
||||
index 00c7c90639f030ebb17476711dec813d7ec3cc22..ce945452a9e634d42fb541b86d347b987822c558 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
||||
@@ -129,9 +129,25 @@ public class PurpurConfig {
|
||||
@@ -129,11 +129,6 @@ public class PurpurConfig {
|
||||
return config.getString(path, config.getString(path));
|
||||
}
|
||||
|
||||
- public static String timingsUrl = "https://timings.pl3x.net";
|
||||
- private static void timingsSettings() {
|
||||
- timingsUrl = getString("settings.timings.url", timingsUrl);
|
||||
- }
|
||||
-
|
||||
public static boolean barrelSixRows = false;
|
||||
public static boolean enderChestSixRows = false;
|
||||
public static boolean enderChestPermissionRows = false;
|
||||
@@ -157,4 +152,24 @@ public class PurpurConfig {
|
||||
private static void fixItemPositionDesync() {
|
||||
fixItemPositionDesync = getBoolean("settings.fix-item-position-desync", fixItemPositionDesync);
|
||||
}
|
||||
+
|
||||
+ public static boolean tpsCatchup = true;
|
||||
+ private static void tpsCatchup() {
|
||||
+ tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
|
||||
+ }
|
||||
+
|
||||
+ public static double laggingThreshold = 19.0D;
|
||||
+ private static void tickLoopSettings() {
|
||||
@ -3166,13 +3115,7 @@ index 00c7c90639f030ebb17476711dec813d7ec3cc22..95ad182ebbbdf733bec496fe12cb0dcb
|
||||
+ private static void dontSendUselessEntityPackets() {
|
||||
+ dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean tpsCatchup = true;
|
||||
+ private static void tpsCatchup() {
|
||||
+ tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup);
|
||||
}
|
||||
|
||||
public static boolean barrelSixRows = false;
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java.rej b/src/main/java/net/pl3x/purpur/PurpurConfig.java.rej
|
||||
deleted file mode 100644
|
||||
index ff05ff6aef1e0f61eb4437253020632745ee2bd2..0000000000000000000000000000000000000000
|
||||
@ -3191,28 +3134,30 @@ index ff05ff6aef1e0f61eb4437253020632745ee2bd2..00000000000000000000000000000000
|
||||
-+ }
|
||||
- }
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
index 361f7857e461578e90cb71e15027dadaf794cb69..ffe35034dc48e3223cb62577c4ee7167a5fd6464 100644
|
||||
index 361f7857e461578e90cb71e15027dadaf794cb69..ba90aa43f2fdd44d0475b519a7e5e1701acd46fb 100644
|
||||
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
||||
@@ -1,7 +1,16 @@
|
||||
@@ -1,7 +1,18 @@
|
||||
package net.pl3x.purpur;
|
||||
|
||||
-import org.bukkit.configuration.ConfigurationSection;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.HashSet;
|
||||
import java.util.List;
|
||||
+import java.util.Set;
|
||||
+import java.util.logging.Level;
|
||||
+import net.minecraft.server.Block;
|
||||
+import net.minecraft.server.Explosion;
|
||||
+import net.minecraft.server.IRegistry;
|
||||
+import net.minecraft.server.Item;
|
||||
+import net.minecraft.server.Items;
|
||||
+import net.minecraft.server.MinecraftKey;
|
||||
+
|
||||
import java.util.List;
|
||||
+import java.util.logging.Level;
|
||||
+
|
||||
+import org.bukkit.configuration.ConfigurationSection;
|
||||
+
|
||||
import static net.pl3x.purpur.PurpurConfig.log;
|
||||
|
||||
public class PurpurWorldConfig {
|
||||
@@ -56,4 +65,163 @@ public class PurpurWorldConfig {
|
||||
@@ -56,4 +67,178 @@ public class PurpurWorldConfig {
|
||||
PurpurConfig.config.addDefault("world-settings.default." + path, def);
|
||||
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path));
|
||||
}
|
||||
@ -3251,6 +3196,7 @@ index 361f7857e461578e90cb71e15027dadaf794cb69..ffe35034dc48e3223cb62577c4ee7167
|
||||
+ private void foxSettings() {
|
||||
+ foxTypeChangesWithTulips = getBoolean("mobs.fox.tulips-change-type", foxTypeChangesWithTulips);
|
||||
+ }
|
||||
+
|
||||
+ public float giantStepHeight = 2.0F;
|
||||
+ public float giantJumpHeight = 1.0F;
|
||||
+ public double giantMaxHealth = 100.0D;
|
||||
@ -3258,7 +3204,6 @@ index 361f7857e461578e90cb71e15027dadaf794cb69..ffe35034dc48e3223cb62577c4ee7167
|
||||
+ public double giantAttackDamage = 50.0D;
|
||||
+ public boolean giantHaveAI = false;
|
||||
+ public boolean giantHaveHostileAI = false;
|
||||
+
|
||||
+ private void giantSettings() {
|
||||
+ giantStepHeight = (float) getDouble("mobs.giant.step-height", giantStepHeight);
|
||||
+ giantJumpHeight = (float) getDouble("mobs.giant.jump-height", giantJumpHeight);
|
||||
@ -3374,6 +3319,21 @@ index 361f7857e461578e90cb71e15027dadaf794cb69..ffe35034dc48e3223cb62577c4ee7167
|
||||
+ public boolean squidImmuneToEAR = true;
|
||||
+ private void squidSettings() {
|
||||
+ squidImmuneToEAR = getBoolean("mobs.squid.immune-to-EAR", squidImmuneToEAR);
|
||||
+ }
|
||||
+
|
||||
+ public Set<Block> noTickBlocks = new HashSet<>();
|
||||
+ private void noTickBlocks() {
|
||||
+ getList("blocks.no-tick", new ArrayList<>()).forEach(key -> {
|
||||
+ Block block = IRegistry.BLOCK.get(new MinecraftKey(key.toString()));
|
||||
+ if (!block.getBlockData().isAir()) {
|
||||
+ noTickBlocks.add(block);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+
|
||||
+ public boolean dolphinDisableTreasureSearching = false;
|
||||
+ private void dolphinSettings() {
|
||||
+ dolphinDisableTreasureSearching = getBoolean("mobs.dolphin.disable-treasure-searching", dolphinDisableTreasureSearching);
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java.rej b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java.rej
|
||||
@ -3396,15 +3356,15 @@ index e7353bb8a2f004e6264433f094bc6a74034de502..00000000000000000000000000000000
|
||||
- public boolean strayRidableInWater = false;
|
||||
- private void straySettings() {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 624dd7632b9fcc1f60174b0dd82ed42dcf345bd1..2b664724a46a7b7221f93da62c6d87b9cac199f5 100644
|
||||
index 624dd7632b9fcc1f60174b0dd82ed42dcf345bd1..6dda54fc22f61329389b50f58c776be2b2c350e8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -835,6 +835,8 @@ public final class CraftServer implements Server {
|
||||
com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper
|
||||
com.tuinity.tuinity.config.TuinityConfig.init((File) console.options.valueOf("tuinity-settings")); // Tuinity - Server Config
|
||||
net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||
+ de.minebench.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami - Server Config
|
||||
+ com.proximyst.rainforest.RainforestConfig.init((File) console.options.valueOf("rainforest-settings")); // Rainforest
|
||||
+ de.minebench.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami
|
||||
for (WorldServer world : console.getWorlds()) {
|
||||
world.worldDataServer.setDifficulty(config.difficulty);
|
||||
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
|
||||
@ -3412,12 +3372,12 @@ index 624dd7632b9fcc1f60174b0dd82ed42dcf345bd1..2b664724a46a7b7221f93da62c6d87b9
|
||||
world.paperConfig.init(); // Paper
|
||||
world.tuinityConfig.init(); // Tuinity - Server Config
|
||||
world.purpurConfig.init(); // Purpur
|
||||
+ world.origamiConfig.init(); // Origami - World Config
|
||||
+ world.rainforestConfig.init(); // Rainforest
|
||||
+ world.origamiConfig.init(); // Origami - World Config
|
||||
}
|
||||
|
||||
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
|
||||
@@ -2249,6 +2253,20 @@ public final class CraftServer implements Server {
|
||||
@@ -2249,6 +2253,19 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
@ -3427,7 +3387,6 @@ index 624dd7632b9fcc1f60174b0dd82ed42dcf345bd1..2b664724a46a7b7221f93da62c6d87b9
|
||||
+ return com.proximyst.rainforest.RainforestConfig.config;
|
||||
+ }
|
||||
+ // Rainforest end
|
||||
+
|
||||
+ // Origami start
|
||||
+ @Override
|
||||
+ public YamlConfiguration getOrigamiConfig() {
|
||||
@ -3438,7 +3397,7 @@ index 624dd7632b9fcc1f60174b0dd82ed42dcf345bd1..2b664724a46a7b7221f93da62c6d87b9
|
||||
@Override
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
@@ -2388,4 +2406,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2388,4 +2405,11 @@ public final class CraftServer implements Server {
|
||||
return mobGoals;
|
||||
}
|
||||
// Paper end
|
||||
@ -3488,21 +3447,13 @@ index a3c8dfd94f78b49341e5f5aba1735651096c9d70..00000000000000000000000000000000
|
||||
- public void restart() {
|
||||
- org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 25f12589ccf3458576b8653a637b6f83eb633630..d6c82bd0afa43a4afcbc7029622c3915fa39bcc9 100644
|
||||
index 25f12589ccf3458576b8653a637b6f83eb633630..63cbecc4cdd549247b58fd094c27683655667799 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -154,6 +154,22 @@ public class Main {
|
||||
@@ -154,6 +154,21 @@ public class Main {
|
||||
.describedAs("Yml file");
|
||||
// Purpur end
|
||||
|
||||
+ // Origami start - Server Config
|
||||
+ acceptsAll(asList("origami", "origami-settings"), "File for origami settings")
|
||||
+ .withRequiredArg()
|
||||
+ .ofType(File.class)
|
||||
+ .defaultsTo(new File("origami.yml"))
|
||||
+ .describedAs("Yml file");
|
||||
+ // Origami end - Server Config
|
||||
+
|
||||
+ // Rainforest start
|
||||
+ acceptsAll(asList("rainforest", "rainforest-settings"), "File for rainforest settings")
|
||||
+ .withRequiredArg()
|
||||
@ -3510,6 +3461,13 @@ index 25f12589ccf3458576b8653a637b6f83eb633630..d6c82bd0afa43a4afcbc7029622c3915
|
||||
+ .defaultsTo(new File("rainforest.yml"))
|
||||
+ .describedAs("Yml file");
|
||||
+ // Rainforest end
|
||||
+ // Origami start
|
||||
+ acceptsAll(asList("origami", "origami-settings"), "File for origami settings")
|
||||
+ .withRequiredArg()
|
||||
+ .ofType(File.class)
|
||||
+ .defaultsTo(new File("origami.yml"))
|
||||
+ .describedAs("Yml file");
|
||||
+ // Origami end
|
||||
+
|
||||
// Paper start
|
||||
acceptsAll(asList("server-name"), "Name of the server")
|
||||
@ -3537,7 +3495,7 @@ index 916603085d652444027e4513b77293ece84a6c4f..00000000000000000000000000000000
|
||||
- acceptsAll(asList("server-name"), "Name of the server")
|
||||
- .withRequiredArg()
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
index 744b2a00fa0743598cabb46c539ae65238cdc736..0677ff98d530da5d4ae2194ebd0c229298d594a6 100644
|
||||
index 744b2a00fa0743598cabb46c539ae65238cdc736..1a311092aaa5763396503bd7fd2464b2e41058fc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -670,8 +670,12 @@ public class CraftBlock implements Block {
|
||||
@ -3547,7 +3505,7 @@ index 744b2a00fa0743598cabb46c539ae65238cdc736..0677ff98d530da5d4ae2194ebd0c2292
|
||||
- return net.minecraft.server.Block.getDrops(iblockdata, (WorldServer) world.getMinecraftWorld(), position, world.getTileEntity(position), entity == null ? null : ((CraftEntity) entity).getHandle(), nms)
|
||||
- .stream().map(CraftItemStack::asBukkitCopy).collect(Collectors.toList());
|
||||
+ List<ItemStack> list = new ArrayList<>();
|
||||
+ for (net.minecraft.server.ItemStack itemStack : net.minecraft.server.Block.getDrops(iblockdata, (WorldServer) world.getMinecraftWorld(), position, world.getTileEntity(position), entity == null ? null : ((CraftEntity) entity).getHandle(), nms)) {
|
||||
+ for (net.minecraft.server.ItemStack itemStack : net.minecraft.server.Block.getDrops(iblockdata, world.getMinecraftWorld(), position, world.getTileEntity(position), entity == null ? null : ((CraftEntity) entity).getHandle(), nms)) {
|
||||
+ ItemStack stack = CraftItemStack.asBukkitCopy(itemStack);
|
||||
+ list.add(stack);
|
||||
+ }
|
||||
|
@ -133,7 +133,7 @@ index fb5d581fa1ded44fb87fad8fcb4994955c2e4a94..26234861e38b4d724a46afeb5428272f
|
||||
|
||||
public CrashReport b(CrashReport crashreport) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 2b664724a46a7b7221f93da62c6d87b9cac199f5..973d8969acec65e7b730cdf869a9687c86fde78b 100644
|
||||
index 6dda54fc22f61329389b50f58c776be2b2c350e8..918b3e38121b0d820293acd40c9eff2f88b20ee1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -216,7 +216,7 @@ import javax.annotation.Nullable; // Paper
|
||||
|
@ -28,10 +28,10 @@ index 26234861e38b4d724a46afeb5428272f14e9f700..c3c5cfb74caf11e452ca061cf882ce70
|
||||
this.X = true;
|
||||
// Purpur start - tps catchup
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 973d8969acec65e7b730cdf869a9687c86fde78b..7a2b16aaf70cefa00beeacf2d6fcd8878bd7f6de 100644
|
||||
index 918b3e38121b0d820293acd40c9eff2f88b20ee1..e2a540d07c68e4ca9b2a2a46d6ba9a33903eced9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -2413,4 +2413,11 @@ public final class CraftServer implements Server {
|
||||
@@ -2412,4 +2412,11 @@ public final class CraftServer implements Server {
|
||||
return getServer().lagging;
|
||||
}
|
||||
// Purpur end
|
||||
@ -44,7 +44,7 @@ index 973d8969acec65e7b730cdf869a9687c86fde78b..7a2b16aaf70cefa00beeacf2d6fcd887
|
||||
+ // Yatopia end
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
index 3c7b9a6d24e064f9c1ec5fb6d52f42627944d7fa..85f588ce9d0e3ce4696f2d4918e7b242bf99a1de 100644
|
||||
index 3c7b9a6d24e064f9c1ec5fb6d52f42627944d7fa..76cf2353754821361a4541c21fc8d5f1a670b0de 100644
|
||||
--- a/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
+++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java
|
||||
@@ -33,7 +33,7 @@ public class TicksPerSecondCommand extends Command
|
||||
@ -62,10 +62,10 @@ index 3c7b9a6d24e064f9c1ec5fb6d52f42627944d7fa..85f588ce9d0e3ce4696f2d4918e7b242
|
||||
}
|
||||
+
|
||||
+ // Yatopia start
|
||||
+ private static String format(long ms)
|
||||
+ public static String format(long ms)
|
||||
+ {
|
||||
+ ChatColor startingColor = ms < 40 ? ChatColor.GREEN : ( ms < 50 ) ? ChatColor.YELLOW : ChatColor.RED;
|
||||
+ return startingColor.toString() + Long.toString( ms ) + ChatColor.GOLD + "ms";
|
||||
+ return startingColor.toString() + ms + ChatColor.GOLD + "ms";
|
||||
+ }
|
||||
+ // Yatopia end
|
||||
}
|
||||
|
@ -18,362 +18,357 @@ index b67f05f290db653cf75a89e85bd3decb5044a1e0..11758b6b158d971b9beb1b609d7513da
|
||||
new TimingsExport(listeners, parent, history).start();
|
||||
diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java b/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..567dd8839173ac74b7dc122c1b677998afe0db5f
|
||||
index 0000000000000000000000000000000000000000..27c6daf22b5ddc8e9de6ef084f396347a5b44feb
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaCommand.java
|
||||
@@ -0,0 +1,128 @@
|
||||
+package dev.tr7zw.yatopia;
|
||||
+
|
||||
+import com.google.common.base.Preconditions;
|
||||
+import com.google.common.collect.Lists;
|
||||
+
|
||||
+import net.minecraft.server.MinecraftKey;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.util.Arrays;
|
||||
+import java.util.Collection;
|
||||
+import java.util.Collections;
|
||||
+import java.util.List;
|
||||
+import java.util.Locale;
|
||||
+import java.util.function.Function;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.ChatColor;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+
|
||||
+public class YatopiaCommand extends Command {
|
||||
+
|
||||
+ public YatopiaCommand(String name) {
|
||||
+ super(name);
|
||||
+ this.description = "Yatopia related commands";
|
||||
+ this.usageMessage = "/yatopia [help | reload | info | version]";
|
||||
+ this.setPermission("bukkit.command.yatopia");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
|
||||
+ if (args.length <= 1) {
|
||||
+ return getListMatchingLast(args, "help", "info", "reload", "version");
|
||||
+ }
|
||||
+ return Collections.emptyList();
|
||||
+ }
|
||||
+
|
||||
+ // Code from Mojang - copyright them
|
||||
+ public static List<String> getListMatchingLast(String[] args, String... matches) {
|
||||
+ return getListMatchingLast(args, Arrays.asList(matches));
|
||||
+ }
|
||||
+
|
||||
+ public static boolean matches(String s, String s1) {
|
||||
+ return s1.regionMatches(true, 0, s, 0, s.length());
|
||||
+ }
|
||||
+
|
||||
+ public static List<String> getListMatchingLast(String[] strings, Collection<?> collection) {
|
||||
+ String last = strings[strings.length - 1];
|
||||
+ List<String> results = Lists.newArrayList();
|
||||
+
|
||||
+ if (!collection.isEmpty()) {
|
||||
+ Function<Object, String> toStringFunction = (o) -> {
|
||||
+ Preconditions.checkNotNull(o);
|
||||
+ return o.toString();
|
||||
+ };
|
||||
+ for (Object c : collection) {
|
||||
+ String value = toStringFunction.apply(c);
|
||||
+ if (matches(last, value)) {
|
||||
+ results.add(value);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (results.isEmpty()) {
|
||||
+ for (Object c : collection) {
|
||||
+ if (c instanceof MinecraftKey) {
|
||||
+ MinecraftKey key = (MinecraftKey) c;
|
||||
+ if (matches(last, key.getKey())) {
|
||||
+ results.add(key.toString());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return results;
|
||||
+ }
|
||||
+ // end copy stuff
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
+ if (!testPermission(sender)) return true;
|
||||
+
|
||||
+ if (args.length == 0) {
|
||||
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ switch (args[0].toLowerCase(Locale.ENGLISH)) {
|
||||
+ case "info":
|
||||
+ doInfo(sender);
|
||||
+ break;
|
||||
+ case "reload":
|
||||
+ doReload(sender);
|
||||
+ break;
|
||||
+ case "ver":
|
||||
+ case "version":
|
||||
+ Command ver = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
|
||||
+ if (ver != null) {
|
||||
+ ver.execute(sender, commandLabel, new String[0]);
|
||||
+ break;
|
||||
+ }
|
||||
+ // else - fall through to default
|
||||
+ default:
|
||||
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ private void doInfo(CommandSender sender) {
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Last tick took " + Bukkit.getLastTickMs() + "ms");
|
||||
+ //TODO
|
||||
+ }
|
||||
+
|
||||
+ private void doReload(CommandSender sender) {
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues.");
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server.");
|
||||
+
|
||||
+ MinecraftServer console = MinecraftServer.getServer();
|
||||
+ dev.tr7zw.yatopia.YatopiaConfig.init((File) console.options.valueOf("yatopia-settings"));
|
||||
+ console.server.reloadCount++;
|
||||
+
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Yatopia config reload complete.");
|
||||
+ }
|
||||
+}
|
||||
@@ -0,0 +1,126 @@
|
||||
+package dev.tr7zw.yatopia;
|
||||
+
|
||||
+import com.google.common.base.Preconditions;
|
||||
+import com.google.common.collect.Lists;
|
||||
+import java.io.File;
|
||||
+import java.util.Arrays;
|
||||
+import java.util.Collection;
|
||||
+import java.util.Collections;
|
||||
+import java.util.List;
|
||||
+import java.util.Locale;
|
||||
+import java.util.function.Function;
|
||||
+import net.minecraft.server.MinecraftKey;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.ChatColor;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.spigotmc.TicksPerSecondCommand;
|
||||
+
|
||||
+public class YatopiaCommand extends Command {
|
||||
+
|
||||
+ public YatopiaCommand(String name) {
|
||||
+ super(name);
|
||||
+ this.description = "Yatopia related commands";
|
||||
+ this.usageMessage = "/yatopia [help | reload | info | version]";
|
||||
+ this.setPermission("bukkit.command.yatopia");
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public List<String> tabComplete(CommandSender sender, String alias, String[] args, Location location) throws IllegalArgumentException {
|
||||
+ if (args.length <= 1) {
|
||||
+ return getListMatchingLast(args, "help", "info", "reload", "version");
|
||||
+ }
|
||||
+ return Collections.emptyList();
|
||||
+ }
|
||||
+
|
||||
+ // Code from Mojang - copyright them
|
||||
+ public static List<String> getListMatchingLast(String[] args, String... matches) {
|
||||
+ return getListMatchingLast(args, Arrays.asList(matches));
|
||||
+ }
|
||||
+
|
||||
+ public static boolean matches(String s, String s1) {
|
||||
+ return s1.regionMatches(true, 0, s, 0, s.length());
|
||||
+ }
|
||||
+
|
||||
+ public static List<String> getListMatchingLast(String[] strings, Collection<?> collection) {
|
||||
+ String last = strings[strings.length - 1];
|
||||
+ List<String> results = Lists.newArrayList();
|
||||
+
|
||||
+ if (!collection.isEmpty()) {
|
||||
+ Function<Object, String> toStringFunction = (o) -> {
|
||||
+ Preconditions.checkNotNull(o);
|
||||
+ return o.toString();
|
||||
+ };
|
||||
+ for (Object c : collection) {
|
||||
+ String value = toStringFunction.apply(c);
|
||||
+ if (matches(last, value)) {
|
||||
+ results.add(value);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (results.isEmpty()) {
|
||||
+ for (Object c : collection) {
|
||||
+ if (c instanceof MinecraftKey) {
|
||||
+ MinecraftKey key = (MinecraftKey) c;
|
||||
+ if (matches(last, key.getKey())) {
|
||||
+ results.add(key.toString());
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return results;
|
||||
+ }
|
||||
+ // end copy stuff
|
||||
+
|
||||
+ @Override
|
||||
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
+ if (!testPermission(sender)) return true;
|
||||
+
|
||||
+ if (args.length == 0) {
|
||||
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ switch (args[0].toLowerCase(Locale.ENGLISH)) {
|
||||
+ case "info":
|
||||
+ doInfo(sender);
|
||||
+ break;
|
||||
+ case "reload":
|
||||
+ doReload(sender);
|
||||
+ break;
|
||||
+ case "ver":
|
||||
+ case "version":
|
||||
+ Command ver = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
|
||||
+ if (ver != null) {
|
||||
+ ver.execute(sender, commandLabel, new String[0]);
|
||||
+ break;
|
||||
+ }
|
||||
+ // else - fall through to default
|
||||
+ default:
|
||||
+ sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ private void doInfo(CommandSender sender) {
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.GOLD + "Last tick took " + TicksPerSecondCommand.format(Bukkit.getLastTickMs()));
|
||||
+ //TODO
|
||||
+ }
|
||||
+
|
||||
+ private void doReload(CommandSender sender) {
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues.");
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server.");
|
||||
+
|
||||
+ MinecraftServer console = MinecraftServer.getServer();
|
||||
+ dev.tr7zw.yatopia.YatopiaConfig.init((File) console.options.valueOf("yatopia-settings"));
|
||||
+ console.server.reloadCount++;
|
||||
+
|
||||
+ Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Yatopia config reload complete.");
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0e5f090e4160d08bce0b46ac4cb6d3d3510128bf
|
||||
index 0000000000000000000000000000000000000000..b6e34ea413e29792043955a655d4261553825157
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
@@ -0,0 +1,218 @@
|
||||
+package dev.tr7zw.yatopia;
|
||||
+
|
||||
+import com.google.common.base.Throwables;
|
||||
+
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+
|
||||
+import java.io.File;
|
||||
+import java.io.IOException;
|
||||
+import java.lang.reflect.InvocationTargetException;
|
||||
+import java.lang.reflect.Method;
|
||||
+import java.lang.reflect.Modifier;
|
||||
+import java.util.HashMap;
|
||||
+import java.util.List;
|
||||
+import java.util.Map;
|
||||
+import java.util.concurrent.TimeUnit;
|
||||
+import java.util.logging.Level;
|
||||
+import java.util.regex.Pattern;
|
||||
+
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.configuration.InvalidConfigurationException;
|
||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+
|
||||
+public class YatopiaConfig {
|
||||
+
|
||||
+ public static File CONFIG_FILE;
|
||||
+ private static final String HEADER = "This is the main configuration file for Yatopia.\n"
|
||||
+ + "Yatopia contains many breaking changes and settings, so know what you are doing!\n"
|
||||
+ + "You have been warned!\n";
|
||||
+ /*========================================================================*/
|
||||
+ public static YamlConfiguration config;
|
||||
+ public static int version; // since we're remapping sidestreams' configs we need this public
|
||||
+ static Map<String, Command> commands;
|
||||
+ public static boolean verbose; // since we're remapping sidestreams' configs we need this public
|
||||
+ private static boolean fatalError;
|
||||
+ /*========================================================================*/
|
||||
+ private static boolean metricsStarted;
|
||||
+
|
||||
+ public static void init(File configFile) {
|
||||
+ CONFIG_FILE = configFile;
|
||||
+ config = new YamlConfiguration();
|
||||
+ try {
|
||||
+ config.load(CONFIG_FILE);
|
||||
+ } catch (IOException ex) {
|
||||
+ } catch (InvalidConfigurationException ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Could not load yatopia.yml, please correct your syntax errors", ex);
|
||||
+ throw Throwables.propagate(ex);
|
||||
+ }
|
||||
+ config.options().header(HEADER);
|
||||
+ config.options().copyDefaults(true);
|
||||
+ verbose = getBoolean("verbose", false);
|
||||
+
|
||||
+ commands = new HashMap<String, Command>();
|
||||
+ commands.put("yatopia", new YatopiaCommand("yatopia"));
|
||||
+
|
||||
+ version = getInt("config-version", 1);
|
||||
+ set("config-version", 1);
|
||||
+ removeLeftovers();
|
||||
+ readConfig(YatopiaConfig.class, null);
|
||||
+ }
|
||||
+
|
||||
+ private static void removeLeftovers() {
|
||||
+ // this method is only to remove non-used values in the config
|
||||
+
|
||||
+ // leftover from akarin / rainforest
|
||||
+ if (config.get("world-settings") != null) {
|
||||
+ set("world-settings", null);
|
||||
+ }
|
||||
+ // unused settings getting removed
|
||||
+ if (config.get("settings.disablePlayerOutOfWorldBorderCheck") != null) {
|
||||
+ set("settings.disablePlayerOutOfWorldBorderCheck", null);
|
||||
+ }
|
||||
+ if (config.get("settings.disableEntityCollisions") != null) {
|
||||
+ set("settings.disableEntityCollisions", null);
|
||||
+ }
|
||||
+ if (config.get("settings.onlyPlayerCollisions") != null) {
|
||||
+ set("settings.onlyPlayerCollisions", null);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ protected static void logError(String s) {
|
||||
+ Bukkit.getLogger().severe(s);
|
||||
+ }
|
||||
+
|
||||
+ protected static void fatal(String s) {
|
||||
+ fatalError = true;
|
||||
+ throw new RuntimeException("Fatal yatopia.yml config error: " + s);
|
||||
+ }
|
||||
+
|
||||
+ protected static void log(String s) {
|
||||
+ if (verbose) {
|
||||
+ Bukkit.getLogger().info(s);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static void registerCommands() {
|
||||
+ for (Map.Entry<String, Command> entry : commands.entrySet()) {
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Yatopia", entry.getValue());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ static void readConfig(Class<?> clazz, Object instance) {
|
||||
+ for (Method method : clazz.getDeclaredMethods()) {
|
||||
+ if (Modifier.isPrivate(method.getModifiers())) {
|
||||
+ if (method.getParameterTypes().length == 0 && method.getReturnType() == Void.TYPE) {
|
||||
+ try {
|
||||
+ method.setAccessible(true);
|
||||
+ method.invoke(instance);
|
||||
+ } catch (InvocationTargetException ex) {
|
||||
+ throw Throwables.propagate(ex.getCause());
|
||||
+ } catch (Exception ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Error invoking " + method, ex);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ config.save(CONFIG_FILE);
|
||||
+ } catch (IOException ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Could not save " + CONFIG_FILE, ex);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static final Pattern SPACE = Pattern.compile(" ");
|
||||
+ private static final Pattern NOT_NUMERIC = Pattern.compile("[^-\\d.]");
|
||||
+
|
||||
+ public static int getSeconds(String str) {
|
||||
+ str = SPACE.matcher(str).replaceAll("");
|
||||
+ final char unit = str.charAt(str.length() - 1);
|
||||
+ str = NOT_NUMERIC.matcher(str).replaceAll("");
|
||||
+ double num;
|
||||
+ try {
|
||||
+ num = Double.parseDouble(str);
|
||||
+ } catch (Exception e) {
|
||||
+ num = 0D;
|
||||
+ }
|
||||
+ switch (unit) {
|
||||
+ case 'd':
|
||||
+ num *= (double) 60 * 60 * 24;
|
||||
+ break;
|
||||
+ case 'h':
|
||||
+ num *= (double) 60 * 60;
|
||||
+ break;
|
||||
+ case 'm':
|
||||
+ num *= 60;
|
||||
+ break;
|
||||
+ default:
|
||||
+ case 's':
|
||||
+ break;
|
||||
+ }
|
||||
+ return (int) num;
|
||||
+ }
|
||||
+
|
||||
+ protected static String timeSummary(int seconds) {
|
||||
+ String time = "";
|
||||
+
|
||||
+ if (seconds > 60 * 60 * 24) {
|
||||
+ time += TimeUnit.SECONDS.toDays(seconds) + "d";
|
||||
+ seconds %= 60 * 60 * 24;
|
||||
+ }
|
||||
+
|
||||
+ if (seconds > 60 * 60) {
|
||||
+ time += TimeUnit.SECONDS.toHours(seconds) + "h";
|
||||
+ seconds %= 60 * 60;
|
||||
+ }
|
||||
+
|
||||
+ if (seconds > 0) {
|
||||
+ time += TimeUnit.SECONDS.toMinutes(seconds) + "m";
|
||||
+ }
|
||||
+ return time;
|
||||
+ }
|
||||
+
|
||||
+ private static void set(String path, Object val) {
|
||||
+ config.set(path, val);
|
||||
+ }
|
||||
+
|
||||
+ private static boolean getBoolean(String path, boolean def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getBoolean(path, config.getBoolean(path));
|
||||
+ }
|
||||
+
|
||||
+ private static double getDouble(String path, double def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getDouble(path, config.getDouble(path));
|
||||
+ }
|
||||
+
|
||||
+ private static float getFloat(String path, float def) {
|
||||
+ // TODO: Figure out why getFloat() always returns the default value.
|
||||
+ return (float) getDouble(path, (double) def);
|
||||
+ }
|
||||
+
|
||||
+ private static int getInt(String path, int def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getInt(path, config.getInt(path));
|
||||
+ }
|
||||
+
|
||||
+ private static <T> List<T> getList(String path, List<T> def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return (List<T>) config.getList(path, config.getList(path));
|
||||
+ }
|
||||
+
|
||||
+ private static String getString(String path, String def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getString(path, config.getString(path));
|
||||
+ }
|
||||
+
|
||||
+ public static boolean disableEntityStuckChecks = false;
|
||||
+ private static void disableEntityStuckChecks() {
|
||||
+ disableEntityStuckChecks = getBoolean("settings.disableEntityStuckChecks", false);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean disableEntityCollisionboxes = false;
|
||||
+ private static void disableEntityCollisionboxes() {
|
||||
+ disableEntityCollisionboxes = getBoolean("settings.disableEntityCollisionboxes", false);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
@@ -0,0 +1,215 @@
|
||||
+package dev.tr7zw.yatopia;
|
||||
+
|
||||
+import com.google.common.base.Throwables;
|
||||
+import java.io.File;
|
||||
+import java.io.IOException;
|
||||
+import java.lang.reflect.InvocationTargetException;
|
||||
+import java.lang.reflect.Method;
|
||||
+import java.lang.reflect.Modifier;
|
||||
+import java.util.HashMap;
|
||||
+import java.util.List;
|
||||
+import java.util.Map;
|
||||
+import java.util.concurrent.TimeUnit;
|
||||
+import java.util.logging.Level;
|
||||
+import java.util.regex.Pattern;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.Bukkit;
|
||||
+import org.bukkit.command.Command;
|
||||
+import org.bukkit.configuration.InvalidConfigurationException;
|
||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||
+
|
||||
+public class YatopiaConfig {
|
||||
+
|
||||
+ public static File CONFIG_FILE;
|
||||
+ private static final String HEADER = "This is the main configuration file for Yatopia.\n"
|
||||
+ + "Yatopia contains many breaking changes and settings, so know what you are doing!\n"
|
||||
+ + "You have been warned!\n";
|
||||
+ /*========================================================================*/
|
||||
+ public static YamlConfiguration config;
|
||||
+ public static int version; // since we're remapping sidestreams' configs we need this public
|
||||
+ static Map<String, Command> commands;
|
||||
+ public static boolean verbose; // since we're remapping sidestreams' configs we need this public
|
||||
+ private static boolean fatalError;
|
||||
+ /*========================================================================*/
|
||||
+ private static boolean metricsStarted;
|
||||
+
|
||||
+ public static void init(File configFile) {
|
||||
+ CONFIG_FILE = configFile;
|
||||
+ config = new YamlConfiguration();
|
||||
+ try {
|
||||
+ config.load(CONFIG_FILE);
|
||||
+ } catch (IOException ex) {
|
||||
+ } catch (InvalidConfigurationException ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Could not load yatopia.yml, please correct your syntax errors", ex);
|
||||
+ throw Throwables.propagate(ex);
|
||||
+ }
|
||||
+ config.options().header(HEADER);
|
||||
+ config.options().copyDefaults(true);
|
||||
+ verbose = getBoolean("verbose", false);
|
||||
+
|
||||
+ commands = new HashMap<String, Command>();
|
||||
+ commands.put("yatopia", new YatopiaCommand("yatopia"));
|
||||
+
|
||||
+ version = getInt("config-version", 1);
|
||||
+ set("config-version", 1);
|
||||
+ removeLeftovers();
|
||||
+ readConfig(YatopiaConfig.class, null);
|
||||
+ }
|
||||
+
|
||||
+ private static void removeLeftovers() {
|
||||
+ // this method is only to remove non-used values in the config
|
||||
+
|
||||
+ // leftover from akarin / rainforest
|
||||
+ if (config.get("world-settings") != null) {
|
||||
+ set("world-settings", null);
|
||||
+ }
|
||||
+ // unused settings getting removed
|
||||
+ if (config.get("settings.disablePlayerOutOfWorldBorderCheck") != null) {
|
||||
+ set("settings.disablePlayerOutOfWorldBorderCheck", null);
|
||||
+ }
|
||||
+ if (config.get("settings.disableEntityCollisions") != null) {
|
||||
+ set("settings.disableEntityCollisions", null);
|
||||
+ }
|
||||
+ if (config.get("settings.onlyPlayerCollisions") != null) {
|
||||
+ set("settings.onlyPlayerCollisions", null);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ protected static void logError(String s) {
|
||||
+ Bukkit.getLogger().severe(s);
|
||||
+ }
|
||||
+
|
||||
+ protected static void fatal(String s) {
|
||||
+ fatalError = true;
|
||||
+ throw new RuntimeException("Fatal yatopia.yml config error: " + s);
|
||||
+ }
|
||||
+
|
||||
+ protected static void log(String s) {
|
||||
+ if (verbose) {
|
||||
+ Bukkit.getLogger().info(s);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static void registerCommands() {
|
||||
+ for (Map.Entry<String, Command> entry : commands.entrySet()) {
|
||||
+ MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Yatopia", entry.getValue());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ static void readConfig(Class<?> clazz, Object instance) {
|
||||
+ for (Method method : clazz.getDeclaredMethods()) {
|
||||
+ if (Modifier.isPrivate(method.getModifiers())) {
|
||||
+ if (method.getParameterTypes().length == 0 && method.getReturnType() == Void.TYPE) {
|
||||
+ try {
|
||||
+ method.setAccessible(true);
|
||||
+ method.invoke(instance);
|
||||
+ } catch (InvocationTargetException ex) {
|
||||
+ throw Throwables.propagate(ex.getCause());
|
||||
+ } catch (Exception ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Error invoking " + method, ex);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ try {
|
||||
+ config.save(CONFIG_FILE);
|
||||
+ } catch (IOException ex) {
|
||||
+ Bukkit.getLogger().log(Level.SEVERE, "Could not save " + CONFIG_FILE, ex);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ private static final Pattern SPACE = Pattern.compile(" ");
|
||||
+ private static final Pattern NOT_NUMERIC = Pattern.compile("[^-\\d.]");
|
||||
+
|
||||
+ public static int getSeconds(String str) {
|
||||
+ str = SPACE.matcher(str).replaceAll("");
|
||||
+ final char unit = str.charAt(str.length() - 1);
|
||||
+ str = NOT_NUMERIC.matcher(str).replaceAll("");
|
||||
+ double num;
|
||||
+ try {
|
||||
+ num = Double.parseDouble(str);
|
||||
+ } catch (Exception e) {
|
||||
+ num = 0D;
|
||||
+ }
|
||||
+ switch (unit) {
|
||||
+ case 'd':
|
||||
+ num *= (double) 60 * 60 * 24;
|
||||
+ break;
|
||||
+ case 'h':
|
||||
+ num *= (double) 60 * 60;
|
||||
+ break;
|
||||
+ case 'm':
|
||||
+ num *= 60;
|
||||
+ break;
|
||||
+ default:
|
||||
+ case 's':
|
||||
+ break;
|
||||
+ }
|
||||
+ return (int) num;
|
||||
+ }
|
||||
+
|
||||
+ protected static String timeSummary(int seconds) {
|
||||
+ String time = "";
|
||||
+
|
||||
+ if (seconds > 60 * 60 * 24) {
|
||||
+ time += TimeUnit.SECONDS.toDays(seconds) + "d";
|
||||
+ seconds %= 60 * 60 * 24;
|
||||
+ }
|
||||
+
|
||||
+ if (seconds > 60 * 60) {
|
||||
+ time += TimeUnit.SECONDS.toHours(seconds) + "h";
|
||||
+ seconds %= 60 * 60;
|
||||
+ }
|
||||
+
|
||||
+ if (seconds > 0) {
|
||||
+ time += TimeUnit.SECONDS.toMinutes(seconds) + "m";
|
||||
+ }
|
||||
+ return time;
|
||||
+ }
|
||||
+
|
||||
+ private static void set(String path, Object val) {
|
||||
+ config.set(path, val);
|
||||
+ }
|
||||
+
|
||||
+ private static boolean getBoolean(String path, boolean def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getBoolean(path, config.getBoolean(path));
|
||||
+ }
|
||||
+
|
||||
+ private static double getDouble(String path, double def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getDouble(path, config.getDouble(path));
|
||||
+ }
|
||||
+
|
||||
+ private static float getFloat(String path, float def) {
|
||||
+ // TODO: Figure out why getFloat() always returns the default value.
|
||||
+ return (float) getDouble(path, (double) def);
|
||||
+ }
|
||||
+
|
||||
+ private static int getInt(String path, int def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getInt(path, config.getInt(path));
|
||||
+ }
|
||||
+
|
||||
+ private static <T> List<T> getList(String path, List<T> def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return (List<T>) config.getList(path, config.getList(path));
|
||||
+ }
|
||||
+
|
||||
+ private static String getString(String path, String def) {
|
||||
+ config.addDefault(path, def);
|
||||
+ return config.getString(path, config.getString(path));
|
||||
+ }
|
||||
+
|
||||
+ public static boolean disableEntityStuckChecks = false;
|
||||
+ private static void disableEntityStuckChecks() {
|
||||
+ disableEntityStuckChecks = getBoolean("settings.disableEntityStuckChecks", false);
|
||||
+ }
|
||||
+
|
||||
+ public static boolean disableEntityCollisionboxes = false;
|
||||
+ private static void disableEntityCollisionboxes() {
|
||||
+ disableEntityCollisionboxes = getBoolean("settings.disableEntityCollisionboxes", false);
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
index a60634fc455e8a59399020689b70eb64b6824d12..cb4a89940cf02de5c3eefc5c746397a931c96b7a 100644
|
||||
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
|
||||
@ -395,7 +390,7 @@ index a60634fc455e8a59399020689b70eb64b6824d12..cb4a89940cf02de5c3eefc5c746397a9
|
||||
this.setAllowFlight(dedicatedserverproperties.allowFlight);
|
||||
this.setResourcePack(dedicatedserverproperties.resourcePack, this.aZ());
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 960ab2a7c65a77e22acad2280f39a79a1556813e..39afc1fdd000f990675ea1d2ba067929e80dc5ad 100644
|
||||
index 93e1b01b97b52c53a7c912faf9bb6454ef57f340..47320e26c33ff132db0cc25c60ea1ed1bda33332 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1034,7 +1034,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@ -408,14 +403,14 @@ index 960ab2a7c65a77e22acad2280f39a79a1556813e..39afc1fdd000f990675ea1d2ba067929
|
||||
});
|
||||
StreamAccumulator<VoxelShape> streamaccumulator = new StreamAccumulator<>(Stream.concat(stream1, stream));
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 150075f5e78fca681e9e1d0582d7d92b904cd121..e8a01779b578a59d5002ca58ed4469a8bb83291e 100644
|
||||
index f24f7f1230a380f46112e886fb5dff7c33edb2ce..88f4c30a03e9139b0284ff1a545ad80941dbd46c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -266,6 +266,7 @@ public abstract class EntityLiving extends Entity {
|
||||
//this.world.getMethodProfiler().enter("livingEntityBaseTick"); // Akarin - remove caller
|
||||
boolean flag = this instanceof EntityHuman;
|
||||
|
||||
+ if (!dev.tr7zw.yatopia.YatopiaConfig.disableEntityStuckChecks) { // Yatopia
|
||||
+ if (dev.tr7zw.yatopia.YatopiaConfig.disableEntityStuckChecks) { // Yatopia
|
||||
if (this.isAlive()) {
|
||||
if (this.inBlock()) {
|
||||
this.damageEntity(DamageSource.STUCK, 1.0F);
|
||||
@ -428,38 +423,38 @@ index 150075f5e78fca681e9e1d0582d7d92b904cd121..e8a01779b578a59d5002ca58ed4469a8
|
||||
if (this.isFireProof() || this.world.isClientSide) {
|
||||
this.extinguish();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 7a2b16aaf70cefa00beeacf2d6fcd8878bd7f6de..21ce618d91cde3beec4767f89221d0ed14778501 100644
|
||||
index e2a540d07c68e4ca9b2a2a46d6ba9a33903eced9..40e0ce2fbad4af193ede76047ad7d894369f10c9 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -837,6 +837,7 @@ public final class CraftServer implements Server {
|
||||
net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
|
||||
de.minebench.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami - Server Config
|
||||
com.proximyst.rainforest.RainforestConfig.init((File) console.options.valueOf("rainforest-settings")); // Rainforest
|
||||
de.minebench.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami
|
||||
+ dev.tr7zw.yatopia.YatopiaConfig.init((File) console.options.valueOf("yatopia-settings")); // Yatopia
|
||||
for (WorldServer world : console.getWorlds()) {
|
||||
world.worldDataServer.setDifficulty(config.difficulty);
|
||||
world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals);
|
||||
@@ -2267,6 +2268,13 @@ public final class CraftServer implements Server {
|
||||
@@ -2265,6 +2266,13 @@ public final class CraftServer implements Server {
|
||||
return de.minebench.origami.OrigamiConfig.config;
|
||||
}
|
||||
// Origami end
|
||||
|
||||
+
|
||||
+ // Yatopia start
|
||||
+ @Override
|
||||
+ @Override
|
||||
+ public YamlConfiguration getYatopiaConfig() {
|
||||
+ return dev.tr7zw.yatopia.YatopiaConfig.config;
|
||||
+ }
|
||||
+ // Yatopia end
|
||||
+
|
||||
|
||||
@Override
|
||||
public void restart() {
|
||||
org.spigotmc.RestartCommand.restart();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index d6c82bd0afa43a4afcbc7029622c3915fa39bcc9..2ba0d89ae1b5d52eec3bd91328088ea2c7249d07 100644
|
||||
index 63cbecc4cdd549247b58fd094c27683655667799..afbcaee4177323da039793bc27869085c632c76a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -170,6 +170,14 @@ public class Main {
|
||||
@@ -169,6 +169,14 @@ public class Main {
|
||||
.describedAs("Yml file");
|
||||
// Rainforest end
|
||||
// Origami end
|
||||
|
||||
+ // Yatopia start
|
||||
+ acceptsAll(asList("yatopia", "yatopia-settings"), "File for yatopia settings")
|
||||
|
@ -14,10 +14,10 @@ The whole code is based around 1 class, the EntityFilter class. Whole filtering
|
||||
Co-authored-by: tr7zw <tr7zw@live.de>
|
||||
|
||||
diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java
|
||||
index be8daf986eb9c83bd5974eca78a00f717e4f5061..3d71ee447b0d45c50ed6f2f17ad5184d28d3bc08 100644
|
||||
index be8daf986eb9c83bd5974eca78a00f717e4f5061..755e5f6ebf1559c3f4359d356b49615cbd0f19e1 100644
|
||||
--- a/src/main/java/de/minebench/origami/OrigamiConfig.java
|
||||
+++ b/src/main/java/de/minebench/origami/OrigamiConfig.java
|
||||
@@ -125,6 +125,38 @@ public final class OrigamiConfig {
|
||||
@@ -125,6 +125,37 @@ public final class OrigamiConfig {
|
||||
private void fastFeatureSearchDontLoad() {
|
||||
fastFeatureSearchDontLoad = getBoolean("fast-feature-search-dont-load", false);
|
||||
}
|
||||
@ -34,7 +34,6 @@ index be8daf986eb9c83bd5974eca78a00f717e4f5061..3d71ee447b0d45c50ed6f2f17ad5184d
|
||||
+ public boolean waterCreatureCollisions = true;
|
||||
+ public boolean waterAmbientCollisions = true;
|
||||
+ public boolean allCollisionsEnabled = false;
|
||||
+
|
||||
+ private void specificCollisionSettings() {
|
||||
+ playerCollisions = getBoolean("collisions.players", playerCollisions);
|
||||
+ animalCollisions = getBoolean("collisions.animals", animalCollisions);
|
||||
@ -58,142 +57,139 @@ index be8daf986eb9c83bd5974eca78a00f717e4f5061..3d71ee447b0d45c50ed6f2f17ad5184d
|
||||
|
||||
diff --git a/src/main/java/dev/tr7zw/yatopia/EntityFilter.java b/src/main/java/dev/tr7zw/yatopia/EntityFilter.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..3c6dc395dd26b995f63a15e3f9a0a86abe0a5647
|
||||
index 0000000000000000000000000000000000000000..e20dfbdfc07e5bc68e66940ef12d7e847ebd35d9
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/dev/tr7zw/yatopia/EntityFilter.java
|
||||
@@ -0,0 +1,130 @@
|
||||
+package dev.tr7zw.yatopia;
|
||||
+
|
||||
+import com.google.common.base.Predicates;
|
||||
+
|
||||
+import de.minebench.origami.OrigamiConfig;
|
||||
+
|
||||
+import net.minecraft.server.Entity;
|
||||
+import net.minecraft.server.EntityTypes;
|
||||
+import net.minecraft.server.EnumCreatureType;
|
||||
+import net.minecraft.server.IEntitySelector;
|
||||
+import net.minecraft.server.ScoreboardTeamBase;
|
||||
+
|
||||
+import java.util.function.Predicate;
|
||||
+
|
||||
+public class EntityFilter {
|
||||
+
|
||||
+ public static Predicate<Entity> getFilter(Entity entity) {
|
||||
+ OrigamiConfig.WorldConfig config = entity.world.origamiConfig;
|
||||
+ if (config.allCollisionsEnabled) {
|
||||
+ return IEntitySelector.a(entity);
|
||||
+ }
|
||||
+
|
||||
+ ScoreboardTeamBase entityTeam = entity.getScoreboardTeam();
|
||||
+ ScoreboardTeamBase.EnumTeamPush entityTeamPush =
|
||||
+ entityTeam == null ?
|
||||
+ ScoreboardTeamBase.EnumTeamPush.ALWAYS :
|
||||
+ entityTeam.getCollisionRule();
|
||||
+
|
||||
+ if (entityTeamPush == ScoreboardTeamBase.EnumTeamPush.NEVER || entity.world.isClientSide
|
||||
+ || entity.isSpectator()) {
|
||||
+ return Predicates.alwaysFalse();
|
||||
+ }
|
||||
+
|
||||
+ Predicate<Entity> ret = (tested) -> {
|
||||
+ if (!tested.canCollideWith(entity) || !entity.canCollideWith(tested)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ ScoreboardTeamBase testedTeam = tested.getScoreboardTeam();
|
||||
+ ScoreboardTeamBase.EnumTeamPush testedPush =
|
||||
+ testedTeam == null ?
|
||||
+ ScoreboardTeamBase.EnumTeamPush.ALWAYS :
|
||||
+ testedTeam.getCollisionRule();
|
||||
+
|
||||
+ if (testedPush == ScoreboardTeamBase.EnumTeamPush.NEVER) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (testedTeam != null && entityTeam != null) {
|
||||
+ // see IEntitySelector#a(Entity)
|
||||
+ // copied from there, although for me this logic doesn't seem quite right
|
||||
+ boolean ally = entityTeam.isAlly(testedTeam);
|
||||
+
|
||||
+ if ((entityTeamPush == ScoreboardTeamBase.EnumTeamPush.PUSH_OWN_TEAM ||
|
||||
+ testedPush == ScoreboardTeamBase.EnumTeamPush.PUSH_OWN_TEAM) && ally) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ return (entityTeamPush != ScoreboardTeamBase.EnumTeamPush.PUSH_OTHER_TEAMS
|
||||
+ && testedPush != ScoreboardTeamBase.EnumTeamPush.PUSH_OTHER_TEAMS) || ally;
|
||||
+ } else {
|
||||
+ return testedPush == ScoreboardTeamBase.EnumTeamPush.ALWAYS &&
|
||||
+ entityTeamPush == ScoreboardTeamBase.EnumTeamPush.ALWAYS;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
+ ret = ret.and((tested) -> {
|
||||
+ // no need to continue if we already got false from this check
|
||||
+ if (!tested.canCollideWith(entity) || !entity.canCollideWith(tested)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ Predicate<Entity> entitySpecific = (es) -> {
|
||||
+ if (config.playerCollisions) {
|
||||
+ return es.getEntityType() == EntityTypes.PLAYER;
|
||||
+ }
|
||||
+ return false;
|
||||
+ };
|
||||
+
|
||||
+ if (config.animalCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.CREATURE);
|
||||
+ }
|
||||
+
|
||||
+ if (config.ambientCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.AMBIENT);
|
||||
+ }
|
||||
+
|
||||
+ if (config.monsterCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.MONSTER
|
||||
+ && (config.pillagerCollisions || es.getEntityType() != EntityTypes.PILLAGER));
|
||||
+ }
|
||||
+
|
||||
+ if (config.miscCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> {
|
||||
+ if (es.getEntityType().getEnumCreatureType() == EnumCreatureType.MISC) {
|
||||
+ return miscVPI(es, config, true);
|
||||
+ }
|
||||
+ return false;
|
||||
+ });
|
||||
+ } else {
|
||||
+ entitySpecific = entitySpecific.or((es) -> miscVPI(es, config, false));
|
||||
+ }
|
||||
+
|
||||
+ if (config.waterCreatureCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.WATER_CREATURE);
|
||||
+ }
|
||||
+
|
||||
+ if (config.waterAmbientCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.WATER_AMBIENT);
|
||||
+ }
|
||||
+
|
||||
+ return entitySpecific.test(tested);
|
||||
+ });
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ private static boolean miscVPI(Entity es, OrigamiConfig.WorldConfig config, boolean isMisc) {
|
||||
+ Predicate<Entity> ret = (p) -> {
|
||||
+ if (config.villagerCollisions) {
|
||||
+ return p.getEntityType() == EntityTypes.VILLAGER;
|
||||
+ }
|
||||
+ return isMisc;
|
||||
+ };
|
||||
+ if (config.ironGolemCollisions) {
|
||||
+ ret = ret.or((p) -> p.getEntityType() == EntityTypes.IRON_GOLEM);
|
||||
+ }
|
||||
+ if (config.itemCollisions) {
|
||||
+ ret = ret.or((p) -> p.getEntityType() == EntityTypes.ITEM);
|
||||
+ }
|
||||
+ return ret.test(es);
|
||||
+ }
|
||||
+}
|
||||
@@ -0,0 +1,127 @@
|
||||
+package dev.tr7zw.yatopia;
|
||||
+
|
||||
+import com.google.common.base.Predicates;
|
||||
+import de.minebench.origami.OrigamiConfig;
|
||||
+import java.util.function.Predicate;
|
||||
+import net.minecraft.server.Entity;
|
||||
+import net.minecraft.server.EntityTypes;
|
||||
+import net.minecraft.server.EnumCreatureType;
|
||||
+import net.minecraft.server.IEntitySelector;
|
||||
+import net.minecraft.server.ScoreboardTeamBase;
|
||||
+
|
||||
+public class EntityFilter {
|
||||
+
|
||||
+ public static Predicate<Entity> getFilter(Entity entity) {
|
||||
+ OrigamiConfig.WorldConfig config = entity.world.origamiConfig;
|
||||
+ if (config.allCollisionsEnabled) {
|
||||
+ return IEntitySelector.a(entity);
|
||||
+ }
|
||||
+
|
||||
+ ScoreboardTeamBase entityTeam = entity.getScoreboardTeam();
|
||||
+ ScoreboardTeamBase.EnumTeamPush entityTeamPush =
|
||||
+ entityTeam == null ?
|
||||
+ ScoreboardTeamBase.EnumTeamPush.ALWAYS :
|
||||
+ entityTeam.getCollisionRule();
|
||||
+
|
||||
+ if (entityTeamPush == ScoreboardTeamBase.EnumTeamPush.NEVER || entity.world.isClientSide
|
||||
+ || entity.isSpectator()) {
|
||||
+ return Predicates.alwaysFalse();
|
||||
+ }
|
||||
+
|
||||
+ Predicate<Entity> ret = (tested) -> {
|
||||
+ if (!tested.canCollideWith(entity) || !entity.canCollideWith(tested)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ ScoreboardTeamBase testedTeam = tested.getScoreboardTeam();
|
||||
+ ScoreboardTeamBase.EnumTeamPush testedPush =
|
||||
+ testedTeam == null ?
|
||||
+ ScoreboardTeamBase.EnumTeamPush.ALWAYS :
|
||||
+ testedTeam.getCollisionRule();
|
||||
+
|
||||
+ if (testedPush == ScoreboardTeamBase.EnumTeamPush.NEVER) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (testedTeam != null && entityTeam != null) {
|
||||
+ // see IEntitySelector#a(Entity)
|
||||
+ // copied from there, although for me this logic doesn't seem quite right
|
||||
+ boolean ally = entityTeam.isAlly(testedTeam);
|
||||
+
|
||||
+ if ((entityTeamPush == ScoreboardTeamBase.EnumTeamPush.PUSH_OWN_TEAM ||
|
||||
+ testedPush == ScoreboardTeamBase.EnumTeamPush.PUSH_OWN_TEAM) && ally) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ return (entityTeamPush != ScoreboardTeamBase.EnumTeamPush.PUSH_OTHER_TEAMS
|
||||
+ && testedPush != ScoreboardTeamBase.EnumTeamPush.PUSH_OTHER_TEAMS) || ally;
|
||||
+ } else {
|
||||
+ return testedPush == ScoreboardTeamBase.EnumTeamPush.ALWAYS &&
|
||||
+ entityTeamPush == ScoreboardTeamBase.EnumTeamPush.ALWAYS;
|
||||
+ }
|
||||
+ };
|
||||
+
|
||||
+ ret = ret.and((tested) -> {
|
||||
+ // no need to continue if we already got false from this check
|
||||
+ if (!tested.canCollideWith(entity) || !entity.canCollideWith(tested)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ Predicate<Entity> entitySpecific = (es) -> {
|
||||
+ if (config.playerCollisions) {
|
||||
+ return es.getEntityType() == EntityTypes.PLAYER;
|
||||
+ }
|
||||
+ return false;
|
||||
+ };
|
||||
+
|
||||
+ if (config.animalCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.CREATURE);
|
||||
+ }
|
||||
+
|
||||
+ if (config.ambientCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.AMBIENT);
|
||||
+ }
|
||||
+
|
||||
+ if (config.monsterCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.MONSTER
|
||||
+ && (config.pillagerCollisions || es.getEntityType() != EntityTypes.PILLAGER));
|
||||
+ }
|
||||
+
|
||||
+ if (config.miscCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> {
|
||||
+ if (es.getEntityType().getEnumCreatureType() == EnumCreatureType.MISC) {
|
||||
+ return miscVPI(es, config, true);
|
||||
+ }
|
||||
+ return false;
|
||||
+ });
|
||||
+ } else {
|
||||
+ entitySpecific = entitySpecific.or((es) -> miscVPI(es, config, false));
|
||||
+ }
|
||||
+
|
||||
+ if (config.waterCreatureCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.WATER_CREATURE);
|
||||
+ }
|
||||
+
|
||||
+ if (config.waterAmbientCollisions) {
|
||||
+ entitySpecific = entitySpecific.or((es) -> es.getEntityType().getEnumCreatureType() == EnumCreatureType.WATER_AMBIENT);
|
||||
+ }
|
||||
+
|
||||
+ return entitySpecific.test(tested);
|
||||
+ });
|
||||
+
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ private static boolean miscVPI(Entity es, OrigamiConfig.WorldConfig config, boolean isMisc) {
|
||||
+ Predicate<Entity> ret = (p) -> {
|
||||
+ if (config.villagerCollisions) {
|
||||
+ return p.getEntityType() == EntityTypes.VILLAGER;
|
||||
+ }
|
||||
+ return isMisc;
|
||||
+ };
|
||||
+ if (config.ironGolemCollisions) {
|
||||
+ ret = ret.or((p) -> p.getEntityType() == EntityTypes.IRON_GOLEM);
|
||||
+ }
|
||||
+ if (config.itemCollisions) {
|
||||
+ ret = ret.or((p) -> p.getEntityType() == EntityTypes.ITEM);
|
||||
+ }
|
||||
+ return ret.test(es);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index e8a01779b578a59d5002ca58ed4469a8bb83291e..4686130f88562de61022f52c3b83428b2a3eecab 100644
|
||||
index 88f4c30a03e9139b0284ff1a545ad80941dbd46c..dca7a86dba22bca9bfd830a353a2c9561d1cf0ec 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2849,7 +2849,7 @@ public abstract class EntityLiving extends Entity {
|
||||
|
@ -5,18 +5,18 @@ Subject: [PATCH] Allow to change the piston push limit
|
||||
|
||||
|
||||
diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
index 0e5f090e4160d08bce0b46ac4cb6d3d3510128bf..c0965eb0b6ef615ab89ffc5942d6a4e92a0d4a67 100644
|
||||
index b6e34ea413e29792043955a655d4261553825157..714e65985075eaf243045a3174d89231899c7f17 100644
|
||||
--- a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
@@ -215,4 +215,8 @@ public class YatopiaConfig {
|
||||
disableEntityCollisionboxes = getBoolean("settings.disableEntityCollisionboxes", false);
|
||||
}
|
||||
|
||||
@@ -212,4 +212,8 @@ public class YatopiaConfig {
|
||||
disableEntityCollisionboxes = getBoolean("settings.disableEntityCollisionboxes", false);
|
||||
}
|
||||
|
||||
+ public static int pistonPushLimit = 12;
|
||||
+ private static void pistonPushLimit() {
|
||||
+ pistonPushLimit = getInt("settings.pistonPushLimit", 12);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/PistonExtendsChecker.java b/src/main/java/net/minecraft/server/PistonExtendsChecker.java
|
||||
index 95aeaaf0bb07c5ecf7117dae3382b0f0aac6426f..89385896af6f6088a9749a13ad5c1d0c581fa502 100644
|
||||
--- a/src/main/java/net/minecraft/server/PistonExtendsChecker.java
|
||||
|
@ -39,7 +39,7 @@ index 5d3bb5f393a1e0e4a2e8b9a466530a91279697a9..7f084e7f11a829c10d113c7fb39eec0b
|
||||
if (enumdirection2 != EnumDirection.DOWN && world.isBlockFacePowered(blockposition1.shift(enumdirection2), enumdirection2)) {
|
||||
return true;
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
index 4686130f88562de61022f52c3b83428b2a3eecab..3de557aba9222b2144485185fbfaaa7fd5b046bc 100644
|
||||
index dca7a86dba22bca9bfd830a353a2c9561d1cf0ec..e42661587ee604b9ebb450aa91e982d69c853f6d 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
||||
@@ -2568,10 +2568,12 @@ public abstract class EntityLiving extends Entity {
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Item stuck sleep config
|
||||
|
||||
|
||||
diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
index c0965eb0b6ef615ab89ffc5942d6a4e92a0d4a67..fb7551f79f3e2e7e834359ef701ff7e568882a7f 100644
|
||||
index 714e65985075eaf243045a3174d89231899c7f17..d77ec2b69e8a195f4591a2cb9589d3676f12c4c7 100644
|
||||
--- a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
@@ -219,4 +219,9 @@ public class YatopiaConfig {
|
||||
@@ -216,4 +216,9 @@ public class YatopiaConfig {
|
||||
private static void pistonPushLimit() {
|
||||
pistonPushLimit = getInt("settings.pistonPushLimit", 12);
|
||||
}
|
||||
@ -17,7 +17,7 @@ index c0965eb0b6ef615ab89ffc5942d6a4e92a0d4a67..fb7551f79f3e2e7e834359ef701ff7e5
|
||||
+ private static void itemStuckSleepTicks() {
|
||||
+ itemStuckSleepTicks = getInt("settings.itemStuckSleepTicks", 1);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
|
||||
index 732f09319a309b92d74e6536e29d30be917be455..4ba28ab7f96dd83edc552a9c81d79b3c0061dc2c 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityItem.java
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Option for simpler Villagers
|
||||
|
||||
|
||||
diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
index fb7551f79f3e2e7e834359ef701ff7e568882a7f..0566088538c2b99ff74a408b67a9edee4751f904 100644
|
||||
index d77ec2b69e8a195f4591a2cb9589d3676f12c4c7..b69459bb141aec6b00a2024db583cacc1667b941 100644
|
||||
--- a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
@@ -224,4 +224,11 @@ public class YatopiaConfig {
|
||||
@@ -221,4 +221,11 @@ public class YatopiaConfig {
|
||||
private static void itemStuckSleepTicks() {
|
||||
itemStuckSleepTicks = getInt("settings.itemStuckSleepTicks", 1);
|
||||
}
|
||||
@ -19,9 +19,9 @@ index fb7551f79f3e2e7e834359ef701ff7e568882a7f..0566088538c2b99ff74a408b67a9edee
|
||||
+ simplerVillagerBehavior = getBoolean("settings.villager.simplerVillagerBehavior", false);
|
||||
+ villagersHideAtNight = getBoolean("settings.villager.villagersHideAtNight", false);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
index 210f6b995565af5a299d6ba855a1de224102150b..d4147e93941f32da8dbb890e03cf306d8325edf0 100644
|
||||
index d32581ec7f521ec53692517811c8e01dc405afbb..f351f76f840009c5b93d337249fb1361f6795c9e 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
||||
@@ -27,6 +27,7 @@ import org.bukkit.event.entity.VillagerReplenishTradeEvent;
|
||||
@ -135,7 +135,7 @@ index 210f6b995565af5a299d6ba855a1de224102150b..d4147e93941f32da8dbb890e03cf306d
|
||||
@Override
|
||||
protected void mobTick() { mobTick(false); }
|
||||
@@ -180,6 +239,13 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
||||
boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
|
||||
boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0;
|
||||
if (world.getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick)
|
||||
// Purpur end
|
||||
+ // Yatopia start
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Heavily optimize furnance fuel and recipe lookups
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java
|
||||
index 66586a0799d669ed860880862173c6ebd0fa76ef..018f926b71b65dc0bbe56070ba2d83af48e40383 100644
|
||||
index 2cbfef98508bcb07db1ad1e5bdafc4cc2bff1393..64adf87f2fe9921e49bf7a76170bb9908dfdaf19 100644
|
||||
--- a/src/main/java/net/minecraft/server/CraftingManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/CraftingManager.java
|
||||
@@ -83,7 +83,22 @@ public class CraftingManager extends ResourceDataJson {
|
||||
|
@ -32,7 +32,7 @@ index f6623032e5d4034c104aa1fc6ff4265169e462ba..c9a61bf6531d761780ac66b69d06a1d0
|
||||
|
||||
protected static void logError(String s) {
|
||||
diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java
|
||||
index 3d71ee447b0d45c50ed6f2f17ad5184d28d3bc08..965cc06a826c7d827e6b9a9e586738bfddc974d8 100644
|
||||
index 755e5f6ebf1559c3f4359d356b49615cbd0f19e1..73f395c1350d7ec45f3951df9014beefb550cedd 100644
|
||||
--- a/src/main/java/de/minebench/origami/OrigamiConfig.java
|
||||
+++ b/src/main/java/de/minebench/origami/OrigamiConfig.java
|
||||
@@ -20,6 +20,8 @@ public final class OrigamiConfig {
|
||||
@ -79,10 +79,10 @@ index cb4a89940cf02de5c3eefc5c746397a931c96b7a..7e053bc9bbd8abc1a6c060c1b4166ff2
|
||||
this.setPVP(dedicatedserverproperties.pvp);
|
||||
this.setAllowFlight(dedicatedserverproperties.allowFlight);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 2ba0d89ae1b5d52eec3bd91328088ea2c7249d07..5c2dec887a41351b1d3288c391dfa899cc7e2a03 100644
|
||||
index afbcaee4177323da039793bc27869085c632c76a..3b3115716724c6ee8d70f840979c9ad4a3ea0259 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -311,7 +311,7 @@ public class Main {
|
||||
@@ -310,7 +310,7 @@ public class Main {
|
||||
}
|
||||
// Paper end
|
||||
System.setProperty( "library.jansi.version", "Paper" ); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Fix lead fall dmg config
|
||||
|
||||
|
||||
diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
index 0566088538c2b99ff74a408b67a9edee4751f904..db5e7cb183682f5cf7049190ae49a835738a065e 100644
|
||||
index b69459bb141aec6b00a2024db583cacc1667b941..915a1937b1e60006c84816dd0a2ba885f17e519a 100644
|
||||
--- a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
|
||||
@@ -231,4 +231,9 @@ public class YatopiaConfig {
|
||||
@@ -228,4 +228,9 @@ public class YatopiaConfig {
|
||||
simplerVillagerBehavior = getBoolean("settings.villager.simplerVillagerBehavior", false);
|
||||
villagersHideAtNight = getBoolean("settings.villager.villagersHideAtNight", false);
|
||||
}
|
||||
@ -17,9 +17,9 @@ index 0566088538c2b99ff74a408b67a9edee4751f904..db5e7cb183682f5cf7049190ae49a835
|
||||
+ private static void fixFallDistance() {
|
||||
+ fixFallDistance = getBoolean("settings.fixFallDistance", false);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 39afc1fdd000f990675ea1d2ba067929e80dc5ad..678f9b908bbb3ccd847a8df55d7afbe5a301fdae 100644
|
||||
index 47320e26c33ff132db0cc25c60ea1ed1bda33332..f7e392bf4f93512dff9dbaa0615aed17f6bc2863 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1265,6 +1265,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
@ -5,7 +5,7 @@ Subject: [PATCH] Optimize player loops around weather
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index ebf4ceb084d9e7bd3eac3e0c90ba064bd9d0a8a7..e30871dd34e2dae074e36c297f34a7dede709e29 100644
|
||||
index af87989796198229fbdf6fc5cf6da42bf2eeec98..c3d7ae1ff75f6d77279255542c5de5a592720ac9 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -814,12 +814,17 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
@ -12,10 +12,10 @@ This changes it so that the portal list is filtered to only include portals with
|
||||
Ported to Yatopia and added per world config option by MrIvanPlays <ivan@mrivanplays.com>
|
||||
|
||||
diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java
|
||||
index 965cc06a826c7d827e6b9a9e586738bfddc974d8..8d6b24c92df72921e5cc81f4892cc9607a33db52 100644
|
||||
index 73f395c1350d7ec45f3951df9014beefb550cedd..72021abbe717c5ade30bf046f7ca12f7afd250c6 100644
|
||||
--- a/src/main/java/de/minebench/origami/OrigamiConfig.java
|
||||
+++ b/src/main/java/de/minebench/origami/OrigamiConfig.java
|
||||
@@ -162,6 +162,11 @@ public final class OrigamiConfig {
|
||||
@@ -161,6 +161,11 @@ public final class OrigamiConfig {
|
||||
&& pillagerCollisions && ironGolemCollisions && miscCollisions && itemCollisions
|
||||
&& waterCreatureCollisions && waterAmbientCollisions;
|
||||
}
|
||||
@ -28,10 +28,10 @@ index 965cc06a826c7d827e6b9a9e586738bfddc974d8..8d6b24c92df72921e5cc81f4892cc960
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
index b74888e554674caac8dfc3d8e00f5961e6527d8b..ce50beecf16687b8d9e3ec5ba7853b4fb9e5af85 100644
|
||||
index 5dce3c862166783e1fc479cd4ecce8b80daa90b2..eb33c274182ec3cdde5d35e028617357c1355782 100644
|
||||
--- a/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
+++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java
|
||||
@@ -31,12 +31,22 @@ public class PortalTravelAgent {
|
||||
@@ -30,12 +30,22 @@ public class PortalTravelAgent {
|
||||
return villageplacerecord.f().getY();
|
||||
});
|
||||
java.util.List<VillagePlaceRecord> list = villageplace.b(type -> type == VillagePlaceType.v, blockposition, i, VillagePlace.Occupancy.ANY).collect(java.util.stream.Collectors.toList());
|
||||
|
@ -1,9 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
git submodule update --init -f
|
||||
cd $1
|
||||
cd Tuinity
|
||||
git clean -fx
|
||||
git clean -fd
|
||||
git fetch
|
||||
git reset --hard origin/1.16.2tmp
|
||||
git submodule update --init --recursive -f
|
||||
|
||||
PS1=$
|
||||
basedir=`pwd`
|
||||
|
||||
function update {
|
||||
branch=$2
|
||||
if [ -z "$2" ]; then
|
||||
branch="master"
|
||||
fi
|
||||
cd "$basedir/$1"
|
||||
git fetch && git reset --hard origin/$branch
|
||||
git add $1
|
||||
}
|
||||
|
||||
function updateAll {
|
||||
update Akarin 1.16.2
|
||||
update Empirecraft ver/1.16.2
|
||||
update Origami 1.16
|
||||
update Purpur ver/1.16
|
||||
update Rainforest ver/1.16
|
||||
update Tuinity 1.16.2tmp
|
||||
}
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
updateAll
|
||||
elif [ "$1" == "true" ]; then
|
||||
update Tuinity 1.16.2tmp
|
||||
else
|
||||
updateAll
|
||||
fi
|
||||
|
||||
git submodule update --recursive
|
@ -26,7 +26,6 @@ echo "----------------------------------------"
|
||||
set -e
|
||||
|
||||
subtasks=1
|
||||
updatepaper=$2
|
||||
#if [ "$updatepaper" == "1" ]; then
|
||||
#echo " $(bashcolor 1 32)(0/$subtasks)$(bashcolorend) - Update Git submodules.."
|
||||
#$gitcmd submodule update --init --remote
|
||||
@ -40,7 +39,11 @@ updatepaper=$2
|
||||
#$gitcmd add Paper
|
||||
#fi
|
||||
|
||||
$basedir/scripts/fetchUpstream.sh $basedir
|
||||
if [ -z "$2" ]; then
|
||||
$basedir/scripts/fetchUpstream.sh
|
||||
else
|
||||
$basedir/scripts/fetchUpstream.sh true
|
||||
fi
|
||||
|
||||
# patch paper
|
||||
echo " $(bashcolor 1 32)(0/$subtasks)$(bashcolorend) - Apply patches of Tuinity.."
|
||||
|
10
yatopia
10
yatopia
@ -63,7 +63,12 @@ case "$1" in
|
||||
"u" | "up" | "upstream" | "update")
|
||||
(
|
||||
basedir
|
||||
$scriptdir/updateUpstream.sh "$basedir" 1
|
||||
$scriptdir/updateUpstream.sh "$basedir"
|
||||
)
|
||||
;;
|
||||
"tu" | "tup" | "tupstream" | "tupdate")
|
||||
(
|
||||
$scriptdir/updateUpstream.sh "$basedir" true
|
||||
)
|
||||
;;
|
||||
"r" | "root")
|
||||
@ -173,10 +178,11 @@ case "$1" in
|
||||
echo " Normal commands:"
|
||||
echo " * r, rebuild | Rebuild patches, can be called from anywhere."
|
||||
echo " * p, patch | Apply all patches to top of Paper without building it. Can be run from anywhere."
|
||||
echo " * u, update | Update and patch the Paper submodule. Can be run from anywhere."
|
||||
echo " * u, update | Updates all submodules. Can be run from anywhere."
|
||||
echo " * b, build | Build the projects, including the API and the Server. Can be ran anywhere."
|
||||
echo " * j, jar | Build the projects and build the launcher jar. Can be ran anywhere."
|
||||
echo " * d, deploy | Build the projects and deploy through Maven. Can be ran anywhere."
|
||||
echo " * tupstream | Updates only tuinity submodule. Can be ran everywhere."
|
||||
echo ""
|
||||
echo " These commands require the setup command before use:"
|
||||
echo " * r, root | Change directory to the root of the project."
|
||||
|
Loading…
Reference in New Issue
Block a user