mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-21 20:52:20 +00:00
Move mana infusion to json
This commit is contained in:
1 parent
80dc95684e
commit
7ff539c5cd
143 files changed
+2020
-423
No files matched your search
@@ -15,13 +15,10 @@ import net.minecraftforge.fml.network.NetworkEvent;
|
||||
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.recipe.RecipeBrew;
|
||||
import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
import vazkii.botania.api.recipe.RecipePureDaisy;
|
||||
import vazkii.botania.api.recipe.RecipeRuneAltar;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -29,14 +26,12 @@ import java.util.stream.Stream;
|
||||
|
||||
public class PacketSyncRecipes {
|
||||
private Map<ResourceLocation, RecipeBrew> brew;
|
||||
private Map<ResourceLocation, RecipeManaInfusion> manaInfusion;
|
||||
private Map<ResourceLocation, RecipePetals> petal;
|
||||
private Map<ResourceLocation, RecipePureDaisy> pureDaisy;
|
||||
private Map<ResourceLocation, RecipeRuneAltar> runeAltar;
|
||||
|
||||
public PacketSyncRecipes(Map<ResourceLocation, RecipeBrew> brew, Map<ResourceLocation, RecipeManaInfusion> manaInfusion, Map<ResourceLocation, RecipePetals> petal, Map<ResourceLocation, RecipePureDaisy> pureDaisy, Map<ResourceLocation, RecipeRuneAltar> runeAltar) {
|
||||
public PacketSyncRecipes(Map<ResourceLocation, RecipeBrew> brew, Map<ResourceLocation, RecipePetals> petal, Map<ResourceLocation, RecipePureDaisy> pureDaisy, Map<ResourceLocation, RecipeRuneAltar> runeAltar) {
|
||||
this.brew = brew;
|
||||
this.manaInfusion = manaInfusion;
|
||||
this.petal = petal;
|
||||
this.pureDaisy = pureDaisy;
|
||||
this.runeAltar = runeAltar;
|
||||
@@ -47,10 +42,6 @@ public class PacketSyncRecipes {
|
||||
for (RecipeBrew recipe : brew.values()) {
|
||||
recipe.write(buf);
|
||||
}
|
||||
buf.writeVarInt(manaInfusion.size());
|
||||
for (RecipeManaInfusion recipe : manaInfusion.values()) {
|
||||
recipe.write(buf);
|
||||
}
|
||||
buf.writeVarInt(petal.size());
|
||||
for (RecipePetals recipe : petal.values()) {
|
||||
recipe.write(buf);
|
||||
@@ -70,10 +61,6 @@ public class PacketSyncRecipes {
|
||||
Map<ResourceLocation, RecipeBrew> brew = Stream.generate(() -> RecipeBrew.read(buf))
|
||||
.limit(brewCount)
|
||||
.collect(Collectors.toMap(RecipeBrew::getId, r -> r));
|
||||
int manaInfusionCount = buf.readVarInt();
|
||||
Map<ResourceLocation, RecipeManaInfusion> manaInfusion = Stream.generate(() -> RecipeManaInfusion.read(buf))
|
||||
.limit(manaInfusionCount)
|
||||
.collect(Collectors.toMap(RecipeManaInfusion::getId, r -> r));
|
||||
int petalCount = buf.readVarInt();
|
||||
Map<ResourceLocation, RecipePetals> petal = Stream.generate(() -> RecipePetals.read(buf))
|
||||
.limit(petalCount)
|
||||
@@ -86,7 +73,7 @@ public class PacketSyncRecipes {
|
||||
Map<ResourceLocation, RecipeRuneAltar> rune = Stream.generate(() -> RecipeRuneAltar.read(buf))
|
||||
.limit(runeCount)
|
||||
.collect(Collectors.toMap(RecipeRuneAltar::getId, r -> r));
|
||||
return new PacketSyncRecipes(brew, manaInfusion, petal, pureDaisy, rune);
|
||||
return new PacketSyncRecipes(brew, petal, pureDaisy, rune);
|
||||
}
|
||||
|
||||
public void handle(Supplier<NetworkEvent.Context> ctx) {
|
||||
@@ -96,7 +83,6 @@ public class PacketSyncRecipes {
|
||||
return;
|
||||
}
|
||||
BotaniaAPI.brewRecipes = brew;
|
||||
BotaniaAPI.manaInfusionRecipes = manaInfusion;
|
||||
BotaniaAPI.petalRecipes = petal;
|
||||
BotaniaAPI.pureDaisyRecipes = pureDaisy;
|
||||
BotaniaAPI.runeAltarRecipes = runeAltar;
|
||||
@@ -111,9 +97,8 @@ public class PacketSyncRecipes {
|
||||
private int loginIndex;
|
||||
|
||||
public Login() {
|
||||
this(new PacketSyncRecipes(BotaniaAPI.brewRecipes,
|
||||
BotaniaAPI.manaInfusionRecipes, BotaniaAPI.petalRecipes,
|
||||
BotaniaAPI.pureDaisyRecipes, BotaniaAPI.runeAltarRecipes));
|
||||
this(new PacketSyncRecipes(BotaniaAPI.brewRecipes, BotaniaAPI.petalRecipes,
|
||||
BotaniaAPI.pureDaisyRecipes, BotaniaAPI.runeAltarRecipes));
|
||||
}
|
||||
|
||||
public Login(PacketSyncRecipes packet) {
|
||||
|
||||
Reference in new issue
Block a user