More work

This commit is contained in:
Vincent Lee committed 2019-03-17 21:25:20 -05:00
1 parent faeac4494c
commit ea50b40229
52 files changed
+731 -526

No files matched your search

@@ -36,7 +36,6 @@ import net.minecraft.util.SoundEvent;
import net.minecraft.util.registry.RegistryNamespaced;
import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.ForgeRegistries;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.api.internal.DummyMethodHandler;
@@ -356,7 +355,7 @@ public final class BotaniaAPI {
}
};
public static final EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", TextFormatting.GOLD, "Relic");
public static final EnumRarity rarityRelic = EnumRarity.EPIC; // todo 1.13 EnumHelper.addRarity("RELIC", TextFormatting.GOLD, "Relic");
public static final KnowledgeType basicKnowledge;
public static final KnowledgeType elvenKnowledge;
@@ -598,7 +597,7 @@ public final class BotaniaAPI {
* or String (case for Ore Dictionary). The array can't be larger than 16.
* @return The recipe created.
*/
public static RecipeRuneAltar registerRuneAltarRecipe(ItemStack output, int mana, Object... inputs) {
public static RecipeRuneAltar registerRuneAltarRecipe(ItemStack output, int mana, Ingredient... inputs) {
Preconditions.checkArgument(inputs.length <= 16);
RecipeRuneAltar recipe = new RecipeRuneAltar(output, mana, inputs);
runeAltarRecipes.add(recipe);
@@ -15,7 +15,6 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.api.brew.IBrewContainer;
@@ -15,7 +15,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.common.core.helper.ItemNBTHelper;
import java.util.ArrayList;
@@ -17,7 +17,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tags.Tag;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.subtile.SubTileEntity;
import java.util.HashMap;
@@ -75,7 +75,7 @@ public class SubTileFunctional extends SubTileEntity {
if(acceptsRedstone()) {
redstoneSignal = 0;
for(EnumFacing dir : EnumFacing.BY_INDEX) {
for(EnumFacing dir : EnumFacing.values()) {
int redstoneSide = supertile.getWorld().getRedstonePower(supertile.getPos().offset(dir), dir);
redstoneSignal = Math.max(redstoneSignal, redstoneSide);
}
@@ -85,7 +85,7 @@ public class SubTileGenerating extends SubTileEntity {
if(acceptsRedstone()) {
redstoneSignal = 0;
for(EnumFacing dir : EnumFacing.BY_INDEX) {
for(EnumFacing dir : EnumFacing.values()) {
int redstoneSide = supertile.getWorld().getRedstonePower(supertile.getPos().offset(dir), dir);
redstoneSignal = Math.max(redstoneSignal, redstoneSide);
}
@@ -24,6 +24,7 @@ import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent.Phase;
import org.lwjgl.glfw.GLFW;
import vazkii.botania.api.corporea.CorporeaHelper;
import vazkii.botania.common.lib.LibObfuscation;
@@ -77,7 +78,7 @@ public class CorporeaAutoCompleteHandler {
if(!valid)
isAutoCompleted = false;
}
if(Keyboard.isKeyDown(15)) {
if(GLFW.glfwGetKey(Minecraft.getInstance().mainWindow.getHandle(), GLFW.GLFW_KEY_TAB) == GLFW.GLFW_PRESS) {
if(tabLastTick)
return;
tabLastTick = true;
@@ -35,6 +35,7 @@ public class CorporeaInputHandler {
/** Filter for usable guis to handle requests. Added to in JEIBotaniaPlugin */
public static Predicate<GuiScreen> supportedGuiFilter = gui -> gui instanceof GuiContainer;
/* todo 1.13
@SubscribeEvent
public static void buttonPressed(KeyboardInputEvent.Post event) {
Minecraft mc = Minecraft.getInstance();
@@ -67,6 +68,7 @@ public class CorporeaInputHandler {
}
}
}
*/
private static ItemStack getStackUnderMouse() {
GuiScreen screen = Minecraft.getInstance().currentScreen;
@@ -11,6 +11,8 @@ package vazkii.botania.client.core.handler;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
@@ -22,6 +24,7 @@ import vazkii.botania.client.model.LexiconModel;
import vazkii.botania.client.model.PlatformModel;
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
import vazkii.botania.common.item.relic.ItemKingKey;
import vazkii.botania.common.lib.LibMisc;
import java.util.EnumMap;
import java.util.Map;
@@ -50,11 +53,11 @@ public class MiscellaneousIcons {
runeAltarTriggerIcon,
terrasteelHelmWillIcon;
public TextureAtlasSprite[] sparkUpgradeIcons;
public TextureAtlasSprite[] kingKeyWeaponIcons;
public final TextureAtlasSprite[] sparkUpgradeIcons = new TextureAtlasSprite[4];
public final TextureAtlasSprite[] kingKeyWeaponIcons = new TextureAtlasSprite[ItemKingKey.WEAPON_TYPES];
// public final Map<TriggerManaLevel.State, TextureAtlasSprite> manaLevelTriggerIcons = new EnumMap<>(TriggerManaLevel.State.class);
public TextureAtlasSprite[] tiaraWingIcons;
public TextureAtlasSprite[] thirdEyeLayers;
public final TextureAtlasSprite[] tiaraWingIcons = new TextureAtlasSprite[ItemFlightTiara.WING_TYPES];
public final TextureAtlasSprite[] thirdEyeLayers = new TextureAtlasSprite[3];
// begin dank_memes
public TextureAtlasSprite tailIcon = null;
@@ -112,67 +115,130 @@ public class MiscellaneousIcons {
originalModel = evt.getModelRegistry().get(key);
evt.getModelRegistry().put(key, new GunModel(originalModel));
}
@SubscribeEvent
public void onTextureStitch(TextureStitchEvent.Pre evt) {
alfPortalTex = IconHelper.forName(evt.getMap(), "alfheim_portal_swirl", "blocks");
lightRelayWorldIcon = IconHelper.forName(evt.getMap(), "luminizer", "blocks");
lightRelayWorldIconRed = IconHelper.forName(evt.getMap(), "luminizer_detector", "blocks");
lightRelayWorldIconGreen = IconHelper.forName(evt.getMap(), "luminizer_fork", "blocks");
lightRelayWorldIconPurple = IconHelper.forName(evt.getMap(), "luminizer_toggle", "blocks");
alchemyCatalystOverlay = IconHelper.forName(evt.getMap(), "catalyst_alchemy_overlay", "blocks");
conjurationCatalystOverlay = IconHelper.forName(evt.getMap(), "catalyst_conjuration_overlay", "blocks");
enchanterOverlay = IconHelper.forName(evt.getMap(), "enchanter_overlay", "blocks");
manaVoidOverlay = IconHelper.forName(evt.getMap(), "mana_void_overlay", "blocks");
manaWater = IconHelper.forName(evt.getMap(), "mana_water", "blocks");
terraPlateOverlay = IconHelper.forName(evt.getMap(), "terra_plate_overlay", "blocks");
corporeaWorldIcon = IconHelper.forName(evt.getMap(), "spark_corporea", "items");
corporeaWorldIconMaster = IconHelper.forName(evt.getMap(), "spark_corporea_master", "items");
corporeaIconStar = IconHelper.forName(evt.getMap(), "spark_corporea_star", "items");
sparkWorldIcon = IconHelper.forName(evt.getMap(), "spark", "items");
public void onTextureStitchPre(TextureStitchEvent.Pre evt) {
register(evt.getMap(), "blocks/alfheim_portal_swirl");
register(evt.getMap(), "blocks/alfheim_portal_swirl");
register(evt.getMap(), "blocks/luminizer");
register(evt.getMap(), "blocks/luminizer_detector");
register(evt.getMap(), "blocks/luminizer_fork");
register(evt.getMap(), "blocks/luminizer_toggle");
register(evt.getMap(), "blocks/catalyst_alchemy_overlay");
register(evt.getMap(), "blocks/catalyst_conjuration_overlay");
register(evt.getMap(), "blocks/enchanter_overlay");
register(evt.getMap(), "blocks/mana_void_overlay");
register(evt.getMap(), "blocks/mana_water");
register(evt.getMap(), "blocks/terra_plate_overlay");
register(evt.getMap(), "items/spark_corporea");
register(evt.getMap(), "items/spark_corporea_master");
register(evt.getMap(), "items/spark_corporea_star");
register(evt.getMap(), "items/spark");
sparkUpgradeIcons = new TextureAtlasSprite[4];
for(int i = 0; i < 4; i++) {
sparkUpgradeIcons[i] = IconHelper.forName(evt.getMap(), "spark_upgrade_rune_" + i, "items");
register(evt.getMap(), "items/spark_upgrade_rune_" + i);
}
tailIcon = IconHelper.forName(evt.getMap(), "special_tail", "items");
phiFlowerIcon = IconHelper.forName(evt.getMap(), "special_phiflower", "items");
goldfishIcon = IconHelper.forName(evt.getMap(), "special_goldfish", "items");
nerfBatIcon = IconHelper.forName(evt.getMap(), "special_nerfbat", "items");
register(evt.getMap(), "items/special_tail");
register(evt.getMap(), "items/special_phiflower");
register(evt.getMap(), "items/special_goldfish");
register(evt.getMap(), "items/special_nerfbat");
kingKeyWeaponIcons = new TextureAtlasSprite[ItemKingKey.WEAPON_TYPES];
for(int i = 0; i < ItemKingKey.WEAPON_TYPES; i++)
kingKeyWeaponIcons[i] = IconHelper.forName(evt.getMap(), "gate_weapon_" + i, "items");
thirdEyeLayers = new TextureAtlasSprite[3];
for(int i = 0; i < 3; i++)
thirdEyeLayers[i] = IconHelper.forName(evt.getMap(), "third_eye_" + i, "items");
register(evt.getMap(), "items/gate_weapon_" + i);
manaDetectorIcon = IconHelper.forName(evt.getMap(), "triggers/manaDetector", "items");
runeAltarTriggerIcon = IconHelper.forName(evt.getMap(), "triggers/runeAltarCanCraft", "items");
for(int i = 0; i < 3; i++)
register(evt.getMap(), "items/third_eye_" + i);
register(evt.getMap(), "items/triggers/manaDetector");
register(evt.getMap(), "items/triggers/runeAltarCanCraft");
/*
for (TriggerManaLevel.State s : TriggerManaLevel.State.values()) {
manaLevelTriggerIcons.put(s, IconHelper.forName(evt.getMap(), "triggers/mana" + WordUtils.capitalizeFully(s.name()), "items"));
register(evt.getMap(), "items/triggers/mana" + WordUtils.capitalizeFully(s.name()));
}
*/
tiaraWingIcons = new TextureAtlasSprite[ItemFlightTiara.WING_TYPES];
for (int i = 0; i < tiaraWingIcons.length; i++) {
tiaraWingIcons[i] = IconHelper.forName(evt.getMap(), "headpiece_tiara_wing_" + (i + 1), "items");
register(evt.getMap(), "items/headpiece_tiara_wing_" + (i + 1));
}
terrasteelHelmWillIcon = IconHelper.forName(evt.getMap(), "willFlame", "items");
register(evt.getMap(), "items/willFlame");
bloodPendantChain = IconHelper.forName(evt.getMap(), "pendant_blood_chain", "items");
bloodPendantGem = IconHelper.forName(evt.getMap(), "pendant_blood_gem", "items");
snowflakePendantGem = IconHelper.forName(evt.getMap(), "pendant_ice_gem", "items");
itemFinderGem = IconHelper.forName(evt.getMap(), "headpiece_item_finder_gem", "items");
pyroclastGem = IconHelper.forName(evt.getMap(), "pendant_lava_gem", "items");
crimsonGem = IconHelper.forName(evt.getMap(), "pendant_lava_super_gem", "items");
cirrusGem = IconHelper.forName(evt.getMap(), "pendant_cloud_gem", "items");
nimbusGem = IconHelper.forName(evt.getMap(), "pendant_cloud_super_gem", "items");
register(evt.getMap(), "items/pendant_blood_chain");
register(evt.getMap(), "items/pendant_blood_gem");
register(evt.getMap(), "items/pendant_ice_gem");
register(evt.getMap(), "items/headpiece_item_finder_gem");
register(evt.getMap(), "items/pendant_lava_gem");
register(evt.getMap(), "items/pendant_lava_super_gem");
register(evt.getMap(), "items/pendant_cloud_gem");
register(evt.getMap(), "items/pendant_cloud_super_gem");
}
@SubscribeEvent
public void onTextureStitchPost(TextureStitchEvent.Post evt) {
alfPortalTex = get(evt.getMap(), "blocks/alfheim_portal_swirl");
lightRelayWorldIcon = get(evt.getMap(), "blocks/luminizer");
lightRelayWorldIconRed = get(evt.getMap(), "blocks/luminizer_detector");
lightRelayWorldIconGreen = get(evt.getMap(), "blocks/luminizer_fork");
lightRelayWorldIconPurple = get(evt.getMap(), "blocks/luminizer_toggle");
alchemyCatalystOverlay = get(evt.getMap(), "blocks/catalyst_alchemy_overlay");
conjurationCatalystOverlay = get(evt.getMap(), "blocks/catalyst_conjuration_overlay");
enchanterOverlay = get(evt.getMap(), "blocks/enchanter_overlay");
manaVoidOverlay = get(evt.getMap(), "blocks/mana_void_overlay");
manaWater = get(evt.getMap(), "blocks/mana_water");
terraPlateOverlay = get(evt.getMap(), "blocks/terra_plate_overlay");
corporeaWorldIcon = get(evt.getMap(), "items/spark_corporea");
corporeaWorldIconMaster = get(evt.getMap(), "items/spark_corporea_master");
corporeaIconStar = get(evt.getMap(), "items/spark_corporea_star");
sparkWorldIcon = get(evt.getMap(), "items/spark");
for(int i = 0; i < 4; i++) {
sparkUpgradeIcons[i] = get(evt.getMap(), "items/spark_upgrade_rune_" + i);
}
tailIcon = get(evt.getMap(), "items/special_tail");
phiFlowerIcon = get(evt.getMap(), "items/special_phiflower");
goldfishIcon = get(evt.getMap(), "items/special_goldfish");
nerfBatIcon = get(evt.getMap(), "items/special_nerfbat");
for(int i = 0; i < ItemKingKey.WEAPON_TYPES; i++)
kingKeyWeaponIcons[i] = get(evt.getMap(), "items/gate_weapon_" + i);
for(int i = 0; i < 3; i++)
thirdEyeLayers[i] = get(evt.getMap(), "items/third_eye_" + i);
manaDetectorIcon = get(evt.getMap(), "items/triggers/manaDetector");
runeAltarTriggerIcon = get(evt.getMap(), "items/triggers/runeAltarCanCraft");
/*
for (TriggerManaLevel.State s : TriggerManaLevel.State.values()) {
manaLevelTriggerIcons.put(s, get(evt.getMap(), "items/triggers/mana" + WordUtils.capitalizeFully(s.name())));
}
*/
for (int i = 0; i < tiaraWingIcons.length; i++) {
tiaraWingIcons[i] = get(evt.getMap(), "items/headpiece_tiara_wing_" + (i + 1));
}
terrasteelHelmWillIcon = get(evt.getMap(), "items/willFlame");
bloodPendantChain = get(evt.getMap(), "items/pendant_blood_chain");
bloodPendantGem = get(evt.getMap(), "items/pendant_blood_gem");
snowflakePendantGem = get(evt.getMap(), "items/pendant_ice_gem");
itemFinderGem = get(evt.getMap(), "items/headpiece_item_finder_gem");
pyroclastGem = get(evt.getMap(), "items/pendant_lava_gem");
crimsonGem = get(evt.getMap(), "items/pendant_lava_super_gem");
cirrusGem = get(evt.getMap(), "items/pendant_cloud_gem");
nimbusGem = get(evt.getMap(), "items/pendant_cloud_super_gem");
}
private void register(TextureMap map, String name) {
map.registerSprite(null, new ResourceLocation(LibMisc.MOD_ID, name));
}
private TextureAtlasSprite get(TextureMap map, String name) {
return map.getSprite(new ResourceLocation(LibMisc.MOD_ID, name));
}
private MiscellaneousIcons() {}
@@ -21,14 +21,6 @@ import vazkii.botania.client.lib.LibResources;
public final class IconHelper {
public static TextureAtlasSprite forName(TextureMap ir, String name) {
return ir.registerSprite(new ResourceLocation(LibResources.PREFIX_MOD + name));
}
public static TextureAtlasSprite forName(TextureMap ir, String name, String dir) {
return ir.registerSprite(new ResourceLocation(LibResources.PREFIX_MOD + dir + "/" + name));
}
/**
* Renders a sprite from the spritesheet with depth, like a "builtin/generated" item model.
* Adapted from ItemRenderer.renderItemIn2D, 1.7.10
@@ -59,4 +59,9 @@ public class InventoryBaubleBox implements IItemHandlerModifiable {
return boxInv.getSlotLimit(slot);
}
@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
return boxInv.isItemValid(slot, stack);
}
}
@@ -174,19 +174,19 @@ public class FloatingFlowerModel implements IBakedModel {
ImmutableList.Builder<BakedQuad> genBuilder = ImmutableList.builder();
final TRSRTransformation transform = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(0F, 0.2F, 0F), null, new Vector3f(0.5F, 0.5F, 0.5F), null));
for(EnumFacing e : EnumFacing.BY_INDEX)
for(EnumFacing e : EnumFacing.values())
faceQuads.put(e, new ArrayList<>());
// Add flower quads, scaled and translated
flower.getQuads(null, null, new Random(0)).stream().map(q -> transform(q, transform)).forEach(genBuilder::add);
for(EnumFacing e : EnumFacing.BY_INDEX) {
for(EnumFacing e : EnumFacing.values()) {
List<BakedQuad> faceQ = faceQuads.get(e);
flower.getQuads(null, e, new Random(0)).stream().map(input -> transform(input, transform)).forEach(faceQ::add);
}
// Add island quads
genBuilder.addAll(island.getQuads(null, null, new Random(0)));
for(EnumFacing e : EnumFacing.BY_INDEX) {
for(EnumFacing e : EnumFacing.values()) {
faceQuads.get(e).addAll(island.getQuads(null, e, new Random(0)));
}
@@ -118,7 +118,7 @@ public class GunModel implements IBakedModel {
ImmutableList.Builder<BakedQuad> genBuilder = ImmutableList.builder();
final TRSRTransformation transform = TRSRTransformation.blockCenterToCorner(new TRSRTransformation(new Vector3f(-0.4F, 0.25F, 0), null, new Vector3f(0.625F, 0.625F, 0.625F), TRSRTransformation.quatFromXYZ(0, (float) Math.PI / 2, 0)));
for(EnumFacing e : EnumFacing.BY_INDEX)
for(EnumFacing e : EnumFacing.values())
faceQuads.put(e, new ArrayList<>());
// Add lens quads, scaled and translated
@@ -126,13 +126,13 @@ public class GunModel implements IBakedModel {
genBuilder.add(transform(quad, transform));
}
for(EnumFacing e : EnumFacing.BY_INDEX) {
for(EnumFacing e : EnumFacing.values()) {
faceQuads.get(e).addAll(lens.getQuads(null, e, new Random(0)).stream().map(input -> transform(input, transform)).collect(Collectors.toList()));
}
// Add gun quads
genBuilder.addAll(gun.getQuads(null, null, new Random(0)));
for(EnumFacing e : EnumFacing.BY_INDEX) {
for(EnumFacing e : EnumFacing.values()) {
faceQuads.get(e).addAll(gun.getQuads(null, e, new Random(0)));
}
@@ -145,7 +145,6 @@ public class Botania {
PacketHandler.init();
ModBrews.init();
ModMultiblocks.init();
ModBanners.init();
ModPetalRecipes.init();
ModPureDaisyRecipes.init();
ModRuneRecipes.init();
@@ -176,6 +175,8 @@ public class Botania {
if(Botania.gardenOfGlassLoaded)
new WorldTypeSkyblock();
ModBanners.init();
CriteriaTriggers.register(AlfPortalTrigger.INSTANCE);
CriteriaTriggers.register(CorporeaRequestTrigger.INSTANCE);
CriteriaTriggers.register(DopplegangerNoArmorTrigger.INSTANCE);
@@ -15,32 +15,33 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.BannerPattern;
import vazkii.botania.common.item.ModItems;
import java.util.Locale;
public final class ModBanners {
public static void init() {
Class<? extends Enum<?>> clazz = BannerPattern.class;
addPattern(clazz, "flower", "flr", new ItemStack(ModItems.livingwoodTwig));
addPattern(clazz, "lexicon", "lex", new ItemStack(ModItems.lexicon));
addPattern(clazz, "logo", "lgo", new ItemStack(ModItems.terrasteel));
addPattern(clazz, "sapling", "spl", new ItemStack(ModItems.dreamwoodTwig));
addPattern(clazz, "tiny_potato", "tpt", new ItemStack(ModBlocks.tinyPotato));
addPattern("flower", "flr", new ItemStack(ModItems.livingwoodTwig));
addPattern("lexicon", "lex", new ItemStack(ModItems.lexicon));
addPattern("logo", "lgo", new ItemStack(ModItems.terrasteel));
addPattern("sapling", "spl", new ItemStack(ModItems.dreamwoodTwig));
addPattern("tiny_potato", "tpt", new ItemStack(ModBlocks.tinyPotato));
addPattern(clazz, "spark_dispersive", "sds", new ItemStack(ModItems.sparkUpgradeDispersive));
addPattern(clazz, "spark_dominant", "sdm", new ItemStack(ModItems.sparkUpgradeDominant));
addPattern(clazz, "spark_recessive", "src", new ItemStack(ModItems.sparkUpgradeRecessive));
addPattern(clazz, "spark_isolated", "sis", new ItemStack(ModItems.sparkUpgradeIsolated));
addPattern("spark_dispersive", "sds", new ItemStack(ModItems.sparkUpgradeDispersive));
addPattern("spark_dominant", "sdm", new ItemStack(ModItems.sparkUpgradeDominant));
addPattern("spark_recessive", "src", new ItemStack(ModItems.sparkUpgradeRecessive));
addPattern("spark_isolated", "sis", new ItemStack(ModItems.sparkUpgradeIsolated));
addPattern(clazz, "fish", "fis", new ItemStack(Items.COD));
addPattern(clazz, "axe", "axe", new ItemStack(Items.IRON_AXE));
addPattern(clazz, "hoe", "hoe", new ItemStack(Items.IRON_HOE));
addPattern(clazz, "pickaxe", "pik", new ItemStack(Items.IRON_PICKAXE));
addPattern(clazz, "shovel", "shv", new ItemStack(Items.IRON_SHOVEL));
addPattern(clazz, "sword", "srd", new ItemStack(Items.IRON_SWORD));
addPattern("fish", "fis", new ItemStack(Items.COD));
addPattern("axe", "axe", new ItemStack(Items.IRON_AXE));
addPattern("hoe", "hoe", new ItemStack(Items.IRON_HOE));
addPattern("pickaxe", "pik", new ItemStack(Items.IRON_PICKAXE));
addPattern("shovel", "shv", new ItemStack(Items.IRON_SHOVEL));
addPattern("sword", "srd", new ItemStack(Items.IRON_SWORD));
}
public static void addPattern(Class<? extends Enum<?>> clazz, String name, String id, ItemStack craftingItem) {
private static void addPattern(String name, String id, ItemStack craftingItem) {
name = "botania_" + name;
id = "bt_" + id;
EnumHelper.addEnum(clazz, name.toUpperCase(), new Class[] { String.class, String.class, ItemStack.class }, name, id, craftingItem);
BannerPattern.create(name.toUpperCase(Locale.ROOT), name, id, craftingItem);
}
}
@@ -22,7 +22,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.IForgeRegistry;
import net.minecraftforge.registries.IForgeRegistryEntry;
import net.minecraftforge.registries.ObjectHolder;
@@ -51,6 +50,7 @@ import vazkii.botania.common.block.mana.BlockConjurationCatalyst;
import vazkii.botania.common.block.mana.BlockDistributor;
import vazkii.botania.common.block.mana.BlockEnchanter;
import vazkii.botania.common.block.mana.BlockForestDrum;
import vazkii.botania.common.block.mana.BlockManaDetector;
import vazkii.botania.common.block.mana.BlockManaVoid;
import vazkii.botania.common.block.mana.BlockPool;
import vazkii.botania.common.block.mana.BlockPrism;
@@ -446,7 +446,7 @@ public final class ModBlocks {
register(r, new BlockManaVoid(builder), LibBlockNames.MANA_VOID);
builder = Block.Properties.create(Material.ROCK).hardnessAndResistance(2, 10).sound(SoundType.STONE);
register(r, new BlockDistributor(builder), LibBlockNames.MANA_DETECTOR);
register(r, new BlockManaDetector(builder), LibBlockNames.MANA_DETECTOR);
register(r, new BlockEnchanter(Block.Properties.create(Material.ROCK).hardnessAndResistance(3, 5).lightValue(15).sound(SoundType.STONE)), LibBlockNames.ENCHANTER);
register(r, new BlockTurntable(Block.Properties.create(Material.WOOD).hardnessAndResistance(2).sound(SoundType.WOOD)), LibBlockNames.TURNTABLE);
@@ -795,7 +795,7 @@ public final class ModBlocks {
r.register(new ItemBlockMod(doubleFlowerGreen, props).setRegistryName(doubleFlowerGreen.getRegistryName()));
r.register(new ItemBlockMod(doubleFlowerRed, props).setRegistryName(doubleFlowerRed.getRegistryName()));
r.register(new ItemBlockMod(doubleFlowerBlack, props).setRegistryName(doubleFlowerBlack.getRegistryName()));
r.register(new ItemBlockBlaze(blazeBlock).setRegistryName(blazeBlock.getRegistryName()));
r.register(new ItemBlockBlaze(blazeBlock, props).setRegistryName(blazeBlock.getRegistryName()));
r.register(new ItemBlockMod(corporeaInterceptor, props).setRegistryName(corporeaInterceptor.getRegistryName()));
r.register(new ItemBlockMod(corporeaCrystalCube, ModItems.defaultBuilder().setTEISR(() -> RenderTileCorporeaCrystalCube.TEISR::new)).setRegistryName(corporeaCrystalCube.getRegistryName()));
r.register(new ItemBlockMod(incensePlate, props).setRegistryName(incensePlate.getRegistryName()));
@@ -1066,7 +1066,51 @@ public final class ModBlocks {
case BLACK: return blackBuriedPetals;
}
}
public static Block getShinyFlower(EnumDyeColor color) {
switch (color) {
default:
case WHITE: return whiteShinyFlower;
case ORANGE: return orangeShinyFlower;
case MAGENTA: return magentaShinyFlower;
case LIGHT_BLUE: return lightBlueShinyFlower;
case YELLOW: return yellowShinyFlower;
case LIME: return limeShinyFlower;
case PINK: return pinkShinyFlower;
case GRAY: return grayShinyFlower;
case LIGHT_GRAY: return lightGrayShinyFlower;
case CYAN: return cyanShinyFlower;
case PURPLE: return purpleShinyFlower;
case BLUE: return blueShinyFlower;
case BROWN: return brownShinyFlower;
case GREEN: return greenShinyFlower;
case RED: return redShinyFlower;
case BLACK: return blackShinyFlower;
}
}
public static Block getFloatingFlower(EnumDyeColor color) {
switch (color) {
default:
case WHITE: return whiteFloatingFlower;
case ORANGE: return orangeFloatingFlower;
case MAGENTA: return magentaFloatingFlower;
case LIGHT_BLUE: return lightBlueFloatingFlower;
case YELLOW: return yellowFloatingFlower;
case LIME: return limeFloatingFlower;
case PINK: return pinkFloatingFlower;
case GRAY: return grayFloatingFlower;
case LIGHT_GRAY: return lightGrayFloatingFlower;
case CYAN: return cyanFloatingFlower;
case PURPLE: return purpleFloatingFlower;
case BLUE: return blueFloatingFlower;
case BROWN: return brownFloatingFlower;
case GREEN: return greenFloatingFlower;
case RED: return redFloatingFlower;
case BLACK: return blackFloatingFlower;
}
}
public static Block getDoubleFlower(EnumDyeColor color) {
switch (color) {
default:
@@ -22,6 +22,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import vazkii.botania.api.internal.IManaBurst;
@@ -59,10 +60,11 @@ public class BlockManaDetector extends BlockMod implements ILexiconable, IManaCo
return state.get(BotaniaStateProps.POWERED) ? 15 : 0;
}
@Nonnull
@Override
public void addCollisionBoxToList(IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull AxisAlignedBB par5AxisAlignedBB, @Nonnull List<AxisAlignedBB> stacks, Entity par7Entity, boolean isActualState) {
if(par7Entity != null && !(par7Entity instanceof IManaBurst))
super.addCollisionBoxToList(state, world, pos, par5AxisAlignedBB, stacks, par7Entity, isActualState);
public VoxelShape getCollisionShape(IBlockState state, IBlockReader worldIn, BlockPos pos) {
// todo 1.13 don't collide if it's a burst
return super.getCollisionShape(state, worldIn, pos);
}
@Override
@@ -17,6 +17,7 @@ import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.mana.IManaPool;
import vazkii.botania.api.subtile.SubTileEntity;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.lexicon.LexiconData;
public class SubTileManastar extends SubTileEntity {
@@ -35,7 +36,7 @@ public class SubTileManastar extends SubTileEntity {
Botania.proxy.wispFX(supertile.getPos().getX() + 0.55 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.75 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5, state == INCREASING ? 0.05F : 1F, 0.05F, state == INCREASING ? 1F : 0.05F, (float) Math.random() / 7, (float) -Math.random() / 50);
} else {
int mana = 0;
for(EnumFacing dir : EnumFacing.BY_HORIZONTAL_INDEX) {
for(EnumFacing dir : MathHelper.HORIZONTALS) {
BlockPos pos = supertile.getPos().offset(dir);
if(getWorld().isBlockLoaded(pos)) {
TileEntity tile = supertile.getWorld().getTileEntity(pos);
@@ -35,6 +35,7 @@ import vazkii.botania.api.mana.IManaItem;
import vazkii.botania.api.subtile.RadiusDescriptor;
import vazkii.botania.api.subtile.SubTileFunctional;
import vazkii.botania.common.core.helper.InventoryHelper;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.lexicon.LexiconData;
import java.util.ArrayList;
@@ -75,7 +76,7 @@ public class SubTileHopperhock extends SubTileFunctional {
boolean priorityInv = false;
int amountToPutIn = 0;
for(EnumFacing dir : EnumFacing.BY_INDEX) {
for(EnumFacing dir : EnumFacing.values()) {
BlockPos pos_ = pos.offset(dir);
InvWithLocation inv = InventoryHelper.getInventoryWithLocation(supertile.getWorld(), pos_, dir.getOpposite());
@@ -155,15 +156,15 @@ public class SubTileHopperhock extends SubTileFunctional {
Block chest = supertile.getWorld().getBlockState(pos).getBlock();
if(tileEntity instanceof TileEntityChest)
for(EnumFacing dir : EnumFacing.BY_HORIZONTAL_INDEX)
for(EnumFacing dir : MathHelper.HORIZONTALS)
if(supertile.getWorld().getBlockState(pos.offset(dir)).getBlock() == chest) {
filter.addAll(getFilterForInventory(pos.offset(dir), false));
break;
}
}
for(EnumFacing dir : EnumFacing.BY_HORIZONTAL_INDEX) {
AxisAlignedBB aabb = new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1));
for(EnumFacing dir : MathHelper.HORIZONTALS) {
AxisAlignedBB aabb = new AxisAlignedBB(pos.offset(dir));
List<EntityItemFrame> frames = supertile.getWorld().getEntitiesWithinAABB(EntityItemFrame.class, aabb);
for(EntityItemFrame frame : frames) {
if(frame.facingDirection == dir)
@@ -22,7 +22,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.WeightedRandom;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.subtile.RadiusDescriptor;
@@ -16,6 +16,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -38,9 +39,9 @@ public class SubTileMunchdew extends SubTileGenerating {
private static final int RANGE = 8;
private static final int RANGE_Y = 16;
boolean ateOnce = false;
int ticksWithoutEating = -1;
int cooldown = 0;
private boolean ateOnce = false;
private int ticksWithoutEating = -1;
private int cooldown = 0;
@Override
public void onUpdate() {
@@ -62,19 +63,15 @@ public class SubTileMunchdew extends SubTileGenerating {
List<BlockPos> coords = new ArrayList<>();
BlockPos pos = supertile.getPos();
nextCoord:
for(BlockPos pos_ : BlockPos.getAllInBox(pos.add(-RANGE, 0, -RANGE), pos.add(RANGE, RANGE_Y, RANGE))) {
if(supertile.getWorld().getBlockState(pos_).getMaterial() == Material.LEAVES) {
boolean exposed = false;
for(EnumFacing dir : EnumFacing.BY_INDEX) {
IBlockState offState = supertile.getWorld().getBlockState(pos_.offset(dir));
if(offState.getBlock().isAir(offState, supertile.getWorld(), pos_.offset(dir))) {
exposed = true;
break;
if(supertile.getWorld().getBlockState(pos_).getBlock().isIn(BlockTags.LEAVES)) {
for(EnumFacing dir : EnumFacing.values()) {
if(supertile.getWorld().isAirBlock(pos_.offset(dir))) {
coords.add(pos_);
break nextCoord;
}
}
if(exposed)
coords.add(pos_);
}
}
@@ -24,7 +24,6 @@ import net.minecraft.util.ITickable;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.ObjectHolder;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.ILexicon;
@@ -126,7 +126,7 @@ public class TileAnimatedTorch extends TileMod implements ITickable {
// tell neighbors that signal is off because we are rotating
world.notifyNeighborsOfStateChange(getPos(), getBlockState().getBlock());
for(EnumFacing e : EnumFacing.BY_INDEX) {
for(EnumFacing e : EnumFacing.values()) {
world.notifyNeighborsOfStateChange(getPos().offset(e), getBlockState().getBlock());
}
}
@@ -151,7 +151,7 @@ public class TileAnimatedTorch extends TileMod implements ITickable {
rotating = false;
// done rotating, tell neighbors
world.notifyNeighborsOfStateChange(getPos(), getBlockState().getBlock());
for(EnumFacing e : EnumFacing.BY_INDEX) {
for(EnumFacing e : EnumFacing.values()) {
world.notifyNeighborsOfStateChange(getPos().offset(e), getBlockState().getBlock());
}
}
@@ -53,7 +53,7 @@ public class TileOpenCrate extends TileSimpleInventory implements ITickable {
return;
boolean redstone = false;
for(EnumFacing dir : EnumFacing.BY_INDEX) {
for(EnumFacing dir : EnumFacing.values()) {
int redstoneSide = world.getRedstonePower(pos.offset(dir), dir);
if(redstoneSide > 0) {
redstone = true;
@@ -44,7 +44,7 @@ public class TilePlatform extends TileCamo {
}
private void swapSurroudings(TilePlatform tile, boolean empty) {
for(EnumFacing dir : EnumFacing.BY_INDEX) {
for(EnumFacing dir : EnumFacing.values()) {
BlockPos pos = tile.getPos().offset(dir);
TileEntity tileAt = world.getTileEntity(pos);
if(tileAt instanceof TilePlatform) {
@@ -19,6 +19,7 @@ import vazkii.botania.api.internal.VanillaPacketDispatcher;
import vazkii.botania.api.mana.spark.ISparkAttachable;
import vazkii.botania.api.mana.spark.ISparkEntity;
import vazkii.botania.api.mana.spark.SparkUpgradeType;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.item.ItemSparkUpgrade;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibBlockNames;
@@ -43,9 +44,9 @@ public class TileSparkChanger extends TileSimpleInventory {
ItemStack changeStack = itemHandler.getStackInSlot(0);
List<ISparkAttachable> attachables = new ArrayList<>();
for(EnumFacing dir : EnumFacing.BY_HORIZONTAL_INDEX) {
for(EnumFacing dir : MathHelper.HORIZONTALS) {
TileEntity tile = world.getTileEntity(pos.offset(dir));
if(tile != null && tile instanceof ISparkAttachable) {
if(tile instanceof ISparkAttachable) {
ISparkAttachable attach = (ISparkAttachable) tile;
ISparkEntity spark = attach.getAttachedSpark();
if(spark != null) {
@@ -24,6 +24,7 @@ import vazkii.botania.api.corporea.CorporeaHelper;
import vazkii.botania.api.corporea.ICorporeaRequestor;
import vazkii.botania.api.corporea.ICorporeaSpark;
import vazkii.botania.common.core.helper.InventoryHelper;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibMisc;
@@ -58,7 +59,7 @@ public class TileCorporeaFunnel extends TileCorporeaBase implements ICorporeaReq
1, 2, 4, 8, 16, 32, 48, 64
};
for(EnumFacing dir : EnumFacing.BY_HORIZONTAL_INDEX) {
for(EnumFacing dir : MathHelper.HORIZONTALS) {
List<EntityItemFrame> frames = world.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1)));
for(EntityItemFrame frame : frames) {
EnumFacing orientation = frame.facingDirection;
@@ -53,7 +53,7 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor
world.getPendingBlockTicks().scheduleTick(getPos(), getBlockState().getBlock(), 2);
TileEntity requestor = source.getSparkInventory().world.getTileEntity(source.getSparkInventory().pos);
for(EnumFacing dir : EnumFacing.BY_INDEX) {
for(EnumFacing dir : EnumFacing.values()) {
TileEntity tile = world.getTileEntity(pos.offset(dir));
if(tile instanceof TileCorporeaRetainer)
((TileCorporeaRetainer) tile).setPendingRequest(requestor.getPos(), request, count);
@@ -81,7 +81,7 @@ public class TileCorporeaInterceptor extends TileCorporeaBase implements ICorpor
public List<ItemStack> getFilter() {
List<ItemStack> filter = new ArrayList<>();
for(EnumFacing dir : EnumFacing.BY_INDEX) {
for(EnumFacing dir : EnumFacing.values()) {
List<EntityItemFrame> frames = world.getEntitiesWithinAABB(EntityItemFrame.class, new AxisAlignedBB(pos.offset(dir), pos.offset(dir).add(1, 1, 1)));
for(EntityItemFrame frame : frames) {
EnumFacing orientation = frame.facingDirection;
@@ -20,6 +20,7 @@ import vazkii.botania.api.internal.VanillaPacketDispatcher;
import vazkii.botania.api.mana.IManaPool;
import vazkii.botania.api.mana.IManaReceiver;
import vazkii.botania.common.block.tile.TileMod;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibMisc;
@@ -40,7 +41,7 @@ public class TileDistributor extends TileMod implements IManaReceiver, ITickable
if (world.isRemote)
return;
validPools.clear();
for(EnumFacing dir : EnumFacing.BY_HORIZONTAL_INDEX) {
for(EnumFacing dir : MathHelper.HORIZONTALS) {
BlockPos pos = this.pos.offset(dir);
if(world.isBlockLoaded(pos)) {
TileEntity tileAt = world.getTileEntity(pos);
@@ -58,6 +58,7 @@ import vazkii.botania.common.block.tile.TileMod;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.core.handler.ManaNetworkHandler;
import vazkii.botania.common.core.handler.ModSounds;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.item.ItemManaTablet;
import vazkii.botania.common.item.ModItems;
@@ -283,7 +284,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
int bellowCount = 0;
if(outputting)
for(EnumFacing dir : EnumFacing.BY_HORIZONTAL_INDEX) {
for(EnumFacing dir : MathHelper.HORIZONTALS) {
TileEntity tile = world.getTileEntity(pos.offset(dir));
if(tile instanceof TileBellows && ((TileBellows) tile).getLinkedTile() == this)
bellowCount++;
@@ -80,7 +80,7 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, ITickable
}
private int transmitEnergy(int energy) {
for(EnumFacing e : EnumFacing.BY_INDEX) {
for(EnumFacing e : EnumFacing.values()) {
BlockPos neighbor = getPos().offset(e);
if(!world.isBlockLoaded(neighbor))
continue;
@@ -46,7 +46,7 @@ public class TileTurntable extends TileMod implements ITickable {
public void tick() {
boolean redstone = false;
for(EnumFacing dir : EnumFacing.BY_INDEX) {
for(EnumFacing dir : EnumFacing.values()) {
int redstoneSide = world.getRedstonePower(pos.offset(dir), dir);
if(redstoneSide > 0)
redstone = true;
@@ -11,9 +11,11 @@
package vazkii.botania.common.core;
import net.minecraft.block.Block;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.NonNullList;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.Botania;
@@ -21,7 +23,6 @@ import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.ModFluffBlocks;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.material.ItemManaResource;
import vazkii.botania.common.lib.LibMisc;
import javax.annotation.Nonnull;
@@ -54,8 +55,9 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.lexicon);
addBlock(ModBlocks.flower);
addBlock(ModBlocks.specialFlower);
for(EnumDyeColor color : EnumDyeColor.values())
addItem(ModBlocks.getFlower(color));
addItem(ModBlocks.specialFlower);
ModItems.petals.values().forEach(this::addItem);
addItem(ModItems.pestleAndMortar);
ModItems.dyes.values().forEach(this::addItem);
@@ -88,11 +90,11 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.pebble);
addItem(ModItems.manaweaveCloth);
addItem(ModItems.manaPowder);
addBlock(ModBlocks.manasteelBlock);
addBlock(ModBlocks.terrasteelBlock);
addBlock(ModBlocks.elementiumBlock);
addBlock(ModBlocks.manaDiamondBlock);
addBlock(ModBlocks.dragonstoneBlock);
addItem(ModBlocks.manasteelBlock);
addItem(ModBlocks.terrasteelBlock);
addItem(ModBlocks.elementiumBlock);
addItem(ModBlocks.manaDiamondBlock);
addItem(ModBlocks.dragonstoneBlock);
addItem(ModItems.manaCookie);
addItem(ModItems.runeWater);
addItem(ModItems.runeFire);
@@ -110,7 +112,7 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.runeWrath);
addItem(ModItems.runeEnvy);
addItem(ModItems.runePride);
addBlock(ModBlocks.avatar);
addItem(ModBlocks.avatar);
addItem(ModItems.dirtRod);
addItem(ModItems.skyDirtRod);
addItem(ModItems.cobbleRod);
@@ -122,10 +124,10 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.waterRod);
addItem(ModItems.openBucket);
addItem(ModItems.rainbowRod);
addBlock(ModBlocks.bifrostPerm);
addBlock(ModFluffBlocks.bifrostPane);
addBlock(ModBlocks.shimmerrock);
addBlock(ModBlocks.shimmerwoodPlanks);
addItem(ModBlocks.bifrostPerm);
addItem(ModFluffBlocks.bifrostPane);
addItem(ModBlocks.shimmerrock);
addItem(ModBlocks.shimmerwoodPlanks);
addItem(ModItems.tornadoRod);
addItem(ModItems.fireRod);
addItem(ModItems.smeltRod);
@@ -140,7 +142,7 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.keepIvy);
addItem(ModItems.worldSeed);
addItem(ModItems.overgrowthSeed);
addBlock(ModBlocks.enchantedSoil);
addItem(ModBlocks.enchantedSoil);
addItem(ModItems.grassSeeds);
addItem(ModItems.podzolSeeds);
addItem(ModItems.mycelSeeds);
@@ -150,42 +152,42 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.scorchedSeeds);
addItem(ModItems.infusedSeeds);
addItem(ModItems.mutatedSeeds);
addBlock(ModBlocks.dryGrass);
addBlock(ModBlocks.goldenGrass);
addBlock(ModBlocks.vividGrass);
addBlock(ModBlocks.scorchedGrass);
addBlock(ModBlocks.infusedGrass);
addBlock(ModBlocks.mutatedGrass);
addItem(ModBlocks.dryGrass);
addItem(ModBlocks.goldenGrass);
addItem(ModBlocks.vividGrass);
addItem(ModBlocks.scorchedGrass);
addItem(ModBlocks.infusedGrass);
addItem(ModBlocks.mutatedGrass);
if(Botania.thaumcraftLoaded)
addItem(ModItems.manaInkwell);
addBlock(ModBlocks.wildDrum);
addBlock(ModBlocks.gatheringDrum);
addBlock(ModBlocks.canopyDrum);
addBlock(ModBlocks.forestEye);
addBlock(ModBlocks.enderEye);
addItem(ModBlocks.wildDrum);
addItem(ModBlocks.gatheringDrum);
addItem(ModBlocks.canopyDrum);
addItem(ModBlocks.forestEye);
addItem(ModBlocks.enderEye);
addItem(ModItems.enderHand);
addItem(ModItems.spellCloth);
addItem(ModItems.craftingHalo);
addItem(ModItems.autocraftingHalo);
addItem(ModItems.spawnerMover);
addBlock(ModBlocks.spawnerClaw);
addBlock(ModBlocks.cocoon);
addBlock(ModBlocks.teruTeruBozu);
addItem(ModBlocks.spawnerClaw);
addItem(ModBlocks.cocoon);
addItem(ModBlocks.teruTeruBozu);
addItem(ModItems.slimeBottle);
addItem(ModItems.sextant);
addItem(ModItems.astrolabe);
addItem(ModItems.blackHoleTalisman);
if(Botania.gardenOfGlassLoaded) {
addBlock(ModBlocks.root);
addItem(ModBlocks.root);
addItem(ModItems.waterBowl);
}
addBlock(ModBlocks.livingrock);
addBlock(ModBlocks.livingwood);
addItem(ModBlocks.livingrock);
addItem(ModBlocks.livingwood);
addBlock(ModBlocks.openCrate);
addBlock(ModBlocks.craftCrate);
addItem(ModBlocks.openCrate);
addItem(ModBlocks.craftCrate);
addItem(ModItems.craftPattern1_1);
addItem(ModItems.craftPattern2_2);
addItem(ModItems.craftPattern1_2);
@@ -196,53 +198,53 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.craftPattern3_2);
addItem(ModItems.craftPatternDonut);
addBlock(ModBlocks.abstrusePlatform);
addBlock(ModBlocks.spectralPlatform);
addBlock(ModBlocks.infrangiblePlatform);
addBlock(ModBlocks.alfPortal);
addBlock(ModBlocks.defaultAltar);
addBlock(ModBlocks.forestAltar);
addBlock(ModBlocks.plainsAltar);
addBlock(ModBlocks.mountainAltar);
addBlock(ModBlocks.fungalAltar);
addBlock(ModBlocks.swampAltar);
addBlock(ModBlocks.desertAltar);
addBlock(ModBlocks.taigaAltar);
addBlock(ModBlocks.mesaAltar);
addBlock(ModBlocks.mossyAltar);
addBlock(ModBlocks.runeAltar);
addBlock(ModBlocks.terraPlate);
addBlock(ModBlocks.brewery);
addItem(ModBlocks.abstrusePlatform);
addItem(ModBlocks.spectralPlatform);
addItem(ModBlocks.infrangiblePlatform);
addItem(ModBlocks.alfPortal);
addItem(ModBlocks.defaultAltar);
addItem(ModBlocks.forestAltar);
addItem(ModBlocks.plainsAltar);
addItem(ModBlocks.mountainAltar);
addItem(ModBlocks.fungalAltar);
addItem(ModBlocks.swampAltar);
addItem(ModBlocks.desertAltar);
addItem(ModBlocks.taigaAltar);
addItem(ModBlocks.mesaAltar);
addItem(ModBlocks.mossyAltar);
addItem(ModBlocks.runeAltar);
addItem(ModBlocks.terraPlate);
addItem(ModBlocks.brewery);
addItem(ModItems.vial);
addItem(ModItems.flask);
addItem(ModItems.brewVial);
addItem(ModItems.brewFlask);
addBlock(ModBlocks.incensePlate);
addItem(ModBlocks.incensePlate);
addItem(ModItems.incenseStick);
addItem(ModItems.bloodPendant);
addBlock(ModBlocks.felPumpkin);
addBlock(ModBlocks.manaPylon);
addBlock(ModBlocks.naturaPylon);
addBlock(ModBlocks.gaiaPylon);
addBlock(ModBlocks.pistonRelay);
addBlock(ModBlocks.hourglass);
addBlock(ModBlocks.animatedTorch);
addItem(ModBlocks.felPumpkin);
addItem(ModBlocks.manaPylon);
addItem(ModBlocks.naturaPylon);
addItem(ModBlocks.gaiaPylon);
addItem(ModBlocks.pistonRelay);
addItem(ModBlocks.hourglass);
addItem(ModBlocks.animatedTorch);
addBlock(ModBlocks.redStringContainer);
addBlock(ModBlocks.redStringDispenser);
addBlock(ModBlocks.redStringFertilizer);
addBlock(ModBlocks.redStringComparator);
addBlock(ModBlocks.redStringRelay);
addBlock(ModBlocks.redStringInterceptor);
addItem(ModBlocks.redStringContainer);
addItem(ModBlocks.redStringDispenser);
addItem(ModBlocks.redStringFertilizer);
addItem(ModBlocks.redStringComparator);
addItem(ModBlocks.redStringRelay);
addItem(ModBlocks.redStringInterceptor);
addBlock(ModBlocks.tinyPotato);
addBlock(ModBlocks.starfield);
addItem(ModBlocks.tinyPotato);
addItem(ModBlocks.starfield);
addBlock(ModBlocks.dreamwood);
addBlock(ModBlocks.manaGlass);
addBlock(ModFluffBlocks.managlassPane);
addBlock(ModBlocks.elfGlass);
addBlock(ModFluffBlocks.alfglassPane);
addItem(ModBlocks.dreamwood);
addItem(ModBlocks.manaGlass);
addItem(ModFluffBlocks.managlassPane);
addItem(ModBlocks.elfGlass);
addItem(ModFluffBlocks.alfglassPane);
addItem(ModItems.glassPick);
addItem(ModItems.manasteelPick);
@@ -312,7 +314,7 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.baubleBox);
addItem(ModItems.tinyPlanet);
addBlock(ModBlocks.tinyPlanet);
addItem(ModBlocks.tinyPlanet);
addItem(ModItems.manaRing);
addItem(ModItems.auraRing);
addItem(ModItems.manaRingGreater);
@@ -348,27 +350,27 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.manaTablet);
addItem(ModItems.manaMirror);
addItem(ModItems.manaBottle);
addBlock(ModBlocks.manaPool);
addBlock(ModBlocks.creativePool);
addBlock(ModBlocks.dilutedPool);
addBlock(ModBlocks.fabulousPool);
addBlock(ModBlocks.alchemyCatalyst);
addBlock(ModBlocks.conjurationCatalyst);
addBlock(ModBlocks.distributor);
addBlock(ModBlocks.manaVoid);
addBlock(ModBlocks.bellows);
addBlock(ModBlocks.manaDetector);
addBlock(ModBlocks.manaBomb);
addBlock(ModBlocks.ghostRail);
addItem(ModBlocks.manaPool);
addItem(ModBlocks.creativePool);
addItem(ModBlocks.dilutedPool);
addItem(ModBlocks.fabulousPool);
addItem(ModBlocks.alchemyCatalyst);
addItem(ModBlocks.conjurationCatalyst);
addItem(ModBlocks.distributor);
addItem(ModBlocks.manaVoid);
addItem(ModBlocks.bellows);
addItem(ModBlocks.manaDetector);
addItem(ModBlocks.manaBomb);
addItem(ModBlocks.ghostRail);
addItem(ModItems.poolMinecart);
addBlock(ModBlocks.pump);
addBlock(ModBlocks.rfGenerator);
addBlock(ModBlocks.manaSpreader);
addBlock(ModBlocks.redstoneSpreader);
addBlock(ModBlocks.elvenSpreader);
addBlock(ModBlocks.gaiaSpreader);
addBlock(ModBlocks.turntable);
addBlock(ModBlocks.prism);
addItem(ModBlocks.pump);
addItem(ModBlocks.rfGenerator);
addItem(ModBlocks.manaSpreader);
addItem(ModBlocks.redstoneSpreader);
addItem(ModBlocks.elvenSpreader);
addItem(ModBlocks.gaiaSpreader);
addItem(ModBlocks.turntable);
addItem(ModBlocks.prism);
addItem(ModItems.lensNormal);
addItem(ModItems.lensSpeed);
addItem(ModItems.lensPower);
@@ -400,81 +402,87 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.sparkUpgradeDominant);
addItem(ModItems.sparkUpgradeRecessive);
addItem(ModItems.sparkUpgradeIsolated);
addBlock(ModBlocks.sparkChanger);
addItem(ModBlocks.sparkChanger);
addItem(ModItems.corporeaSpark);
addItem(ModItems.corporeaSparkMaster);
addBlock(ModBlocks.corporeaIndex);
addBlock(ModBlocks.corporeaFunnel);
addBlock(ModBlocks.corporeaInterceptor);
addBlock(ModBlocks.corporeaRetainer);
addBlock(ModBlocks.corporeaCrystalCube);
addBlock(ModBlocks.lightRelay);
addBlock(ModBlocks.lightLauncher);
addBlock(ModBlocks.cellBlock);
addItem(ModBlocks.corporeaIndex);
addItem(ModBlocks.corporeaFunnel);
addItem(ModBlocks.corporeaInterceptor);
addItem(ModBlocks.corporeaRetainer);
addItem(ModBlocks.corporeaCrystalCube);
addItem(ModBlocks.lightRelayDefault);
addItem(ModBlocks.lightRelayDetector);
addItem(ModBlocks.lightRelayFork);
addItem(ModBlocks.lightRelayToggle);
addItem(ModBlocks.lightLauncher);
addItem(ModBlocks.cellBlock);
// FLUFF
addBlock(ModBlocks.doubleFlower1);
addBlock(ModBlocks.doubleFlower2);
addBlock(ModBlocks.shinyFlower);
addBlock(ModBlocks.floatingFlower);
addBlock(ModBlocks.floatingSpecialFlower);
addBlock(ModBlocks.petalBlockWhite);
addBlock(ModBlocks.petalBlockOrange);
addBlock(ModBlocks.petalBlockMagenta);
addBlock(ModBlocks.petalBlockLightBlue);
addBlock(ModBlocks.petalBlockYellow);
addBlock(ModBlocks.petalBlockLime);
addBlock(ModBlocks.petalBlockPink);
addBlock(ModBlocks.petalBlockGray);
addBlock(ModBlocks.petalBlockSilver);
addBlock(ModBlocks.petalBlockCyan);
addBlock(ModBlocks.petalBlockPurple);
addBlock(ModBlocks.petalBlockBlue);
addBlock(ModBlocks.petalBlockBrown);
addBlock(ModBlocks.petalBlockGreen);
addBlock(ModBlocks.petalBlockRed);
addBlock(ModBlocks.petalBlockBlack);
addBlock(ModBlocks.mushroom);
for(EnumDyeColor color : EnumDyeColor.values())
addItem(ModBlocks.getDoubleFlower(color));
for(EnumDyeColor color : EnumDyeColor.values())
addItem(ModBlocks.getShinyFlower(color));
for(EnumDyeColor color : EnumDyeColor.values())
addItem(ModBlocks.getFloatingFlower(color));
addItem(ModBlocks.floatingSpecialFlower);
addItem(ModBlocks.petalBlockWhite);
addItem(ModBlocks.petalBlockOrange);
addItem(ModBlocks.petalBlockMagenta);
addItem(ModBlocks.petalBlockLightBlue);
addItem(ModBlocks.petalBlockYellow);
addItem(ModBlocks.petalBlockLime);
addItem(ModBlocks.petalBlockPink);
addItem(ModBlocks.petalBlockGray);
addItem(ModBlocks.petalBlockSilver);
addItem(ModBlocks.petalBlockCyan);
addItem(ModBlocks.petalBlockPurple);
addItem(ModBlocks.petalBlockBlue);
addItem(ModBlocks.petalBlockBrown);
addItem(ModBlocks.petalBlockGreen);
addItem(ModBlocks.petalBlockRed);
addItem(ModBlocks.petalBlockBlack);
for(EnumDyeColor color : EnumDyeColor.values())
addItem(ModBlocks.getMushroom(color));
addBlock(ModBlocks.blazeBlock);
addItem(ModBlocks.blazeBlock);
addBlock(ModBlocks.azulejo0);
addBlock(ModBlocks.azulejo1);
addBlock(ModBlocks.azulejo2);
addBlock(ModBlocks.azulejo3);
addBlock(ModBlocks.azulejo4);
addBlock(ModBlocks.azulejo5);
addBlock(ModBlocks.azulejo6);
addBlock(ModBlocks.azulejo7);
addBlock(ModBlocks.azulejo8);
addBlock(ModBlocks.azulejo9);
addBlock(ModBlocks.azulejo10);
addBlock(ModBlocks.azulejo11);
addBlock(ModBlocks.azulejo12);
addBlock(ModBlocks.azulejo13);
addBlock(ModBlocks.azulejo14);
addBlock(ModBlocks.azulejo15);
addItem(ModBlocks.azulejo0);
addItem(ModBlocks.azulejo1);
addItem(ModBlocks.azulejo2);
addItem(ModBlocks.azulejo3);
addItem(ModBlocks.azulejo4);
addItem(ModBlocks.azulejo5);
addItem(ModBlocks.azulejo6);
addItem(ModBlocks.azulejo7);
addItem(ModBlocks.azulejo8);
addItem(ModBlocks.azulejo9);
addItem(ModBlocks.azulejo10);
addItem(ModBlocks.azulejo11);
addItem(ModBlocks.azulejo12);
addItem(ModBlocks.azulejo13);
addItem(ModBlocks.azulejo14);
addItem(ModBlocks.azulejo15);
addBlock(ModFluffBlocks.livingwoodStairs);
addBlock(ModFluffBlocks.livingwoodSlab);
addBlock(ModFluffBlocks.livingwoodWall);
addBlock(ModFluffBlocks.livingwoodPlankStairs);
addBlock(ModFluffBlocks.livingwoodPlankSlab);
addBlock(ModFluffBlocks.livingrockStairs);
addBlock(ModFluffBlocks.livingrockSlab);
addBlock(ModFluffBlocks.livingrockWall);
addBlock(ModFluffBlocks.livingrockBrickStairs);
addBlock(ModFluffBlocks.livingrockBrickSlab);
addBlock(ModFluffBlocks.dreamwoodStairs);
addBlock(ModFluffBlocks.dreamwoodSlab);
addBlock(ModFluffBlocks.dreamwoodWall);
addBlock(ModFluffBlocks.dreamwoodPlankStairs);
addBlock(ModFluffBlocks.dreamwoodPlankSlab);
addBlock(ModFluffBlocks.shimmerwoodPlankStairs);
addBlock(ModFluffBlocks.shimmerwoodPlankSlab);
addBlock(ModFluffBlocks.shimmerrockStairs);
addBlock(ModFluffBlocks.shimmerrockSlab);
addItem(ModFluffBlocks.livingwoodStairs);
addItem(ModFluffBlocks.livingwoodSlab);
addItem(ModFluffBlocks.livingwoodWall);
addItem(ModFluffBlocks.livingwoodPlankStairs);
addItem(ModFluffBlocks.livingwoodPlankSlab);
addItem(ModFluffBlocks.livingrockStairs);
addItem(ModFluffBlocks.livingrockSlab);
addItem(ModFluffBlocks.livingrockWall);
addItem(ModFluffBlocks.livingrockBrickStairs);
addItem(ModFluffBlocks.livingrockBrickSlab);
addItem(ModFluffBlocks.dreamwoodStairs);
addItem(ModFluffBlocks.dreamwoodSlab);
addItem(ModFluffBlocks.dreamwoodWall);
addItem(ModFluffBlocks.dreamwoodPlankStairs);
addItem(ModFluffBlocks.dreamwoodPlankSlab);
addItem(ModFluffBlocks.shimmerwoodPlankStairs);
addItem(ModFluffBlocks.shimmerwoodPlankSlab);
addItem(ModFluffBlocks.shimmerrockStairs);
addItem(ModFluffBlocks.shimmerrockSlab);
addItem(ModItems.darkQuartz);
addItem(ModItems.manaQuartz);
@@ -484,52 +492,59 @@ public final class BotaniaCreativeTab extends ItemGroup {
addItem(ModItems.elfQuartz);
addItem(ModItems.sunnyQuartz);
addBlock(ModFluffBlocks.darkQuartz);
addBlock(ModFluffBlocks.darkQuartzSlab);
addBlock(ModFluffBlocks.darkQuartzStairs);
addItem(ModFluffBlocks.darkQuartz);
addItem(ModFluffBlocks.darkQuartzSlab);
addItem(ModFluffBlocks.darkQuartzStairs);
addBlock(ModFluffBlocks.manaQuartz);
addBlock(ModFluffBlocks.manaQuartzSlab);
addBlock(ModFluffBlocks.manaQuartzStairs);
addBlock(ModFluffBlocks.blazeQuartz);
addBlock(ModFluffBlocks.blazeQuartzSlab);
addBlock(ModFluffBlocks.blazeQuartzStairs);
addBlock(ModFluffBlocks.lavenderQuartz);
addBlock(ModFluffBlocks.lavenderQuartzSlab);
addBlock(ModFluffBlocks.lavenderQuartzStairs);
addBlock(ModFluffBlocks.redQuartz);
addBlock(ModFluffBlocks.redQuartzSlab);
addBlock(ModFluffBlocks.redQuartzStairs);
addBlock(ModFluffBlocks.elfQuartz);
addBlock(ModFluffBlocks.elfQuartzSlab);
addBlock(ModFluffBlocks.elfQuartzStairs);
addBlock(ModFluffBlocks.sunnyQuartz);
addBlock(ModFluffBlocks.sunnyQuartzSlab);
addBlock(ModFluffBlocks.sunnyQuartzStairs);
addItem(ModFluffBlocks.manaQuartz);
addItem(ModFluffBlocks.manaQuartzSlab);
addItem(ModFluffBlocks.manaQuartzStairs);
addItem(ModFluffBlocks.blazeQuartz);
addItem(ModFluffBlocks.blazeQuartzSlab);
addItem(ModFluffBlocks.blazeQuartzStairs);
addItem(ModFluffBlocks.lavenderQuartz);
addItem(ModFluffBlocks.lavenderQuartzSlab);
addItem(ModFluffBlocks.lavenderQuartzStairs);
addItem(ModFluffBlocks.redQuartz);
addItem(ModFluffBlocks.redQuartzSlab);
addItem(ModFluffBlocks.redQuartzStairs);
addItem(ModFluffBlocks.elfQuartz);
addItem(ModFluffBlocks.elfQuartzSlab);
addItem(ModFluffBlocks.elfQuartzStairs);
addItem(ModFluffBlocks.sunnyQuartz);
addItem(ModFluffBlocks.sunnyQuartzSlab);
addItem(ModFluffBlocks.sunnyQuartzStairs);
addBlock(ModFluffBlocks.biomeStoneA);
addBlock(ModFluffBlocks.biomeStoneB);
/* todo 1.13 cba to type this all out rn
addItem(ModFluffBlocks.biomeStoneA);
addItem(ModFluffBlocks.biomeStoneB);
for(int i = 0; i < 24; i++)
addBlock(ModFluffBlocks.biomeStoneStairs[i]);
addItem(ModFluffBlocks.biomeStoneStairs[i]);
for(int i = 0; i < 24; i++)
addBlock(ModFluffBlocks.biomeStoneSlabs[i]);
addBlock(ModFluffBlocks.biomeStoneWall);
addItem(ModFluffBlocks.biomeStoneSlabs[i]);
addItem(ModFluffBlocks.biomeStoneWall);
*/
addBlock(ModFluffBlocks.pavement);
for (Block pavementStair : ModFluffBlocks.pavementStairs)
addBlock(pavementStair);
for (Block pavementSlab : ModFluffBlocks.pavementSlabs)
addBlock(pavementSlab);
addItem(ModFluffBlocks.whitePavement);
addItem(ModFluffBlocks.blackPavement);
addItem(ModFluffBlocks.bluePavement);
addItem(ModFluffBlocks.yellowPavement);
addItem(ModFluffBlocks.redPavement);
addItem(ModFluffBlocks.whitePavementStair);
addItem(ModFluffBlocks.blackPavementStair);
addItem(ModFluffBlocks.bluePavementStair);
addItem(ModFluffBlocks.yellowPavementStair);
addItem(ModFluffBlocks.redPavementStair);
addItem(ModFluffBlocks.whitePavementSlab);
addItem(ModFluffBlocks.blackPavementSlab);
addItem(ModFluffBlocks.bluePavementSlab);
addItem(ModFluffBlocks.yellowPavementSlab);
addItem(ModFluffBlocks.redPavementSlab);
ModItems.cosmetics.values().forEach(this::addItem);
}
private void addItem(Item item) {
item.fillItemGroup(this, list);
private void addItem(IItemProvider item) {
item.asItem().fillItemGroup(this, list);
}
private void addBlock(Block block) {
block.fillItemGroup(this, list);
}
}
@@ -11,9 +11,11 @@
package vazkii.botania.common.core.helper;
import net.minecraft.entity.Entity;
import net.minecraft.util.EnumFacing;
import vazkii.botania.api.internal.VanillaPacketDispatcher;
public final class MathHelper {
public static final EnumFacing[] HORIZONTALS = { EnumFacing.SOUTH, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.EAST };
public static float pointDistanceSpace(double x1, double y1, double z1, double x2, double y2, double z2) {
return (float) Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) + (z1 - z2) * (z1 - z2));
}
@@ -45,7 +45,7 @@ public class ThreadDownloadMod extends Thread {
@Override
public void run() {
try {
ITextComponent component = ITextComponent.Serializer.jsonToComponent(I18n.format("botania.versioning.startingDownload", fileName));
ITextComponent component = ITextComponent.Serializer.fromJson(I18n.format("botania.versioning.startingDownload", fileName));
if(Minecraft.getInstance().player != null)
Minecraft.getInstance().player.sendMessage(component);
@@ -14,6 +14,8 @@ import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.tags.ItemTags;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.recipe.RecipeManaInfusion;
import vazkii.botania.common.Botania;
@@ -56,119 +58,117 @@ public final class ModManaAlchemyRecipes {
public static List<RecipeManaInfusion> prismarineRecipes;
public static void init() {
leatherRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.LEATHER), new ItemStack(Items.ROTTEN_FLESH), 600);
leatherRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.LEATHER), Ingredient.fromItems(Items.ROTTEN_FLESH), 600);
woodRecipes = new ArrayList<>();
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.SPRUCE_LOG), new ItemStack(Blocks.OAK_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.BIRCH_LOG), new ItemStack(Blocks.SPRUCE_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.JUNGLE_LOG), new ItemStack(Blocks.BIRCH_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ACACIA_LOG), new ItemStack(Blocks.JUNGLE_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DARK_OAK_LOG), new ItemStack(Blocks.ACACIA_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.OAK_LOG), new ItemStack(Blocks.DARK_OAK_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.SPRUCE_LOG), Ingredient.fromItems(Blocks.OAK_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.BIRCH_LOG), Ingredient.fromItems(Blocks.SPRUCE_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.JUNGLE_LOG), Ingredient.fromItems(Blocks.BIRCH_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ACACIA_LOG), Ingredient.fromItems(Blocks.JUNGLE_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DARK_OAK_LOG), Ingredient.fromItems(Blocks.ACACIA_LOG), 40));
woodRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.OAK_LOG), Ingredient.fromItems(Blocks.DARK_OAK_LOG), 40));
saplingRecipes = new ArrayList<>();
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.SPRUCE_SAPLING), new ItemStack(Blocks.OAK_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.BIRCH_SAPLING), new ItemStack(Blocks.SPRUCE_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.JUNGLE_SAPLING), new ItemStack(Blocks.BIRCH_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ACACIA_SAPLING), new ItemStack(Blocks.JUNGLE_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DARK_OAK_SAPLING), new ItemStack(Blocks.ACACIA_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.OAK_SAPLING), new ItemStack(Blocks.DARK_OAK_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.SPRUCE_SAPLING), Ingredient.fromItems(Blocks.OAK_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.BIRCH_SAPLING), Ingredient.fromItems(Blocks.SPRUCE_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.JUNGLE_SAPLING), Ingredient.fromItems(Blocks.BIRCH_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ACACIA_SAPLING), Ingredient.fromItems(Blocks.JUNGLE_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DARK_OAK_SAPLING), Ingredient.fromItems(Blocks.ACACIA_SAPLING), 120));
saplingRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.OAK_SAPLING), Ingredient.fromItems(Blocks.DARK_OAK_SAPLING), 120));
glowstoneDustRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.GLOWSTONE_DUST, 4), new ItemStack(Blocks.GLOWSTONE), 25);
glowstoneDustRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.GLOWSTONE_DUST, 4), Ingredient.fromItems(Blocks.GLOWSTONE), 25);
quartzRecipes = new ArrayList<>();
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.QUARTZ, 4), new ItemStack(Blocks.QUARTZ_BLOCK), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.darkQuartz, 4), new ItemStack(ModFluffBlocks.darkQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.manaQuartz, 4), new ItemStack(ModFluffBlocks.manaQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.blazeQuartz, 4), new ItemStack(ModFluffBlocks.blazeQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.lavenderQuartz, 4), new ItemStack(ModFluffBlocks.lavenderQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.redQuartz, 4), new ItemStack(ModFluffBlocks.redQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.elfQuartz, 4), new ItemStack(ModFluffBlocks.elfQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.QUARTZ, 4), Ingredient.fromItems(Blocks.QUARTZ_BLOCK), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.darkQuartz, 4), Ingredient.fromItems(ModFluffBlocks.darkQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.manaQuartz, 4), Ingredient.fromItems(ModFluffBlocks.manaQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.blazeQuartz, 4), Ingredient.fromItems(ModFluffBlocks.blazeQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.lavenderQuartz, 4), Ingredient.fromItems(ModFluffBlocks.lavenderQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.redQuartz, 4), Ingredient.fromItems(ModFluffBlocks.redQuartz), 25));
quartzRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.elfQuartz, 4), Ingredient.fromItems(ModFluffBlocks.elfQuartz), 25));
chiseledBrickRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.CHISELED_STONE_BRICKS, 1), new ItemStack(Blocks.STONE_BRICKS), 150);
iceRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ICE), new ItemStack(Blocks.SNOW), 2250);
chiseledBrickRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.CHISELED_STONE_BRICKS, 1), Ingredient.fromItems(Blocks.STONE_BRICKS), 150);
iceRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ICE), Ingredient.fromItems(Blocks.SNOW), 2250);
swampFolliageRecipes = new ArrayList<>();
swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LILY_PAD), new ItemStack(Blocks.VINE), 320));
swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.VINE), new ItemStack(Blocks.LILY_PAD), 320));
swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LILY_PAD), Ingredient.fromItems(Blocks.VINE), 320));
swampFolliageRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.VINE), Ingredient.fromItems(Blocks.LILY_PAD), 320));
fishRecipes = new ArrayList<>();
for(int i = 0; i < 4; i++)
fishRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.FISH, 1, i == 3 ? 0 : i + 1), new ItemStack(Items.FISH, 1, i), 200));
// todo 1.13 fishRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.FISH, 1, i == 3 ? 0 : i + 1), Ingredient.fromTag(ItemTags.FISHES), 200));
cropRecipes = new ArrayList<>();
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.WHEAT_SEEDS), new ItemStack(Items.COCOA_BEANS), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.POTATO), new ItemStack(Items.WHEAT), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.CARROT), new ItemStack(Items.POTATO), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.BEETROOT_SEEDS), new ItemStack(Items.CARROT), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.MELON_SEEDS), new ItemStack(Items.BEETROOT_SEEDS), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.PUMPKIN_SEEDS), new ItemStack(Items.MELON_SEEDS), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.COCOA_BEANS), new ItemStack(Items.PUMPKIN_SEEDS), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.WHEAT_SEEDS), Ingredient.fromItems(Items.COCOA_BEANS), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.POTATO), Ingredient.fromItems(Items.WHEAT), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.CARROT), Ingredient.fromItems(Items.POTATO), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.BEETROOT_SEEDS), Ingredient.fromItems(Items.CARROT), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.MELON_SEEDS), Ingredient.fromItems(Items.BEETROOT_SEEDS), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.PUMPKIN_SEEDS), Ingredient.fromItems(Items.MELON_SEEDS), 6000));
cropRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.COCOA_BEANS), Ingredient.fromItems(Items.PUMPKIN_SEEDS), 6000));
potatoRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.POTATO), new ItemStack(Items.POISONOUS_POTATO), 1200);
netherWartRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.NETHER_WART), new ItemStack(Items.BLAZE_ROD), 4000);
potatoRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.POTATO), Ingredient.fromItems(Items.POISONOUS_POTATO), 1200);
netherWartRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.NETHER_WART), Ingredient.fromItems(Items.BLAZE_ROD), 4000);
gunpowderAndFlintRecipes = new ArrayList<>();
gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.FLINT), new ItemStack(Items.GUNPOWDER), 200));
gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.GUNPOWDER), new ItemStack(Items.FLINT), 200));
gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.FLINT), Ingredient.fromItems(Items.GUNPOWDER), 200));
gunpowderAndFlintRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.GUNPOWDER), Ingredient.fromItems(Items.FLINT), 200));
nameTagRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.NAME_TAG), new ItemStack(Items.WRITABLE_BOOK), 16000);
nameTagRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.NAME_TAG), Ingredient.fromItems(Items.WRITABLE_BOOK), 16000);
stringRecipes = new ArrayList<>();
for(int i = 0; i < 16; i++)
stringRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.STRING, 3), new ItemStack(Blocks.WOOL, 1, i), 100));
stringRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.STRING, 3), Ingredient.fromTag(ItemTags.WOOL), 100));
slimeballCactusRecipes = new ArrayList<>();
slimeballCactusRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.SLIME_BALL), new ItemStack(Blocks.CACTUS), 1200));
slimeballCactusRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.CACTUS), new ItemStack(Items.SLIME_BALL), 1200));
slimeballCactusRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.SLIME_BALL), Ingredient.fromItems(Blocks.CACTUS), 1200));
slimeballCactusRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.CACTUS), Ingredient.fromItems(Items.SLIME_BALL), 1200));
enderPearlRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.ENDER_PEARL), new ItemStack(Items.GHAST_TEAR), 28000);
enderPearlRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.ENDER_PEARL), Ingredient.fromItems(Items.GHAST_TEAR), 28000);
redstoneToGlowstoneRecipes = new ArrayList<>();
redstoneToGlowstoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.REDSTONE), new ItemStack(Items.GLOWSTONE_DUST), 300));
redstoneToGlowstoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.GLOWSTONE_DUST), new ItemStack(Items.REDSTONE), 300));
redstoneToGlowstoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.REDSTONE), Ingredient.fromItems(Items.GLOWSTONE_DUST), 300));
redstoneToGlowstoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.GLOWSTONE_DUST), Ingredient.fromItems(Items.REDSTONE), 300));
sandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.SAND), new ItemStack(Blocks.COBBLESTONE), 50);
redSandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_SAND), new ItemStack(Blocks.TERRACOTTA), 50);
sandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.SAND), Ingredient.fromItems(Blocks.COBBLESTONE), 50);
redSandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_SAND), Ingredient.fromItems(Blocks.TERRACOTTA), 50);
clayBreakdownRecipes = new ArrayList<>();
clayBreakdownRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.CLAY_BALL, 4), new ItemStack(Blocks.CLAY), 25));
clayBreakdownRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.BRICK, 4), new ItemStack(Blocks.BRICKS), 25));
clayBreakdownRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.CLAY_BALL, 4), Ingredient.fromItems(Blocks.CLAY), 25));
clayBreakdownRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.BRICK, 4), Ingredient.fromItems(Blocks.BRICKS), 25));
coarseDirtRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.COARSE_DIRT), new ItemStack(Blocks.DIRT), 120);
coarseDirtRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.COARSE_DIRT), Ingredient.fromItems(Blocks.DIRT), 120);
stoneRecipes = new ArrayList<>();
stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ANDESITE), new ItemStack(Blocks.STONE), 200));
stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DIORITE), new ItemStack(Blocks.ANDESITE), 200));
stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.GRANITE), new ItemStack(Blocks.DIORITE), 200));
stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ANDESITE), new ItemStack(Blocks.GRANITE), 200));
stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ANDESITE), Ingredient.fromItems(Blocks.STONE), 200));
stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DIORITE), Ingredient.fromItems(Blocks.ANDESITE), 200));
stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.GRANITE), Ingredient.fromItems(Blocks.DIORITE), 200));
stoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ANDESITE), Ingredient.fromItems(Blocks.GRANITE), 200));
tallgrassRecipes = new ArrayList<>();
tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DEAD_BUSH), new ItemStack(Blocks.FERN), 500));
tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.GRASS), new ItemStack(Blocks.DEAD_BUSH), 500));
tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.FERN), new ItemStack(Blocks.GRASS), 500));
tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DEAD_BUSH), Ingredient.fromItems(Blocks.FERN), 500));
tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.GRASS), Ingredient.fromItems(Blocks.DEAD_BUSH), 500));
tallgrassRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.FERN), Ingredient.fromItems(Blocks.GRASS), 500));
flowersRecipes = new ArrayList<>();
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.POPPY), new ItemStack(Blocks.DANDELION), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.BLUE_ORCHID), new ItemStack(Blocks.POPPY), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ALLIUM), new ItemStack(Blocks.BLUE_ORCHID), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.AZURE_BLUET), new ItemStack(Blocks.ALLIUM), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_TULIP), new ItemStack(Blocks.AZURE_BLUET), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ORANGE_TULIP), new ItemStack(Blocks.RED_TULIP), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.WHITE_TULIP), new ItemStack(Blocks.ORANGE_TULIP), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.PINK_TULIP), new ItemStack(Blocks.WHITE_TULIP), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.OXEYE_DAISY), new ItemStack(Blocks.PINK_TULIP), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.SUNFLOWER), new ItemStack(Blocks.OXEYE_DAISY), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LILAC), new ItemStack(Blocks.SUNFLOWER), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ROSE_BUSH), new ItemStack(Blocks.LILAC), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.PEONY), new ItemStack(Blocks.ROSE_BUSH), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DANDELION), new ItemStack(Blocks.PEONY), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.POPPY), Ingredient.fromItems(Blocks.DANDELION), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.BLUE_ORCHID), Ingredient.fromItems(Blocks.POPPY), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ALLIUM), Ingredient.fromItems(Blocks.BLUE_ORCHID), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.AZURE_BLUET), Ingredient.fromItems(Blocks.ALLIUM), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.RED_TULIP), Ingredient.fromItems(Blocks.AZURE_BLUET), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ORANGE_TULIP), Ingredient.fromItems(Blocks.RED_TULIP), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.WHITE_TULIP), Ingredient.fromItems(Blocks.ORANGE_TULIP), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.PINK_TULIP), Ingredient.fromItems(Blocks.WHITE_TULIP), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.OXEYE_DAISY), Ingredient.fromItems(Blocks.PINK_TULIP), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.SUNFLOWER), Ingredient.fromItems(Blocks.OXEYE_DAISY), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.LILAC), Ingredient.fromItems(Blocks.SUNFLOWER), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.ROSE_BUSH), Ingredient.fromItems(Blocks.LILAC), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.PEONY), Ingredient.fromItems(Blocks.ROSE_BUSH), 400));
flowersRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.DANDELION), Ingredient.fromItems(Blocks.PEONY), 400));
chorusRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.CHORUS_FLOWER), new ItemStack(Items.POPPED_CHORUS_FRUIT), 10000);
chorusRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.CHORUS_FLOWER), Ingredient.fromItems(Items.POPPED_CHORUS_FRUIT), 10000);
if(Botania.gardenOfGlassLoaded) {
prismarineRecipes = new ArrayList<>();
prismarineRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.PRISMARINE_SHARD), new ItemStack(Items.QUARTZ), 1000));
prismarineRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.PRISMARINE_CRYSTALS), new ItemStack(Items.PRISMARINE_SHARD), 500));
prismarineRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.PRISMARINE_SHARD), Ingredient.fromItems(Items.QUARTZ), 1000));
prismarineRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.PRISMARINE_CRYSTALS), Ingredient.fromItems(Items.PRISMARINE_SHARD), 500));
}
}
}
@@ -12,6 +12,9 @@ package vazkii.botania.common.crafting;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.ResourceLocation;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.recipe.RecipePetals;
import vazkii.botania.common.Botania;
@@ -19,14 +22,13 @@ import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.core.helper.ItemNBTHelper;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.lib.LibMisc;
import vazkii.botania.common.lib.LibOreDict;
import java.util.Arrays;
public final class ModPetalRecipes {
public static final String white = LibOreDict.PETAL[0], orange = LibOreDict.PETAL[1], magenta = LibOreDict.PETAL[2], lightBlue = LibOreDict.PETAL[3], yellow = LibOreDict.PETAL[4], lime = LibOreDict.PETAL[5], pink = LibOreDict.PETAL[6], gray = LibOreDict.PETAL[7], lightGray = LibOreDict.PETAL[8], cyan = LibOreDict.PETAL[9], purple = LibOreDict.PETAL[10], blue = LibOreDict.PETAL[11], brown = LibOreDict.PETAL[12], green = LibOreDict.PETAL[13], red = LibOreDict.PETAL[14], black = LibOreDict.PETAL[15];
public static final String runeWater = LibOreDict.RUNE[0], runeFire = LibOreDict.RUNE[1], runeEarth = LibOreDict.RUNE[2], runeAir = LibOreDict.RUNE[3], runeSpring = LibOreDict.RUNE[4], runeSummer = LibOreDict.RUNE[5], runeAutumn = LibOreDict.RUNE[6], runeWinter = LibOreDict.RUNE[7], runeMana = LibOreDict.RUNE[8], runeLust = LibOreDict.RUNE[9], runeGluttony = LibOreDict.RUNE[10], runeGreed = LibOreDict.RUNE[11], runeSloth = LibOreDict.RUNE[12], runeWrath = LibOreDict.RUNE[13], runeEnvy = LibOreDict.RUNE[14], runePride = LibOreDict.RUNE[15];
public static final String redstoneRoot = LibOreDict.REDSTONE_ROOT;
public static final String pixieDust = LibOreDict.PIXIE_DUST;
public static final String gaiaSpirit = LibOreDict.LIFE_ESSENCE;
@@ -35,8 +37,6 @@ public final class ModPetalRecipes {
public static RecipePetals pureDaisyRecipe;
public static RecipePetals manastarRecipe;
public static RecipePetals daybloomRecipe;
public static RecipePetals nightshadeRecipe;
public static RecipePetals endoflameRecipe;
public static RecipePetals hydroangeasRecipe;
public static RecipePetals thermalilyRecipe;
@@ -79,6 +79,39 @@ public final class ModPetalRecipes {
public static RecipePetals bergamuteRecipe;
public static void init() {
Ingredient white = tagIngr("petals/white");
Ingredient orange = tagIngr("petals/orange");
Ingredient magenta = tagIngr("petals/magenta");
Ingredient lightBlue = tagIngr("petals/light_blue");
Ingredient yellow = tagIngr("petals/yellow");
Ingredient lime = tagIngr("petals/lime");
Ingredient pink = tagIngr("petals/pink");
Ingredient gray = tagIngr("petals/gray");
Ingredient lightGray = tagIngr("petals/light_gray");
Ingredient cyan = tagIngr("petals/cyan");
Ingredient purple = tagIngr("petals/purple");
Ingredient blue = tagIngr("petals/blue");
Ingredient brown = tagIngr("petals/brown");
Ingredient green = tagIngr("petals/green");
Ingredient red = tagIngr("petals/red");
Ingredient black = tagIngr("petals/black");
Ingredient runeWater = tagIngr("runes/water");
Ingredient runeFire = tagIngr("runes/fire");
Ingredient runeEarth = tagIngr("runes/earth");
Ingredient runeAir = tagIngr("runes/air");
Ingredient runeSpring = tagIngr("runes/spring");
Ingredient runeSummer = tagIngr("runes/summer");
Ingredient runeAutumn = tagIngr("runes/autumn");
Ingredient runeWinter = tagIngr("runes/winter");
Ingredient runeMana = tagIngr("runes/mana");
Ingredient runeLust = tagIngr("runes/lust");
Ingredient runeGluttony = tagIngr("runes/gluttony");
Ingredient runeGreed = tagIngr("runes/greed");
Ingredient runeSloth = tagIngr("runes/sloth");
Ingredient runeWrath = tagIngr("runes/wrath");
Ingredient runeEnvy = tagIngr("runes/envy");
Ingredient runePride = tagIngr("runes/pride");
pureDaisyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY), white, white, white, white);
manastarRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MANASTAR), lightBlue, green, red, cyan);
@@ -130,8 +163,12 @@ public final class ModPetalRecipes {
ItemStack stack = new ItemStack(Items.PLAYER_HEAD);
ItemNBTHelper.setString(stack, "SkullOwner", "Vazkii");
Object[] inputs = new Object[16];
Ingredient[] inputs = new Ingredient[16];
Arrays.fill(inputs, pink);
BotaniaAPI.registerPetalRecipe(stack, inputs);
}
private static Ingredient tagIngr(String tag) {
return Ingredient.fromTag(new ItemTags.Wrapper(new ResourceLocation(LibMisc.MOD_ID, tag)));
}
}
@@ -131,7 +131,7 @@ public class EntityPoolMinecart extends EntityMinecart {
public void moveMinecartOnRail(BlockPos pos) {
super.moveMinecartOnRail(pos);
for(EnumFacing dir : EnumFacing.BY_HORIZONTAL_INDEX) {
for(EnumFacing dir : vazkii.botania.common.core.helper.MathHelper.HORIZONTALS) {
BlockPos posP = pos.offset(dir);
Block block = world.getBlockState(posP).getBlock();
if(block == ModBlocks.pump) {
@@ -22,7 +22,10 @@ import net.minecraft.client.resources.I18n;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
@@ -36,16 +39,20 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IInteractionObject;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.crafting.VanillaRecipeTypes;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
@@ -62,6 +69,7 @@ import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.lib.LibGuiIDs;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Arrays;
public class ItemCraftingHalo extends ItemMod {
@@ -79,7 +87,10 @@ public class ItemCraftingHalo extends ItemMod {
public ItemCraftingHalo(Properties props) {
super(props);
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.addListener(this::onItemCrafted);
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
MinecraftForge.EVENT_BUS.addListener(this::onRenderWorldLast);
});
}
@Nonnull
@@ -89,14 +100,19 @@ public class ItemCraftingHalo extends ItemMod {
int segment = getSegmentLookedAt(stack, player);
ItemStack itemForPos = getItemForSlot(stack, segment);
if(segment == 0)
player.openGui(Botania.instance, LibGuiIDs.CRAFTING_HALO, world, hand == EnumHand.OFF_HAND ? 1 : 0, 0, 0);
else {
if(itemForPos.isEmpty())
assignRecipe(stack, itemForPos, segment);
else tryCraft(player, stack, segment, true, getFakeInv(player), true);
if(!world.isRemote) {
if(segment == 0) {
NetworkHooks.openGui((EntityPlayerMP) player, new ContainerProvider(world), buf -> {
buf.writeBoolean(hand == EnumHand.OFF_HAND);
});
} else {
if(itemForPos.isEmpty())
assignRecipe(stack, itemForPos, segment);
else tryCraft(player, stack, segment, true, getFakeInv(player), true);
}
}
return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
}
@@ -126,7 +142,7 @@ public class ItemCraftingHalo extends ItemMod {
if(!equipped) {
int angles = 360;
int segAngles = angles / SEGMENTS;
float shift = segAngles / 2;
float shift = segAngles / 2.0F;
setRotationBase(stack, getCheckingAngle((EntityLivingBase) entity) - shift);
}
}
@@ -242,7 +258,6 @@ public class ItemCraftingHalo extends ItemMod {
}
private static int getSegmentLookedAt(ItemStack stack, EntityLivingBase player) {
getRotationBase(stack);
float yaw = getCheckingAngle(player, getRotationBase(stack));
int angles = 360;
@@ -278,7 +293,7 @@ public class ItemCraftingHalo extends ItemMod {
return angle;
}
public static ItemStack getItemForSlot(ItemStack stack, int slot) {
private static ItemStack getItemForSlot(ItemStack stack, int slot) {
if(slot == 0)
return craftingTable;
else if(slot >= SEGMENTS)
@@ -287,21 +302,19 @@ public class ItemCraftingHalo extends ItemMod {
NBTTagCompound cmp = getStoredRecipeCompound(stack, slot);
if(cmp != null) {
ItemStack cmpStack = getLastCraftingItem(cmp, 9);
return cmpStack;
return getLastCraftingItem(cmp, 9);
} else return ItemStack.EMPTY;
}
}
public static void assignRecipe(ItemStack stack, ItemStack itemForPos, int pos) {
private static void assignRecipe(ItemStack stack, ItemStack itemForPos, int pos) {
if(!itemForPos.isEmpty())
ItemNBTHelper.setCompound(stack, TAG_STORED_RECIPE_PREFIX + pos, new NBTTagCompound());
else
ItemNBTHelper.setCompound(stack, TAG_STORED_RECIPE_PREFIX + pos, getLastCraftingCompound(stack, false));
}
@SubscribeEvent
public void onItemCrafted(ItemCraftedEvent event) {
private void onItemCrafted(ItemCraftedEvent event) {
if(!(event.getPlayer().openContainer instanceof ContainerCraftingHalo) || !(event.getInventory() instanceof InventoryCrafting))
return;
@@ -314,34 +327,28 @@ public class ItemCraftingHalo extends ItemMod {
private void saveRecipeToStack(ItemCraftedEvent event, ItemStack stack) {
NBTTagCompound cmp = new NBTTagCompound();
NBTTagCompound cmp1 = new NBTTagCompound();
ItemStack result = event.getPlayer().world.getRecipeManager().getResult(event.getInventory(), event.getPlayer().world, VanillaRecipeTypes.CRAFTING);
if(!result.isEmpty()) {
cmp1 = result.write(cmp1);
cmp.put(TAG_ITEM_PREFIX + 9, cmp1);
cmp.put(TAG_ITEM_PREFIX + 9, result.write(new NBTTagCompound()));
for(int i = 0; i < 9; i++) {
cmp1 = new NBTTagCompound();
NBTTagCompound ingr = new NBTTagCompound();
ItemStack stackSlot = event.getInventory().getStackInSlot(i);
if(!stackSlot.isEmpty()) {
ItemStack writeStack = stackSlot.copy();
writeStack.setCount(1);
cmp1 = writeStack.write(cmp1);
ingr = writeStack.write(new NBTTagCompound());
}
cmp.put(TAG_ITEM_PREFIX + i, cmp1);
cmp.put(TAG_ITEM_PREFIX + i, ingr);
}
}
ItemNBTHelper.setCompound(stack, TAG_LAST_CRAFTING, cmp);
}
public static ItemStack[] getLastCraftingItems(ItemStack stack) {
return getCraftingItems(stack, SEGMENTS);
}
public static ItemStack[] getCraftingItems(ItemStack stack, int slot) {
private static ItemStack[] getCraftingItems(ItemStack stack, int slot) {
ItemStack[] stackArray = new ItemStack[10];
Arrays.fill(stackArray, ItemStack.EMPTY);
@@ -353,48 +360,39 @@ public class ItemCraftingHalo extends ItemMod {
return stackArray;
}
public static NBTTagCompound getLastCraftingCompound(ItemStack stack, boolean nullify) {
private static NBTTagCompound getLastCraftingCompound(ItemStack stack, boolean nullify) {
return ItemNBTHelper.getCompound(stack, TAG_LAST_CRAFTING, nullify);
}
public static NBTTagCompound getStoredRecipeCompound(ItemStack stack, int slot) {
private static NBTTagCompound getStoredRecipeCompound(ItemStack stack, int slot) {
return slot == SEGMENTS ? getLastCraftingCompound(stack, true) : ItemNBTHelper.getCompound(stack, TAG_STORED_RECIPE_PREFIX + slot, true);
}
public static ItemStack getLastCraftingItem(ItemStack stack, int pos) {
return getLastCraftingItem(getLastCraftingCompound(stack, true), pos);
}
public static ItemStack getLastCraftingItem(NBTTagCompound cmp, int pos) {
private static ItemStack getLastCraftingItem(NBTTagCompound cmp, int pos) {
if(cmp == null)
return ItemStack.EMPTY;
NBTTagCompound cmp1 = cmp.getCompound(TAG_ITEM_PREFIX + pos);
if(cmp1 == null)
return ItemStack.EMPTY;
return ItemStack.read(cmp1);
return ItemStack.read(cmp.getCompound(TAG_ITEM_PREFIX + pos));
}
public static boolean wasEquipped(ItemStack stack) {
private static boolean wasEquipped(ItemStack stack) {
return ItemNBTHelper.getBoolean(stack, TAG_EQUIPPED, false);
}
public static void setEquipped(ItemStack stack, boolean equipped) {
private static void setEquipped(ItemStack stack, boolean equipped) {
ItemNBTHelper.setBoolean(stack, TAG_EQUIPPED, equipped);
}
public static float getRotationBase(ItemStack stack) {
private static float getRotationBase(ItemStack stack) {
return ItemNBTHelper.getFloat(stack, TAG_ROTATION_BASE, 0F);
}
public static void setRotationBase(ItemStack stack, float rotation) {
private static void setRotationBase(ItemStack stack, float rotation) {
ItemNBTHelper.setFloat(stack, TAG_ROTATION_BASE, rotation);
}
@OnlyIn(Dist.CLIENT)
@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent event) {
private void onRenderWorldLast(RenderWorldLastEvent event) {
EntityPlayer player = Minecraft.getInstance().player;
ItemStack stack = PlayerHelper.getFirstHeldItemClass(player, ItemCraftingHalo.class);
if(!stack.isEmpty())
@@ -425,7 +423,7 @@ public class ItemCraftingHalo extends ItemMod {
float base = getRotationBase(stack);
int angles = 360;
int segAngles = angles / SEGMENTS;
float shift = base - segAngles / 2;
float shift = base - segAngles / 2.0F;
float u = 1F;
float v = 0.25F;
@@ -546,7 +544,7 @@ public class ItemCraftingHalo extends ItemMod {
}
@OnlyIn(Dist.CLIENT)
public static void renderRecipe(ITextComponent label, ItemStack[] recipe, EntityPlayer player, boolean setRecipe) {
private static void renderRecipe(ITextComponent label, ItemStack[] recipe, EntityPlayer player, boolean setRecipe) {
Minecraft mc = Minecraft.getInstance();
if(!recipe[9].isEmpty()) {
@@ -581,10 +579,47 @@ public class ItemCraftingHalo extends ItemMod {
int yoff = 110;
if(setRecipe && !canCraft(recipe, getFakeInv(player))) {
String warning = TextFormatting.RED + I18n.format("botaniamisc.cantCraft");
mc.fontRenderer.drawStringWithShadow(warning, mc.mainWindow.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(warning) / 2, mc.mainWindow.getScaledHeight() / 2 - yoff, 0xFFFFFF);
mc.fontRenderer.drawStringWithShadow(warning, mc.mainWindow.getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(warning) / 2.0F, mc.mainWindow.getScaledHeight() / 2.0F - yoff, 0xFFFFFF);
yoff += 12;
}
mc.fontRenderer.drawStringWithShadow(label.getFormattedText(), mc.mainWindow.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(label.getString()) / 2, mc.mainWindow.getScaledHeight() / 2 - yoff, 0xFFFFFF);
mc.fontRenderer.drawStringWithShadow(label.getFormattedText(), mc.mainWindow.getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(label.getString()) / 2.0F, mc.mainWindow.getScaledHeight() / 2.0F - yoff, 0xFFFFFF);
}
public static class ContainerProvider implements IInteractionObject {
private final World world;
public ContainerProvider(World world) {
this.world = world;
}
@Nonnull
@Override
public Container createContainer(@Nonnull InventoryPlayer inv, @Nonnull EntityPlayer player) {
return new ContainerCraftingHalo(inv, world);
}
@Nonnull
@Override
public String getGuiID() {
return "botania:crafting_halo";
}
@Nonnull
@Override
public ITextComponent getName() {
return new TextComponentString(getGuiID());
}
@Override
public boolean hasCustomName() {
return false;
}
@Nullable
@Override
public ITextComponent getCustomName() {
return null;
}
}
}
@@ -11,17 +11,16 @@
package vazkii.botania.common.item;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemUseContext;
import net.minecraft.nbt.INBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.play.server.SPacketCollectItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ActionResult;
@@ -30,25 +29,26 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.IInteractionObject;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.capabilities.ICapabilitySerializable;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.ItemStackHandler;
import net.minecraftforge.items.wrapper.InvWrapper;
import vazkii.botania.common.Botania;
import vazkii.botania.client.gui.bag.ContainerFlowerBag;
import vazkii.botania.client.gui.bag.InventoryFlowerBag;
import vazkii.botania.common.block.BlockModFlower;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.lib.LibGuiIDs;
import vazkii.botania.common.lib.LibItemNames;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -68,15 +68,12 @@ public class ItemFlowerBag extends ItemMod {
private static class InvProvider implements ICapabilitySerializable<INBTBase> {
private final IItemHandler inv = new ItemStackHandler(16) {
@Nonnull
@Override
public ItemStack insertItem(int slot, @Nonnull ItemStack toInsert, boolean simulate) {
Block blk = Block.getBlockFromItem(toInsert.getItem());
if(!toInsert.isEmpty()
public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
Block blk = Block.getBlockFromItem(stack.getItem());
return !stack.isEmpty()
&& blk instanceof BlockModFlower
&& slot == ((BlockModFlower) blk).color.getId())
return super.insertItem(slot, toInsert, simulate);
else return toInsert;
&& slot == ((BlockModFlower) blk).color.getId();
}
};
private final LazyOptional<IItemHandler> opt = LazyOptional.of(() -> inv);
@@ -136,7 +133,11 @@ public class ItemFlowerBag extends ItemMod {
@Nonnull
@Override
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) {
player.openGui(Botania.instance, LibGuiIDs.FLOWER_BAG, world, hand == EnumHand.OFF_HAND ? 1 : 0, 0, 0);
if(!world.isRemote) {
NetworkHooks.openGui((EntityPlayerMP) player, new ContainerProvider(player.getHeldItem(hand)), buf -> {
buf.writeBoolean(hand == EnumHand.OFF_HAND);
});
}
return ActionResult.newResult(EnumActionResult.SUCCESS, player.getHeldItem(hand));
}
@@ -171,4 +172,41 @@ public class ItemFlowerBag extends ItemMod {
return EnumActionResult.PASS;
}
private static class ContainerProvider implements IInteractionObject {
private final ItemStack stack;
private ContainerProvider(ItemStack stack) {
this.stack = stack;
}
@Nonnull
@Override
public Container createContainer(@Nonnull InventoryPlayer playerInventory, @Nonnull EntityPlayer player) {
return new ContainerFlowerBag(playerInventory, new InventoryFlowerBag(stack));
}
@Nonnull
@Override
public String getGuiID() {
return "botania:flower_bag";
}
@Nonnull
@Override
public ITextComponent getName() {
return new TextComponentString(getGuiID());
}
@Override
public boolean hasCustomName() {
return false;
}
@Nullable
@Override
public ITextComponent getCustomName() {
return null;
}
}
}
@@ -23,7 +23,6 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.lib.LibItemNames;
@@ -18,7 +18,6 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.registries.IForgeRegistry;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.api.mana.spark.SparkUpgradeType;
@@ -633,16 +632,6 @@ public final class ModItems {
}
private static void registerOreDictionary() {
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
OreDictionary.registerOre(LibOreDict.QUARTZ[0], new ItemStack(darkQuartz));
OreDictionary.registerOre(LibOreDict.QUARTZ[1], new ItemStack(manaQuartz));
OreDictionary.registerOre(LibOreDict.QUARTZ[2], new ItemStack(blazeQuartz));
OreDictionary.registerOre(LibOreDict.QUARTZ[3], new ItemStack(lavenderQuartz));
OreDictionary.registerOre(LibOreDict.QUARTZ[4], new ItemStack(redQuartz));
OreDictionary.registerOre(LibOreDict.QUARTZ[5], new ItemStack(elfQuartz));
OreDictionary.registerOre(LibOreDict.QUARTZ[6], new ItemStack(sunnyQuartz));
OreDictionary.registerOre(LibOreDict.PESTLE_AND_MORTAR, pestleAndMortar);
OreDictionary.registerOre(LibOreDict.MANA_STEEL, new ItemStack(manaSteel));
OreDictionary.registerOre(LibOreDict.MANA_PEARL, new ItemStack(manaPearl));
@@ -668,9 +657,6 @@ public final class ModItems {
OreDictionary.registerOre(LibOreDict.MANAWEAVE_CLOTH, new ItemStack(manaweaveCloth));
OreDictionary.registerOre(LibOreDict.MANA_POWDER, new ItemStack(manaPowder));
OreDictionary.registerOre(LibOreDict.VIAL, new ItemStack(vial));
OreDictionary.registerOre(LibOreDict.FLASK, new ItemStack(flask));
OreDictionary.registerOre("rodBlaze", Items.BLAZE_ROD);
OreDictionary.registerOre("powderBlaze", Items.BLAZE_POWDER);
}
@@ -24,7 +24,6 @@ import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.Tags;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.item.IAvatarTile;
import vazkii.botania.api.item.IAvatarWieldable;
import vazkii.botania.api.item.IManaProficiencyArmor;
@@ -33,13 +33,13 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.item.IBlockProvider;
import vazkii.botania.api.item.IManaProficiencyArmor;
import vazkii.botania.api.mana.IManaUsingItem;
import vazkii.botania.api.mana.ManaItemHandler;
import vazkii.botania.api.subtile.ISpecialFlower;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.item.ItemMod;
import vazkii.botania.common.lib.LibItemNames;
import vazkii.botania.common.lib.LibMisc;
@@ -112,7 +112,7 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP
if(TERRAFORMABLE.contains(state.getBlock())) {
List<BlockPos> airBlocks = new ArrayList<>();
for(EnumFacing dir : EnumFacing.BY_HORIZONTAL_INDEX) {
for(EnumFacing dir : MathHelper.HORIZONTALS) {
BlockPos pos_ = pos.offset(dir);
IBlockState state_ = world.getBlockState(pos_);
Block block_ = state_.getBlock();
@@ -18,7 +18,6 @@ import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.api.internal.IGuiLexiconEntry;
@@ -7,10 +7,10 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.oredict.OreDictionary;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.internal.IGuiLexiconEntry;
import vazkii.botania.api.lexicon.LexiconEntry;
@@ -64,14 +64,10 @@ public class PageElvenRecipe extends PageRecipe {
renderItemAtOutputPos(gui, i % 2, i / 2, outputs.get(i));
}
List<Object> inputs = recipe.getInputs();
List<Ingredient> inputs = recipe.getInputs();
int i = 0;
for(Object obj : inputs) {
Object input = obj;
if(input instanceof String)
input = OreDictionary.getOres((String) input).get(0);
renderItemAtInputPos(gui, i, (ItemStack) input);
for(Ingredient input : inputs) {
renderItemAtInputPos(gui, i, input.getMatchingStacks()[0]);
i++;
}
@@ -24,7 +24,6 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.oredict.OreDictionary;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.internal.IGuiLexiconEntry;
import vazkii.botania.api.lexicon.LexiconEntry;
@@ -28,7 +28,6 @@ import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.internal.IGuiLexiconEntry;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
@@ -11,8 +11,6 @@
package vazkii.botania.common.lib;
public final class LibOreDict {
public static final String LEXICON = "lexicaBotania";
public static final String PESTLE_AND_MORTAR = "pestleAndMortar";
public static final String TWIG_WAND = "twigWand";
public static final String MANA_STEEL = "ingotManasteel";
@@ -39,34 +37,12 @@ public final class LibOreDict {
public static final String MANAWEAVE_CLOTH = "clothManaweave";
public static final String MANA_POWDER = "powderMana";
public static final String VIAL = "bVial";
public static final String FLASK = "bFlask";
public static final String BLAZE_BLOCK = "blockBlaze";
public static final String[] FLOWER = new String[] {
"mysticFlowerWhite", "mysticFlowerOrange", "mysticFlowerMagenta", "mysticFlowerLightBlue",
"mysticFlowerYellow", "mysticFlowerLime", "mysticFlowerPink", "mysticFlowerGray",
"mysticFlowerLightGray", "mysticFlowerCyan", "mysticFlowerPurple", "mysticFlowerBlue",
"mysticFlowerBrown", "mysticFlowerGreen", "mysticFlowerRed", "mysticFlowerBlack"
};
public static final String[] PETAL = new String[] {
"petalWhite", "petalOrange", "petalMagenta", "petalLightBlue",
"petalYellow", "petalLime", "petalPink", "petalGray",
"petalLightGray", "petalCyan", "petalPurple", "petalBlue",
"petalBrown", "petalGreen", "petalRed", "petalBlack"
};
public static final String[] RUNE = new String[] {
"runeWaterB", "runeFireB", "runeEarthB", "runeAirB",
"runeSpringB", "runeSummerB", "runeAutumnB", "runeWinterB",
"runeManaB", "runeLustB", "runeGluttonyB", "runeGreedB",
"runeSlothB", "runeWrathB", "runeEnvyB", "runePrideB"
};
public static final String[] QUARTZ = new String[] {
"quartzDark", "quartzMana", "quartzBlaze",
"quartzLavender", "quartzRed", "quartzElven", "quartzSunny"
};
}
@@ -79,7 +79,7 @@ public class PacketBotaniaEffect {
int g = (hex & 0xFF00) >> 8;
int b = hex & 0xFF;
for(int i = 0; i < 10; i++) {
BlockPos pos = new BlockPos(message.x, message.y, message.z).offset(EnumFacing.BY_INDEX[world.rand.nextInt(6)]);
BlockPos pos = new BlockPos(message.x, message.y, message.z).offset(EnumFacing.random(world.rand));
Botania.proxy.sparkleFX(
pos.getX() + (float) Math.random(), pos.getY() + (float) Math.random(), pos.getZ() + (float) Math.random(),
r / 255F, g / 255F, b / 255F, 0.6F + (float) Math.random() * 0.5F, 5);
+3 -1
View File
@@ -49,4 +49,6 @@ public net.minecraft.item.EnumDyeColor field_193351_w # colorValue
public net.minecraft.entity.EntityLiving field_184659_bA # deathLootTable
public net.minecraft.item.ItemUseContext <init>(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;FFF)V
public net.minecraft.item.ItemUseContext <init>(Lnet/minecraft/world/World;Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/EnumFacing;FFF)V
public net.minecraft.tileentity.TileEntityFurnace func_145952_a(Lnet/minecraft/item/ItemStack;)I # getItemBurnTime
@@ -0,0 +1,12 @@
{
"replace": false,
"values": [
"botania:dark_quartz",
"botania:mana_quartz",
"botania:blaze_quartz",
"botania:lavender_quartz",
"botania:red_quartz",
"botania:elven_quartz",
"botania:sunny_quartz"
]
}