Initial stab at 1.11
About halfway.
This commit is contained in:
parent
ce52aea512
commit
00d6f8eb46
|
@ -45,7 +45,6 @@ if (new File(projectDir, '.git').exists())
|
|||
|
||||
repositories {
|
||||
maven { url "http://dvs1.progwml6.com/files/maven" }
|
||||
maven { url "http://mobiusstrip.eu/maven" }
|
||||
maven { url "http://tehnut.info/maven" }
|
||||
|
||||
ivy {
|
||||
|
@ -60,9 +59,8 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
deobfCompile "mezz.jei:jei_${mc_version}:${jei_version}"
|
||||
deobfCompile "mcp.mobius.waila:Waila:${waila_version}_${mc_version}:dev"
|
||||
deobfCompile "mcp.mobius.waila:Hwyla:${waila_version}_${mc_version}"
|
||||
deobfCompile "info.amerifrance.guideapi:Guide-API:${mc_version}-${guideapi_version}"
|
||||
deobfCompile "info.tehnut.buttons:Buttons:${buttons_version}:api"
|
||||
|
||||
// compile name: "Thaumcraft", version: "${mc_version}-${thaumcraft_version}", ext: "jar"
|
||||
// compile name: 'Baubles', version: "${baubles_version}", ext: 'jar'
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
mod_name=BloodMagic
|
||||
package_group=com.wayoftime.bloodmagic
|
||||
mod_version=2.1.0
|
||||
mc_version=1.9.4
|
||||
forge_version=12.17.0.1957
|
||||
mc_version=1.11
|
||||
forge_version=13.19.1.2189
|
||||
curse_id=224791
|
||||
|
||||
mappings_version=snapshot_20160518
|
||||
mappings_version=snapshot_20161212
|
||||
|
||||
jei_version=3.6.8.225
|
||||
waila_version=1.7.0-B3
|
||||
thaumcraft_version=5.1.5
|
||||
baubles_version=1.1.3.0
|
||||
guideapi_version=2.0.0-37
|
||||
buttons_version=1.10.2-0.0.3-3
|
||||
jei_version=4.0.5.203
|
||||
waila_version=1.8.5-B19
|
||||
guideapi_version=2.1.0-47
|
|
@ -1,15 +1,13 @@
|
|||
package WayofTime.bloodmagic;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
import WayofTime.bloodmagic.meteor.MeteorConfigHandler;
|
||||
import lombok.Getter;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.launchwrapper.Launch;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
|
@ -25,7 +23,6 @@ import WayofTime.bloodmagic.api.util.helper.LogHelper;
|
|||
import WayofTime.bloodmagic.client.gui.GuiHandler;
|
||||
import WayofTime.bloodmagic.command.CommandBloodMagic;
|
||||
import WayofTime.bloodmagic.compat.ICompatibility;
|
||||
import WayofTime.bloodmagic.compat.minecraft.ICrossVersionProxy;
|
||||
import WayofTime.bloodmagic.network.BloodMagicPacketHandler;
|
||||
import WayofTime.bloodmagic.proxy.CommonProxy;
|
||||
import WayofTime.bloodmagic.registry.ModArmourTrackers;
|
||||
|
@ -42,8 +39,6 @@ import WayofTime.bloodmagic.structures.ModDungeons;
|
|||
import WayofTime.bloodmagic.util.Utils;
|
||||
import WayofTime.bloodmagic.util.handler.IMCHandler;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
@Mod(modid = Constants.Mod.MODID, name = Constants.Mod.NAME, version = Constants.Mod.VERSION, dependencies = Constants.Mod.DEPEND, guiFactory = "WayofTime.bloodmagic.client.gui.config.ConfigGuiFactory")
|
||||
@Getter
|
||||
public class BloodMagic
|
||||
|
@ -57,18 +52,18 @@ public class BloodMagic
|
|||
public static CreativeTabs tabBloodMagic = new CreativeTabs(Constants.Mod.MODID + ".creativeTab")
|
||||
{
|
||||
@Override
|
||||
public Item getTabIconItem()
|
||||
public ItemStack getTabIconItem()
|
||||
{
|
||||
return ModItems.BLOOD_ORB;
|
||||
return new ItemStack(ModItems.BLOOD_ORB);
|
||||
}
|
||||
};
|
||||
|
||||
public static CreativeTabs tabUpgradeTome = new CreativeTabs(Constants.Mod.MODID + ".creativeTabTome")
|
||||
{
|
||||
@Override
|
||||
public Item getTabIconItem()
|
||||
public ItemStack getTabIconItem()
|
||||
{
|
||||
return ModItems.UPGRADE_TOME;
|
||||
return new ItemStack(ModItems.UPGRADE_TOME);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -76,32 +71,13 @@ public class BloodMagic
|
|||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}.setNoTitle().setBackgroundImageName("upgrade_tomes.png");
|
||||
|
||||
@Getter
|
||||
private static boolean isDev = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
|
||||
|
||||
@Getter
|
||||
private static ICrossVersionProxy crossVersionProxy;
|
||||
private static final Map<String, String> PROXY_MAP = ImmutableMap.of("1.9.4", "WayofTime.bloodmagic.compat.minecraft.CrossVersionProxy19", "1.10", "WayofTime.bloodmagic.compat.minecraft.CrossVersionProxy110", "1.10.2", "WayofTime.bloodmagic.compat.minecraft.CrossVersionProxy110");
|
||||
|
||||
static
|
||||
{
|
||||
try
|
||||
{
|
||||
String mcVersion = (String) Loader.class.getDeclaredField("MC_VERSION").get(null);
|
||||
|
||||
if (!PROXY_MAP.containsKey(mcVersion))
|
||||
throw new IllegalStateException("Blood Magic couldn't find a cross version proxy!");
|
||||
|
||||
Class proxyClass = Class.forName(PROXY_MAP.get(mcVersion));
|
||||
crossVersionProxy = (ICrossVersionProxy) proxyClass.newInstance();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new IllegalArgumentException("Blood Magic could not find a cross version proxy!", e);
|
||||
}
|
||||
|
||||
tabUpgradeTome.setNoTitle().setBackgroundImageName("upgrade_tomes.png");
|
||||
|
||||
FluidRegistry.enableUniversalBucket();
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
|||
public class AlchemyTableRecipe
|
||||
{
|
||||
protected ItemStack output = null;
|
||||
protected ArrayList<Object> input = new ArrayList<Object>();
|
||||
protected ArrayList<ItemStack> input = new ArrayList<ItemStack>();
|
||||
@Getter
|
||||
protected int lpDrained;
|
||||
@Getter
|
||||
|
@ -148,7 +148,7 @@ public class AlchemyTableRecipe
|
|||
*
|
||||
* @return The recipes input vales.
|
||||
*/
|
||||
public ArrayList<Object> getInput()
|
||||
public ArrayList<ItemStack> getInput()
|
||||
{
|
||||
return this.input;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import WayofTime.bloodmagic.api.ritual.Ritual;
|
|||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -57,6 +58,7 @@ public class RitualRegistry
|
|||
registerRitual(ritual, ritual.getName());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Ritual getRitualForId(String id)
|
||||
{
|
||||
Ritual ritual = registry.get(id);
|
||||
|
|
|
@ -33,6 +33,6 @@ public class TeleporterBloodMagic extends Teleporter
|
|||
@Override
|
||||
public void placeInPortal(Entity entity, float rotationYaw)
|
||||
{
|
||||
entity.setLocationAndAngles(MathHelper.floor_double(entity.posX), MathHelper.floor_double(entity.posY) + 2, MathHelper.floor_double(entity.posZ), entity.rotationYaw, entity.rotationPitch);
|
||||
entity.setLocationAndAngles(MathHelper.floor(entity.posX), MathHelper.floor(entity.posY) + 2, MathHelper.floor(entity.posZ), entity.rotationYaw, entity.rotationPitch);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import net.minecraft.util.math.Vec3d;
|
|||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
|
@ -368,7 +369,7 @@ public class BlockEnumStairs<E extends Enum<E> & IStringSerializable> extends Bl
|
|||
@Override
|
||||
public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face)
|
||||
{
|
||||
if (BloodMagic.getCrossVersionProxy().disableStairSlabCulling())
|
||||
if (ForgeModContainer.disableStairSlabCulling)
|
||||
return super.doesSideBlockRendering(state, world, pos, face);
|
||||
|
||||
if (state.isOpaqueCube())
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.buttons;
|
||||
|
||||
import WayofTime.bloodmagic.compat.buttons.button.ButtonFillNetwork;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import tehnut.buttons.api.ButtonsPlugin;
|
||||
import tehnut.buttons.api.IWidgetPlugin;
|
||||
import tehnut.buttons.api.IWidgetRegistry;
|
||||
import tehnut.buttons.api.WidgetTexture;
|
||||
|
||||
@ButtonsPlugin
|
||||
public class BloodMagicPlugin extends IWidgetPlugin.Base {
|
||||
|
||||
public static final WidgetTexture FILL_BUTTON = new WidgetTexture(
|
||||
new ResourceLocation("bloodmagic", "textures/gui/buttons_compat.png"),
|
||||
0,
|
||||
0,
|
||||
20,
|
||||
20
|
||||
);
|
||||
|
||||
@Override
|
||||
public void register(IWidgetRegistry widgetRegistry) {
|
||||
widgetRegistry.addUtilityButton(new ButtonFillNetwork());
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.buttons.button;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.api.saving.SoulNetwork;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import WayofTime.bloodmagic.compat.buttons.BloodMagicPlugin;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import tehnut.buttons.api.button.utility.Button;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class ButtonFillNetwork extends Button {
|
||||
|
||||
public ButtonFillNetwork() {
|
||||
super(BloodMagicPlugin.FILL_BUTTON);
|
||||
|
||||
setServerRequired();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<? extends ITextComponent> getTooltip() {
|
||||
return Collections.singletonList(new TextComponentTranslation("button.bloodmagic.tooltip.fill"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onServerClick(EntityPlayerMP player) {
|
||||
SoulNetwork network = NetworkHelper.getSoulNetwork(player);
|
||||
network.setCurrentEssence(Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getButtonId() {
|
||||
return new ResourceLocation(Constants.Mod.MODID, "button_fillnetwork");
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import WayofTime.bloodmagic.compat.ICompatibility;
|
||||
import amerifrance.guideapi.api.GuideAPI;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
public class CompatibilityGuideAPI implements ICompatibility
|
||||
{
|
||||
private static IRecipe guideRecipe = null;
|
||||
private static boolean worldFlag;
|
||||
|
||||
@Override
|
||||
public void loadCompatibility(InitializationPhase phase)
|
||||
{
|
||||
switch (phase)
|
||||
{
|
||||
case PRE_INIT:
|
||||
{
|
||||
GuideBloodMagic.initBook();
|
||||
GameRegistry.register(GuideBloodMagic.guideBook);
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
||||
GuideAPI.setModel(GuideBloodMagic.guideBook);
|
||||
|
||||
break;
|
||||
}
|
||||
case INIT:
|
||||
{
|
||||
guideRecipe = new ShapelessOreRecipe(GuideAPI.getStackFromBook(GuideBloodMagic.guideBook), new ItemStack(Items.BOOK), Blocks.GLASS, Items.FEATHER);
|
||||
break;
|
||||
}
|
||||
case POST_INIT:
|
||||
{
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
||||
GuideBloodMagic.initCategories();
|
||||
break;
|
||||
}
|
||||
case MAPPING:
|
||||
{
|
||||
if (!worldFlag) {
|
||||
GameRegistry.addRecipe(guideRecipe);
|
||||
worldFlag = true;
|
||||
} else {
|
||||
CraftingManager.getInstance().getRecipeList().remove(guideRecipe);
|
||||
worldFlag = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModId()
|
||||
{
|
||||
return "guideapi";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableCompat()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,50 +1,56 @@
|
|||
package WayofTime.bloodmagic.compat.guideapi;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.guideapi.book.*;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
import WayofTime.bloodmagic.registry.ModBlocks;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
import amerifrance.guideapi.api.GuideAPI;
|
||||
import amerifrance.guideapi.api.GuideBook;
|
||||
import amerifrance.guideapi.api.IGuideBook;
|
||||
import amerifrance.guideapi.api.impl.Book;
|
||||
import amerifrance.guideapi.api.util.NBTBookTags;
|
||||
import amerifrance.guideapi.category.CategoryItemStack;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.Color;
|
||||
|
||||
public class GuideBloodMagic
|
||||
@GuideBook
|
||||
public class GuideBloodMagic implements IGuideBook
|
||||
{
|
||||
public static Book guideBook;
|
||||
|
||||
public static void initBook()
|
||||
{
|
||||
@Nullable
|
||||
@Override
|
||||
public Book buildBook() {
|
||||
guideBook = new Book();
|
||||
guideBook.setTitle("guide.BloodMagic.title");
|
||||
guideBook.setDisplayName("guide.BloodMagic.display");
|
||||
guideBook.setWelcomeMessage("guide.BloodMagic.welcome");
|
||||
guideBook.setAuthor("guide.BloodMagic.author");
|
||||
guideBook.setRegistryName("BloodMagic");
|
||||
guideBook.setRegistryName(new ResourceLocation(Constants.Mod.MODID, "guide"));
|
||||
guideBook.setColor(Color.RED);
|
||||
|
||||
if (FMLCommonHandler.instance().getSide() == Side.CLIENT)
|
||||
GuideAPI.setModel(guideBook);
|
||||
return guideBook;
|
||||
}
|
||||
|
||||
public static void initCategories()
|
||||
{
|
||||
@Override
|
||||
public void handleModel(ItemStack bookStack) {
|
||||
GuideAPI.setModel(guideBook);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePost(ItemStack bookStack) {
|
||||
guideBook.addCategory(new CategoryItemStack(CategoryAlchemy.buildCategory(), "guide.BloodMagic.category.alchemy", new ItemStack(ModItems.ARCANE_ASHES)));
|
||||
guideBook.addCategory(new CategoryItemStack(CategoryArchitect.buildCategory(), "guide.BloodMagic.category.architect", new ItemStack(ModItems.SIGIL_DIVINATION)));
|
||||
guideBook.addCategory(new CategoryItemStack(CategoryDemon.buildCategory(), "guide.BloodMagic.category.demon", new ItemStack(ModItems.BLOOD_SHARD)));
|
||||
guideBook.addCategory(new CategoryItemStack(CategoryRitual.buildCategory(), "guide.BloodMagic.category.ritual", new ItemStack(ModBlocks.RITUAL_CONTROLLER)));
|
||||
// guideBook.addCategory(new CategoryItemStack(CategorySpell.buildCategory(), "guide.BloodMagic.category.spell", new ItemStack(ModItems.ritualDiviner)));
|
||||
}
|
||||
|
||||
public static void initJEIBlacklist()
|
||||
{
|
||||
if (Loader.isModLoaded("JEI"))
|
||||
BloodMagicPlugin.jeiHelper.getNbtIgnoreList().ignoreNbtTagNames(GuideAPI.guideBook, NBTBookTags.BOOK_TAG, NBTBookTags.CATEGORY_PAGE_TAG, NBTBookTags.CATEGORY_TAG, NBTBookTags.ENTRY_PAGE_TAG, NBTBookTags.ENTRY_TAG, NBTBookTags.KEY_TAG, NBTBookTags.PAGE_TAG);
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(GuideAPI.getStackFromBook(GuideBloodMagic.guideBook), new ItemStack(Items.BOOK), Blocks.GLASS, Items.FEATHER));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package WayofTime.bloodmagic.compat.guideapi.page;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -32,17 +33,17 @@ public class PageAlchemyArray extends Page
|
|||
|
||||
public PageAlchemyArray(List<ResourceLocation> resources, ItemStack inputStack, ItemStack catalystStack)
|
||||
{
|
||||
this(resources, inputStack, catalystStack, null);
|
||||
this(resources, inputStack, catalystStack, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
public PageAlchemyArray(ResourceLocation resource, ItemStack inputStack, ItemStack catalystStack, ItemStack outputStack)
|
||||
{
|
||||
this(Arrays.asList(resource), inputStack, catalystStack, outputStack);
|
||||
this(Collections.singletonList(resource), inputStack, catalystStack, outputStack);
|
||||
}
|
||||
|
||||
public PageAlchemyArray(ResourceLocation resource, ItemStack inputStack, ItemStack catalystStack)
|
||||
{
|
||||
this(Arrays.asList(resource), inputStack, catalystStack);
|
||||
this(Collections.singletonList(resource), inputStack, catalystStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -53,7 +54,7 @@ public class PageAlchemyArray extends Page
|
|||
int y = guiTop + 30;
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("bloodmagicguide" + ":textures/gui/alchemyArrayCrafting.png"));
|
||||
guiBase.drawTexturedModalRect(x, y, 0, 0, 62, 88 + (outputStack == null ? 0 : 26));
|
||||
guiBase.drawTexturedModalRect(x, y, 0, 0, 62, 88 + (outputStack.isEmpty() ? 0 : 26));
|
||||
|
||||
guiBase.drawCenteredString(fontRenderer, TextHelper.localize("guide.BloodMagic.page.alchemyArray"), guiLeft + guiBase.xSize / 2, guiTop + 12, 0);
|
||||
|
||||
|
@ -85,7 +86,7 @@ public class PageAlchemyArray extends Page
|
|||
guiBase.renderToolTip(catalystStack, mouseX, mouseY);
|
||||
}
|
||||
|
||||
if (outputStack != null)
|
||||
if (!outputStack.isEmpty())
|
||||
{
|
||||
int outputX = x + 43;
|
||||
int outputY = y + 95;
|
||||
|
|
|
@ -53,7 +53,7 @@ public class PageAltarRecipe extends Page
|
|||
guiBase.renderToolTip(input.get(0), mouseX, mouseY);
|
||||
}
|
||||
|
||||
if (output == null)
|
||||
if (output.isEmpty())
|
||||
{
|
||||
output = new ItemStack(Blocks.BARRIER);
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyArray;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.compat.jei.BloodMagicPlugin;
|
||||
|
@ -50,14 +53,15 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
|
|||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 0, 5);
|
||||
recipeLayout.getItemStacks().init(CATALYST_SLOT, true, 29, 3);
|
||||
|
@ -66,9 +70,9 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory
|
|||
if (recipeWrapper instanceof AlchemyArrayCraftingRecipeJEI)
|
||||
{
|
||||
AlchemyArrayCraftingRecipeJEI alchemyArrayWrapper = (AlchemyArrayCraftingRecipeJEI) recipeWrapper;
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, alchemyArrayWrapper.getInputs());
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, ingredients.getInputs(ItemStack.class).get(0));
|
||||
recipeLayout.getItemStacks().set(CATALYST_SLOT, alchemyArrayWrapper.getCatalyst());
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, alchemyArrayWrapper.getOutputs());
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0).get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,14 +15,6 @@ public class AlchemyArrayCraftingRecipeHandler implements IRecipeHandler<Alchemy
|
|||
return AlchemyArrayCraftingRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYARRAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AlchemyArrayCraftingRecipeJEI recipe)
|
||||
{
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
@ -27,22 +28,14 @@ public class AlchemyArrayCraftingRecipeJEI extends BlankRecipeWrapper
|
|||
this.output = output;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getInputs()
|
||||
{
|
||||
return inputs;
|
||||
}
|
||||
|
||||
public ItemStack getCatalyst()
|
||||
{
|
||||
return catalyst;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setOutputs(ItemStack.class, Collections.singletonList(output));
|
||||
ingredients.setInputs(ItemStack.class, inputs);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -63,15 +62,16 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
|
|||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
public IDrawable getIcon()
|
||||
{
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
|
@ -90,9 +90,9 @@ public class AlchemyTableRecipeCategory implements IRecipeCategory
|
|||
if (recipeWrapper instanceof AlchemyTableRecipeJEI)
|
||||
{
|
||||
AlchemyTableRecipeJEI recipe = (AlchemyTableRecipeJEI) recipeWrapper;
|
||||
guiItemStacks.set(ORB_SLOT, (ArrayList<ItemStack>) recipe.getInputs().get(1));
|
||||
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
|
||||
craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 3, 2);
|
||||
guiItemStacks.set(ORB_SLOT, ingredients.getInputs(ItemStack.class).get(1));
|
||||
craftingGridHelper.setOutput(guiItemStacks, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,14 +15,6 @@ public class AlchemyTableRecipeHandler implements IRecipeHandler<AlchemyTableRec
|
|||
return AlchemyTableRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ALCHEMYTABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AlchemyTableRecipeJEI recipe)
|
||||
{
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
package WayofTime.bloodmagic.compat.jei.alchemyTable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import lombok.Getter;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.recipe.AlchemyTableRecipe;
|
||||
import WayofTime.bloodmagic.api.registry.OrbRegistry;
|
||||
import WayofTime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
||||
|
@ -20,32 +15,17 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
|||
@Getter
|
||||
private AlchemyTableRecipe recipe;
|
||||
|
||||
// @Getter
|
||||
// private ArrayList<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||
|
||||
public AlchemyTableRecipeJEI(AlchemyTableRecipe recipe)
|
||||
{
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<Collection> getInputs()
|
||||
{
|
||||
ArrayList<Collection> ret = new ArrayList<Collection>();
|
||||
ret.add(recipe.getInput());
|
||||
ret.add(OrbRegistry.getOrbsDownToTier(recipe.getTierRequired()));
|
||||
return ret;
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
// ingredients.setInputLists(ItemStack.class, Lists.<ItemStack>newArrayList(recipe.getInput(), OrbRegistry.getOrbsDownToTier(recipe.getTierRequired())));
|
||||
ingredients.setOutput(ItemStack.class, recipe.getRecipeOutput(new ArrayList<ItemStack>()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Collections.singletonList(recipe.getRecipeOutput(new ArrayList<ItemStack>()));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
|
@ -54,8 +34,7 @@ public class AlchemyTableRecipeJEI extends BlankRecipeWrapper
|
|||
{
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.lpDrained", recipe.getLpDrained()));
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.ticksRequired", recipe.getTicksRequired()));
|
||||
return ret;
|
||||
}
|
||||
return null;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package WayofTime.bloodmagic.compat.jei.altar;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -52,14 +54,14 @@ public class AltarRecipeCategory implements IRecipeCategory
|
|||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
{
|
||||
|
||||
public IDrawable getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(IRecipeLayout recipeLayout, IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
recipeLayout.getItemStacks().init(INPUT_SLOT, true, 31, 0);
|
||||
recipeLayout.getItemStacks().init(OUTPUT_SLOT, false, 125, 30);
|
||||
|
@ -67,9 +69,9 @@ public class AltarRecipeCategory implements IRecipeCategory
|
|||
if (recipeWrapper instanceof AltarRecipeJEI)
|
||||
{
|
||||
AltarRecipeJEI altarRecipeWrapper = (AltarRecipeJEI) recipeWrapper;
|
||||
List<List<ItemStack>> inputs = altarRecipeWrapper.getInputs();
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
recipeLayout.getItemStacks().set(INPUT_SLOT, inputs.get(0));
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, altarRecipeWrapper.getOutputs());
|
||||
recipeLayout.getItemStacks().set(OUTPUT_SLOT, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,14 +15,6 @@ public class AltarRecipeHandler implements IRecipeHandler<AltarRecipeJEI>
|
|||
return AltarRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ALTAR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(@Nonnull AltarRecipeJEI recipe)
|
||||
{
|
||||
|
|
|
@ -2,13 +2,12 @@ package WayofTime.bloodmagic.compat.jei.altar;
|
|||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import WayofTime.bloodmagic.util.helper.NumeralHelper;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -37,18 +36,11 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<List<ItemStack>> getInputs()
|
||||
{
|
||||
return Collections.singletonList(input);
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
ingredients.setInputs(ItemStack.class, input);
|
||||
ingredients.setOutput(ItemStack.class, output);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
return Collections.singletonList(output);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
|
@ -57,9 +49,8 @@ public class AltarRecipeJEI extends BlankRecipeWrapper
|
|||
{
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.consumptionRate", consumptionRate));
|
||||
ret.add(TextHelper.localize("jei.BloodMagic.recipe.drainRate", drainRate));
|
||||
return ret;
|
||||
}
|
||||
return null;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import mezz.jei.api.gui.ICraftingGridHelper;
|
||||
import mezz.jei.api.gui.IDrawable;
|
||||
import mezz.jei.api.gui.IGuiItemStackGroup;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.IRecipeCategory;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
@ -63,15 +62,15 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
|||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public void drawAnimations(Minecraft minecraft)
|
||||
{
|
||||
|
||||
public IDrawable getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper)
|
||||
public void setRecipe(@Nonnull IRecipeLayout recipeLayout, @Nonnull IRecipeWrapper recipeWrapper, IIngredients ingredients)
|
||||
{
|
||||
IGuiItemStackGroup guiItemStacks = recipeLayout.getItemStacks();
|
||||
|
||||
|
@ -89,10 +88,9 @@ public class ArmourDowngradeRecipeCategory implements IRecipeCategory
|
|||
|
||||
if (recipeWrapper instanceof ArmourDowngradeRecipeJEI)
|
||||
{
|
||||
ArmourDowngradeRecipeJEI recipe = (ArmourDowngradeRecipeJEI) recipeWrapper;
|
||||
guiItemStacks.set(KEY_SLOT, (ArrayList<ItemStack>) recipe.getInputs().get(1));
|
||||
craftingGridHelper.setOutput(guiItemStacks, recipe.getOutputs());
|
||||
craftingGridHelper.setInput(guiItemStacks, (List) recipe.getInputs().get(0), 3, 2);
|
||||
guiItemStacks.set(KEY_SLOT, ingredients.getInputs(ItemStack.class).get(1));
|
||||
craftingGridHelper.setOutput(guiItemStacks, ingredients.getOutputs(ItemStack.class).get(0));
|
||||
craftingGridHelper.setInputs(guiItemStacks, ingredients.getInputs(ItemStack.class), 3, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,14 +15,6 @@ public class ArmourDowngradeRecipeHandler implements IRecipeHandler<ArmourDowngr
|
|||
return ArmourDowngradeRecipeJEI.class;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid()
|
||||
{
|
||||
return Constants.Compat.JEI_CATEGORY_ARMOURDOWNGRADE;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getRecipeCategoryUid(ArmourDowngradeRecipeJEI recipe)
|
||||
|
@ -40,6 +32,6 @@ public class ArmourDowngradeRecipeHandler implements IRecipeHandler<ArmourDowngr
|
|||
@Override
|
||||
public boolean isRecipeValid(@Nonnull ArmourDowngradeRecipeJEI recipe)
|
||||
{
|
||||
return recipe.getInputs().get(0).size() > 0 && recipe.getOutputs().size() > 0;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,65 +1,28 @@
|
|||
package WayofTime.bloodmagic.compat.jei.armourDowngrade;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import lombok.Getter;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import WayofTime.bloodmagic.api.recipe.LivingArmourDowngradeRecipe;
|
||||
import WayofTime.bloodmagic.api.util.helper.ItemHelper.LivingUpgrades;
|
||||
import WayofTime.bloodmagic.registry.ModItems;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
public class ArmourDowngradeRecipeJEI extends BlankRecipeWrapper
|
||||
{
|
||||
@Getter
|
||||
private LivingArmourDowngradeRecipe recipe;
|
||||
|
||||
// @Getter
|
||||
// private ArrayList<ItemStack> validGems = new ArrayList<ItemStack>();
|
||||
|
||||
public ArmourDowngradeRecipeJEI(LivingArmourDowngradeRecipe recipe)
|
||||
{
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<Collection> getInputs()
|
||||
{
|
||||
ArrayList<Collection> ret = new ArrayList<Collection>();
|
||||
ret.add(recipe.getInput());
|
||||
ret.add(Lists.newArrayList(recipe.getKey()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public List<ItemStack> getOutputs()
|
||||
{
|
||||
public void getIngredients(IIngredients ingredients) {
|
||||
// TODO - inputs
|
||||
ItemStack upgradeStack = new ItemStack(ModItems.UPGRADE_TOME);
|
||||
LivingUpgrades.setUpgrade(upgradeStack, recipe.getRecipeOutput());
|
||||
return Collections.singletonList(upgradeStack);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> getTooltipStrings(int mouseX, int mouseY)
|
||||
{
|
||||
// ArrayList<String> ret = new ArrayList<String>();
|
||||
// if (mouseX >= 58 && mouseX <= 78 && mouseY >= 21 && mouseY <= 34)
|
||||
// {
|
||||
// ret.add(TextHelper.localize("jei.BloodMagic.recipe.lpDrained", recipe.getLpDrained()));
|
||||
// ret.add(TextHelper.localize("jei.BloodMagic.recipe.ticksRequired", recipe.getTicksRequired()));
|
||||
// return ret;
|
||||
// }
|
||||
return null;
|
||||
ingredients.setOutput(ItemStack.class, upgradeStack);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.minecraft;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class CrossVersionProxy110 implements ICrossVersionProxy {
|
||||
|
||||
@Override
|
||||
public TileEntity createTileFromData(World world, NBTTagCompound tagCompound)
|
||||
{
|
||||
Method m = ReflectionHelper.findMethod(TileEntity.class, null, new String[] { "create", "func_190200_a", "a" }, World.class, NBTTagCompound.class);
|
||||
try
|
||||
{
|
||||
return (TileEntity) m.invoke(null, world, tagCompound);
|
||||
} catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean disableStairSlabCulling()
|
||||
{
|
||||
Field disableStairSlabCulling = ReflectionHelper.findField(ForgeModContainer.class, "disableStairSlabCulling");
|
||||
try
|
||||
{
|
||||
return (Boolean) disableStairSlabCulling.get(null);
|
||||
} catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.minecraft;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class CrossVersionProxy19 implements ICrossVersionProxy
|
||||
{
|
||||
|
||||
@Override
|
||||
public TileEntity createTileFromData(World world, NBTTagCompound tagCompound)
|
||||
{
|
||||
Method m = ReflectionHelper.findMethod(TileEntity.class, null, new String[] { "create", "func_189514_c", "c" }, NBTTagCompound.class);
|
||||
try
|
||||
{
|
||||
return (TileEntity) m.invoke(null, tagCompound);
|
||||
} catch (Exception e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean disableStairSlabCulling()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.minecraft;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Allows for Blood Magic to support multiple MC versions that have only slight changes.
|
||||
*
|
||||
* Implementation copied from <a href="https://github.com/williewillus/Botania">Botania</a>.
|
||||
*/
|
||||
public interface ICrossVersionProxy
|
||||
{
|
||||
TileEntity createTileFromData(World world, NBTTagCompound tagCompound);
|
||||
|
||||
boolean disableStairSlabCulling();
|
||||
}
|
|
@ -4,9 +4,6 @@ import WayofTime.bloodmagic.block.*;
|
|||
import WayofTime.bloodmagic.compat.waila.provider.*;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.block.base.BlockEnumPillar;
|
||||
import WayofTime.bloodmagic.block.base.BlockEnumPillarCap;
|
||||
import WayofTime.bloodmagic.block.base.BlockEnumStairs;
|
||||
|
||||
public class WailaCallbackHandler
|
||||
{
|
||||
|
@ -22,9 +19,6 @@ public class WailaCallbackHandler
|
|||
registrar.registerStackProvider(new DataProviderAlchemyArray(), BlockAlchemyArray.class);
|
||||
registrar.registerStackProvider(new DataProviderMimic(), BlockMimic.class);
|
||||
registrar.registerNBTProvider(new DataProviderMimic(), BlockMimic.class);
|
||||
registrar.registerStackProvider(DataProviderPillar.INSTANCE, BlockEnumPillarCap.class);
|
||||
registrar.registerStackProvider(DataProviderPillar.INSTANCE, BlockEnumPillar.class);
|
||||
registrar.registerStackProvider(DataProviderPillar.INSTANCE, BlockEnumStairs.class);
|
||||
|
||||
registrar.addConfig(Constants.Mod.MODID, Constants.Compat.WAILA_CONFIG_BYPASS_SNEAK, false);
|
||||
registrar.addConfig(Constants.Mod.MODID, Constants.Compat.WAILA_CONFIG_ALTAR, true);
|
||||
|
|
|
@ -43,10 +43,10 @@ public class DataProviderAlchemyArray implements IWailaDataProvider
|
|||
if (tile instanceof TileAlchemyArray)
|
||||
{
|
||||
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
|
||||
if (tileArray.getStackInSlot(0) != null)
|
||||
if (!tileArray.getStackInSlot(0).isEmpty())
|
||||
currenttip.add(TextHelper.localize("waila.BloodMagic.array.reagent", tileArray.getStackInSlot(0).getDisplayName()));
|
||||
|
||||
if (tileArray.getStackInSlot(1) != null)
|
||||
if (!tileArray.getStackInSlot(1).isEmpty())
|
||||
currenttip.add(TextHelper.localize("waila.BloodMagic.array.catalyst", tileArray.getStackInSlot(1).getDisplayName()));
|
||||
}
|
||||
} else
|
||||
|
|
|
@ -129,10 +129,10 @@ public class DataProviderBloodAltar implements IWailaDataProvider
|
|||
|
||||
private static boolean holdingSeerSigil(EntityPlayer player)
|
||||
{
|
||||
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilSeer)
|
||||
if (player.getHeldItemMainhand().getItem() instanceof ItemSigilSeer)
|
||||
return true;
|
||||
|
||||
if (player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() instanceof ItemSigilSeer)
|
||||
if (player.getHeldItemOffhand().getItem() instanceof ItemSigilSeer)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -140,10 +140,10 @@ public class DataProviderBloodAltar implements IWailaDataProvider
|
|||
|
||||
private static boolean holdingDivinationSigil(EntityPlayer player)
|
||||
{
|
||||
if (player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSigilDivination)
|
||||
if (player.getHeldItemMainhand().getItem() instanceof ItemSigilDivination)
|
||||
return true;
|
||||
|
||||
if (player.getHeldItemOffhand() != null && player.getHeldItemOffhand().getItem() instanceof ItemSigilDivination)
|
||||
if (player.getHeldItemOffhand().getItem() instanceof ItemSigilDivination)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -35,7 +35,7 @@ public class DataProviderBloodTank implements IWailaDataProvider
|
|||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (!config.getConfig(Constants.Compat.WAILA_CONFIG_BLOOD_TANK))
|
||||
if (!config.getConfig(Constants.Compat.WAILA_CONFIG_BLOOD_TANK) && !config.getConfig("capability.tankinfo"))
|
||||
return currenttip;
|
||||
|
||||
if (accessor.getPlayer().isSneaking() || config.getConfig(Constants.Compat.WAILA_CONFIG_BYPASS_SNEAK))
|
||||
|
|
|
@ -20,7 +20,7 @@ public class DataProviderMimic implements IWailaDataProvider
|
|||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config)
|
||||
{
|
||||
if (accessor.getNBTData().getBoolean("hasItem"))
|
||||
return ItemStack.loadItemStackFromNBT(accessor.getNBTData());
|
||||
return new ItemStack(accessor.getNBTData());
|
||||
|
||||
return new ItemStack(accessor.getBlock(), 1, accessor.getMetadata());
|
||||
}
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
package WayofTime.bloodmagic.compat.waila.provider;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class DataProviderPillar implements IWailaDataProvider {
|
||||
|
||||
public static final DataProviderPillar INSTANCE = new DataProviderPillar();
|
||||
|
||||
@Override
|
||||
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return new ItemStack(accessor.getBlock(), 1, accessor.getBlock().damageDropped(accessor.getBlockState()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, BlockPos pos) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -65,7 +65,7 @@ public class DataProviderRitualController implements IWailaDataProvider
|
|||
|
||||
if (accessor.getBlock().getMetaFromState(accessor.getBlockState()) == 1 && accessor.getTileEntity() instanceof TileImperfectRitualStone)
|
||||
{
|
||||
if (accessor.getWorld().getBlockState(accessor.getPosition().up()).getBlock() != null)
|
||||
if (accessor.getWorld().isAirBlock(accessor.getPosition().up()))
|
||||
{
|
||||
Block up = accessor.getWorld().getBlockState(accessor.getPosition().up()).getBlock();
|
||||
int meta = up.getMetaFromState(accessor.getWorld().getBlockState(accessor.getPosition().up()));
|
||||
|
|
|
@ -42,7 +42,7 @@ public class DataProviderTeleposer implements IWailaDataProvider
|
|||
if (accessor.getBlock() instanceof BlockTeleposer && accessor.getTileEntity() instanceof TileTeleposer)
|
||||
{
|
||||
TileTeleposer teleposer = (TileTeleposer) accessor.getTileEntity();
|
||||
if (teleposer.getStackInSlot(0) != null)
|
||||
if (!teleposer.getStackInSlot(0).isEmpty())
|
||||
{
|
||||
ItemStack contained = teleposer.getStackInSlot(0);
|
||||
BlockPos toPos = ((ItemTelepositionFocus) contained.getItem()).getBlockPos(contained);
|
||||
|
|
|
@ -20,15 +20,15 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
{
|
||||
for (ItemStack invStack : inv)
|
||||
{
|
||||
if (invStack == null)
|
||||
if (invStack.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int i = 2; i <= 3; i++)
|
||||
{
|
||||
ItemStack stacky = getRecipe(invStack, world, i);
|
||||
if (stacky != null)
|
||||
ItemStack stack = getRecipe(invStack, world, i);
|
||||
if (!stack.isEmpty())
|
||||
{
|
||||
int threshold = CompressionRegistry.getItemThreshold(invStack);
|
||||
|
||||
|
@ -37,13 +37,13 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
if (neededLeft <= 0)
|
||||
{
|
||||
iterateThroughInventory(invStack, 0, inv, needed, true);
|
||||
return stacky;
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
public int iterateThroughInventory(ItemStack required, int kept, ItemStack[] inv, int needed, boolean doDrain)
|
||||
|
@ -54,14 +54,14 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
{
|
||||
i++;
|
||||
|
||||
if (invStack == null)
|
||||
if (invStack.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (invStack.isItemEqual(required) && (invStack.getTagCompound() == null ? required.getTagCompound() == null : invStack.getTagCompound().equals(required.getTagCompound())))
|
||||
{
|
||||
int stackSize = invStack.stackSize;
|
||||
int stackSize = invStack.getCount();
|
||||
int used = 0;
|
||||
if (kept > 0)
|
||||
{
|
||||
|
@ -76,10 +76,10 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
int remainingFromStack = Math.max(stackSize - used - needed, 0);
|
||||
if (doDrain)
|
||||
{
|
||||
invStack.stackSize = remainingFromStack + used;
|
||||
if (invStack.stackSize <= 0)
|
||||
invStack.setCount(remainingFromStack + used);
|
||||
if (invStack.isEmpty())
|
||||
{
|
||||
inv[i] = null;
|
||||
inv[i] = ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
|
||||
public static boolean isResultStackReversible(ItemStack stack, int gridSize, World world)
|
||||
{
|
||||
if (stack == null)
|
||||
if (stack.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -113,12 +113,12 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
inventory.setInventorySlotContents(0, stack);
|
||||
|
||||
ItemStack returnStack = StorageBlockCraftingManager.getInstance().findMatchingRecipe(inventory, world);
|
||||
if (returnStack == null)
|
||||
if (returnStack.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack compressedStack = null;
|
||||
ItemStack compressedStack = ItemStack.EMPTY;
|
||||
switch (gridSize)
|
||||
{
|
||||
case 2:
|
||||
|
@ -129,7 +129,7 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
break;
|
||||
}
|
||||
|
||||
return compressedStack != null && CompressionRegistry.areItemStacksEqual(stack, compressedStack);
|
||||
return !compressedStack.isEmpty() && CompressionRegistry.areItemStacksEqual(stack, compressedStack);
|
||||
}
|
||||
|
||||
public static ItemStack getRecipe(ItemStack stack, World world, int gridSize)
|
||||
|
@ -151,7 +151,7 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
|
||||
public static boolean has22Recipe(ItemStack stack, World world)
|
||||
{
|
||||
return get22Recipe(stack, world) != null;
|
||||
return !get22Recipe(stack, world).isEmpty();
|
||||
}
|
||||
|
||||
public static ItemStack get22Recipe(ItemStack stack, World world)
|
||||
|
@ -161,7 +161,7 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
|
||||
public static boolean has33Recipe(ItemStack stack, World world)
|
||||
{
|
||||
return get33Recipe(stack, world) != null;
|
||||
return !get33Recipe(stack, world).isEmpty();
|
||||
}
|
||||
|
||||
public static ItemStack get33Recipe(ItemStack stack, World world)
|
||||
|
|
|
@ -38,7 +38,7 @@ public class BaseCompressionHandler extends CompressionHandler
|
|||
return this.getResultStack();
|
||||
}
|
||||
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
public int getRemainingNeeded(ItemStack[] inv)
|
||||
|
@ -53,7 +53,7 @@ public class BaseCompressionHandler extends CompressionHandler
|
|||
|
||||
public int iterateThroughInventory(ItemStack[] inv, boolean doDrain)
|
||||
{
|
||||
int needed = this.required.stackSize;
|
||||
int needed = this.required.getCount();
|
||||
int kept = this.getLeftover();
|
||||
int i = -1;
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class BaseCompressionHandler extends CompressionHandler
|
|||
|
||||
if (invStack.isItemEqual(this.required) && (invStack.getTagCompound() == null ? this.required.getTagCompound() == null : invStack.getTagCompound().equals(this.required.getTagCompound())))
|
||||
{
|
||||
int stackSize = invStack.stackSize;
|
||||
int stackSize = invStack.getCount();
|
||||
int used = 0;
|
||||
if (kept > 0)
|
||||
{
|
||||
|
@ -83,10 +83,10 @@ public class BaseCompressionHandler extends CompressionHandler
|
|||
int remainingFromStack = Math.max(stackSize - used - needed, 0);
|
||||
if (doDrain)
|
||||
{
|
||||
invStack.stackSize = remainingFromStack + used;
|
||||
if (invStack.stackSize <= 0)
|
||||
invStack.setCount(remainingFromStack + used);
|
||||
if (invStack.isEmpty())
|
||||
{
|
||||
inv[i] = null;
|
||||
inv[i] = ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ public class StorageBlockCraftingManager
|
|||
|
||||
private static boolean isResultStackReversible(ItemStack stack, int gridSize, World world, List list)
|
||||
{
|
||||
if (stack == null)
|
||||
if (stack.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -47,12 +47,12 @@ public class StorageBlockCraftingManager
|
|||
inventory.setInventorySlotContents(0, stack);
|
||||
|
||||
ItemStack returnStack = StorageBlockCraftingManager.getInstance().findMatchingRecipe(inventory, world, list);
|
||||
if (returnStack == null || returnStack.getItem() == null)
|
||||
if (returnStack.isEmpty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack compressedStack = null;
|
||||
ItemStack compressedStack = ItemStack.EMPTY;
|
||||
switch (gridSize)
|
||||
{
|
||||
case 2:
|
||||
|
@ -63,7 +63,7 @@ public class StorageBlockCraftingManager
|
|||
break;
|
||||
}
|
||||
|
||||
return compressedStack != null && CompressionRegistry.areItemStacksEqual(stack, compressedStack);
|
||||
return !compressedStack.isEmpty() && CompressionRegistry.areItemStacksEqual(stack, compressedStack);
|
||||
}
|
||||
|
||||
private static ItemStack getRecipe(ItemStack stack, World world, int gridSize, List list)
|
||||
|
@ -85,7 +85,7 @@ public class StorageBlockCraftingManager
|
|||
|
||||
private static boolean has22Recipe(ItemStack stack, World world, List list)
|
||||
{
|
||||
return get22Recipe(stack, world, list) != null;
|
||||
return !get22Recipe(stack, world, list).isEmpty();
|
||||
}
|
||||
|
||||
private static ItemStack get22Recipe(ItemStack stack, World world, List list)
|
||||
|
@ -95,7 +95,7 @@ public class StorageBlockCraftingManager
|
|||
|
||||
private static boolean has33Recipe(ItemStack stack, World world, List list)
|
||||
{
|
||||
return get33Recipe(stack, world, list) != null;
|
||||
return !get33Recipe(stack, world, list).isEmpty();
|
||||
}
|
||||
|
||||
private static ItemStack get33Recipe(ItemStack stack, World world, List list)
|
||||
|
@ -111,15 +111,15 @@ public class StorageBlockCraftingManager
|
|||
private ItemStack findMatchingRecipe(InventoryCrafting craftingInventory, World world, List list)
|
||||
{
|
||||
int i = 0;
|
||||
ItemStack itemstack = null;
|
||||
ItemStack itemstack1 = null;
|
||||
ItemStack itemstack = ItemStack.EMPTY;
|
||||
ItemStack itemstack1 = ItemStack.EMPTY;
|
||||
int j;
|
||||
|
||||
for (j = 0; j < craftingInventory.getSizeInventory(); ++j)
|
||||
{
|
||||
ItemStack itemstack2 = craftingInventory.getStackInSlot(j);
|
||||
|
||||
if (itemstack2 != null)
|
||||
if (!itemstack2.isEmpty())
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
|
@ -135,13 +135,13 @@ public class StorageBlockCraftingManager
|
|||
}
|
||||
}
|
||||
|
||||
if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && itemstack.getItem().isRepairable())
|
||||
if (i == 2 && itemstack.getItem() == itemstack1.getItem() && itemstack.getCount() == 1 && itemstack1.getCount() == 1 && itemstack.getItem().isRepairable())
|
||||
{
|
||||
Item item = itemstack.getItem();
|
||||
int j1 = item.getMaxDamage() - itemstack.getItemDamage();
|
||||
int k = item.getMaxDamage() - itemstack1.getItemDamage();
|
||||
int l = j1 + k + item.getMaxDamage() * 5 / 100;
|
||||
int i1 = item.getMaxDamage() - l;
|
||||
int j1 = item.getMaxDamage(itemstack) - itemstack.getItemDamage();
|
||||
int k = item.getMaxDamage(itemstack) - itemstack1.getItemDamage();
|
||||
int l = j1 + k + item.getMaxDamage(itemstack) * 5 / 100;
|
||||
int i1 = item.getMaxDamage(itemstack) - l;
|
||||
|
||||
if (i1 < 0)
|
||||
{
|
||||
|
@ -161,7 +161,7 @@ public class StorageBlockCraftingManager
|
|||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ public class StorageBlockCraftingRecipeAssimilator
|
|||
continue;
|
||||
|
||||
ItemStack output = recipe.getRecipeOutput();
|
||||
if (output == null || output.getItem() == null)
|
||||
if (output.isEmpty())
|
||||
continue;
|
||||
|
||||
if (output.stackSize == 1)
|
||||
if (output.getCount() == 1)
|
||||
{
|
||||
PackingRecipe packingRecipe = getPackingRecipe(recipe);
|
||||
|
||||
|
@ -44,7 +44,7 @@ public class StorageBlockCraftingRecipeAssimilator
|
|||
{
|
||||
packingRecipes.add(packingRecipe);
|
||||
}
|
||||
} else if ((output.stackSize == 4 || output.stackSize == 9) && recipe.getRecipeSize() == 1)
|
||||
} else if ((output.getCount() == 4 || output.getCount() == 9) && recipe.getRecipeSize() == 1)
|
||||
{
|
||||
unpackingRecipes.add(recipe);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ public class StorageBlockCraftingRecipeAssimilator
|
|||
{
|
||||
// the recipe could be parsed, use its inputs directly since that's faster verify recipe size
|
||||
|
||||
if (recipePack.inputCount != unpacked.stackSize)
|
||||
if (recipePack.inputCount != unpacked.getCount())
|
||||
continue;
|
||||
|
||||
// check if any of the input options matches the unpacked
|
||||
|
@ -99,14 +99,14 @@ public class StorageBlockCraftingRecipeAssimilator
|
|||
{
|
||||
// unknown IRecipe, check through the recipe conventionally verify recipe size for 3x3 to skip anything smaller quickly
|
||||
|
||||
if (unpacked.stackSize == 9 && recipePack.recipe.getRecipeSize() < 9)
|
||||
if (unpacked.getCount() == 9 && recipePack.recipe.getRecipeSize() < 9)
|
||||
continue;
|
||||
|
||||
// initialize inventory late, but only once per unpack recipe
|
||||
|
||||
if (inventory == null)
|
||||
{
|
||||
if (unpacked.stackSize == 4)
|
||||
if (unpacked.getCount() == 4)
|
||||
{
|
||||
inventory = inventory2x2;
|
||||
} else
|
||||
|
@ -114,7 +114,7 @@ public class StorageBlockCraftingRecipeAssimilator
|
|||
inventory = inventory3x3;
|
||||
}
|
||||
|
||||
for (int i = 0; i < unpacked.stackSize; i++)
|
||||
for (int i = 0; i < unpacked.getCount(); i++)
|
||||
{
|
||||
inventory.setInventorySlotContents(i, unpacked.copy());
|
||||
}
|
||||
|
|
|
@ -29,13 +29,7 @@ public class WillChunk
|
|||
this.currentWill = currentWill;
|
||||
}
|
||||
|
||||
public boolean isModified()
|
||||
{
|
||||
if ((this.chunkRef != null) && (this.chunkRef.get() != null))
|
||||
{
|
||||
return ((Chunk) this.chunkRef.get()).needsSaving(false);
|
||||
}
|
||||
|
||||
return false;
|
||||
public boolean isModified() {
|
||||
return (this.chunkRef != null) && (this.chunkRef.get() != null) && this.chunkRef.get().needsSaving(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
|
@ -15,6 +16,7 @@ public class WorldDemonWillHandler
|
|||
static ConcurrentHashMap<Integer, WillWorld> containedWills = new ConcurrentHashMap<Integer, WillWorld>();
|
||||
public static ConcurrentHashMap<Integer, CopyOnWriteArrayList<PosXY>> dirtyChunks = new ConcurrentHashMap<Integer, CopyOnWriteArrayList<PosXY>>();
|
||||
|
||||
@Nullable
|
||||
public static DemonWillHolder getWillHolder(int dim, int x, int y)
|
||||
{
|
||||
WillChunk chunk = getWillChunk(dim, x, y);
|
||||
|
@ -36,6 +38,7 @@ public class WorldDemonWillHandler
|
|||
return containedWills.get(dim);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static WillChunk getWillChunk(int dim, int x, int y)
|
||||
{
|
||||
if (!containedWills.containsKey(dim))
|
||||
|
|
|
@ -37,12 +37,12 @@ public class EntityAIAttackRangedBow extends EntityAIBase
|
|||
*/
|
||||
public boolean shouldExecute()
|
||||
{
|
||||
return this.entity.getAttackTarget() == null ? false : this.isBowInMainhand();
|
||||
return this.entity.getAttackTarget() != null && this.isBowInMainhand();
|
||||
}
|
||||
|
||||
protected boolean isBowInMainhand()
|
||||
{
|
||||
return this.entity.getHeldItemMainhand() != null && this.entity.getHeldItemMainhand().getItem() instanceof ItemBow;
|
||||
return this.entity.getHeldItemMainhand().getItem() instanceof ItemBow;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,7 +37,7 @@ public class EntityAIAttackStealthMelee extends EntityAIBase
|
|||
public EntityAIAttackStealthMelee(EntityCorruptedChicken creature, double speedIn, boolean useLongMemory)
|
||||
{
|
||||
this.chicken = creature;
|
||||
this.worldObj = creature.worldObj;
|
||||
this.worldObj = creature.getEntityWorld();
|
||||
this.speedTowardsTarget = speedIn;
|
||||
this.longMemory = useLongMemory;
|
||||
this.setMutexBits(3);
|
||||
|
|
|
@ -20,7 +20,7 @@ public class EntityAIEatAndCorruptBlock extends EntityAIBase
|
|||
public EntityAIEatAndCorruptBlock(EntityAspectedDemonBase entity)
|
||||
{
|
||||
this.grassEaterEntity = entity;
|
||||
this.world = entity.worldObj;
|
||||
this.world = entity.getEntityWorld();
|
||||
this.setMutexBits(7);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public class EntityAIFollowOwner extends EntityAIBase
|
|||
public EntityAIFollowOwner(EntityDemonBase thePetIn, double followSpeedIn, float minDistIn, float maxDistIn)
|
||||
{
|
||||
this.thePet = thePetIn;
|
||||
this.theWorld = thePetIn.worldObj;
|
||||
this.theWorld = thePetIn.getEntityWorld();
|
||||
this.followSpeed = followSpeedIn;
|
||||
this.petPathfinder = thePetIn.getNavigator();
|
||||
this.minDist = minDistIn;
|
||||
|
@ -100,7 +100,7 @@ public class EntityAIFollowOwner extends EntityAIBase
|
|||
{
|
||||
IBlockState iblockstate = this.theWorld.getBlockState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
return block == Blocks.AIR ? true : !iblockstate.isFullCube();
|
||||
return block == Blocks.AIR || !iblockstate.isFullCube();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -122,9 +122,9 @@ public class EntityAIFollowOwner extends EntityAIBase
|
|||
{
|
||||
if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D)
|
||||
{
|
||||
int i = MathHelper.floor_double(this.theOwner.posX) - 2;
|
||||
int j = MathHelper.floor_double(this.theOwner.posZ) - 2;
|
||||
int k = MathHelper.floor_double(this.theOwner.getEntityBoundingBox().minY);
|
||||
int i = MathHelper.floor(this.theOwner.posX) - 2;
|
||||
int j = MathHelper.floor(this.theOwner.posZ) - 2;
|
||||
int k = MathHelper.floor(this.theOwner.getEntityBoundingBox().minY);
|
||||
|
||||
for (int l = 0; l <= 4; ++l)
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ public class EntityAIGrabEffectsFromOwner extends EntityAIBase
|
|||
public EntityAIGrabEffectsFromOwner(EntitySentientSpecter thePetIn, double followSpeedIn, float minDistIn)
|
||||
{
|
||||
this.thePet = thePetIn;
|
||||
this.theWorld = thePetIn.worldObj;
|
||||
this.theWorld = thePetIn.getEntityWorld();
|
||||
this.followSpeed = followSpeedIn;
|
||||
this.petPathfinder = thePetIn.getNavigator();
|
||||
this.minDist = minDistIn;
|
||||
|
@ -105,7 +105,7 @@ public class EntityAIGrabEffectsFromOwner extends EntityAIBase
|
|||
{
|
||||
IBlockState iblockstate = this.theWorld.getBlockState(pos);
|
||||
Block block = iblockstate.getBlock();
|
||||
return block == Blocks.AIR ? true : !iblockstate.isFullCube();
|
||||
return block == Blocks.AIR || !iblockstate.isFullCube();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -135,9 +135,9 @@ public class EntityAIGrabEffectsFromOwner extends EntityAIBase
|
|||
{
|
||||
if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D)
|
||||
{
|
||||
int i = MathHelper.floor_double(this.theOwner.posX) - 2;
|
||||
int j = MathHelper.floor_double(this.theOwner.posZ) - 2;
|
||||
int k = MathHelper.floor_double(this.theOwner.getEntityBoundingBox().minY);
|
||||
int i = MathHelper.floor(this.theOwner.posX) - 2;
|
||||
int j = MathHelper.floor(this.theOwner.posZ) - 2;
|
||||
int k = MathHelper.floor(this.theOwner.getEntityBoundingBox().minY);
|
||||
|
||||
for (int l = 0; l <= 4; ++l)
|
||||
{
|
||||
|
|
|
@ -40,7 +40,7 @@ public class EntityAIPickUpAlly extends EntityAIBase
|
|||
public EntityAIPickUpAlly(EntityAspectedDemonBase creature, double speedIn, boolean useLongMemory)
|
||||
{
|
||||
this.entity = creature;
|
||||
this.worldObj = creature.worldObj;
|
||||
this.worldObj = creature.getEntityWorld();
|
||||
this.speedTowardsTarget = speedIn;
|
||||
this.longMemory = useLongMemory;
|
||||
this.setMutexBits(3);
|
||||
|
@ -57,7 +57,7 @@ public class EntityAIPickUpAlly extends EntityAIBase
|
|||
}
|
||||
|
||||
AxisAlignedBB bb = new AxisAlignedBB(entity.posX - 0.5, entity.posY - 0.5, entity.posZ - 0.5, entity.posX + 0.5, entity.posY + 0.5, entity.posZ + 0.5).expandXyz(5);
|
||||
List<EntityLivingBase> list = this.entity.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, bb, new EntityAspectedDemonBase.WillTypePredicate(entity.getType()));
|
||||
List<EntityLivingBase> list = this.entity.getEntityWorld().getEntitiesWithinAABB(EntityLivingBase.class, bb, new EntityAspectedDemonBase.WillTypePredicate(entity.getType()));
|
||||
for (EntityLivingBase testEntity : list)
|
||||
{
|
||||
if (testEntity != this.entity)
|
||||
|
|
|
@ -21,7 +21,7 @@ public class EntityAIProtectAlly extends EntityAIBase
|
|||
public EntityAIProtectAlly(EntityCorruptedSheep entity)
|
||||
{
|
||||
this.entity = entity;
|
||||
this.world = entity.worldObj;
|
||||
this.world = entity.getEntityWorld();
|
||||
this.setMutexBits(7);
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ public class EntityAIRetreatToHeal<T extends Entity> extends EntityAIBase
|
|||
}
|
||||
|
||||
//This part almost doesn't matter
|
||||
List<T> list = this.theEntity.worldObj.<T>getEntitiesWithinAABB(this.classToAvoid, this.theEntity.getEntityBoundingBox().expand((double) this.avoidDistance, 3.0D, (double) this.avoidDistance), Predicates.and(new Predicate[] { EntitySelectors.CAN_AI_TARGET, this.canBeSeenSelector, this.avoidTargetSelector }));
|
||||
List<T> list = this.theEntity.getEntityWorld().<T>getEntitiesWithinAABB(this.classToAvoid, this.theEntity.getEntityBoundingBox().expand((double) this.avoidDistance, 3.0D, (double) this.avoidDistance), Predicates.and(new Predicate[] { EntitySelectors.CAN_AI_TARGET, this.canBeSeenSelector, this.avoidTargetSelector }));
|
||||
|
||||
if (list.isEmpty())
|
||||
{
|
||||
|
|
|
@ -82,7 +82,7 @@ public class EntityAIStealthRetreat extends EntityAIBase
|
|||
@Override
|
||||
public void startExecuting()
|
||||
{
|
||||
ticksLeft = this.entity.worldObj.rand.nextInt(100) + 100;
|
||||
ticksLeft = this.entity.getEntityWorld().rand.nextInt(100) + 100;
|
||||
this.entityPathNavigate.setPath(this.entityPathEntity, this.farSpeed);
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public class EntityAIStealthTowardsTarget extends EntityAIBase
|
|||
return false;
|
||||
} else
|
||||
{
|
||||
ticksLeft = this.entity.worldObj.rand.nextInt(200) + 100;
|
||||
ticksLeft = this.entity.getEntityWorld().rand.nextInt(200) + 100;
|
||||
this.xPosition = vec3d.xCoord;
|
||||
this.yPosition = vec3d.yCoord;
|
||||
this.zPosition = vec3d.zCoord;
|
||||
|
@ -75,7 +75,7 @@ public class EntityAIStealthTowardsTarget extends EntityAIBase
|
|||
if (this.entity.getNavigator().noPath())
|
||||
{
|
||||
EntityLivingBase target = this.entity.getAttackTarget();
|
||||
Vec3d vec3d = null;
|
||||
Vec3d vec3d;
|
||||
if (target instanceof EntityCreature)
|
||||
{
|
||||
vec3d = RandomPositionGenerator.findRandomTarget((EntityCreature) target, 10, 7);
|
||||
|
|
|
@ -180,15 +180,15 @@ public abstract class EntityAspectedDemonBase extends EntityDemonBase
|
|||
float newAmount = amount;
|
||||
if (source.isProjectile())
|
||||
{
|
||||
newAmount *= MathHelper.clamp_double(1 - getProjectileResist(), 0, 1);
|
||||
newAmount *= MathHelper.clamp(1 - getProjectileResist(), 0, 1);
|
||||
} else
|
||||
{
|
||||
newAmount *= MathHelper.clamp_double(1 - getMeleeResist(), 0, 1);
|
||||
newAmount *= MathHelper.clamp(1 - getMeleeResist(), 0, 1);
|
||||
}
|
||||
|
||||
if (source.isMagicDamage())
|
||||
{
|
||||
newAmount *= MathHelper.clamp_double(1 - getMagicResist(), 0, 1);
|
||||
newAmount *= MathHelper.clamp(1 - getMagicResist(), 0, 1);
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, newAmount);
|
||||
|
|
|
@ -139,7 +139,7 @@ public class EntityCorruptedChicken extends EntityAspectedDemonBase
|
|||
this.oFlap = this.wingRotation;
|
||||
this.oFlapSpeed = this.destPos;
|
||||
this.destPos = (float) ((double) this.destPos + (double) (this.onGround ? -1 : 4) * 0.3D);
|
||||
this.destPos = MathHelper.clamp_float(this.destPos, 0.0F, 1.0F);
|
||||
this.destPos = MathHelper.clamp(this.destPos, 0.0F, 1.0F);
|
||||
|
||||
if (!this.onGround && this.wingRotDelta < 1.0F)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ public class EntityCorruptedChicken extends EntityAspectedDemonBase
|
|||
|
||||
this.wingRotation += this.wingRotDelta * 2.0F;
|
||||
|
||||
if (!this.worldObj.isRemote && !this.isChild() && --this.timeUntilNextEgg <= 0)
|
||||
if (!this.getEntityWorld().isRemote && !this.isChild() && --this.timeUntilNextEgg <= 0)
|
||||
{
|
||||
this.playSound(SoundEvents.ENTITY_CHICKEN_EGG, 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
|
||||
this.dropItem(Items.EGG, 1);
|
||||
|
|
|
@ -121,7 +121,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh
|
|||
@Override
|
||||
public void onLivingUpdate()
|
||||
{
|
||||
if (this.worldObj.isRemote)
|
||||
if (this.getEntityWorld().isRemote)
|
||||
{
|
||||
this.sheepTimer = Math.max(0, this.sheepTimer - 1);
|
||||
this.castTimer = Math.max(0, castTimer - 1);
|
||||
|
@ -359,7 +359,7 @@ public class EntityCorruptedSheep extends EntityAspectedDemonBase implements ISh
|
|||
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, @Nullable IEntityLivingData livingdata)
|
||||
{
|
||||
livingdata = super.onInitialSpawn(difficulty, livingdata);
|
||||
this.setFleeceColor(getRandomSheepColor(this.worldObj.rand));
|
||||
this.setFleeceColor(getRandomSheepColor(this.getEntityWorld().rand));
|
||||
return livingdata;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
|
|||
this.tasks.addTask(5, new EntityAIWander(this, 0.8D));
|
||||
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
||||
this.tasks.addTask(6, new EntityAILookIdle(this));
|
||||
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
|
||||
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
|
||||
|
||||
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
|
||||
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityLivingBase>(this, EntityLivingBase.class, 10, true, false, new EntityAspectedDemonBase.TeamAttackPredicate(this)));
|
||||
|
@ -95,7 +95,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
|
|||
}
|
||||
|
||||
@Override
|
||||
protected PathNavigate getNewNavigator(World worldIn)
|
||||
protected PathNavigate createNavigator(World worldIn)
|
||||
{
|
||||
return new PathNavigateClimber(this, worldIn);
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
|
|||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
this.dataManager.register(CLIMBING, Byte.valueOf((byte) 0));
|
||||
this.dataManager.register(CLIMBING, (byte) 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -112,7 +112,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
|
|||
{
|
||||
super.onUpdate();
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
if (!this.getEntityWorld().isRemote)
|
||||
{
|
||||
this.setBesideClimbableBlock(this.isCollidedHorizontally);
|
||||
}
|
||||
|
@ -168,17 +168,17 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
|
|||
@Override
|
||||
public boolean isPotionApplicable(PotionEffect potioneffectIn)
|
||||
{
|
||||
return potioneffectIn.getPotion() == MobEffects.POISON ? false : super.isPotionApplicable(potioneffectIn);
|
||||
return potioneffectIn.getPotion() != MobEffects.POISON && super.isPotionApplicable(potioneffectIn);
|
||||
}
|
||||
|
||||
public boolean isBesideClimbableBlock()
|
||||
{
|
||||
return (((Byte) this.dataManager.get(CLIMBING)).byteValue() & 1) != 0;
|
||||
return (this.dataManager.get(CLIMBING) & 1) != 0;
|
||||
}
|
||||
|
||||
public void setBesideClimbableBlock(boolean climbing)
|
||||
{
|
||||
byte b0 = ((Byte) this.dataManager.get(CLIMBING)).byteValue();
|
||||
byte b0 = this.dataManager.get(CLIMBING);
|
||||
|
||||
if (climbing)
|
||||
{
|
||||
|
@ -188,7 +188,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
|
|||
b0 = (byte) (b0 & -2);
|
||||
}
|
||||
|
||||
this.dataManager.set(CLIMBING, Byte.valueOf(b0));
|
||||
this.dataManager.set(CLIMBING, b0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -213,7 +213,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
|
|||
|
||||
if (f >= 0.5F && this.attacker.getRNG().nextInt(100) == 0)
|
||||
{
|
||||
this.attacker.setAttackTarget((EntityLivingBase) null);
|
||||
this.attacker.setAttackTarget(null);
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
|
@ -240,7 +240,7 @@ public class EntityCorruptedSpider extends EntityAspectedDemonBase
|
|||
public boolean shouldExecute()
|
||||
{
|
||||
float f = this.taskOwner.getBrightness(1.0F);
|
||||
return f >= 0.5F ? false : super.shouldExecute();
|
||||
return !(f >= 0.5F) && super.shouldExecute();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -73,17 +73,17 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase
|
|||
@Override
|
||||
public void setCombatTask()
|
||||
{
|
||||
if (this.worldObj != null && !this.worldObj.isRemote)
|
||||
if (!this.getEntityWorld().isRemote)
|
||||
{
|
||||
this.tasks.removeTask(this.aiAttackOnCollide);
|
||||
this.tasks.removeTask(this.aiArrowAttack);
|
||||
ItemStack itemstack = this.getHeldItemMainhand();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemBow)
|
||||
if (!itemstack.isEmpty() && itemstack.getItem() instanceof ItemBow)
|
||||
{
|
||||
int i = 20;
|
||||
|
||||
if (this.worldObj.getDifficulty() != EnumDifficulty.HARD)
|
||||
if (this.getEntityWorld().getDifficulty() != EnumDifficulty.HARD)
|
||||
{
|
||||
i = 40;
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase
|
|||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount)
|
||||
{
|
||||
return this.isEntityInvulnerable(source) ? false : super.attackEntityFrom(source, amount);
|
||||
return !this.isEntityInvulnerable(source) && super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -128,7 +128,7 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase
|
|||
*/
|
||||
public double absorbWillFromAuraToHeal(double toHeal)
|
||||
{
|
||||
if (worldObj.isRemote)
|
||||
if (getEntityWorld().isRemote)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -139,13 +139,13 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase
|
|||
return 0;
|
||||
}
|
||||
|
||||
double will = WorldDemonWillHandler.getCurrentWill(worldObj, getPosition(), getType());
|
||||
double will = WorldDemonWillHandler.getCurrentWill(getEntityWorld(), getPosition(), getType());
|
||||
|
||||
toHeal = Math.min(healthMissing, Math.min(toHeal, will / getWillToHealth()));
|
||||
if (toHeal > 0)
|
||||
{
|
||||
this.heal((float) toHeal);
|
||||
return WorldDemonWillHandler.drainWill(worldObj, getPosition(), getType(), toHeal * getWillToHealth(), true);
|
||||
return WorldDemonWillHandler.drainWill(getEntityWorld(), getPosition(), getType(), toHeal * getWillToHealth(), true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -164,7 +164,7 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase
|
|||
|
||||
public void onUpdate()
|
||||
{
|
||||
if (!this.worldObj.isRemote && this.ticksExisted % 20 == 0)
|
||||
if (!this.getEntityWorld().isRemote && this.ticksExisted % 20 == 0)
|
||||
{
|
||||
absorbWillFromAuraToHeal(2);
|
||||
}
|
||||
|
@ -174,15 +174,8 @@ public class EntityCorruptedZombie extends EntityAspectedDemonBase
|
|||
|
||||
//TODO: Change to fit the given AI
|
||||
@Override
|
||||
public boolean shouldAttackEntity(EntityLivingBase attacker, EntityLivingBase owner)
|
||||
{
|
||||
if (!(attacker instanceof EntityCreeper) && !(attacker instanceof EntityGhast))
|
||||
{
|
||||
return super.shouldAttackEntity(attacker, owner);
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public boolean shouldAttackEntity(EntityLivingBase attacker, EntityLivingBase owner) {
|
||||
return !(attacker instanceof EntityCreeper) && !(attacker instanceof EntityGhast) && super.shouldAttackEntity(attacker, owner);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,8 +39,8 @@ import com.google.common.base.Predicate;
|
|||
|
||||
public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
||||
{
|
||||
protected static final DataParameter<Byte> TAMED = EntityDataManager.<Byte>createKey(EntityDemonBase.class, DataSerializers.BYTE);
|
||||
protected static final DataParameter<Optional<UUID>> OWNER_UNIQUE_ID = EntityDataManager.<Optional<UUID>>createKey(EntityDemonBase.class, DataSerializers.OPTIONAL_UNIQUE_ID);
|
||||
protected static final DataParameter<Byte> TAMED = EntityDataManager.createKey(EntityDemonBase.class, DataSerializers.BYTE);
|
||||
protected static final DataParameter<Optional<UUID>> OWNER_UNIQUE_ID = EntityDataManager.createKey(EntityDemonBase.class, DataSerializers.OPTIONAL_UNIQUE_ID);
|
||||
|
||||
public EntityDemonBase(World worldIn)
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
this.dataManager.register(TAMED, Byte.valueOf((byte) 0));
|
||||
this.dataManager.register(TAMED, (byte) 0);
|
||||
this.dataManager.register(OWNER_UNIQUE_ID, Optional.<UUID>absent());
|
||||
}
|
||||
|
||||
|
@ -84,7 +84,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount)
|
||||
{
|
||||
return this.isEntityInvulnerable(source) ? false : super.attackEntityFrom(source, amount);
|
||||
return !this.isEntityInvulnerable(source) && super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -106,7 +106,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
|
||||
if (flag)
|
||||
{
|
||||
if (i > 0 && attackedEntity instanceof EntityLivingBase)
|
||||
if (i > 0)
|
||||
{
|
||||
((EntityLivingBase) attackedEntity).knockBack(this, (float) i * 0.5F, (double) MathHelper.sin(this.rotationYaw * 0.017453292F), (double) (-MathHelper.cos(this.rotationYaw * 0.017453292F)));
|
||||
this.motionX *= 0.6D;
|
||||
|
@ -124,16 +124,16 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
{
|
||||
EntityPlayer entityplayer = (EntityPlayer) attackedEntity;
|
||||
ItemStack itemstack = this.getHeldItemMainhand();
|
||||
ItemStack itemstack1 = entityplayer.isHandActive() ? entityplayer.getActiveItemStack() : null;
|
||||
ItemStack itemstack1 = entityplayer.isHandActive() ? entityplayer.getActiveItemStack() : ItemStack.EMPTY;
|
||||
|
||||
if (itemstack != null && itemstack1 != null && itemstack.getItem() instanceof ItemAxe && itemstack1.getItem() == Items.SHIELD)
|
||||
if (!itemstack.isEmpty() && !itemstack1.isEmpty() && itemstack.getItem() instanceof ItemAxe && itemstack1.getItem() == Items.SHIELD)
|
||||
{
|
||||
float f1 = 0.25F + (float) EnchantmentHelper.getEfficiencyModifier(this) * 0.05F;
|
||||
|
||||
if (this.rand.nextFloat() < f1)
|
||||
{
|
||||
entityplayer.getCooldownTracker().setCooldown(Items.SHIELD, 100);
|
||||
this.worldObj.setEntityState(entityplayer, (byte) 30);
|
||||
this.getEntityWorld().setEntityState(entityplayer, (byte) 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
{
|
||||
super.setItemStackToSlot(slotIn, stack);
|
||||
|
||||
if (!this.worldObj.isRemote && slotIn == EntityEquipmentSlot.MAINHAND)
|
||||
if (!this.getEntityWorld().isRemote && slotIn == EntityEquipmentSlot.MAINHAND)
|
||||
{
|
||||
this.setCombatTask();
|
||||
}
|
||||
|
@ -169,10 +169,10 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
{
|
||||
this.heal((float) toHeal);
|
||||
|
||||
if (worldObj instanceof WorldServer)
|
||||
if (getEntityWorld() instanceof WorldServer)
|
||||
{
|
||||
WorldServer server = (WorldServer) worldObj;
|
||||
server.spawnParticle(EnumParticleTypes.HEART, this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, 7, 0.2, 0.2, 0.2, 0, new int[0]);
|
||||
WorldServer server = (WorldServer) getEntityWorld();
|
||||
server.spawnParticle(EnumParticleTypes.HEART, this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, 7, 0.2, 0.2, 0.2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
{
|
||||
super.readEntityFromNBT(tag);
|
||||
|
||||
String s = "";
|
||||
String s;
|
||||
|
||||
if (tag.hasKey("OwnerUUID", 8))
|
||||
{
|
||||
|
@ -248,7 +248,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
}
|
||||
}
|
||||
|
||||
return attacker instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) attacker) ? false : !(attacker instanceof EntityHorse) || !((EntityHorse) attacker).isTame();
|
||||
return !(attacker instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) attacker)) && (!(attacker instanceof EntityHorse) || !((EntityHorse) attacker).isTame());
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
|
@ -262,19 +262,19 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
|
||||
public boolean isTamed()
|
||||
{
|
||||
return (((Byte) this.dataManager.get(TAMED)).byteValue() & 4) != 0;
|
||||
return (this.dataManager.get(TAMED) & 4) != 0;
|
||||
}
|
||||
|
||||
public void setTamed(boolean tamed)
|
||||
{
|
||||
byte b0 = ((Byte) this.dataManager.get(TAMED)).byteValue();
|
||||
byte b0 = this.dataManager.get(TAMED);
|
||||
|
||||
if (tamed)
|
||||
{
|
||||
this.dataManager.set(TAMED, Byte.valueOf((byte) (b0 | 4)));
|
||||
this.dataManager.set(TAMED, (byte) (b0 | 4));
|
||||
} else
|
||||
{
|
||||
this.dataManager.set(TAMED, Byte.valueOf((byte) (b0 & -5)));
|
||||
this.dataManager.set(TAMED, (byte) (b0 & -5));
|
||||
}
|
||||
|
||||
// this.setupTamedAI();
|
||||
|
@ -316,7 +316,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
@Override
|
||||
public UUID getOwnerId()
|
||||
{
|
||||
return (UUID) (this.dataManager.get(OWNER_UNIQUE_ID)).orNull();
|
||||
return (this.dataManager.get(OWNER_UNIQUE_ID)).orNull();
|
||||
}
|
||||
|
||||
public void setOwnerId(UUID uuid)
|
||||
|
@ -330,7 +330,7 @@ public class EntityDemonBase extends EntityCreature implements IEntityOwnable
|
|||
try
|
||||
{
|
||||
UUID uuid = this.getOwnerId();
|
||||
return uuid == null ? null : this.worldObj.getPlayerEntityByUUID(uuid);
|
||||
return uuid == null ? null : this.getEntityWorld().getPlayerEntityByUUID(uuid);
|
||||
} catch (IllegalArgumentException var2)
|
||||
{
|
||||
return null;
|
||||
|
|
|
@ -43,7 +43,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
/**
|
||||
* Copy of EntitySpider's AI (should be pretty evident...)
|
||||
*/
|
||||
private static final DataParameter<Byte> CLIMBING = EntityDataManager.<Byte>createKey(EntityMimic.class, DataSerializers.BYTE);
|
||||
private static final DataParameter<Byte> CLIMBING = EntityDataManager.createKey(EntityMimic.class, DataSerializers.BYTE);
|
||||
|
||||
public boolean dropItemsOnBreak = true;
|
||||
public NBTTagCompound tileTag = new NBTTagCompound();
|
||||
|
@ -64,7 +64,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
this.tasks.addTask(8, new EntityAILookIdle(this));
|
||||
this.tasks.addTask(7, new EntityAIMimicReform(this));
|
||||
|
||||
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
|
||||
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
|
||||
this.targetTasks.addTask(2, new EntityMimic.AISpiderTarget(this, EntityPlayer.class));
|
||||
this.targetTasks.addTask(3, new EntityMimic.AISpiderTarget(this, EntityIronGolem.class));
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
}
|
||||
|
||||
BlockPos newPos = centerPos.add(i, j, k);
|
||||
if (spawnMimicBlockAtPosition(worldObj, newPos))
|
||||
if (spawnMimicBlockAtPosition(getEntityWorld(), newPos))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
{
|
||||
super.onDeath(cause);
|
||||
|
||||
if (!worldObj.isRemote)
|
||||
if (!getEntityWorld().isRemote)
|
||||
{
|
||||
BlockPos centerPos = this.getPosition();
|
||||
|
||||
|
@ -201,7 +201,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
}
|
||||
|
||||
BlockPos newPos = centerPos.add(i, j, k);
|
||||
if (spawnHeldBlockOnDeath(worldObj, newPos))
|
||||
if (spawnHeldBlockOnDeath(getEntityWorld(), newPos))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
* Returns new PathNavigateGround instance
|
||||
*/
|
||||
@Override
|
||||
protected PathNavigate getNewNavigator(World worldIn)
|
||||
protected PathNavigate createNavigator(World worldIn)
|
||||
{
|
||||
return new PathNavigateClimber(this, worldIn);
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
protected void entityInit()
|
||||
{
|
||||
super.entityInit();
|
||||
this.dataManager.register(CLIMBING, Byte.valueOf((byte) 0));
|
||||
this.dataManager.register(CLIMBING, (byte) 0);
|
||||
// this.dataManager.register(ITEMSTACK, null);
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
if (!this.worldObj.isRemote && this.worldObj.getDifficulty() == EnumDifficulty.PEACEFUL)
|
||||
if (!this.getEntityWorld().isRemote && this.getEntityWorld().getDifficulty() == EnumDifficulty.PEACEFUL)
|
||||
{
|
||||
if (reformIntoMimicBlock(this.getPosition()))
|
||||
{
|
||||
|
@ -256,7 +256,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
|
||||
super.onUpdate();
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
if (!this.getEntityWorld().isRemote)
|
||||
{
|
||||
this.setBesideClimbableBlock(this.isCollidedHorizontally);
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
@Override
|
||||
public boolean isPotionApplicable(PotionEffect potioneffectIn)
|
||||
{
|
||||
return potioneffectIn.getPotion() == MobEffects.POISON ? false : super.isPotionApplicable(potioneffectIn);
|
||||
return potioneffectIn.getPotion() != MobEffects.POISON && super.isPotionApplicable(potioneffectIn);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -333,7 +333,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
*/
|
||||
public boolean isBesideClimbableBlock()
|
||||
{
|
||||
return (((Byte) this.dataManager.get(CLIMBING)).byteValue() & 1) != 0;
|
||||
return (this.dataManager.get(CLIMBING) & 1) != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -342,7 +342,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
*/
|
||||
public void setBesideClimbableBlock(boolean climbing)
|
||||
{
|
||||
byte b0 = ((Byte) this.dataManager.get(CLIMBING)).byteValue();
|
||||
byte b0 = this.dataManager.get(CLIMBING);
|
||||
|
||||
if (climbing)
|
||||
{
|
||||
|
@ -352,7 +352,7 @@ public class EntityMimic extends EntityDemonBase
|
|||
b0 = (byte) (b0 & -2);
|
||||
}
|
||||
|
||||
this.dataManager.set(CLIMBING, Byte.valueOf(b0));
|
||||
this.dataManager.set(CLIMBING, b0);
|
||||
}
|
||||
|
||||
public float getEyeHeight()
|
||||
|
|
|
@ -107,17 +107,17 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
@Override
|
||||
public void setCombatTask()
|
||||
{
|
||||
if (this.worldObj != null && !this.worldObj.isRemote)
|
||||
if (!this.getEntityWorld().isRemote)
|
||||
{
|
||||
this.tasks.removeTask(this.aiAttackOnCollide);
|
||||
this.tasks.removeTask(this.aiArrowAttack);
|
||||
ItemStack itemstack = this.getHeldItemMainhand();
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemBow)
|
||||
if (!itemstack.isEmpty() && itemstack.getItem() instanceof ItemBow)
|
||||
{
|
||||
int i = 20;
|
||||
|
||||
if (this.worldObj.getDifficulty() != EnumDifficulty.HARD)
|
||||
if (this.getEntityWorld().getDifficulty() != EnumDifficulty.HARD)
|
||||
{
|
||||
i = 40;
|
||||
}
|
||||
|
@ -132,16 +132,11 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isPotionApplicable(PotionEffect effect)
|
||||
{
|
||||
public boolean isPotionApplicable(PotionEffect effect) {
|
||||
Potion potion = effect.getPotion();
|
||||
|
||||
if (potion == MobEffects.REGENERATION || potion == MobEffects.INSTANT_HEALTH) //Specter cannot be healed by normal means
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.isPotionApplicable(effect);
|
||||
//Specter cannot be healed by normal means
|
||||
return !(potion == MobEffects.REGENERATION || potion == MobEffects.INSTANT_HEALTH) && super.isPotionApplicable(effect);
|
||||
}
|
||||
|
||||
public boolean canStealEffectFromOwner(EntityLivingBase owner, PotionEffect effect)
|
||||
|
@ -280,7 +275,7 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount)
|
||||
{
|
||||
return this.isEntityInvulnerable(source) ? false : super.attackEntityFrom(source, amount);
|
||||
return !this.isEntityInvulnerable(source) && super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -311,7 +306,7 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
{
|
||||
super.onDeath(cause);
|
||||
|
||||
if (!worldObj.isRemote && getHeldItemMainhand() != null)
|
||||
if (!getEntityWorld().isRemote && !getHeldItemMainhand().isEmpty())
|
||||
{
|
||||
this.entityDropItem(getHeldItemMainhand(), 0);
|
||||
}
|
||||
|
@ -339,20 +334,21 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean processInteract(EntityPlayer player, EnumHand hand, @Nullable ItemStack stack)
|
||||
public boolean processInteract(EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (this.isTamed() && player.equals(this.getOwner()) && hand == EnumHand.MAIN_HAND)
|
||||
{
|
||||
if (stack == null && player.isSneaking()) //Should return to the entity
|
||||
if (stack.isEmpty() && player.isSneaking()) //Should return to the entity
|
||||
{
|
||||
if (!worldObj.isRemote)
|
||||
if (!getEntityWorld().isRemote)
|
||||
{
|
||||
if (getHeldItemMainhand() != null)
|
||||
if (!getHeldItemMainhand().isEmpty())
|
||||
{
|
||||
this.entityDropItem(getHeldItemMainhand(), 0);
|
||||
}
|
||||
|
||||
if (getHeldItemOffhand() != null)
|
||||
if (!getHeldItemOffhand().isEmpty())
|
||||
{
|
||||
this.entityDropItem(getHeldItemOffhand(), 0);
|
||||
}
|
||||
|
@ -367,7 +363,7 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
}
|
||||
}
|
||||
|
||||
return super.processInteract(player, hand, stack);
|
||||
return super.processInteract(player, hand);
|
||||
}
|
||||
|
||||
public boolean isEntityInvulnerable(DamageSource source)
|
||||
|
@ -380,9 +376,9 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
{
|
||||
this.heal((float) toHeal);
|
||||
|
||||
if (worldObj instanceof WorldServer)
|
||||
if (getEntityWorld() instanceof WorldServer)
|
||||
{
|
||||
WorldServer server = (WorldServer) worldObj;
|
||||
WorldServer server = (WorldServer) getEntityWorld();
|
||||
server.spawnParticle(EnumParticleTypes.HEART, this.posX + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, this.posY + 0.5D + (double) (this.rand.nextFloat() * this.height), this.posZ + (double) (this.rand.nextFloat() * this.width * 2.0F) - (double) this.width, 7, 0.2, 0.2, 0.2, 0, new int[0]);
|
||||
}
|
||||
}
|
||||
|
@ -394,7 +390,7 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
*/
|
||||
public double absorbWillFromAuraToHeal(double toHeal)
|
||||
{
|
||||
if (worldObj.isRemote)
|
||||
if (getEntityWorld().isRemote)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -405,13 +401,13 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
return 0;
|
||||
}
|
||||
|
||||
double will = WorldDemonWillHandler.getCurrentWill(worldObj, getPosition(), getType());
|
||||
double will = WorldDemonWillHandler.getCurrentWill(getEntityWorld(), getPosition(), getType());
|
||||
|
||||
toHeal = Math.min(healthMissing, Math.min(toHeal, will / getWillToHealth()));
|
||||
if (toHeal > 0)
|
||||
{
|
||||
this.heal((float) toHeal);
|
||||
return WorldDemonWillHandler.drainWill(worldObj, getPosition(), getType(), toHeal * getWillToHealth(), true);
|
||||
return WorldDemonWillHandler.drainWill(getEntityWorld(), getPosition(), getType(), toHeal * getWillToHealth(), true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -430,7 +426,7 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
|
||||
public void onUpdate()
|
||||
{
|
||||
if (!this.worldObj.isRemote && this.ticksExisted % 20 == 0)
|
||||
if (!this.getEntityWorld().isRemote && this.ticksExisted % 20 == 0)
|
||||
{
|
||||
absorbWillFromAuraToHeal(2);
|
||||
}
|
||||
|
@ -485,7 +481,7 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
ItemStack heldStack = this.getItemStackFromSlot(EntityEquipmentSlot.MAINHAND);
|
||||
if (heldStack != null && heldStack.getItem() == ModItems.SENTIENT_BOW)
|
||||
{
|
||||
EntityTippedArrow arrowEntity = ((ItemSentientBow) heldStack.getItem()).getArrowEntity(worldObj, heldStack, target, this, velocity);
|
||||
EntityTippedArrow arrowEntity = ((ItemSentientBow) heldStack.getItem()).getArrowEntity(getEntityWorld(), heldStack, target, this, velocity);
|
||||
if (arrowEntity != null)
|
||||
{
|
||||
List<PotionEffect> effects = getPotionEffectsForArrowRemovingDuration(0.2f);
|
||||
|
@ -495,19 +491,19 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
}
|
||||
|
||||
this.playSound(SoundEvents.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
|
||||
this.worldObj.spawnEntityInWorld(arrowEntity);
|
||||
this.getEntityWorld().spawnEntity(arrowEntity);
|
||||
}
|
||||
} else
|
||||
{
|
||||
EntityTippedArrow entitytippedarrow = new EntityTippedArrow(this.worldObj, this); //TODO: Change to an arrow created by the Sentient Bow
|
||||
EntityTippedArrow entitytippedarrow = new EntityTippedArrow(this.getEntityWorld(), this); //TODO: Change to an arrow created by the Sentient Bow
|
||||
double d0 = target.posX - this.posX;
|
||||
double d1 = target.getEntityBoundingBox().minY + (double) (target.height / 3.0F) - entitytippedarrow.posY;
|
||||
double d2 = target.posZ - this.posZ;
|
||||
double d3 = (double) MathHelper.sqrt_double(d0 * d0 + d2 * d2);
|
||||
double d3 = (double) MathHelper.sqrt(d0 * d0 + d2 * d2);
|
||||
entitytippedarrow.setThrowableHeading(d0, d1 + d3 * 0.2, d2, 1.6F, 0); //TODO: Yes, it is an accurate arrow. Don't be hatin'
|
||||
int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.POWER, this);
|
||||
int j = EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.PUNCH, this);
|
||||
entitytippedarrow.setDamage((double) (velocity * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.worldObj.getDifficulty().getDifficultyId() * 0.11F));
|
||||
entitytippedarrow.setDamage((double) (velocity * 2.0F) + this.rand.nextGaussian() * 0.25D + (double) ((float) this.getEntityWorld().getDifficulty().getDifficultyId() * 0.11F));
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
|
@ -533,7 +529,7 @@ public class EntitySentientSpecter extends EntityDemonBase
|
|||
}
|
||||
|
||||
this.playSound(SoundEvents.ENTITY_SKELETON_SHOOT, 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
|
||||
this.worldObj.spawnEntityInWorld(entitytippedarrow);
|
||||
this.getEntityWorld().spawnEntity(entitytippedarrow);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit
|
|||
@Override
|
||||
public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8)
|
||||
{
|
||||
float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5);
|
||||
float var9 = MathHelper.sqrt(var1 * var1 + var3 * var3 + var5 * var5);
|
||||
var1 /= var9;
|
||||
var3 /= var9;
|
||||
var5 /= var9;
|
||||
|
@ -74,7 +74,7 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit
|
|||
motionX = var1;
|
||||
motionY = var3;
|
||||
motionZ = var5;
|
||||
float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5);
|
||||
float var10 = MathHelper.sqrt(var1 * var1 + var5 * var5);
|
||||
prevRotationYaw = rotationYaw = (float) (Math.atan2(var1, var5) * 180.0D / Math.PI);
|
||||
prevRotationPitch = rotationPitch = (float) (Math.atan2(var3, var10) * 180.0D / Math.PI);
|
||||
}
|
||||
|
@ -105,9 +105,9 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit
|
|||
EnumFacing sideHit = mop.sideHit;
|
||||
BlockPos blockPos = mop.getBlockPos().offset(sideHit);
|
||||
|
||||
if (worldObj.isAirBlock(blockPos))
|
||||
if (getEntityWorld().isAirBlock(blockPos))
|
||||
{
|
||||
worldObj.setBlockState(blockPos, ModBlocks.BLOOD_LIGHT.getDefaultState());
|
||||
getEntityWorld().setBlockState(blockPos, ModBlocks.BLOOD_LIGHT.getDefaultState());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,9 +129,9 @@ public class EntityBloodLight extends EntityThrowable implements IThrowableEntit
|
|||
}
|
||||
}
|
||||
|
||||
if (worldObj.isAirBlock(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ)))
|
||||
if (getEntityWorld().isAirBlock(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ)))
|
||||
{
|
||||
worldObj.setBlockState(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ), Blocks.FIRE.getDefaultState());
|
||||
getEntityWorld().setBlockState(new BlockPos((int) this.posX, (int) this.posY, (int) this.posZ), Blocks.FIRE.getDefaultState());
|
||||
}
|
||||
|
||||
// spawnHitParticles("magicCrit", 8);
|
||||
|
|
|
@ -95,12 +95,12 @@ public class EntityMeteor extends EntityThrowable implements IThrowableEntity
|
|||
|
||||
public void generateMeteor(BlockPos pos)
|
||||
{
|
||||
MeteorRegistry.generateMeteorForItem(meteorStack, worldObj, pos, Blocks.STONE.getDefaultState(), radiusModifier, explosionModifier, fillerChance);
|
||||
MeteorRegistry.generateMeteorForItem(meteorStack, getEntityWorld(), pos, Blocks.STONE.getDefaultState(), radiusModifier, explosionModifier, fillerChance);
|
||||
}
|
||||
|
||||
public DamageSource getDamageSource()
|
||||
{
|
||||
return DamageSource.anvil;
|
||||
return DamageSource.ANVIL;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -127,7 +127,7 @@ public class EntityMeteor extends EntityThrowable implements IThrowableEntity
|
|||
radiusModifier = nbt.getDouble("radiusModifier");
|
||||
explosionModifier = nbt.getDouble("explosionModifier");
|
||||
fillerChance = nbt.getDouble("fillerChance");
|
||||
meteorStack = ItemStack.loadItemStackFromNBT(nbt);
|
||||
meteorStack = new ItemStack(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,7 +41,7 @@ public class EntitySentientArrow extends EntityTippedArrow
|
|||
{
|
||||
if (this.shootingEntity instanceof EntityPlayer)
|
||||
{
|
||||
if (hitEntity.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && !(hitEntity instanceof IMob))
|
||||
if (hitEntity.getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL && !(hitEntity instanceof IMob))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class EntitySoulSnare extends EntityThrowable
|
|||
|
||||
if (result.entityHit != null && result.entityHit != this.getThrower())
|
||||
{
|
||||
if (result.entityHit instanceof EntityLivingBase && result.entityHit.worldObj.rand.nextDouble() < 0.25)
|
||||
if (result.entityHit instanceof EntityLivingBase && result.entityHit.getEntityWorld().rand.nextDouble() < 0.25)
|
||||
{
|
||||
((EntityLivingBase) result.entityHit).addPotionEffect(new PotionEffect(ModPotions.soulSnare, 300, 0));
|
||||
}
|
||||
|
@ -49,10 +49,10 @@ public class EntitySoulSnare extends EntityThrowable
|
|||
|
||||
for (int j = 0; j < 8; ++j)
|
||||
{
|
||||
this.worldObj.spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
this.getEntityWorld().spawnParticle(EnumParticleTypes.SNOWBALL, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
if (!this.getEntityWorld().isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
|
|
@ -5,31 +5,13 @@ import net.minecraft.network.EnumPacketDirection;
|
|||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.client.CPacketAnimation;
|
||||
import net.minecraft.network.play.client.CPacketChatMessage;
|
||||
import net.minecraft.network.play.client.CPacketClickWindow;
|
||||
import net.minecraft.network.play.client.CPacketClientSettings;
|
||||
import net.minecraft.network.play.client.CPacketClientStatus;
|
||||
import net.minecraft.network.play.client.CPacketCloseWindow;
|
||||
import net.minecraft.network.play.client.CPacketConfirmTransaction;
|
||||
import net.minecraft.network.play.client.CPacketCreativeInventoryAction;
|
||||
import net.minecraft.network.play.client.CPacketEnchantItem;
|
||||
import net.minecraft.network.play.client.CPacketEntityAction;
|
||||
import net.minecraft.network.play.client.CPacketHeldItemChange;
|
||||
import net.minecraft.network.play.client.CPacketInput;
|
||||
import net.minecraft.network.play.client.CPacketKeepAlive;
|
||||
import net.minecraft.network.play.client.CPacketPlayer;
|
||||
import net.minecraft.network.play.client.CPacketPlayerAbilities;
|
||||
import net.minecraft.network.play.client.CPacketPlayerDigging;
|
||||
import net.minecraft.network.play.client.CPacketPlayerTryUseItem;
|
||||
import net.minecraft.network.play.client.CPacketResourcePackStatus;
|
||||
import net.minecraft.network.play.client.CPacketSpectate;
|
||||
import net.minecraft.network.play.client.CPacketTabComplete;
|
||||
import net.minecraft.network.play.client.CPacketUpdateSign;
|
||||
import net.minecraft.network.play.client.CPacketUseEntity;
|
||||
import net.minecraft.network.play.client.*;
|
||||
import net.minecraft.network.play.server.SPacketPlayerPosLook;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* All credits for this go to CrazyPants, from EIO
|
||||
*/
|
||||
|
@ -47,7 +29,47 @@ public class FakeNetHandlerPlayServer extends NetHandlerPlayServer
|
|||
}
|
||||
|
||||
@Override
|
||||
public void kickPlayerFromServer(String p_147360_1_)
|
||||
public void update()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnect(String reason)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processVehicleMove(CPacketVehicleMove packetIn)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processConfirmTeleport(CPacketConfirmTeleport packetIn)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerLocation(double x, double y, double z, float yaw, float pitch, Set<SPacketPlayerPosLook.EnumFlags> relativeSet)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processTryUseItemOnBlock(CPacketPlayerTryUseItemOnBlock packetIn)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processTryUseItem(CPacketPlayerTryUseItem packetIn)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processSteerBoat(CPacketSteerBoat packetIn)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCustomPayload(CPacketCustomPayload packetIn)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -71,11 +93,6 @@ public class FakeNetHandlerPlayServer extends NetHandlerPlayServer
|
|||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processPlayerBlockPlacement(CPacketPlayerTryUseItem packetIn)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisconnect(ITextComponent p_147231_1_)
|
||||
{
|
||||
|
|
|
@ -16,8 +16,6 @@ import com.mojang.authlib.GameProfile;
|
|||
*/
|
||||
public class FakePlayerBM extends FakePlayer
|
||||
{
|
||||
ItemStack prevWeapon;
|
||||
|
||||
public FakePlayerBM(World world, BlockPos pos, GameProfile profile)
|
||||
{
|
||||
super(FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(world.provider.getDimension()), profile);
|
||||
|
|
|
@ -34,7 +34,7 @@ public class Serializers
|
|||
@Override
|
||||
public EnumDemonWillType read(PacketBuffer buf)
|
||||
{
|
||||
return (EnumDemonWillType) buf.readEnumValue(EnumDemonWillType.class);
|
||||
return buf.readEnumValue(EnumDemonWillType.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -94,12 +94,8 @@ public class InversionPillarHandler
|
|||
{
|
||||
List<BlockPos> otherPosList = willMap.get(type);
|
||||
|
||||
Iterator<BlockPos> posIterator = otherPosList.iterator();
|
||||
while (posIterator.hasNext())
|
||||
{
|
||||
BlockPos closePos = posIterator.next();
|
||||
if (!closePos.equals(pos) && closePos.distanceSq(pos) <= farthestDistanceSquared)
|
||||
{
|
||||
for (BlockPos closePos : otherPosList) {
|
||||
if (!closePos.equals(pos) && closePos.distanceSq(pos) <= farthestDistanceSquared) {
|
||||
closePosList.add(closePos);
|
||||
}
|
||||
}
|
||||
|
@ -113,16 +109,11 @@ public class InversionPillarHandler
|
|||
{
|
||||
Map<BlockPos, List<BlockPos>> posMap = willMap.get(type);
|
||||
|
||||
Iterator<BlockPos> closePosIterator = closePosList.iterator();
|
||||
while (closePosIterator.hasNext())
|
||||
{
|
||||
BlockPos closePos = closePosIterator.next();
|
||||
for (BlockPos closePos : closePosList) {
|
||||
List<BlockPos> posList = posMap.get(closePos);
|
||||
if (posList != null && !posList.contains(pos))
|
||||
{
|
||||
if (posList != null && !posList.contains(pos)) {
|
||||
posList.add(pos);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
posList = new ArrayList<BlockPos>();
|
||||
posList.add(pos);
|
||||
posMap.put(closePos, posList);
|
||||
|
@ -220,18 +211,12 @@ public class InversionPillarHandler
|
|||
//Positions that are new this iteration and need to be dumped into uncheckedPosList next iteration.
|
||||
List<BlockPos> newPosList = new ArrayList<BlockPos>();
|
||||
|
||||
Iterator<BlockPos> itr = uncheckedPosList.iterator();
|
||||
while (itr.hasNext())
|
||||
{
|
||||
BlockPos checkPos = itr.next();
|
||||
for (BlockPos checkPos : uncheckedPosList) {
|
||||
List<BlockPos> posList = posMap.get(checkPos);
|
||||
if (posList != null)
|
||||
{
|
||||
for (BlockPos testPos : posList)
|
||||
{
|
||||
if (posList != null) {
|
||||
for (BlockPos testPos : posList) {
|
||||
//Check if the position has already been checked, is scheduled to be checked, or is already found it needs to be checked.
|
||||
if (!checkedPosList.contains(testPos) && !uncheckedPosList.contains(testPos) && !newPosList.contains(testPos))
|
||||
{
|
||||
if (!checkedPosList.contains(testPos) && !uncheckedPosList.contains(testPos) && !newPosList.contains(testPos)) {
|
||||
newPosList.add(testPos);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,8 @@ import WayofTime.bloodmagic.util.helper.TextHelper;
|
|||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshProvider
|
||||
{
|
||||
private static Field _FLAGS = ReflectionHelper.findField(Entity.class, "FLAGS", "field_184240_ax");
|
||||
|
@ -138,12 +140,12 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
|
||||
int maxAbsorption = 100000;
|
||||
|
||||
if (source.equals(DamageSource.drown))
|
||||
if (source.equals(DamageSource.DROWN))
|
||||
{
|
||||
return new ArmorProperties(-1, 0, 0);
|
||||
}
|
||||
|
||||
if (source.equals(DamageSource.outOfWorld))
|
||||
if (source.equals(DamageSource.OUT_OF_WORLD))
|
||||
{
|
||||
return new ArmorProperties(-1, 0, 0);
|
||||
}
|
||||
|
@ -243,7 +245,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
if (damage > this.getMaxDamage(stack) - this.getDamage(stack))
|
||||
{
|
||||
//TODO: Syphon a load of LP.
|
||||
if (entity.worldObj.isRemote && entity instanceof EntityPlayer)
|
||||
if (entity.getEntityWorld().isRemote && entity instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
SoulNetwork network = NetworkHelper.getSoulNetwork(player);
|
||||
|
@ -307,7 +309,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
if (tracker != null)
|
||||
{
|
||||
double progress = tracker.getProgress(armour, upgrade.getUpgradeLevel());
|
||||
tooltip.add(TextHelper.localize("tooltip.BloodMagic.livingArmour.upgrade.progress", TextHelper.localize(upgrade.getUnlocalizedName()), MathHelper.clamp_int((int) (progress * 100D), 0, 100)));
|
||||
tooltip.add(TextHelper.localize("tooltip.BloodMagic.livingArmour.upgrade.progress", TextHelper.localize(upgrade.getUnlocalizedName()), MathHelper.clamp((int) (progress * 100D), 0, 100)));
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
@ -458,6 +460,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
return ret;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static LivingArmour getLivingArmourFromStack(ItemStack stack)
|
||||
{
|
||||
NBTTagCompound livingTag = getArmourTag(stack);
|
||||
|
@ -549,6 +552,7 @@ public class ItemLivingArmour extends ItemArmor implements ISpecialArmor, IMeshP
|
|||
return uuid != null && armourMap.containsKey(uuid);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static LivingArmour getLivingArmour(ItemStack stack)
|
||||
{
|
||||
UUID uuid = Utils.getUUID(stack);
|
||||
|
|
|
@ -197,7 +197,7 @@ public class LivingArmour implements ILivingArmour
|
|||
continue;
|
||||
}
|
||||
|
||||
if ((world.isRemote && upgrade.runOnClient()) || !world.isRemote)
|
||||
if (!world.isRemote || upgrade.runOnClient())
|
||||
{
|
||||
upgrade.onTick(world, player, this);
|
||||
}
|
||||
|
@ -385,7 +385,7 @@ public class LivingArmour implements ILivingArmour
|
|||
continue;
|
||||
}
|
||||
ItemStack slotStack = player.getItemStackFromSlot(slot);
|
||||
if (slotStack == null || !(slotStack.getItem() instanceof ItemLivingArmour))
|
||||
if (slotStack.isEmpty() || !(slotStack.getItem() instanceof ItemLivingArmour))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ public class LivingArmourUpgradeDisoriented extends LivingArmourUpgrade
|
|||
{
|
||||
if (world.isRemote && player.ticksExisted % 20 == 0 && world.rand.nextDouble() <= chance[this.level])
|
||||
{
|
||||
player.rotationYaw = (float) (world.rand.nextFloat() * 360);
|
||||
player.rotationPitch = (float) (world.rand.nextFloat() * 180 - 90);
|
||||
player.rotationYaw = world.rand.nextFloat() * 360;
|
||||
player.rotationPitch = world.rand.nextFloat() * 180 - 90;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class LivingArmourUpgradeMeleeDecrease extends LivingArmourUpgrade
|
|||
{
|
||||
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
|
||||
|
||||
modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(0271023, 5321), "damage modifier" + 2, meleeDamage[this.level], 1));
|
||||
modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(new UUID(271023, 5321), "damage modifier" + 2, meleeDamage[this.level], 1));
|
||||
|
||||
return modifierMap;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public class LivingArmourUpgradeSlowness extends LivingArmourUpgrade
|
|||
{
|
||||
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
|
||||
|
||||
modifierMap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85472, 8502), "speed modifier" + 2, speedModifier[this.level], 1));
|
||||
modifierMap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(new UUID(85472, 8502), "speed modifier" + 2, speedModifier[this.level], 1));
|
||||
|
||||
return modifierMap;
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public class LivingArmourUpgradeFallProtect extends LivingArmourUpgrade
|
|||
@Override
|
||||
public double getArmourProtection(EntityLivingBase wearer, DamageSource source)
|
||||
{
|
||||
if (source.equals(DamageSource.fall))
|
||||
if (source.equals(DamageSource.FALL))
|
||||
{
|
||||
return protectionLevel[this.level];
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class LivingArmourUpgradeHealthboost extends LivingArmourUpgrade
|
|||
{
|
||||
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
|
||||
|
||||
modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(9423688, 1), "Health modifier" + 1, healthModifier[this.level], 0));
|
||||
modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(9423688, 1), "Health modifier" + 1, healthModifier[this.level], 0));
|
||||
|
||||
return modifierMap;
|
||||
}
|
||||
|
|
|
@ -26,11 +26,11 @@ public class LivingArmourUpgradeKnockbackResist extends LivingArmourUpgrade
|
|||
{
|
||||
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
|
||||
|
||||
modifierMap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132, 1), "Knockback modifier" + 1, kbModifier[this.level], 0));
|
||||
modifierMap.put(SharedMonsterAttributes.KNOCKBACK_RESISTANCE.getName(), new AttributeModifier(new UUID(895132, 1), "Knockback modifier" + 1, kbModifier[this.level], 0));
|
||||
|
||||
if (healthModifier[this.level] > 0)
|
||||
{
|
||||
modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(952142, 1), "Health modifier" + 1, healthModifier[this.level], 0));
|
||||
modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(952142, 1), "Health modifier" + 1, healthModifier[this.level], 0));
|
||||
}
|
||||
|
||||
return modifierMap;
|
||||
|
|
|
@ -34,7 +34,7 @@ public class LivingArmourUpgradeMeleeDamage extends LivingArmourUpgrade
|
|||
{
|
||||
Multimap<String, AttributeModifier> modifierMap = HashMultimap.<String, AttributeModifier>create();
|
||||
|
||||
modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(9423688, 1), "damage modifier" + 1, meleeDamage[this.level], 0));
|
||||
modifierMap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), new AttributeModifier(new UUID(9423688, 1), "damage modifier" + 1, meleeDamage[this.level], 0));
|
||||
|
||||
return modifierMap;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class LivingArmourUpgradeRepairing extends LivingArmourUpgrade
|
|||
|
||||
EntityEquipmentSlot randomSlot = EntityEquipmentSlot.values()[2 + world.rand.nextInt(4)];
|
||||
ItemStack repairStack = player.getItemStackFromSlot(randomSlot);
|
||||
if (repairStack != null)
|
||||
if (!repairStack.isEmpty())
|
||||
{
|
||||
if (repairStack.isItemStackDamageable() && repairStack.isItemDamaged())
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ public class LivingArmourUpgradeSolarPowered extends LivingArmourUpgrade
|
|||
@Override
|
||||
public double getArmourProtection(EntityLivingBase wearer, DamageSource source)
|
||||
{
|
||||
if (wearer.worldObj.canSeeSky(wearer.getPosition()) || wearer.worldObj.provider.isDaytime())
|
||||
if (wearer.getEntityWorld().canSeeSky(wearer.getPosition()) || wearer.getEntityWorld().provider.isDaytime())
|
||||
{
|
||||
return protectionLevel[this.level];
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class LivingArmourUpgradeSpeed extends LivingArmourUpgrade
|
|||
|
||||
if (healthModifier[this.level] > 0)
|
||||
{
|
||||
modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(952142, 1), "Health modifier" + 1, healthModifier[this.level], 0));
|
||||
modifierMap.put(SharedMonsterAttributes.MAX_HEALTH.getName(), new AttributeModifier(new UUID(952142, 1), "Health modifier" + 1, healthModifier[this.level], 0));
|
||||
}
|
||||
|
||||
return modifierMap;
|
||||
|
|
|
@ -7,9 +7,11 @@ import lombok.Getter;
|
|||
import lombok.Setter;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
||||
|
@ -34,8 +36,8 @@ public class MeteorComponent
|
|||
meta = Integer.parseInt(stringList[2]);
|
||||
}
|
||||
|
||||
Block ore = Block.REGISTRY.getObject(new ResourceLocation(domain, block));
|
||||
if (ore != null)
|
||||
Block ore = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(domain, block));
|
||||
if (ore != Blocks.AIR)
|
||||
{
|
||||
return ore.getStateFromMeta(meta);
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class PlayerVelocityPacketProcessor implements IMessage, IMessageHandler<
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void onMessageFromServer()
|
||||
{
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
EntityPlayer player = Minecraft.getMinecraft().player;
|
||||
player.motionX = motionX;
|
||||
player.motionY = motionY;
|
||||
player.motionZ = motionZ;
|
||||
|
|
|
@ -30,7 +30,7 @@ public class BMPotionUtils
|
|||
|
||||
public static double damageMobAndGrowSurroundingPlants(EntityLivingBase entity, int horizontalRadius, int verticalRadius, double damageRatio, int maxPlantsGrown)
|
||||
{
|
||||
World world = entity.worldObj;
|
||||
World world = entity.getEntityWorld();
|
||||
if (world.isRemote)
|
||||
{
|
||||
return 0;
|
||||
|
|
|
@ -59,12 +59,10 @@ public class PotionEventHandlers
|
|||
{
|
||||
int d0 = 3;
|
||||
AxisAlignedBB axisAlignedBB = new AxisAlignedBB(event.getEntityLiving().posX - 0.5, event.getEntityLiving().posY - 0.5, event.getEntityLiving().posZ - 0.5, event.getEntityLiving().posX + 0.5, event.getEntityLiving().posY + 0.5, event.getEntityLiving().posZ + 0.5).expand(d0, d0, d0);
|
||||
List entityList = event.getEntityLiving().worldObj.getEntitiesWithinAABB(Entity.class, axisAlignedBB);
|
||||
List<Entity> entityList = event.getEntityLiving().getEntityWorld().getEntitiesWithinAABB(Entity.class, axisAlignedBB);
|
||||
|
||||
for (Object thing : entityList)
|
||||
for (Entity projectile : entityList)
|
||||
{
|
||||
Entity projectile = (Entity) thing;
|
||||
|
||||
if (projectile == null)
|
||||
continue;
|
||||
if (!(projectile instanceof IProjectile))
|
||||
|
|
|
@ -76,8 +76,9 @@ public class ItemPotionFlask extends Item implements IVariantProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
int remainingUses = stack.getMaxDamage() - stack.getItemDamage();
|
||||
if (remainingUses <= 0)
|
||||
{
|
||||
|
|
|
@ -51,13 +51,11 @@ public class AlchemyTableDyeableRecipe extends AlchemyTableRecipe
|
|||
if (match)
|
||||
{
|
||||
inputItemLocation = x;
|
||||
continue;
|
||||
} else
|
||||
{
|
||||
if (slot.getItem() == Items.NAME_TAG || slot.getItem() == Items.DYE)
|
||||
{
|
||||
nameTagOrDyeLocation = x;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -108,30 +106,19 @@ public class AlchemyTableDyeableRecipe extends AlchemyTableRecipe
|
|||
boolean hasNameTagOrDye = false;
|
||||
boolean hasInputItem = false;
|
||||
|
||||
for (int x = 0; x < checkedList.size(); x++)
|
||||
{
|
||||
ItemStack slot = checkedList.get(x);
|
||||
|
||||
if (slot != null)
|
||||
{
|
||||
for (ItemStack slot : checkedList) {
|
||||
if (slot != null) {
|
||||
boolean match = OreDictionary.itemMatches(inputItem, slot, false);
|
||||
|
||||
if (match && hasInputItem)
|
||||
{
|
||||
if (match && hasInputItem) {
|
||||
return false;
|
||||
} else if (match)
|
||||
{
|
||||
} else if (match) {
|
||||
hasInputItem = true;
|
||||
continue;
|
||||
} else
|
||||
{
|
||||
if (slot.getItem() == Items.NAME_TAG || slot.getItem() == Items.DYE)
|
||||
{
|
||||
if (hasNameTagOrDye)
|
||||
{
|
||||
} else {
|
||||
if (slot.getItem() == Items.NAME_TAG || slot.getItem() == Items.DYE) {
|
||||
if (hasNameTagOrDye) {
|
||||
return false;
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
hasNameTagOrDye = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package WayofTime.bloodmagic.recipe.alchemyTable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
|
@ -38,7 +35,7 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe
|
|||
|
||||
public AlchemyTablePotionAugmentRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect, double lengthAugment, int powerAugment)
|
||||
{
|
||||
this(lpDrained, ticksRequired, tierRequired, Arrays.asList(inputItem), baseEffect, lengthAugment, powerAugment);
|
||||
this(lpDrained, ticksRequired, tierRequired, Collections.singletonList(inputItem), baseEffect, lengthAugment, powerAugment);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,19 +76,14 @@ public class AlchemyTablePotionAugmentRecipe extends AlchemyTablePotionRecipe
|
|||
List<PotionEffect> effectList = PotionUtils.getEffectsFromStack(outputStack);
|
||||
List<PotionEffect> newEffectList = new ArrayList<PotionEffect>();
|
||||
|
||||
Iterator<PotionEffect> effectIterator = effectList.iterator();
|
||||
while (effectIterator.hasNext())
|
||||
{
|
||||
PotionEffect effect = effectIterator.next();
|
||||
if (effect.getPotion() == wantedPotion)
|
||||
{
|
||||
for (PotionEffect effect : effectList) {
|
||||
if (effect.getPotion() == wantedPotion) {
|
||||
double currentLengthAugment = Math.max(lengthAugment, BMPotionUtils.getLengthAugment(outputStack, wantedPotion));
|
||||
int currentPowerAugment = Math.max(powerAugment, effect.getAmplifier());
|
||||
int potionLength = wantedPotion.isInstant() ? 1 : BMPotionUtils.getAugmentedLength(baseEffect.getDuration(), currentLengthAugment, currentPowerAugment);
|
||||
newEffectList.add(new PotionEffect(wantedPotion, potionLength, currentPowerAugment));
|
||||
BMPotionUtils.setLengthAugment(outputStack, wantedPotion, currentLengthAugment);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
newEffectList.add(effect);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package WayofTime.bloodmagic.recipe.alchemyTable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
@ -40,7 +37,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
|
|||
|
||||
public AlchemyTablePotionRecipe(int lpDrained, int ticksRequired, int tierRequired, ItemStack inputItem, PotionEffect baseEffect)
|
||||
{
|
||||
this(lpDrained, ticksRequired, tierRequired, Arrays.asList(inputItem), baseEffect);
|
||||
this(lpDrained, ticksRequired, tierRequired, Collections.singletonList(inputItem), baseEffect);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,7 +55,6 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
|
|||
if (match)
|
||||
{
|
||||
flaskLocation = x;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +64,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
|
|||
return getModifiedFlaskForInput(inputList.get(flaskLocation));
|
||||
}
|
||||
|
||||
return getModifiedFlaskForInput(null);
|
||||
return getModifiedFlaskForInput(ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -76,39 +72,27 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
|
|||
{
|
||||
ArrayList<Object> required = new ArrayList<Object>(input);
|
||||
|
||||
for (int x = 0; x < checkedList.size(); x++)
|
||||
{
|
||||
ItemStack slot = checkedList.get(x);
|
||||
|
||||
if (slot != null)
|
||||
{
|
||||
for (ItemStack slot : checkedList) {
|
||||
if (slot != null) {
|
||||
boolean inRecipe = false;
|
||||
Iterator<Object> req = required.iterator();
|
||||
|
||||
while (req.hasNext())
|
||||
{
|
||||
for (Object aRequired : required) {
|
||||
boolean match = false;
|
||||
|
||||
Object next = req.next();
|
||||
Object next = aRequired;
|
||||
|
||||
if (next instanceof ItemStack)
|
||||
{
|
||||
if (next instanceof ItemStack) {
|
||||
match = OreDictionary.itemMatches((ItemStack) next, slot, false);
|
||||
} else if (next instanceof List)
|
||||
{
|
||||
} else if (next instanceof List) {
|
||||
Iterator<ItemStack> itr = ((List<ItemStack>) next).iterator();
|
||||
while (itr.hasNext() && !match)
|
||||
{
|
||||
while (itr.hasNext() && !match) {
|
||||
match = OreDictionary.itemMatches(itr.next(), slot, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (match)
|
||||
{
|
||||
if (next instanceof ItemStack && ((ItemStack) next).getItem() == ModItems.POTION_FLASK)
|
||||
{
|
||||
if (!isPotionFlaskValidInput(slot))
|
||||
{
|
||||
if (match) {
|
||||
if (next instanceof ItemStack && ((ItemStack) next).getItem() == ModItems.POTION_FLASK) {
|
||||
if (!isPotionFlaskValidInput(slot)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -119,8 +103,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
|
|||
}
|
||||
}
|
||||
|
||||
if (!inRecipe)
|
||||
{
|
||||
if (!inRecipe) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -150,7 +133,7 @@ public class AlchemyTablePotionRecipe extends AlchemyTableRecipe
|
|||
|
||||
public ItemStack getModifiedFlaskForInput(ItemStack inputStack)
|
||||
{
|
||||
if (inputStack == null)
|
||||
if (inputStack.isEmpty())
|
||||
{
|
||||
ItemStack outputStack = new ItemStack(ModItems.POTION_FLASK);
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package WayofTime.bloodmagic.registry;
|
||||
|
||||
import WayofTime.bloodmagic.compat.ICompatibility;
|
||||
import WayofTime.bloodmagic.compat.guideapi.CompatibilityGuideAPI;
|
||||
import WayofTime.bloodmagic.compat.jei.CompatibilityJustEnoughItems;
|
||||
import WayofTime.bloodmagic.compat.waila.CompatibilityWaila;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
|
@ -16,7 +15,6 @@ public class ModCompatibility
|
|||
{
|
||||
compatibilities.add(new CompatibilityJustEnoughItems());
|
||||
compatibilities.add(new CompatibilityWaila());
|
||||
compatibilities.add(new CompatibilityGuideAPI());
|
||||
// compatibilities.add(new CompatibilityThaumcraft());
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package WayofTime.bloodmagic.registry;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import net.minecraftforge.fml.common.registry.EntityEntry;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedChicken;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSheep;
|
||||
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
|
||||
|
@ -12,22 +11,21 @@ import WayofTime.bloodmagic.entity.projectile.EntityBloodLight;
|
|||
import WayofTime.bloodmagic.entity.projectile.EntityMeteor;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySentientArrow;
|
||||
import WayofTime.bloodmagic.entity.projectile.EntitySoulSnare;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ModEntities
|
||||
{
|
||||
public static void init()
|
||||
{
|
||||
int id = 0;
|
||||
|
||||
EntityRegistry.registerModEntity(EntityBloodLight.class, "BloodLight", id++, BloodMagic.instance, 64, 20, true);
|
||||
EntityRegistry.registerModEntity(EntitySoulSnare.class, "SoulSnare", id++, BloodMagic.instance, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(EntitySentientArrow.class, "SoulArrow", id++, BloodMagic.instance, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityMeteor.class, "Meteor", id++, BloodMagic.instance, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(EntitySentientSpecter.class, "SentientSpecter", id++, BloodMagic.instance, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityMimic.class, "Mimic", id++, BloodMagic.instance, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityCorruptedZombie.class, "CorruptedZombie", id++, BloodMagic.instance, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityCorruptedSheep.class, "CorruptedSheep", id++, BloodMagic.instance, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityCorruptedChicken.class, "CorruptedChicken", id++, BloodMagic.instance, 64, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityCorruptedSpider.class, "CorruptedSpider", id++, BloodMagic.instance, 64, 1, true);
|
||||
GameRegistry.register(new EntityEntry(EntityBloodLight.class, "BloodLight").setRegistryName("BloodLight"));
|
||||
GameRegistry.register(new EntityEntry(EntitySoulSnare.class, "SoulSnare").setRegistryName("SoulSnare"));
|
||||
GameRegistry.register(new EntityEntry(EntitySentientArrow.class, "SoulArrow").setRegistryName("SoulArrow"));
|
||||
GameRegistry.register(new EntityEntry(EntityMeteor.class, "Meteor").setRegistryName("Meteor"));
|
||||
GameRegistry.register(new EntityEntry(EntitySentientSpecter.class, "SentientSpecter").setRegistryName("SentientSpecter"));
|
||||
GameRegistry.register(new EntityEntry(EntityMimic.class, "Mimic").setRegistryName("Mimic"));
|
||||
GameRegistry.register(new EntityEntry(EntityCorruptedZombie.class, "CorruptedZombie").setRegistryName("CorruptedZombie"));
|
||||
GameRegistry.register(new EntityEntry(EntityCorruptedSheep.class, "CorruptedSheep").setRegistryName("CorruptedSheep"));
|
||||
GameRegistry.register(new EntityEntry(EntityCorruptedChicken.class, "CorruptedChicken").setRegistryName("CorruptedChicken"));
|
||||
GameRegistry.register(new EntityEntry(EntityCorruptedSpider.class, "CorruptedSpider").setRegistryName("CorruptedSpider"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -456,7 +456,7 @@ public class ModRecipes
|
|||
if (dustList != null && dustList.size() > 0)
|
||||
{
|
||||
ItemStack dustStack = dustList.get(0).copy();
|
||||
dustStack.stackSize = 2;
|
||||
dustStack.setCount(2);
|
||||
AlchemyTableRecipeRegistry.registerRecipe(new AlchemyTableCustomRecipe(dustStack, 400, 200, 1, ore, ItemCuttingFluid.getStack(ItemCuttingFluid.BASIC)));
|
||||
addedOreRecipeList.add(ore);
|
||||
}
|
||||
|
|
|
@ -203,16 +203,16 @@ public class RitualAltarBuilder extends Ritual
|
|||
{
|
||||
if (tileEntity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN))
|
||||
{
|
||||
IItemHandler iItemHandler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN);
|
||||
IItemHandler itemHandler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN);
|
||||
|
||||
if (iItemHandler.getSlots() <= 0)
|
||||
if (itemHandler.getSlots() <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < iItemHandler.getSlots(); i++)
|
||||
for (int i = 0; i < itemHandler.getSlots(); i++)
|
||||
{
|
||||
if (iItemHandler.getStackInSlot(i) != null && iItemHandler.getStackInSlot(i).stackSize > 0 && iItemHandler.getStackInSlot(i).getItem() == item && iItemHandler.getStackInSlot(i).getItemDamage() == damage && iItemHandler.extractItem(i, 1, !consumeItem) != null)
|
||||
if (!itemHandler.getStackInSlot(i).isEmpty() && itemHandler.getStackInSlot(i).getItem() == item && itemHandler.getStackInSlot(i).getItemDamage() == damage && !itemHandler.extractItem(i, 1, !consumeItem).isEmpty())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ public class RitualAltarBuilder extends Ritual
|
|||
IInventory inv = (IInventory) tileEntity;
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++)
|
||||
{
|
||||
if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).stackSize > 0 && inv.getStackInSlot(i).getItem() == item && inv.getStackInSlot(i).getItemDamage() == damage)
|
||||
if (!inv.getStackInSlot(0).isEmpty() && inv.getStackInSlot(i).getItem() == item && inv.getStackInSlot(i).getItemDamage() == damage)
|
||||
{
|
||||
if (consumeItem)
|
||||
{
|
||||
|
@ -242,19 +242,19 @@ public class RitualAltarBuilder extends Ritual
|
|||
{
|
||||
if (tileEntity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN))
|
||||
{
|
||||
IItemHandler iItemHandler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN);
|
||||
IItemHandler itemHandler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN);
|
||||
|
||||
if (iItemHandler.getSlots() <= 0)
|
||||
if (itemHandler.getSlots() <= 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < iItemHandler.getSlots(); i++)
|
||||
for (int i = 0; i < itemHandler.getSlots(); i++)
|
||||
{
|
||||
if (iItemHandler.getStackInSlot(i) != null && iItemHandler.getStackInSlot(i).stackSize > 0 && iItemHandler.getStackInSlot(i).getItem() instanceof ItemBlock && Block.getBlockFromItem(iItemHandler.getStackInSlot(i).getItem()) instanceof BlockBloodRune && iItemHandler.extractItem(i, 1, true) != null)
|
||||
if (!itemHandler.getStackInSlot(i).isEmpty() && itemHandler.getStackInSlot(i).getItem() instanceof ItemBlock && Block.getBlockFromItem(itemHandler.getStackInSlot(i).getItem()) instanceof BlockBloodRune && itemHandler.extractItem(i, 1, true) != null)
|
||||
{
|
||||
BlockStack blockStack = new BlockStack(Utils.getBlockForComponent(EnumAltarComponent.BLOODRUNE), iItemHandler.getStackInSlot(i).getItemDamage());
|
||||
iItemHandler.extractItem(i, 1, false);
|
||||
BlockStack blockStack = new BlockStack(Utils.getBlockForComponent(EnumAltarComponent.BLOODRUNE), itemHandler.getStackInSlot(i).getItemDamage());
|
||||
itemHandler.extractItem(i, 1, false);
|
||||
return blockStack;
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ public class RitualAltarBuilder extends Ritual
|
|||
IInventory inv = (IInventory) tileEntity;
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++)
|
||||
{
|
||||
if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).stackSize > 0 && inv.getStackInSlot(i).getItem() instanceof ItemBlock && Block.getBlockFromItem(inv.getStackInSlot(i).getItem()) instanceof BlockBloodRune)
|
||||
if (!inv.getStackInSlot(i).isEmpty() && inv.getStackInSlot(i).getItem() instanceof ItemBlock && Block.getBlockFromItem(inv.getStackInSlot(i).getItem()) instanceof BlockBloodRune)
|
||||
{
|
||||
BlockStack blockStack = new BlockStack(Utils.getBlockForComponent(EnumAltarComponent.BLOODRUNE), inv.getStackInSlot(i).getItemDamage());
|
||||
inv.decrStackSize(i, 1);
|
||||
|
@ -281,22 +281,22 @@ public class RitualAltarBuilder extends Ritual
|
|||
{
|
||||
if (tileEntity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN))
|
||||
{
|
||||
IItemHandler iItemHandler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN);
|
||||
IItemHandler itemHandler = tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, EnumFacing.DOWN);
|
||||
|
||||
if (iItemHandler.getSlots() <= 0)
|
||||
if (itemHandler.getSlots() <= 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < iItemHandler.getSlots(); i++)
|
||||
for (int i = 0; i < itemHandler.getSlots(); i++)
|
||||
{
|
||||
if (iItemHandler.getStackInSlot(i) != null && iItemHandler.getStackInSlot(i).stackSize > 0 && iItemHandler.getStackInSlot(i).getItem() instanceof ItemBlock && !(Block.getBlockFromItem(iItemHandler.getStackInSlot(i).getItem()) instanceof BlockBloodRune) && iItemHandler.extractItem(i, 1, true) != null)
|
||||
if (!itemHandler.getStackInSlot(i).isEmpty() && itemHandler.getStackInSlot(i).getItem() instanceof ItemBlock && !(Block.getBlockFromItem(itemHandler.getStackInSlot(i).getItem()) instanceof BlockBloodRune) && itemHandler.extractItem(i, 1, true) != null)
|
||||
{
|
||||
Block block = Block.getBlockFromItem(iItemHandler.getStackInSlot(i).getItem());
|
||||
Block block = Block.getBlockFromItem(itemHandler.getStackInSlot(i).getItem());
|
||||
if (block != null && block != Blocks.GLOWSTONE && block != ModBlocks.BLOOD_STONE && block != ModBlocks.CRYSTAL)
|
||||
{
|
||||
BlockStack blockStack = new BlockStack(block, iItemHandler.getStackInSlot(i).getItemDamage());
|
||||
iItemHandler.extractItem(i, 1, false);
|
||||
BlockStack blockStack = new BlockStack(block, itemHandler.getStackInSlot(i).getItemDamage());
|
||||
itemHandler.extractItem(i, 1, false);
|
||||
return blockStack;
|
||||
}
|
||||
}
|
||||
|
@ -306,10 +306,10 @@ public class RitualAltarBuilder extends Ritual
|
|||
IInventory inv = (IInventory) tileEntity;
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++)
|
||||
{
|
||||
if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).stackSize > 0 && inv.getStackInSlot(i).getItem() instanceof ItemBlock && !(Block.getBlockFromItem(inv.getStackInSlot(i).getItem()) instanceof BlockBloodRune))
|
||||
if (!inv.getStackInSlot(i).isEmpty() && inv.getStackInSlot(i).getItem() instanceof ItemBlock && !(Block.getBlockFromItem(inv.getStackInSlot(i).getItem()) instanceof BlockBloodRune))
|
||||
{
|
||||
Block block = Block.getBlockFromItem(inv.getStackInSlot(i).getItem());
|
||||
if (block != null && block != Blocks.GLOWSTONE && block != ModBlocks.BLOOD_STONE && block != ModBlocks.CRYSTAL)
|
||||
if (block != Blocks.GLOWSTONE && block != ModBlocks.BLOOD_STONE && block != ModBlocks.CRYSTAL)
|
||||
{
|
||||
BlockStack blockStack = new BlockStack(block, inv.getStackInSlot(i).getItemDamage());
|
||||
inv.decrStackSize(i, 1);
|
||||
|
|
|
@ -232,7 +232,14 @@ public class RitualAnimalGrowth extends Ritual
|
|||
@Override
|
||||
public ITextComponent[] provideInformationOfRitualToPlayer(EntityPlayer player)
|
||||
{
|
||||
return new ITextComponent[] { new TextComponentTranslation(this.getUnlocalizedName() + ".info"), new TextComponentTranslation(this.getUnlocalizedName() + ".default.info"), new TextComponentTranslation(this.getUnlocalizedName() + ".corrosive.info"), new TextComponentTranslation(this.getUnlocalizedName() + ".steadfast.info"), new TextComponentTranslation(this.getUnlocalizedName() + ".destructive.info"), new TextComponentTranslation(this.getUnlocalizedName() + ".vengeful.info") };
|
||||
return new ITextComponent[] {
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".default.info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".corrosive.info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".steadfast.info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".destructive.info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".vengeful.info")
|
||||
};
|
||||
}
|
||||
|
||||
public int getBreedingDecreaseForWill(double vengefulWill)
|
||||
|
|
|
@ -55,7 +55,7 @@ public class RitualArmourEvolve extends Ritual
|
|||
|
||||
masterRitualStone.setActive(false);
|
||||
|
||||
world.spawnEntityInWorld(new EntityLightningBolt(world, pos.getX(), pos.getY() - 1, pos.getZ(), true));
|
||||
world.spawnEntity(new EntityLightningBolt(world, pos.getX(), pos.getY() - 1, pos.getZ(), true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public class RitualCobblestone extends Ritual
|
|||
if (tileEntity != null && tileEntity instanceof TileAlchemyArray)
|
||||
{
|
||||
TileAlchemyArray alchemyArray = (TileAlchemyArray) tileEntity;
|
||||
if (alchemyArray.getStackInSlot(0) != null && alchemyArray.getStackInSlot(0).getItem() instanceof ItemComponent)
|
||||
if (!alchemyArray.getStackInSlot(0).isEmpty() && alchemyArray.getStackInSlot(0).getItem() instanceof ItemComponent)
|
||||
{
|
||||
switch (alchemyArray.getStackInSlot(0).getItemDamage())
|
||||
{
|
||||
|
|
|
@ -129,7 +129,7 @@ public class RitualCrushing extends Ritual
|
|||
if (useCuttingFluid)
|
||||
{
|
||||
ItemStack checkStack = block.getItem(world, newPos, state);
|
||||
if (checkStack == null)
|
||||
if (checkStack.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class RitualCrushing extends Ritual
|
|||
}
|
||||
|
||||
ItemStack result = recipe.getRecipeOutput(input);
|
||||
if (result == null)
|
||||
if (result.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ public class RitualCrushing extends Ritual
|
|||
if (tile != null)
|
||||
{
|
||||
result = Utils.insertStackIntoTile(result, tile, EnumFacing.DOWN);
|
||||
if (result != null && result.stackSize > 0)
|
||||
if (!result.isEmpty())
|
||||
{
|
||||
Utils.spawnStackAtBlock(world, pos, EnumFacing.UP, result);
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ public class RitualCrushing extends Ritual
|
|||
if (!isBlockClaimed && isSilkTouch && block.canSilkHarvest(world, newPos, state, null))
|
||||
{
|
||||
ItemStack checkStack = block.getItem(world, newPos, state);
|
||||
if (checkStack == null)
|
||||
if (checkStack.isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ public class RitualCrushing extends Ritual
|
|||
else
|
||||
Utils.spawnStackAtBlock(world, pos, EnumFacing.UP, copyStack);
|
||||
|
||||
if (copyStack != null && copyStack.stackSize > 0)
|
||||
if (!copyStack.isEmpty())
|
||||
{
|
||||
Utils.spawnStackAtBlock(world, pos, EnumFacing.UP, copyStack);
|
||||
}
|
||||
|
@ -223,31 +223,28 @@ public class RitualCrushing extends Ritual
|
|||
|
||||
List<ItemStack> stackList = block.getDrops(world, newPos, state, fortune);
|
||||
|
||||
if (stackList != null && !stackList.isEmpty())
|
||||
for (ItemStack item : stackList)
|
||||
{
|
||||
for (ItemStack item : stackList)
|
||||
{
|
||||
ItemStack copyStack = ItemStack.copyItemStack(item);
|
||||
ItemStack copyStack = item.copy();
|
||||
|
||||
if (tile != null)
|
||||
{
|
||||
copyStack = Utils.insertStackIntoTile(copyStack, tile, EnumFacing.DOWN);
|
||||
} else
|
||||
{
|
||||
Utils.spawnStackAtBlock(world, pos, EnumFacing.UP, copyStack);
|
||||
continue;
|
||||
}
|
||||
if (copyStack != null && copyStack.stackSize > 0)
|
||||
{
|
||||
Utils.spawnStackAtBlock(world, pos, EnumFacing.UP, copyStack);
|
||||
}
|
||||
}
|
||||
|
||||
if (fortune > 0)
|
||||
if (tile != null)
|
||||
{
|
||||
WorldDemonWillHandler.drainWill(world, pos, EnumDemonWillType.DESTRUCTIVE, destructiveWillDrain, true);
|
||||
destructiveWill -= destructiveWillDrain;
|
||||
copyStack = Utils.insertStackIntoTile(copyStack, tile, EnumFacing.DOWN);
|
||||
} else
|
||||
{
|
||||
Utils.spawnStackAtBlock(world, pos, EnumFacing.UP, copyStack);
|
||||
continue;
|
||||
}
|
||||
if (!copyStack.isEmpty())
|
||||
{
|
||||
Utils.spawnStackAtBlock(world, pos, EnumFacing.UP, copyStack);
|
||||
}
|
||||
}
|
||||
|
||||
if (fortune > 0)
|
||||
{
|
||||
WorldDemonWillHandler.drainWill(world, pos, EnumDemonWillType.DESTRUCTIVE, destructiveWillDrain, true);
|
||||
destructiveWill -= destructiveWillDrain;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -323,7 +320,14 @@ public class RitualCrushing extends Ritual
|
|||
@Override
|
||||
public ITextComponent[] provideInformationOfRitualToPlayer(EntityPlayer player)
|
||||
{
|
||||
return new ITextComponent[] { new TextComponentTranslation(this.getUnlocalizedName() + ".info"), new TextComponentTranslation(this.getUnlocalizedName() + ".default.info"), new TextComponentTranslation(this.getUnlocalizedName() + ".corrosive.info"), new TextComponentTranslation(this.getUnlocalizedName() + ".steadfast.info"), new TextComponentTranslation(this.getUnlocalizedName() + ".destructive.info"), new TextComponentTranslation(this.getUnlocalizedName() + ".vengeful.info") };
|
||||
return new ITextComponent[] {
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".default.info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".corrosive.info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".steadfast.info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".destructive.info"),
|
||||
new TextComponentTranslation(this.getUnlocalizedName() + ".vengeful.info")
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -136,20 +136,20 @@ public class RitualExpulsion extends Ritual
|
|||
|
||||
moveEntityViaTeleport(entityLiving, event.getTargetX(), event.getTargetY(), event.getTargetZ());
|
||||
boolean flag = false;
|
||||
int i = MathHelper.floor_double(entityLiving.posX);
|
||||
int j = MathHelper.floor_double(entityLiving.posY);
|
||||
int k = MathHelper.floor_double(entityLiving.posZ);
|
||||
int i = MathHelper.floor(entityLiving.posX);
|
||||
int j = MathHelper.floor(entityLiving.posY);
|
||||
int k = MathHelper.floor(entityLiving.posZ);
|
||||
int l;
|
||||
|
||||
if (!entityLiving.worldObj.isAirBlock(new BlockPos(i, j, k)))
|
||||
if (!entityLiving.getEntityWorld().isAirBlock(new BlockPos(i, j, k)))
|
||||
{
|
||||
boolean flag1 = false;
|
||||
|
||||
while (!flag1 && j > 0)
|
||||
{
|
||||
IBlockState state = entityLiving.worldObj.getBlockState(new BlockPos(i, j - 1, k));
|
||||
IBlockState state = entityLiving.getEntityWorld().getBlockState(new BlockPos(i, j - 1, k));
|
||||
|
||||
if (state != null && state.getMaterial().blocksMovement())
|
||||
if (state.getMaterial().blocksMovement())
|
||||
{
|
||||
flag1 = true;
|
||||
} else
|
||||
|
@ -163,7 +163,7 @@ public class RitualExpulsion extends Ritual
|
|||
{
|
||||
moveEntityViaTeleport(entityLiving, entityLiving.posX, entityLiving.posY, entityLiving.posZ);
|
||||
|
||||
if (!entityLiving.isCollided && !entityLiving.worldObj.containsAnyLiquid(entityLiving.getEntityBoundingBox()))
|
||||
if (!entityLiving.isCollided && !entityLiving.getEntityWorld().containsAnyLiquid(entityLiving.getEntityBoundingBox()))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
@ -179,13 +179,13 @@ public class RitualExpulsion extends Ritual
|
|||
for (l = 0; l < 128; ++l)
|
||||
{
|
||||
double lengthVal = (double) l / ((double) 128 - 1.0D);
|
||||
float randF1 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F;
|
||||
float randF2 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F;
|
||||
float randF3 = (entityLiving.worldObj.rand.nextFloat() - 0.5F) * 0.2F;
|
||||
double lengthValX = lastX + (entityLiving.posX - lastX) * lengthVal + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
|
||||
double lengthValY = lastY + (entityLiving.posY - lastY) * lengthVal + entityLiving.worldObj.rand.nextDouble() * (double) entityLiving.height;
|
||||
double lengthValZ = lastZ + (entityLiving.posZ - lastZ) * lengthVal + (entityLiving.worldObj.rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
|
||||
entityLiving.worldObj.spawnParticle(EnumParticleTypes.PORTAL, lengthValX, lengthValY, lengthValZ, (double) randF1, (double) randF2, (double) randF3);
|
||||
float randF1 = (entityLiving.getEntityWorld().rand.nextFloat() - 0.5F) * 0.2F;
|
||||
float randF2 = (entityLiving.getEntityWorld().rand.nextFloat() - 0.5F) * 0.2F;
|
||||
float randF3 = (entityLiving.getEntityWorld().rand.nextFloat() - 0.5F) * 0.2F;
|
||||
double lengthValX = lastX + (entityLiving.posX - lastX) * lengthVal + (entityLiving.getEntityWorld().rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
|
||||
double lengthValY = lastY + (entityLiving.posY - lastY) * lengthVal + entityLiving.getEntityWorld().rand.nextDouble() * (double) entityLiving.height;
|
||||
double lengthValZ = lastZ + (entityLiving.posZ - lastZ) * lengthVal + (entityLiving.getEntityWorld().rand.nextDouble() - 0.5D) * (double) entityLiving.width * 2.0D;
|
||||
entityLiving.getEntityWorld().spawnParticle(EnumParticleTypes.PORTAL, lengthValX, lengthValY, lengthValZ, (double) randF1, (double) randF2, (double) randF3);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -200,7 +200,7 @@ public class RitualExpulsion extends Ritual
|
|||
{
|
||||
EntityPlayerMP entityplayermp = (EntityPlayerMP) entityLiving;
|
||||
|
||||
if (entityplayermp.worldObj == entityLiving.worldObj)
|
||||
if (entityplayermp.getEntityWorld() == entityLiving.getEntityWorld())
|
||||
{
|
||||
EnderTeleportEvent event = new EnderTeleportEvent(entityplayermp, x, y, z, 5.0F);
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ public class RitualFeatheredKnife extends Ritual
|
|||
float sacrificedHealth = 1;
|
||||
double lpModifier = 1;
|
||||
|
||||
if ((health / player.getMaxHealth() > healthThreshold) && ((useIncense && !player.isPotionActive(ModPotions.soulFray)) || !useIncense))
|
||||
if ((health / player.getMaxHealth() > healthThreshold) && (!useIncense || !player.isPotionActive(ModPotions.soulFray)))
|
||||
{
|
||||
if (useIncense)
|
||||
{
|
||||
|
|
|
@ -114,17 +114,17 @@ public class RitualFelling extends Ritual
|
|||
private void placeInInventory(IBlockState blockState, World world, BlockPos blockPos, BlockPos tileEntityPos)
|
||||
{
|
||||
TileEntity tile = world.getTileEntity(tileEntityPos);
|
||||
if (tile != null && blockState.getBlock().getDrops(world, blockPos, world.getBlockState(blockPos), 0) != null)
|
||||
if (tile != null)
|
||||
{
|
||||
if (tile instanceof IInventory)
|
||||
{
|
||||
for (ItemStack stack : blockState.getBlock().getDrops(world, blockPos, world.getBlockState(blockPos), 0))
|
||||
{
|
||||
ItemStack copyStack = stack.copy();
|
||||
Utils.insertStackIntoInventory(copyStack, (IInventory) tile, EnumFacing.DOWN);
|
||||
if (copyStack.stackSize > 0)
|
||||
Utils.insertStackIntoTile(copyStack, tile, EnumFacing.DOWN);
|
||||
if (!copyStack.isEmpty())
|
||||
{
|
||||
world.spawnEntityInWorld(new EntityItem(world, blockPos.getX() + 0.4, blockPos.getY() + 2, blockPos.getZ() + 0.4, copyStack));
|
||||
world.spawnEntity(new EntityItem(world, blockPos.getX() + 0.4, blockPos.getY() + 2, blockPos.getZ() + 0.4, copyStack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ public class RitualForsakenSoul extends Ritual
|
|||
{
|
||||
if (entity.isEntityAlive() && !(entity instanceof EntityPlayer))
|
||||
{
|
||||
if (entity.attackEntityFrom(DamageSource.outOfWorld, 1))
|
||||
if (entity.attackEntityFrom(DamageSource.OUT_OF_WORLD, 1))
|
||||
{
|
||||
if (!entity.isEntityAlive())
|
||||
{
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue