mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-23 21:49:46 +00:00
Update mappings to 09/21 snapshots.
Conflict with getMatrix in ITransformation, so renamed to getMatrixVec.
This commit is contained in:
1 parent
5ed03945a0
commit
94e1a8e0a4
210 files changed
+1052
-978
No files matched your search
@@ -118,7 +118,7 @@ public class CompoundIngredient extends Ingredient
|
||||
@Override
|
||||
public CompoundIngredient parse(PacketBuffer buffer)
|
||||
{
|
||||
return new CompoundIngredient(Stream.generate(() -> Ingredient.func_199566_b(buffer)).limit(buffer.readVarInt()).collect(Collectors.toList()));
|
||||
return new CompoundIngredient(Stream.generate(() -> Ingredient.fromBuffer(buffer)).limit(buffer.readVarInt()).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,7 +131,7 @@ public class CompoundIngredient extends Ingredient
|
||||
public void write(PacketBuffer buffer, CompoundIngredient ingredient)
|
||||
{
|
||||
buffer.writeVarInt(ingredient.children.size());
|
||||
ingredient.children.forEach(c -> c.func_199564_a(buffer));
|
||||
ingredient.children.forEach(c -> c.writeToBuffer(buffer));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -111,11 +111,11 @@ public class CraftingHelper
|
||||
public static final IIngredientSerializer<CompoundIngredient> INGREDIENT_COMPOUND = register(new ResourceLocation("forge", "compound"), new CompoundIngredient.Serializer());
|
||||
public static final IIngredientSerializer<Ingredient> INGREDIENT_VANILLA = register(new ResourceLocation("minecraft", "item"), new IIngredientSerializer<Ingredient>() {
|
||||
public Ingredient parse(PacketBuffer buffer) {
|
||||
return Ingredient.func_209357_a(Stream.generate(() -> new Ingredient.SingleItemList(buffer.readItemStack())).limit(buffer.readVarInt()));
|
||||
return Ingredient.fromItemListStream(Stream.generate(() -> new Ingredient.SingleItemList(buffer.readItemStack())).limit(buffer.readVarInt()));
|
||||
}
|
||||
|
||||
public Ingredient parse(JsonObject json) {
|
||||
return Ingredient.func_209357_a(Stream.of(Ingredient.func_199803_a(json)));
|
||||
return Ingredient.fromItemListStream(Stream.of(Ingredient.deserializeItemList(json)));
|
||||
}
|
||||
|
||||
public void write(PacketBuffer buffer, Ingredient ingredient) {
|
||||
@@ -248,9 +248,9 @@ public class CraftingHelper
|
||||
|
||||
tmp.setTag("tag", nbt);
|
||||
tmp.setString("id", itemName);
|
||||
tmp.setInteger("Count", JsonUtils.getInt(json, "count", 1));
|
||||
tmp.setInt("Count", JsonUtils.getInt(json, "count", 1));
|
||||
|
||||
return ItemStack.func_199557_a(tmp);
|
||||
return ItemStack.read(tmp);
|
||||
}
|
||||
catch (CommandSyntaxException e)
|
||||
{
|
||||
@@ -292,15 +292,15 @@ public class CraftingHelper
|
||||
|
||||
public static void reloadConstants(IResourceManager manager) {
|
||||
Map<ResourceLocation, IItemList> ret = new HashMap<>();
|
||||
for(ResourceLocation key : manager.func_199003_a("recipes", filename -> filename.equals("_constants.json")))
|
||||
for(ResourceLocation key : manager.getAllResourceLocations("recipes", filename -> filename.equals("_constants.json")))
|
||||
{
|
||||
String path = key.getPath();
|
||||
if (!path.equals("recipes/_constants.json")) //Top level only
|
||||
continue;
|
||||
|
||||
try (IResource iresource = manager.func_199002_a(key))
|
||||
try (IResource iresource = manager.getResource(key))
|
||||
{
|
||||
JsonObject[] elements = JsonUtils.gsonDeserialize(GSON, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), JsonObject[].class);
|
||||
JsonObject[] elements = JsonUtils.fromJson(GSON, IOUtils.toString(iresource.getInputStream(), StandardCharsets.UTF_8), JsonObject[].class);
|
||||
for (int x = 0; x < elements.length; x++)
|
||||
{
|
||||
JsonObject json = elements[x];
|
||||
@@ -328,7 +328,7 @@ public class CraftingHelper
|
||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(items));
|
||||
}
|
||||
else if (json.has("tag"))
|
||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), Ingredient.func_199803_a(json));
|
||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), Ingredient.deserializeItemList(json));
|
||||
else if (json.has("item"))
|
||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(Lists.newArrayList(getItemStack(JsonUtils.getJsonObject(json, "item"), true))));
|
||||
else
|
||||
|
||||
@@ -44,7 +44,7 @@ public class IngredientNBT extends Ingredient
|
||||
if (input == null)
|
||||
return false;
|
||||
//Can't use areItemStacksEqualUsingNBTShareTag because it compares stack size as well
|
||||
return this.stack.getItem() == input.getItem() && this.stack.getItemDamage() == input.getItemDamage() && ItemStack.areItemStackShareTagsEqual(this.stack, input);
|
||||
return this.stack.getItem() == input.getItem() && this.stack.getDamage() == input.getDamage() && ItemStack.areItemStackShareTagsEqual(this.stack, input);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,13 +37,13 @@ public class StackList implements IItemList
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ItemStack> func_199799_a()
|
||||
public Collection<ItemStack> getStacks()
|
||||
{
|
||||
return items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObject func_200303_b()
|
||||
public JsonObject toJson()
|
||||
{
|
||||
if (items.size() == 1)
|
||||
return toJson(items.iterator().next());
|
||||
@@ -61,8 +61,8 @@ public class StackList implements IItemList
|
||||
ret.addProperty("item", stack.getItem().getRegistryName().toString());
|
||||
if (stack.getCount() != 1)
|
||||
ret.addProperty("count", stack.getCount());
|
||||
if (stack.getTagCompound() != null)
|
||||
ret.addProperty("nbt", stack.getTagCompound().toString()); //TODO: Better serialization?
|
||||
if (stack.getTag() != null)
|
||||
ret.addProperty("nbt", stack.getTag().toString()); //TODO: Better serialization?
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,4 +23,4 @@
|
||||
package net.minecraftforge.common.crafting;
|
||||
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
Reference in new issue
Block a user