mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 04:09:40 +00:00
Move most dynamic recipes to json
This commit is contained in:
1 parent
dec7306816
commit
472cd80183
39 files changed
+774
-311
No files matched your search
@@ -19,27 +19,14 @@ import net.minecraft.entity.boss.EntityWither;
|
||||
import net.minecraft.entity.item.EntityEnderCrystal;
|
||||
import net.minecraft.entity.item.EntityItemFrame;
|
||||
import net.minecraft.entity.item.EntityPainting;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.DeferredWorkQueue;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.Mod.Instance;
|
||||
import net.minecraftforge.fml.common.ModAPIManager;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLModLoadingContext;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -74,6 +61,20 @@ import vazkii.botania.common.crafting.ModManaInfusionRecipes;
|
||||
import vazkii.botania.common.crafting.ModPetalRecipes;
|
||||
import vazkii.botania.common.crafting.ModPureDaisyRecipes;
|
||||
import vazkii.botania.common.crafting.ModRuneRecipes;
|
||||
import vazkii.botania.common.crafting.recipe.AncientWillRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.BlackHoleTalismanExtractRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.CompositeLensRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.CosmeticAttachRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.CosmeticRemoveRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.HelmRevealingRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.KeepIvyRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.LensDyeingRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.ManaGunClipRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.ManaGunLensRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.ManaGunRemoveLensRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.PhantomInkRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.SpellClothRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.TerraPickTippingRecipe;
|
||||
import vazkii.botania.common.entity.EntityCorporeaSpark;
|
||||
import vazkii.botania.common.entity.EntityDoppleganger;
|
||||
import vazkii.botania.common.entity.EntityFlameRing;
|
||||
@@ -84,8 +85,6 @@ import vazkii.botania.common.entity.EntityPinkWither;
|
||||
import vazkii.botania.common.entity.EntitySignalFlare;
|
||||
import vazkii.botania.common.entity.EntitySpark;
|
||||
import vazkii.botania.common.entity.ModEntities;
|
||||
import vazkii.botania.common.integration.buildcraft.StatementAPIPlugin;
|
||||
import vazkii.botania.common.integration.thaumcraft.TCAspects;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import vazkii.botania.common.network.GuiHandler;
|
||||
@@ -112,7 +111,7 @@ public class Botania {
|
||||
public Botania() {
|
||||
instance = this;
|
||||
proxy = DistExecutor.runForDist(() -> ClientProxy::new, () -> ServerProxy::new);
|
||||
FMLModLoadingContext.get().getModEventBus().addListener(this::commonSetup);
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonSetup);
|
||||
}
|
||||
|
||||
private void commonSetup(FMLCommonSetupEvent event) {
|
||||
@@ -135,13 +134,30 @@ public class Botania {
|
||||
if(Botania.gardenOfGlassLoaded)
|
||||
new WorldTypeSkyblock();
|
||||
|
||||
CriteriaTriggers.register(AlfPortalTrigger.INSTANCE);
|
||||
CriteriaTriggers.register(CorporeaRequestTrigger.INSTANCE);
|
||||
CriteriaTriggers.register(DopplegangerNoArmorTrigger.INSTANCE);
|
||||
CriteriaTriggers.register(RelicBindTrigger.INSTANCE);
|
||||
CriteriaTriggers.register(UseItemSuccessTrigger.INSTANCE);
|
||||
|
||||
proxy.preInit(event);
|
||||
|
||||
DeferredWorkQueue.runLater(() -> {
|
||||
CriteriaTriggers.register(AlfPortalTrigger.INSTANCE);
|
||||
CriteriaTriggers.register(CorporeaRequestTrigger.INSTANCE);
|
||||
CriteriaTriggers.register(DopplegangerNoArmorTrigger.INSTANCE);
|
||||
CriteriaTriggers.register(RelicBindTrigger.INSTANCE);
|
||||
CriteriaTriggers.register(UseItemSuccessTrigger.INSTANCE);
|
||||
|
||||
RecipeSerializers.register(AncientWillRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(BlackHoleTalismanExtractRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(CompositeLensRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(CosmeticAttachRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(CosmeticRemoveRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(HelmRevealingRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(KeepIvyRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(LensDyeingRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(ManaGunClipRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(ManaGunLensRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(ManaGunRemoveLensRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(PhantomInkRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(SpellClothRecipe.SERIALIZER);
|
||||
RecipeSerializers.register(TerraPickTippingRecipe.SERIALIZER);
|
||||
});
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
package vazkii.botania.common.core.helper;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.INBTBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
@@ -138,15 +138,15 @@ public final class ItemNBTHelper {
|
||||
//an empty set is a superset of only another empty set (which was already checked above)
|
||||
if(superset == null || superset.isEmpty()) return false;
|
||||
//a subset can't be bigger than its superset
|
||||
if(subset.getKeySet().size() > superset.getKeySet().size()) return false;
|
||||
if(subset.keySet().size() > superset.keySet().size()) return false;
|
||||
|
||||
//it's not an easy case, so we actually have to check the contents of each tag
|
||||
for(String key : superset.getKeySet()) {
|
||||
for(String key : superset.keySet()) {
|
||||
//it's ok if the subset is missing a key from the superset
|
||||
if(!subset.hasKey(key)) continue;
|
||||
if(!subset.contains(key)) continue;
|
||||
|
||||
NBTBase supersetEntry = superset.getTag(key);
|
||||
NBTBase subsetEntry = subset.getTag(key);
|
||||
INBTBase supersetEntry = superset.get(key);
|
||||
INBTBase subsetEntry = subset.get(key);
|
||||
|
||||
//if a value is present on both tags, but they do not match, fail
|
||||
if(supersetEntry instanceof NBTTagCompound && subsetEntry instanceof NBTTagCompound) {
|
||||
|
||||
@@ -327,28 +327,6 @@ public final class ModCraftingRecipes {
|
||||
public static void registerRecipes(RegistryEvent.Register<IRecipe> evt) {
|
||||
IForgeRegistry<IRecipe> r = evt.getRegistry();
|
||||
|
||||
r.register(new AncientWillRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "ancient_will_attach")));
|
||||
r.register(new BlackHoleTalismanExtractRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "black_hole_talisman_extract")));
|
||||
r.register(new SpellClothRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "cleanse_enchants")));
|
||||
r.register(new CompositeLensRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "composite_lens")));
|
||||
r.register(new CosmeticAttachRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "cosmetic_attach")));
|
||||
r.register(new CosmeticRemoveRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "cosmetic_remove")));
|
||||
if(Botania.thaumcraftLoaded) {
|
||||
r.register(new HelmRevealingRecipe(ModItems.terrasteelHelmRevealing, ModItems.terrasteelHelm)
|
||||
.setRegistryName(LibMisc.MOD_ID, LibItemNames.TERRASTEEL_HELM_R + "_from_goggles"));
|
||||
r.register(new HelmRevealingRecipe(ModItems.manasteelHelmRevealing, ModItems.manasteelHelm)
|
||||
.setRegistryName(LibMisc.MOD_ID, LibItemNames.MANASTEEL_HELM_R + "_from_goggles"));
|
||||
r.register(new HelmRevealingRecipe(ModItems.elementiumHelmRevealing, ModItems.elementiumHelm)
|
||||
.setRegistryName(LibMisc.MOD_ID, LibItemNames.ELEMENTIUM_HELM_R + "_from_goggles"));
|
||||
}
|
||||
r.register(new KeepIvyRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "keep_ivy_attach")));
|
||||
r.register(new LensDyeingRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "lens_dye")));
|
||||
r.register(new ManaGunLensRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_lens")));
|
||||
r.register(new ManaGunRemoveLensRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "mana_gun_remove_lens")));
|
||||
r.register(new ManaGunClipRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_clip")));
|
||||
r.register(new PhantomInkRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "phantom_ink")));
|
||||
r.register(new TerraPickTippingRecipe().setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "terra_pick_tipping")));
|
||||
|
||||
for (ResourceLocation s : BotaniaAPI.getAllSubTiles()) {
|
||||
r.register(new SpecialFloatingFlowerRecipe(s).setRegistryName(new ResourceLocation(LibMisc.MOD_ID, "floating_" + s.toString().replaceAll(":", "_"))));
|
||||
}
|
||||
|
||||
@@ -10,31 +10,38 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.api.item.IAncientWillContainer;
|
||||
import vazkii.botania.common.item.ItemAncientWill;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class AncientWillRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class AncientWillRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "ancient_will_attach");
|
||||
public static final IRecipeSerializer<AncientWillRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), AncientWillRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public AncientWillRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundWill = false;
|
||||
boolean foundItem = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ItemAncientWill && !foundWill)
|
||||
foundWill = true;
|
||||
@@ -51,12 +58,12 @@ public class AncientWillRecipe extends IForgeRegistryEntry.Impl<IRecipe> impleme
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack item = ItemStack.EMPTY;
|
||||
IAncientWillContainer.AncientWillType will = null;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof IAncientWillContainer && item.isEmpty())
|
||||
item = stack;
|
||||
@@ -80,7 +87,7 @@ public class AncientWillRecipe extends IForgeRegistryEntry.Impl<IRecipe> impleme
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -10,25 +10,44 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.item.crafting.ShapedRecipe;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class ArmorUpgradeRecipe extends ShapedOreRecipe {
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public ArmorUpgradeRecipe(ItemStack output, Object... inputs) {
|
||||
super(null, output, inputs);
|
||||
public class ArmorUpgradeRecipe implements IRecipe {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "armor_upgrade");
|
||||
private final ShapedRecipe compose;
|
||||
|
||||
public ArmorUpgradeRecipe(ShapedRecipe compose) {
|
||||
this.compose = compose;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting var1) {
|
||||
ItemStack out = output.copy();
|
||||
for (int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof ItemArmor && stack.hasTagCompound()) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
return compose.matches(inv, world);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack out = compose.getCraftingResult(inv);
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if (!stack.isEmpty() && stack.getItem() instanceof ItemArmor && stack.hasTag()) {
|
||||
EnchantmentHelper.setEnchantments(EnchantmentHelper.getEnchantments(stack), out);
|
||||
if(Botania.thaumcraftLoaded)
|
||||
HelmRevealingRecipe.copyTCData(stack, out);
|
||||
@@ -37,4 +56,50 @@ public class ArmorUpgradeRecipe extends ShapedOreRecipe {
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFit(int width, int height) {
|
||||
return compose.canFit(width, height);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return compose.getRecipeOutput();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getId() {
|
||||
return compose.getId();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
|
||||
public static final IRecipeSerializer<ArmorUpgradeRecipe> SERIALIZER = new IRecipeSerializer<ArmorUpgradeRecipe>() {
|
||||
@Override
|
||||
public ArmorUpgradeRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull JsonObject json) {
|
||||
return new ArmorUpgradeRecipe(RecipeSerializers.CRAFTING_SHAPED.read(recipeId, json));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorUpgradeRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull PacketBuffer buffer) {
|
||||
return new ArmorUpgradeRecipe(RecipeSerializers.CRAFTING_SHAPED.read(recipeId, buffer));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@Nonnull PacketBuffer buffer, @Nonnull ArmorUpgradeRecipe recipe) {
|
||||
RecipeSerializers.CRAFTING_SHAPED.write(buffer, recipe.compose);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getName() {
|
||||
return TYPE_ID;
|
||||
}
|
||||
};
|
||||
}
|
||||
+20
-14
@@ -11,29 +11,36 @@
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.common.item.ItemBlackHoleTalisman;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlackHoleTalismanExtractRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class BlackHoleTalismanExtractRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "black_hole_talisman_extract");
|
||||
public static final IRecipeSerializer<BlackHoleTalismanExtractRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), BlackHoleTalismanExtractRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public BlackHoleTalismanExtractRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundTalisman = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() == ModItems.blackHoleTalisman && !foundTalisman)
|
||||
foundTalisman = true;
|
||||
@@ -46,11 +53,11 @@ public class BlackHoleTalismanExtractRecipe extends IForgeRegistryEntry.Impl<IRe
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack talisman = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty())
|
||||
talisman = stack;
|
||||
}
|
||||
@@ -59,8 +66,7 @@ public class BlackHoleTalismanExtractRecipe extends IForgeRegistryEntry.Impl<IRe
|
||||
if(count > 0) {
|
||||
Block block = ItemBlackHoleTalisman.getBlock(talisman);
|
||||
if(block != null) {
|
||||
int meta = ItemBlackHoleTalisman.getBlockMeta(talisman);
|
||||
return new ItemStack(block, Math.min(64, count), meta);
|
||||
return new ItemStack(block, Math.min(64, count));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +80,7 @@ public class BlackHoleTalismanExtractRecipe extends IForgeRegistryEntry.Impl<IRe
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -11,32 +11,39 @@
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.api.mana.ICompositableLens;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.lens.ItemLens;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CompositeLensRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class CompositeLensRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "composite_lens");
|
||||
public static final IRecipeSerializer<CompositeLensRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), CompositeLensRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public CompositeLensRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundLens = false;
|
||||
boolean foundSecondLens = false;
|
||||
boolean foundSlimeball = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ICompositableLens && !foundSecondLens) {
|
||||
if(foundLens)
|
||||
@@ -53,12 +60,12 @@ public class CompositeLensRecipe extends IForgeRegistryEntry.Impl<IRecipe> imple
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack lens = ItemStack.EMPTY;
|
||||
ItemStack secondLens = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ICompositableLens)
|
||||
if(lens.isEmpty())
|
||||
@@ -88,7 +95,7 @@ public class CompositeLensRecipe extends IForgeRegistryEntry.Impl<IRecipe> imple
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -10,30 +10,37 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.api.item.ICosmeticAttachable;
|
||||
import vazkii.botania.api.item.ICosmeticBauble;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CosmeticAttachRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class CosmeticAttachRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "cosmetic_attach");
|
||||
public static final IRecipeSerializer<CosmeticAttachRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), CosmeticAttachRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public CosmeticAttachRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundCosmetic = false;
|
||||
boolean foundAttachable = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ICosmeticBauble && !foundCosmetic)
|
||||
foundCosmetic = true;
|
||||
@@ -50,12 +57,12 @@ public class CosmeticAttachRecipe extends IForgeRegistryEntry.Impl<IRecipe> impl
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack cosmeticItem = ItemStack.EMPTY;
|
||||
ItemStack attachableItem = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ICosmeticBauble && cosmeticItem.isEmpty())
|
||||
cosmeticItem = stack;
|
||||
@@ -82,7 +89,7 @@ public class CosmeticAttachRecipe extends IForgeRegistryEntry.Impl<IRecipe> impl
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -10,29 +10,36 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.api.item.ICosmeticAttachable;
|
||||
import vazkii.botania.api.item.ICosmeticBauble;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class CosmeticRemoveRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class CosmeticRemoveRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "cosmetic_remove");
|
||||
public static final IRecipeSerializer<CosmeticRemoveRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), CosmeticRemoveRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public CosmeticRemoveRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundAttachable = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ICosmeticAttachable && !(stack.getItem() instanceof ICosmeticBauble) && !((ICosmeticAttachable) stack.getItem()).getCosmeticItem(stack).isEmpty())
|
||||
foundAttachable = true;
|
||||
@@ -45,11 +52,11 @@ public class CosmeticRemoveRecipe extends IForgeRegistryEntry.Impl<IRecipe> impl
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack attachableItem = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty())
|
||||
attachableItem = stack;
|
||||
}
|
||||
@@ -70,7 +77,7 @@ public class CosmeticRemoveRecipe extends IForgeRegistryEntry.Impl<IRecipe> impl
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -10,77 +10,101 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.item.crafting.ShapelessRecipe;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.registries.ObjectHolder;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class HelmRevealingRecipe extends ShapelessRecipes {
|
||||
@GameRegistry.ObjectHolder("thaumcraft:goggles")
|
||||
private static Item goggles = null;
|
||||
public class HelmRevealingRecipe implements IRecipe {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "helm_revealing");
|
||||
|
||||
private final Item botaniaHelm;
|
||||
private final ShapelessRecipe compose;
|
||||
|
||||
public HelmRevealingRecipe(Item output, Item botaniaHelm) {
|
||||
super("botania:helm_revealing", new ItemStack(output),
|
||||
NonNullList.from(Ingredient.EMPTY, Ingredient.fromItem(botaniaHelm), Ingredient.fromItem(goggles)));
|
||||
this.botaniaHelm = botaniaHelm;
|
||||
public HelmRevealingRecipe(ShapelessRecipe compose) {
|
||||
this.compose = compose;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
return compose.matches(inv, world);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack helm = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.getItem() == botaniaHelm)
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.getItem().getRegistryName().getNamespace().equals(LibMisc.MOD_ID))
|
||||
helm = stack;
|
||||
}
|
||||
|
||||
if(helm.isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
ItemStack helmCopy = helm.copy();
|
||||
Item helmItem = helmCopy.getItem();
|
||||
|
||||
ItemStack newHelm;
|
||||
|
||||
if(helmItem == ModItems.manasteelHelm)
|
||||
newHelm = new ItemStack(ModItems.manasteelHelmRevealing);
|
||||
else if(helmItem == ModItems.terrasteelHelm)
|
||||
newHelm = new ItemStack(ModItems.terrasteelHelmRevealing);
|
||||
else if(helmItem == ModItems.elementiumHelm)
|
||||
newHelm = new ItemStack(ModItems.elementiumHelmRevealing);
|
||||
else return ItemStack.EMPTY;
|
||||
ItemStack newHelm = compose.getCraftingResult(inv);
|
||||
|
||||
//Copy Ancient Wills
|
||||
for(int i = 0; i < 6; i++)
|
||||
if(ItemNBTHelper.getBoolean(helmCopy, "AncientWill" + i, false))
|
||||
if(ItemNBTHelper.getBoolean(helm, "AncientWill" + i, false))
|
||||
ItemNBTHelper.setBoolean(newHelm, "AncientWill" + i, true);
|
||||
|
||||
//Copy Enchantments
|
||||
NBTTagList enchList = ItemNBTHelper.getList(helmCopy, "ench", 10, true);
|
||||
NBTTagList enchList = ItemNBTHelper.getList(helm, "ench", 10, true);
|
||||
if(enchList != null)
|
||||
ItemNBTHelper.setList(newHelm, "ench", enchList);
|
||||
copyTCData(helmCopy, newHelm);
|
||||
copyTCData(helm, newHelm);
|
||||
|
||||
return newHelm;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFit(int width, int height) {
|
||||
return compose.canFit(width, height);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return compose.getRecipeOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getId() {
|
||||
return compose.getId();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
|
||||
private static final String TAG_RUNIC = "TC.RUNIC";
|
||||
private static final String TAG_WARP = "TC.WARP";
|
||||
private static final String TAG_INFUSION_ENCH = "infench";
|
||||
@@ -102,4 +126,28 @@ public class HelmRevealingRecipe extends ShapelessRecipes {
|
||||
if(infEnchList != null)
|
||||
ItemNBTHelper.setList(destination, TAG_INFUSION_ENCH, infEnchList);
|
||||
}
|
||||
|
||||
public static final IRecipeSerializer<HelmRevealingRecipe> SERIALIZER = new IRecipeSerializer<HelmRevealingRecipe>() {
|
||||
@Nonnull
|
||||
@Override
|
||||
public HelmRevealingRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull JsonObject json) {
|
||||
return new HelmRevealingRecipe(RecipeSerializers.CRAFTING_SHAPELESS.read(recipeId, json));
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelmRevealingRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull PacketBuffer buffer) {
|
||||
return new HelmRevealingRecipe(RecipeSerializers.CRAFTING_SHAPELESS.read(recipeId, buffer));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@Nonnull PacketBuffer buffer, @Nonnull HelmRevealingRecipe recipe) {
|
||||
RecipeSerializers.CRAFTING_SHAPELESS.write(buffer, recipe.compose);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getName() {
|
||||
return TYPE_ID;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -10,35 +10,44 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.item.ItemKeepIvy;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class KeepIvyRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class KeepIvyRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "keep_ivy");
|
||||
public static final IRecipeSerializer<KeepIvyRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), KeepIvyRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public KeepIvyRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundIvy = false;
|
||||
boolean foundItem = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() == ModItems.keepIvy)
|
||||
foundIvy = true;
|
||||
else if(!foundItem && !(stack.hasTagCompound() && ItemNBTHelper.getBoolean(stack, ItemKeepIvy.TAG_KEEP, false)) && !stack.getItem().hasContainerItem(stack))
|
||||
else if(!foundItem
|
||||
&& !(stack.hasTag() && ItemNBTHelper.getBoolean(stack, ItemKeepIvy.TAG_KEEP, false))
|
||||
&& !stack.getItem().hasContainerItem(stack))
|
||||
foundItem = true;
|
||||
else return false;
|
||||
}
|
||||
@@ -49,11 +58,11 @@ public class KeepIvyRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack item = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.getItem() != ModItems.keepIvy)
|
||||
item = stack;
|
||||
}
|
||||
@@ -71,7 +80,7 @@ public class KeepIvyRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -10,36 +10,57 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.lens.ItemLens;
|
||||
import vazkii.botania.common.lib.LibOreDict;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class LensDyeingRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class LensDyeingRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "lens_dye");
|
||||
public static final IRecipeSerializer<LensDyeingRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), LensDyeingRecipe::new);
|
||||
|
||||
private static final List<String> DYES = Arrays.asList("dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue", "dyeYellow", "dyeLime", "dyePink", "dyeGray", "dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue", "dyeBrown", "dyeGreen", "dyeRed", "dyeBlack", LibOreDict.MANA_PEARL);
|
||||
private final List<Ingredient> dyes = Arrays.asList(
|
||||
Ingredient.fromTag(Tags.Items.DYES_WHITE), Ingredient.fromTag(Tags.Items.DYES_ORANGE),
|
||||
Ingredient.fromTag(Tags.Items.DYES_MAGENTA), Ingredient.fromTag(Tags.Items.DYES_LIGHT_BLUE),
|
||||
Ingredient.fromTag(Tags.Items.DYES_YELLOW), Ingredient.fromTag(Tags.Items.DYES_LIME),
|
||||
Ingredient.fromTag(Tags.Items.DYES_PINK), Ingredient.fromTag(Tags.Items.DYES_GRAY),
|
||||
Ingredient.fromTag(Tags.Items.DYES_LIGHT_GRAY), Ingredient.fromTag(Tags.Items.DYES_CYAN),
|
||||
Ingredient.fromTag(Tags.Items.DYES_PURPLE), Ingredient.fromTag(Tags.Items.DYES_BLUE),
|
||||
Ingredient.fromTag(Tags.Items.DYES_BROWN), Ingredient.fromTag(Tags.Items.DYES_RED),
|
||||
Ingredient.fromTag(Tags.Items.DYES_GREEN), Ingredient.fromTag(Tags.Items.DYES_BLACK),
|
||||
Ingredient.fromItems(ModItems.manaPearl) // todo 1.13 tag for mana pearl?
|
||||
);
|
||||
|
||||
public LensDyeingRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundLens = false;
|
||||
boolean foundDye = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ILens && !foundLens)
|
||||
foundLens = true;
|
||||
@@ -58,12 +79,12 @@ public class LensDyeingRecipe extends IForgeRegistryEntry.Impl<IRecipe> implemen
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack lens = ItemStack.EMPTY;
|
||||
int color = -1;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ILens && lens.isEmpty())
|
||||
lens = stack;
|
||||
@@ -72,7 +93,6 @@ public class LensDyeingRecipe extends IForgeRegistryEntry.Impl<IRecipe> implemen
|
||||
}
|
||||
|
||||
if(lens.getItem() instanceof ILens) {
|
||||
lens.getItem();
|
||||
ItemStack lensCopy = lens.copy();
|
||||
ItemLens.setLensColor(lensCopy, color);
|
||||
|
||||
@@ -87,18 +107,11 @@ public class LensDyeingRecipe extends IForgeRegistryEntry.Impl<IRecipe> implemen
|
||||
return width * height >= 2;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
int getStackColor(ItemStack stack) {
|
||||
int[] ids = OreDictionary.getOreIDs(stack);
|
||||
for(int i : ids) {
|
||||
int index = DYES.indexOf(OreDictionary.getOreName(i));
|
||||
if(index >= 0)
|
||||
return index;
|
||||
private int getStackColor(ItemStack stack) {
|
||||
for (int i = 0; i < dyes.size(); i++) {
|
||||
if(dyes.get(i).test(stack)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
@@ -10,30 +10,37 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.common.item.ItemManaGun;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ManaGunClipRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class ManaGunClipRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_clip");
|
||||
public static final IRecipeSerializer<ManaGunClipRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), ManaGunClipRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public ManaGunClipRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundGun = false;
|
||||
boolean foundClip = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ItemManaGun && !ItemManaGun.hasClip(stack))
|
||||
foundGun = true;
|
||||
@@ -50,11 +57,11 @@ public class ManaGunClipRecipe extends IForgeRegistryEntry.Impl<IRecipe> impleme
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack gun = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.getItem() instanceof ItemManaGun)
|
||||
gun = stack;
|
||||
}
|
||||
@@ -77,7 +84,7 @@ public class ManaGunClipRecipe extends IForgeRegistryEntry.Impl<IRecipe> impleme
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -10,31 +10,38 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.api.mana.ILensControl;
|
||||
import vazkii.botania.common.item.ItemManaGun;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ManaGunLensRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class ManaGunLensRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "mana_gun_add_lens");
|
||||
public static final IRecipeSerializer<ManaGunLensRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), ManaGunLensRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public ManaGunLensRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundLens = false;
|
||||
boolean foundGun = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ItemManaGun && ItemManaGun.getLens(stack).isEmpty())
|
||||
foundGun = true;
|
||||
@@ -54,12 +61,12 @@ public class ManaGunLensRecipe extends IForgeRegistryEntry.Impl<IRecipe> impleme
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack lens = ItemStack.EMPTY;
|
||||
ItemStack gun = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ItemManaGun)
|
||||
gun = stack;
|
||||
@@ -84,7 +91,7 @@ public class ManaGunLensRecipe extends IForgeRegistryEntry.Impl<IRecipe> impleme
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -10,28 +10,35 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.common.item.ItemManaGun;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ManaGunRemoveLensRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class ManaGunRemoveLensRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "mana_gun_remove_lens");
|
||||
public static final IRecipeSerializer<ManaGunRemoveLensRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), ManaGunRemoveLensRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public ManaGunRemoveLensRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundGun = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ItemManaGun && !ItemManaGun.getLens(stack).isEmpty())
|
||||
foundGun = true;
|
||||
@@ -45,11 +52,11 @@ public class ManaGunRemoveLensRecipe extends IForgeRegistryEntry.Impl<IRecipe> i
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack gun = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ItemManaGun)
|
||||
gun = stack;
|
||||
@@ -69,7 +76,7 @@ public class ManaGunRemoveLensRecipe extends IForgeRegistryEntry.Impl<IRecipe> i
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -10,23 +10,37 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.item.crafting.ShapedRecipe;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class ManaUpgradeRecipe extends ShapedOreRecipe {
|
||||
public ManaUpgradeRecipe(ItemStack output, Object... inputs) {
|
||||
super(null, output, inputs);
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ManaUpgradeRecipe implements IRecipe {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "mana_upgrade");
|
||||
private final ShapedRecipe compose;
|
||||
|
||||
public ManaUpgradeRecipe(ShapedRecipe compose) {
|
||||
this.compose = compose;
|
||||
}
|
||||
|
||||
public static ItemStack output(ItemStack output, InventoryCrafting var1) {
|
||||
public static ItemStack output(ItemStack output, IInventory inv) {
|
||||
ItemStack out = output.copy();
|
||||
if (!(out.getItem() instanceof IManaItem))
|
||||
return out;
|
||||
IManaItem outItem = (IManaItem) out.getItem();
|
||||
for (int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if (!stack.isEmpty()) {
|
||||
if (stack.getItem() instanceof IManaItem) {
|
||||
IManaItem item = (IManaItem) stack.getItem();
|
||||
@@ -38,7 +52,59 @@ public class ManaUpgradeRecipe extends ShapedOreRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting var1) {
|
||||
return output(output, var1);
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
return compose.matches(inv, world);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
return output(compose.getCraftingResult(inv), inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFit(int width, int height) {
|
||||
return compose.canFit(width, height);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return compose.getRecipeOutput();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getId() {
|
||||
return compose.getId();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
|
||||
public static final IRecipeSerializer<ManaUpgradeRecipe> SERIALIZER = new IRecipeSerializer<ManaUpgradeRecipe>() {
|
||||
@Override
|
||||
public ManaUpgradeRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull JsonObject json) {
|
||||
return new ManaUpgradeRecipe(RecipeSerializers.CRAFTING_SHAPED.read(recipeId, json));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ManaUpgradeRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull PacketBuffer buffer) {
|
||||
return new ManaUpgradeRecipe(RecipeSerializers.CRAFTING_SHAPED.read(recipeId, buffer));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@Nonnull PacketBuffer buffer, ManaUpgradeRecipe recipe) {
|
||||
RecipeSerializers.CRAFTING_SHAPED.write(buffer, recipe.compose);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getName() {
|
||||
return TYPE_ID;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -10,25 +10,32 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.api.item.IPhantomInkable;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class PhantomInkRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class PhantomInkRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "phantom_ink_apply");
|
||||
public static final IRecipeSerializer<PhantomInkRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), PhantomInkRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public PhantomInkRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory var1, @Nonnull World var2) {
|
||||
boolean foundInk = false;
|
||||
boolean foundItem = false;
|
||||
|
||||
@@ -50,7 +57,7 @@ public class PhantomInkRecipe extends IForgeRegistryEntry.Impl<IRecipe> implemen
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory var1) {
|
||||
ItemStack item = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
@@ -72,7 +79,7 @@ public class PhantomInkRecipe extends IForgeRegistryEntry.Impl<IRecipe> implemen
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
+76
-7
@@ -10,17 +10,86 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.item.crafting.ShapelessRecipe;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class ShapelessManaUpgradeRecipe extends ShapelessOreRecipe {
|
||||
public ShapelessManaUpgradeRecipe(ItemStack output, Object... inputs) {
|
||||
super(null, output, inputs);
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class ShapelessManaUpgradeRecipe implements IRecipe {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "shapeless_mana_upgrade");
|
||||
|
||||
private final ShapelessRecipe compose;
|
||||
public ShapelessManaUpgradeRecipe(ShapelessRecipe compose) {
|
||||
this.compose = compose;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting var1) {
|
||||
return ManaUpgradeRecipe.output(output, var1);
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
return compose.matches(inv, world);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
return ManaUpgradeRecipe.output(compose.getCraftingResult(inv), inv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFit(int width, int height) {
|
||||
return compose.canFit(width, height);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return compose.getRecipeOutput();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getId() {
|
||||
return compose.getId();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
|
||||
public static final IRecipeSerializer<ShapelessManaUpgradeRecipe> SERIALIZER = new IRecipeSerializer<ShapelessManaUpgradeRecipe>() {
|
||||
@Nonnull
|
||||
@Override
|
||||
public ShapelessManaUpgradeRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull JsonObject json) {
|
||||
return new ShapelessManaUpgradeRecipe(RecipeSerializers.CRAFTING_SHAPELESS.read(recipeId, json));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ShapelessManaUpgradeRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull PacketBuffer buffer) {
|
||||
return new ShapelessManaUpgradeRecipe(RecipeSerializers.CRAFTING_SHAPELESS.read(recipeId, buffer));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void write(@Nonnull PacketBuffer buffer, @Nonnull ShapelessManaUpgradeRecipe recipe) {
|
||||
IRecipeSerializer<ShapelessRecipe> compose = (IRecipeSerializer<ShapelessRecipe>) recipe.compose.getSerializer();
|
||||
compose.write(buffer, recipe.compose);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getName() {
|
||||
return TYPE_ID;
|
||||
}
|
||||
};
|
||||
}
|
||||
+52
-21
@@ -10,42 +10,46 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.JsonUtils;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class SpecialFloatingFlowerRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public final ResourceLocation type;
|
||||
public class SpecialFloatingFlowerRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "special_floating_flower");
|
||||
public final ResourceLocation flowerType;
|
||||
|
||||
public SpecialFloatingFlowerRecipe(ResourceLocation type) {
|
||||
this.type = type;
|
||||
public SpecialFloatingFlowerRecipe(ResourceLocation id, ResourceLocation flowerType) {
|
||||
super(id);
|
||||
this.flowerType = flowerType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundFloatingFlower = false;
|
||||
boolean foundSpecialFlower = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() == Item.getItemFromBlock(ModBlocks.floatingFlower))
|
||||
if(stack.getItem() == ModBlocks.floatingFlower.asItem())
|
||||
foundFloatingFlower = true;
|
||||
|
||||
else if(stack.getItem() == Item.getItemFromBlock(ModBlocks.specialFlower) && ItemBlockSpecialFlower.getType(stack).equals(type))
|
||||
else if(stack.getItem() == ModBlocks.specialFlower.asItem() && ItemBlockSpecialFlower.getType(stack).equals(flowerType))
|
||||
foundSpecialFlower = true;
|
||||
|
||||
else return false; // Found an invalid item, breaking the recipe
|
||||
@@ -57,19 +61,19 @@ public class SpecialFloatingFlowerRecipe extends IForgeRegistryEntry.Impl<IRecip
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack specialFlower = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.getItem() == Item.getItemFromBlock(ModBlocks.specialFlower) && ItemBlockSpecialFlower.getType(stack).equals(type))
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.getItem() == ModBlocks.specialFlower.asItem() && ItemBlockSpecialFlower.getType(stack).equals(flowerType))
|
||||
specialFlower = stack;
|
||||
}
|
||||
|
||||
if(specialFlower.isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
return ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), type);
|
||||
return ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), flowerType);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,7 +83,34 @@ public class SpecialFloatingFlowerRecipe extends IForgeRegistryEntry.Impl<IRecip
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
|
||||
public static final IRecipeSerializer<SpecialFloatingFlowerRecipe> SERIALIZER = new IRecipeSerializer<SpecialFloatingFlowerRecipe>() {
|
||||
@Nonnull
|
||||
@Override
|
||||
public SpecialFloatingFlowerRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull JsonObject json) {
|
||||
ResourceLocation flowerType = new ResourceLocation(JsonUtils.getString(json, "type"));
|
||||
return new SpecialFloatingFlowerRecipe(recipeId, flowerType);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public SpecialFloatingFlowerRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull PacketBuffer buffer) {
|
||||
ResourceLocation flowerType = buffer.readResourceLocation();
|
||||
return new SpecialFloatingFlowerRecipe(recipeId, flowerType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@Nonnull PacketBuffer buffer, @Nonnull SpecialFloatingFlowerRecipe recipe) {
|
||||
buffer.writeResourceLocation(recipe.flowerType);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getName() {
|
||||
return TYPE_ID;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -10,32 +10,39 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class SpellClothRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class SpellClothRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "spell_cloth_apply");
|
||||
public static final IRecipeSerializer<SpellClothRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), SpellClothRecipe::new);
|
||||
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public SpellClothRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundCloth = false;
|
||||
boolean foundEnchanted = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.isItemEnchanted() && !foundEnchanted && stack.getItem() != ModItems.spellCloth)
|
||||
if(stack.isEnchanted() && !foundEnchanted && stack.getItem() != ModItems.spellCloth)
|
||||
foundEnchanted = true;
|
||||
|
||||
else if(stack.getItem() == ModItems.spellCloth && !foundCloth)
|
||||
@@ -50,11 +57,11 @@ public class SpellClothRecipe extends IForgeRegistryEntry.Impl<IRecipe> implemen
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack stackToDisenchant = ItemStack.EMPTY;
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.isItemEnchanted() && stack.getItem() != ModItems.spellCloth) {
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.isEnchanted() && stack.getItem() != ModItems.spellCloth) {
|
||||
stackToDisenchant = stack.copy();
|
||||
stackToDisenchant.setCount(1);
|
||||
break;
|
||||
@@ -64,7 +71,7 @@ public class SpellClothRecipe extends IForgeRegistryEntry.Impl<IRecipe> implemen
|
||||
if(stackToDisenchant.isEmpty())
|
||||
return ItemStack.EMPTY;
|
||||
|
||||
stackToDisenchant.getTagCompound().removeTag("ench"); // Remove enchantments
|
||||
stackToDisenchant.getTag().remove("ench"); // Remove enchantments
|
||||
return stackToDisenchant;
|
||||
}
|
||||
|
||||
@@ -75,7 +82,7 @@ public class SpellClothRecipe extends IForgeRegistryEntry.Impl<IRecipe> implemen
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
}
|
||||
@@ -10,30 +10,45 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeHidden;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.RecipeSerializers;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.IForgeRegistryEntry;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.tool.terrasteel.ItemTerraPick;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class TerraPickTippingRecipe extends IForgeRegistryEntry.Impl<IRecipe> implements IRecipe {
|
||||
public class TerraPickTippingRecipe extends IRecipeHidden {
|
||||
private static final ResourceLocation TYPE_ID = new ResourceLocation(LibMisc.MOD_ID, "terra_pick_tipping");
|
||||
public static final IRecipeSerializer<TerraPickTippingRecipe> SERIALIZER = new RecipeSerializers.SimpleSerializer<>(TYPE_ID.toString(), TerraPickTippingRecipe::new);
|
||||
|
||||
public TerraPickTippingRecipe(ResourceLocation id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public boolean isDynamic() {
|
||||
return true;
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull InventoryCrafting var1, @Nonnull World var2) {
|
||||
public boolean matches(@Nonnull IInventory inv, @Nonnull World world) {
|
||||
boolean foundTerraPick = false;
|
||||
boolean foundElementiumPick = false;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty()) {
|
||||
if(stack.getItem() instanceof ItemTerraPick && !ItemTerraPick.isTipped(stack))
|
||||
foundTerraPick = true;
|
||||
@@ -50,11 +65,11 @@ public class TerraPickTippingRecipe extends IForgeRegistryEntry.Impl<IRecipe> im
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1) {
|
||||
public ItemStack getCraftingResult(@Nonnull IInventory inv) {
|
||||
ItemStack terraPick = ItemStack.EMPTY;
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
if(!stack.isEmpty() && stack.getItem() instanceof ItemTerraPick)
|
||||
terraPick = stack;
|
||||
}
|
||||
@@ -71,10 +86,4 @@ public class TerraPickTippingRecipe extends IForgeRegistryEntry.Impl<IRecipe> im
|
||||
public boolean canFit(int width, int height) {
|
||||
return width * height >= 2;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public final class LibItemNames {
|
||||
public static final String DIRT_ROD = "dirtrod";
|
||||
public static final String TERRAFORM_ROD = "terraformrod";
|
||||
public static final String MANA_MIRROR = "manamirror";
|
||||
public static final String MANASTEEL_HELM = "manasteelhelm";
|
||||
public static final String MANASTEEL_HELM = "manasteel_helmet";
|
||||
public static final String MANASTEEL_CHEST = "manasteelchest";
|
||||
public static final String MANASTEEL_LEGS = "manasteellegs";
|
||||
public static final String MANASTEEL_BOOTS = "manasteelboots";
|
||||
@@ -45,7 +45,7 @@ public final class LibItemNames {
|
||||
public static final String GRASS_HORN = "horn_grass";
|
||||
public static final String LEAVES_HORN = "horn_leaves";
|
||||
public static final String SNOW_HORN = "horn_snow";
|
||||
public static final String TERRASTEEL_HELM = "terrasteelhelm";
|
||||
public static final String TERRASTEEL_HELM = "terrasteel_helmet";
|
||||
public static final String TERRASTEEL_CHEST = "terrasteelchest";
|
||||
public static final String TERRASTEEL_LEGS = "terrasteellegs";
|
||||
public static final String TERRASTEEL_BOOTS = "terrasteelboots";
|
||||
@@ -76,7 +76,7 @@ public final class LibItemNames {
|
||||
"quartz_sunny"
|
||||
};
|
||||
public static final String WATER_ROD = "waterrod";
|
||||
public static final String ELEMENTIUM_HELM = "elementiumhelm";
|
||||
public static final String ELEMENTIUM_HELM = "elementium_helmet";
|
||||
public static final String ELEMENTIUM_CHEST = "elementiumchest";
|
||||
public static final String ELEMENTIUM_LEGS = "elementiumlegs";
|
||||
public static final String ELEMENTIUM_BOOTS = "elementiumboots";
|
||||
@@ -100,9 +100,9 @@ public final class LibItemNames {
|
||||
public static final String NULL_VIRUS = "virus_nullodermal";
|
||||
public static final String REACH_RING = "reachring";
|
||||
public static final String SKY_DIRT_ROD = "skydirtrod";
|
||||
public static final String MANASTEEL_HELM_R = "manasteelhelmreveal";
|
||||
public static final String TERRASTEEL_HELM_R = "terrasteelhelmreveal";
|
||||
public static final String ELEMENTIUM_HELM_R = "elementiumhelmreveal";
|
||||
public static final String MANASTEEL_HELM_R = "manasteel_helmet_revealing";
|
||||
public static final String TERRASTEEL_HELM_R = "terrasteel_helmet_revealing";
|
||||
public static final String ELEMENTIUM_HELM_R = "elementium_helmet_revealing";
|
||||
public static final String ITEM_FINDER = "itemfinder";
|
||||
public static final String SUPER_LAVA_PENDANT = "superlavapendant";
|
||||
public static final String ENDER_HAND = "enderhand";
|
||||
|
||||
@@ -31,7 +31,7 @@ public class PacketJump {
|
||||
return new PacketJump();
|
||||
}
|
||||
|
||||
public static void handle(PacketJump msg, Supplier<NetworkEvent.Context> ctx) {
|
||||
public void handle(Supplier<NetworkEvent.Context> ctx) {
|
||||
ctx.get().enqueueWork(() -> {
|
||||
EntityPlayerMP player = ctx.get().getSender();
|
||||
IItemHandler baublesInv = BaublesApi.getBaublesHandler(player);
|
||||
|
||||
Reference in new issue
Block a user