mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 11:19:19 +00:00
Merge branch 'master' of github.com:Vazkii/Botania into 1.15
This commit is contained in:
commit
31de0d6dd1
268 files changed
+172
-6168
No files matched your search
@@ -54,7 +54,6 @@ import vazkii.botania.common.crafting.recipe.TerraPickTippingRecipe;
|
||||
import vazkii.botania.common.item.ItemLaputaShard;
|
||||
import vazkii.botania.common.item.ItemLexicon;
|
||||
import vazkii.botania.common.item.ItemManaTablet;
|
||||
import vazkii.botania.common.item.ItemTwigWand;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.brew.ItemBrewBase;
|
||||
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
|
||||
@@ -76,7 +75,6 @@ public class JEIBotaniaPlugin implements IModPlugin {
|
||||
registry.registerSubtypeInterpreter(ModItems.incenseStick, ItemBrewBase::getSubtype);
|
||||
registry.registerSubtypeInterpreter(ModItems.bloodPendant, ItemBrewBase::getSubtype);
|
||||
|
||||
registry.registerSubtypeInterpreter(ModItems.twigWand, stack -> ItemTwigWand.getColor1(stack) + "_" + ItemTwigWand.getColor2(stack));
|
||||
registry.registerSubtypeInterpreter(ModItems.flightTiara, stack -> String.valueOf(ItemFlightTiara.getVariant(stack)));
|
||||
registry.registerSubtypeInterpreter(ModItems.lexicon, stack -> String.valueOf(ItemNBTHelper.getBoolean(stack, ItemLexicon.TAG_ELVEN_UNLOCK, false)));
|
||||
registry.registerSubtypeInterpreter(ModItems.laputaShard, stack -> String.valueOf(ItemLaputaShard.getShardLevel(stack)));
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.Random;
|
||||
public class BlockModMushroom extends MushroomBlock implements IHornHarvestable, ICustomApothecaryColor {
|
||||
|
||||
private static final VoxelShape SHAPE = makeCuboidShape(4.8, 0, 4.8, 12.8, 16, 12.8);
|
||||
private final DyeColor color;
|
||||
public final DyeColor color;
|
||||
|
||||
public BlockModMushroom(DyeColor color, Properties builder) {
|
||||
super(builder);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class BehaviourCocoaBeans extends DefaultDispenseItemBehavior {
|
||||
Direction facing = source.getBlockState().get(DispenserBlock.FACING);
|
||||
BlockPos pos = source.getBlockPos().offset(facing);
|
||||
World world = source.getWorld();
|
||||
BlockItemUseContext ctx = new DirectionalPlaceContext(source.getWorld(), source.getBlockPos(), facing, new ItemStack(block), facing.getOpposite());
|
||||
BlockItemUseContext ctx = new DirectionalPlaceContext(source.getWorld(), source.getBlockPos().offset(facing), facing, new ItemStack(block), facing.getOpposite());
|
||||
BlockState cocoa = block.getStateForPlacement(ctx);
|
||||
if(cocoa != null && world.isAirBlock(pos)) {
|
||||
world.setBlockState(pos, cocoa);
|
||||
|
||||
@@ -98,6 +98,8 @@ public final class ModManaAlchemyRecipes {
|
||||
|
||||
evt.manaInfusion().accept(RecipeManaInfusion.alchemy(prefix("chorus_fruit_to_flower"), new ItemStack(Blocks.CHORUS_FLOWER), Ingredient.fromItems(Items.POPPED_CHORUS_FRUIT), 10000));
|
||||
|
||||
cycle(evt.manaInfusion(), 240, "botania:berry_cycle", Items.APPLE, Items.SWEET_BERRIES);
|
||||
|
||||
if(Botania.gardenOfGlassLoaded) {
|
||||
evt.manaInfusion().accept(RecipeManaInfusion.alchemy(prefix("prismarine_shard_gog"), new ItemStack(Items.PRISMARINE_SHARD), Ingredient.fromItems(Items.QUARTZ), 1000));
|
||||
evt.manaInfusion().accept(RecipeManaInfusion.alchemy(prefix("prismarine_crystals_gog"), new ItemStack(Items.PRISMARINE_CRYSTALS), Ingredient.fromItems(Items.PRISMARINE_SHARD), 500));
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
* This class was created by <Hubry>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [2020-01-30, 17:20 (UTC+2)]
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.ICraftingRecipe;
|
||||
import net.minecraft.item.crafting.IRecipeSerializer;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.item.crafting.ShapedRecipe;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.registries.ForgeRegistryEntry;
|
||||
import vazkii.botania.common.block.decor.BlockModMushroom;
|
||||
import vazkii.botania.common.item.ItemTwigWand;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.material.ItemPetal;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class TwigWandRecipe implements ICraftingRecipe {
|
||||
public static final IRecipeSerializer<TwigWandRecipe> SERIALIZER = new Serializer();
|
||||
private final ShapedRecipe compose;
|
||||
|
||||
public TwigWandRecipe(ShapedRecipe compose) {
|
||||
this.compose = compose;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(@Nonnull CraftingInventory inv, @Nonnull World worldIn) {
|
||||
return compose.matches(inv, worldIn);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getCraftingResult(CraftingInventory inv) {
|
||||
int first = -1;
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack stack = inv.getStackInSlot(i);
|
||||
Item item = stack.getItem();
|
||||
|
||||
int colorId;
|
||||
if (item instanceof ItemPetal) {
|
||||
colorId = ((ItemPetal) item).color.getId();
|
||||
} else if (item instanceof BlockItem && ((BlockItem) item).getBlock() instanceof BlockModMushroom) {
|
||||
colorId = ((BlockModMushroom) ((BlockItem) item).getBlock()).color.getId();
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
if (first == -1)
|
||||
first = colorId;
|
||||
else
|
||||
return ItemTwigWand.forColors(first, colorId);
|
||||
}
|
||||
return ItemTwigWand.forColors(first != -1 ? first : 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFit(int width, int height) {
|
||||
return compose.canFit(width, height);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return new ItemStack(ModItems.twigWand);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ResourceLocation getId() {
|
||||
return compose.getId();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NonNullList<ItemStack> getRemainingItems(CraftingInventory inv) {
|
||||
return compose.getRemainingItems(inv);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public NonNullList<Ingredient> getIngredients() {
|
||||
return compose.getIngredients();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getGroup() {
|
||||
return compose.getGroup();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack getIcon() {
|
||||
return compose.getIcon();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IRecipeSerializer<?> getSerializer() {
|
||||
return SERIALIZER;
|
||||
}
|
||||
|
||||
private static class Serializer extends ForgeRegistryEntry<IRecipeSerializer<?>> implements IRecipeSerializer<TwigWandRecipe> {
|
||||
@Nonnull
|
||||
@Override
|
||||
public TwigWandRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull JsonObject json) {
|
||||
return new TwigWandRecipe(CRAFTING_SHAPED.read(recipeId, json));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public TwigWandRecipe read(@Nonnull ResourceLocation recipeId, @Nonnull PacketBuffer buffer) {
|
||||
return new TwigWandRecipe(CRAFTING_SHAPED.read(recipeId, buffer));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@Nonnull PacketBuffer buffer, @Nonnull TwigWandRecipe recipe) {
|
||||
CRAFTING_SHAPED.write(buffer, recipe.compose);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,23 +39,7 @@ import vazkii.botania.client.gui.box.GuiBaubleBox;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.core.handler.ModSounds;
|
||||
import vazkii.botania.common.crafting.recipe.AncientWillRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.ArmorUpgradeRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.BlackHoleTalismanExtractRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.CompositeLensRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.CosmeticAttachRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.CosmeticRemoveRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.HelmRevealingRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.KeepIvyRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.LensDyeingRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.ManaGunClipRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.ManaGunLensRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.ManaGunRemoveLensRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.ManaUpgradeRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.PhantomInkRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.ShapelessManaUpgradeRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.SpellClothRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.TerraPickTippingRecipe;
|
||||
import vazkii.botania.common.crafting.recipe.*;
|
||||
import vazkii.botania.common.item.brew.ItemBrewBase;
|
||||
import vazkii.botania.common.item.brew.ItemIncenseStick;
|
||||
import vazkii.botania.common.item.brew.ItemVial;
|
||||
@@ -740,6 +724,7 @@ public final class ModItems {
|
||||
register(r, PhantomInkRecipe.SERIALIZER, "phantom_ink_apply");
|
||||
register(r, SpellClothRecipe.SERIALIZER, "spell_cloth_apply");
|
||||
register(r, TerraPickTippingRecipe.SERIALIZER, "terra_pick_tipping");
|
||||
register(r, TwigWandRecipe.SERIALIZER, "twig_wand");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect {
|
||||
|
||||
for(LivingEntity living : entities) {
|
||||
if(living == thrower || living instanceof PlayerEntity && thrower instanceof PlayerEntity
|
||||
&& ((PlayerEntity) thrower).canAttackPlayer(((PlayerEntity) living)))
|
||||
&& !((PlayerEntity) thrower).canAttackPlayer(((PlayerEntity) living)))
|
||||
continue;
|
||||
|
||||
if(living.hurtTime == 0) {
|
||||
|
||||
Reference in new issue
Block a user