mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-11-22 18:46:27 +01:00
Update tuinity
Also nuked 1 more stream from recipes
This commit is contained in:
parent
220d92f4c5
commit
467f3ee06e
2
Tuinity
2
Tuinity
@ -1 +1 @@
|
||||
Subproject commit 1ed41fcb75de4e90846425f60b99362ce101f820
|
||||
Subproject commit c628aa4fe1b7baa964252d777080be0f85b9f889
|
@ -735,7 +735,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 672de5bc48ea83055f5de2aa35d22bd444500e3b..4cab3f19366a1ea0d6708011e83e4e44b7eff875 100644
|
||||
index 4168c02e620be25f92fa22814fd7b3474a018e12..8aec423827ec300f06598e7dd6ea06decf62e1da 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -3,6 +3,7 @@ package net.minecraft.server;
|
||||
@ -764,7 +764,7 @@ index 672de5bc48ea83055f5de2aa35d22bd444500e3b..4cab3f19366a1ea0d6708011e83e4e44
|
||||
}
|
||||
|
||||
public void resetPortalCooldown() {
|
||||
@@ -2371,7 +2372,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -2375,7 +2376,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
WorldServer worldserver1 = minecraftserver.getWorldServer(resourcekey);
|
||||
|
||||
if (true && !this.isPassenger() && this.portalTicks++ >= i) { // CraftBukkit
|
||||
@ -773,7 +773,7 @@ index 672de5bc48ea83055f5de2aa35d22bd444500e3b..4cab3f19366a1ea0d6708011e83e4e44
|
||||
this.portalTicks = i;
|
||||
this.resetPortalCooldown();
|
||||
// CraftBukkit start
|
||||
@@ -2381,7 +2382,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -2385,7 +2386,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
this.b(worldserver1);
|
||||
}
|
||||
// CraftBukkit end
|
||||
@ -782,7 +782,7 @@ index 672de5bc48ea83055f5de2aa35d22bd444500e3b..4cab3f19366a1ea0d6708011e83e4e44
|
||||
}
|
||||
|
||||
this.inPortal = false;
|
||||
@@ -2764,14 +2765,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -2768,14 +2769,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
}
|
||||
// Paper end
|
||||
if (this.world instanceof WorldServer && !this.dead) {
|
||||
@ -799,7 +799,7 @@ index 672de5bc48ea83055f5de2aa35d22bd444500e3b..4cab3f19366a1ea0d6708011e83e4e44
|
||||
ShapeDetectorShape shapedetectorshape = (location == null) ? this.a(worldserver) : new ShapeDetectorShape(new Vec3D(location.getX(), location.getY(), location.getZ()), Vec3D.a, this.yaw, this.pitch, worldserver, null); // CraftBukkit
|
||||
|
||||
if (shapedetectorshape == null) {
|
||||
@@ -2798,16 +2799,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -2802,16 +2803,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
entity.bukkitEntity = this.getBukkitEntity();
|
||||
|
||||
if (this instanceof EntityInsentient) {
|
||||
@ -819,7 +819,7 @@ index 672de5bc48ea83055f5de2aa35d22bd444500e3b..4cab3f19366a1ea0d6708011e83e4e44
|
||||
return entity;
|
||||
}
|
||||
} else {
|
||||
@@ -3042,7 +3043,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
@@ -3046,7 +3047,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
entity.a(entity1, Entity::teleportAndSync);
|
||||
}
|
||||
|
||||
@ -1629,7 +1629,7 @@ index d1016d22fbb2dd15042fd6ccdf2ee7848351e518..00000000000000000000000000000000
|
||||
-
|
||||
- entitypigzombie.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0));
|
||||
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
index 5e4eb269bc849ee6b8dc8603a4f90639822b8bee..2b7dcf88e2feba50e5ae306ab3e746cd8b60ef02 100644
|
||||
index a8a7b605bb096734e34a0a0ae34bfc879426e367..3ca1cfe61474474ce3b9fefb5a008a2411b18aad 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityPlayer.java
|
||||
@@ -135,7 +135,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@ -1649,7 +1649,7 @@ index 5e4eb269bc849ee6b8dc8603a4f90639822b8bee..2b7dcf88e2feba50e5ae306ab3e746cd
|
||||
this.advancementDataPlayer.b(this);
|
||||
}
|
||||
|
||||
@@ -917,7 +918,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -918,7 +919,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
ShapeDetectorShape shapedetectorshape = this.a(worldserver);
|
||||
|
||||
if (shapedetectorshape != null) {
|
||||
@ -1658,7 +1658,7 @@ index 5e4eb269bc849ee6b8dc8603a4f90639822b8bee..2b7dcf88e2feba50e5ae306ab3e746cd
|
||||
worldserver = shapedetectorshape.world; // CraftBukkit
|
||||
if (worldserver == null) { } else // CraftBukkit - empty to fall through to null to event
|
||||
if (resourcekey == DimensionManager.OVERWORLD && worldserver.getTypeKey() == DimensionManager.THE_NETHER) { // CraftBukkit
|
||||
@@ -940,8 +941,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -941,8 +942,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
worldserver = ((CraftWorld) exit.getWorld()).getHandle();
|
||||
// CraftBukkit end
|
||||
|
||||
@ -1669,7 +1669,7 @@ index 5e4eb269bc849ee6b8dc8603a4f90639822b8bee..2b7dcf88e2feba50e5ae306ab3e746cd
|
||||
if (true) { // CraftBukkit
|
||||
this.worldChangeInvuln = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
|
||||
|
||||
@@ -958,7 +959,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
@@ -959,7 +960,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
worldserver.addPlayerPortal(this);
|
||||
this.playerConnection.teleport(exit); // CraftBukkit - use internal teleport without event
|
||||
this.playerConnection.syncPosition(); // CraftBukkit - sync position after changing it (from PortalTravelAgent#findAndteleport)
|
||||
|
@ -19,7 +19,7 @@ index 039255d795f0e00b2a40861aa05c38c11db425cd..729e6d5fa5d3abd77d07defb0dbd5b2c
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 4cab3f19366a1ea0d6708011e83e4e44b7eff875..55916c77365076450e6c1b6c7e530433172d95c7 100644
|
||||
index 8aec423827ec300f06598e7dd6ea06decf62e1da..6aa1d450bea7be80f3c883bc08edc647f1aee0cb 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -1266,6 +1266,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
@ -831,7 +831,7 @@ index ac6e5e3309affc830d4db07fd9b8d809c3085033..37a3b26cdeb02acb8051f0a99313de79
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
||||
index 55916c77365076450e6c1b6c7e530433172d95c7..60d040eb58c44790214f0869e7294bc70b021ec5 100644
|
||||
index 6aa1d450bea7be80f3c883bc08edc647f1aee0cb..f17b5c00c4d691ef7b4a233bd8ada6c4b0f05c0f 100644
|
||||
--- a/src/main/java/net/minecraft/server/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/server/Entity.java
|
||||
@@ -75,7 +75,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
||||
|
@ -17,17 +17,16 @@ index b7635ab1625c5b2540e44aafc2b908749820f7e2..9031f138e75f51f1f4074bd1eea5e51c
|
||||
double d0 = (double) blockutil_rectangle.side1;
|
||||
double d1 = (double) blockutil_rectangle.side2;
|
||||
diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java
|
||||
index 64adf87f2fe9921e49bf7a76170bb9908dfdaf19..ebb002a15e3b8c67b776d4118c90a31bb18314bf 100644
|
||||
index 64adf87f2fe9921e49bf7a76170bb9908dfdaf19..de7d5ed8d6260ce5ee4164df29cdaf69f561045c 100644
|
||||
--- a/src/main/java/net/minecraft/server/CraftingManager.java
|
||||
+++ b/src/main/java/net/minecraft/server/CraftingManager.java
|
||||
@@ -78,9 +78,16 @@ public class CraftingManager extends ResourceDataJson {
|
||||
@@ -78,9 +78,15 @@ public class CraftingManager extends ResourceDataJson {
|
||||
|
||||
public <C extends IInventory, T extends IRecipe<C>> Optional<T> craft(Recipes<T> recipes, C c0, World world) {
|
||||
// CraftBukkit start
|
||||
+ // Yatopia start - replace stream
|
||||
+ java.util.List<IRecipe<C>> collection = new java.util.ArrayList<>(this.b(recipes).values());
|
||||
+ Optional<T> recipe = Optional.empty();
|
||||
+ if (!collection.isEmpty()) recipe = recipes.a(collection.get(0), world, c0);
|
||||
+ List<IRecipe<C>> collection = new java.util.ArrayList<>(this.b(recipes).values());
|
||||
+ Optional<T> recipe = collection.isEmpty() ? Optional.empty() : recipes.a(collection.get(0), world, c0);
|
||||
+ /*
|
||||
Optional<T> recipe = this.b(recipes).values().stream().flatMap((irecipe) -> {
|
||||
return SystemUtils.a(recipes.a(irecipe, world, c0));
|
||||
@ -37,3 +36,36 @@ index 64adf87f2fe9921e49bf7a76170bb9908dfdaf19..ebb002a15e3b8c67b776d4118c90a31b
|
||||
c0.setCurrentRecipe(recipe.orElse(null)); // CraftBukkit - Clear recipe when no recipe is found
|
||||
// CraftBukkit end
|
||||
// Yatopia start
|
||||
@@ -111,11 +117,20 @@ public class CraftingManager extends ResourceDataJson {
|
||||
}
|
||||
|
||||
public <C extends IInventory, T extends IRecipe<C>> List<T> b(Recipes<T> recipes, C c0, World world) {
|
||||
+ // Yatopia start - WHY?! WHO DID THIS TO YOU!?!
|
||||
+ Collection<IRecipe<C>> recipeCollection = this.b(recipes).values();
|
||||
+ if (recipeCollection.isEmpty()) return java.util.Collections.emptyList();
|
||||
+ List<T> ret = new java.util.ArrayList<>();
|
||||
+ for (IRecipe<C> iRecipe : recipeCollection) recipes.a(iRecipe, world, c0).ifPresent(ret::add);
|
||||
+ ret.sort(Comparator.comparing((iRecipe) -> iRecipe.getResult().getTranslationKey()));
|
||||
+ return ret;
|
||||
+ /*
|
||||
return (List) this.b(recipes).values().stream().flatMap((irecipe) -> {
|
||||
return SystemUtils.a(recipes.a(irecipe, world, c0));
|
||||
}).sorted(Comparator.comparing((irecipe) -> {
|
||||
return irecipe.getResult().j();
|
||||
})).collect(Collectors.toList());
|
||||
+ */ // Yatopia end
|
||||
}
|
||||
|
||||
private <C extends IInventory, T extends IRecipe<C>> Map<MinecraftKey, IRecipe<C>> b(Recipes<T> recipes) {
|
||||
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
index ace50805bfebbf4c3485ba1de334d975830a7d3c..a12d7e868093f5c2892ba3c269f34a034b575051 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
||||
@@ -570,6 +570,7 @@ public final class ItemStack {
|
||||
return !this.e() ? this.doMaterialsMatch(itemstack) : !itemstack.isEmpty() && this.getItem() == itemstack.getItem();
|
||||
}
|
||||
|
||||
+ public final String getTranslationKey() { return j(); } // Yatopia
|
||||
public String j() {
|
||||
return this.getItem().f(this);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user