Damage related crash fix, Forestry squeezer support for necromancy blood

Fixed indirectmagic damage related crash, added blood to take the place
of necromancy blood, added MT support for squeezer with custom liquids
This commit is contained in:
JAWolfe04 2016-04-01 21:23:34 -05:00
parent 06ec23ab68
commit 8ae6ac99aa
23 changed files with 307 additions and 14 deletions

View File

@ -1,6 +1,6 @@
minecraft_version=1.7.10
forge_version=10.13.4.1558-1.7.10
tfc_version=0.79.27
mod_version=1.10
mod_version=1.11
mod_id=TerraFirmaPunkTweaks
group_name=com.JAWolfe.TerraFirmaPunkTweaks

Binary file not shown.

View File

@ -1,6 +1,15 @@
Changelog
=================================================
-------------------------------------------------
TFP Tweaks 1.11
-------------------------------------------------
New Features
+Added blood to replace broken necromancy blood
+Added minetweaker method for adding recipes to the forestry squeezer that can use custom liquids
Bug Fix
+Fixed indirectmagic damage to mobs causing crash
-------------------------------------------------
TFP Tweaks 1.10
-------------------------------------------------
Bug Fixes

View File

@ -44,6 +44,6 @@ public class RecipeTweaks
if(Loader.isModLoaded("Steamcraft"))
{
//OreDictionary.registerOre("itemAxe", new ItemStack(SteamcraftItems.steamAxe, 1, OreDictionary.WILDCARD_VALUE));
}
}
}
}

View File

@ -4,12 +4,16 @@ import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import flaxbeard.steamcraft.SteamcraftBlocks;
import net.minecraft.block.Block;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
public class TFPBlocks
{
public static Block tweakedboiler;
public static Block tweakedboilerOn;
public static Block tweakedFlashBoiler;
public static Block tfpBlood;
public static Fluid tfpFluidBlood;
public static void initialise()
{
@ -23,5 +27,15 @@ public class TFPBlocks
GameRegistry.registerBlock(tweakedboilerOn, "tweakedboilerOn");
GameRegistry.registerBlock(tweakedFlashBoiler, "tweakedFlashBoiler");
}
if(Loader.isModLoaded("necromancy"))
{
tfpFluidBlood = new Fluid("tfpBlood");
FluidRegistry.registerFluid(tfpFluidBlood);
tfpBlood = new TFPBlood(tfpFluidBlood).setBlockName("tfpBlood");
GameRegistry.registerBlock(tfpBlood, "tfpBlood");
tfpFluidBlood.setBlock(tfpBlood);
}
}
}

View File

@ -0,0 +1,89 @@
package com.JAWolfe.terrafirmapunktweaks.blocks;
import java.util.Random;
import com.JAWolfe.terrafirmapunktweaks.reference.References;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
public class TFPBlood extends BlockFluidClassic
{
protected IIcon[] icons;
protected Fluid fluid;
public TFPBlood(Fluid fluid)
{
super(fluid, Material.water);
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta)
{
return side != 0 && side != 1 ? this.icons[1] : this.icons[0];
}
@Override
public void registerBlockIcons(IIconRegister register)
{
this.getFluid().setIcons(register.registerIcon(References.ModID + ":blood_still"), register.registerIcon(References.ModID + ":blood_flow"));
icons = new IIcon[]{getFluid().getStillIcon(), getFluid().getFlowingIcon()};
}
@Override
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side)
{
Block block = world.getBlock(x, y, z);
if(block.getMaterial() == this.getMaterial())
return false;
return super.shouldSideBeRendered(world, x, y, z, side);
}
@Override
@SideOnly(Side.CLIENT)
public int colorMultiplier(IBlockAccess iblockaccess, int x, int y, int z)
{
return 0xD90000;
}
@Override
public boolean canDisplace(IBlockAccess world, int x, int y, int z)
{
if (world.getBlock(x, y, z).getMaterial().isLiquid())
return false;
return super.canDisplace(world, x, y, z);
}
@Override
public boolean displaceIfPossible(World world, int x, int y, int z)
{
if (world.getBlock(x, y, z).getMaterial().isLiquid())
return false;
return super.displaceIfPossible(world, x, y, z);
}
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rand)
{
super.randomDisplayTick(world, x, y, z, rand);
if (rand.nextInt(10) == 0
&& World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)
&& !world.getBlock(x, y - 2, z).getMaterial().blocksMovement()) {
double px = (double) ((float) x + rand.nextFloat());
double py = (double) y - 1.05D;
double pz = (double) ((float) z + rand.nextFloat());
world.spawnParticle("dripLava", px, py, pz, 0, 0, 0);
}
}
}

View File

@ -240,11 +240,13 @@ public class PlayerDamageHandler
//Add damage for indirect magic damage
if(ConfigSettings.VanillaMagicScaling && "indirectMagic".contentEquals(event.source.damageType))
{
event.source.getEntity().getEntityData().setBoolean("Attacking", true);
event.entity.attackEntityFrom(event.source, ConfigSettings.VanillaPvPNonWeaponDamageMultipier);
if(event.entity instanceof EntityWitch || event.entity.getClass().toString().contains("EntityWitherWitch"))
{
//Direct hit of a magic bottle kills a witch
event.source.getEntity().getEntityData().setBoolean("Attacking", true);
event.entity.attackEntityFrom(event.source, 100000);
}
}

View File

@ -0,0 +1,31 @@
package com.JAWolfe.terrafirmapunktweaks.items;
import com.JAWolfe.terrafirmapunktweaks.reference.References;
import com.bioxx.tfc.Items.Tools.ItemCustomBucket;
import com.bioxx.tfc.api.Enums.EnumSize;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
public class CustomBucketBlood extends ItemCustomBucket
{
public CustomBucketBlood(Block contents)
{
super(contents);
this.setFolder("tools/");
this.setSize(EnumSize.MEDIUM);
}
public CustomBucketBlood(Block contents, Item container)
{
this(contents);
this.setContainerItem(container);
}
@Override
public void registerIcons(IIconRegister registerer)
{
this.itemIcon = registerer.registerIcon(References.ModID + ":" + this.getUnlocalizedName().replace("item.", ""));
}
}

View File

@ -1,19 +1,31 @@
package com.JAWolfe.terrafirmapunktweaks.items;
import com.JAWolfe.terrafirmapunktweaks.blocks.TFPBlocks;
import com.bioxx.tfc.api.TFCItems;
import buildcraft.BuildCraftEnergy;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
public class TFPItems
{
public static Item CustomBucketOil;
public static Item CustomBucketBlood;
public static void initialise()
{
CustomBucketOil = new CustomBucketOil(BuildCraftEnergy.blockOil, TFCItems.woodenBucketEmpty).setUnlocalizedName("Wooden Bucket Oil");
if(Loader.isModLoaded("BuildCraft|Core"))
{
CustomBucketOil = new CustomBucketOil(BuildCraftEnergy.blockOil, TFCItems.woodenBucketEmpty).setUnlocalizedName("Wooden Bucket Oil");
GameRegistry.registerItem(CustomBucketOil, CustomBucketOil.getUnlocalizedName());
}
GameRegistry.registerItem(CustomBucketOil, CustomBucketOil.getUnlocalizedName());
if(Loader.isModLoaded("necromancy"))
{
CustomBucketBlood = new CustomBucketBlood(TFPBlocks.tfpBlood, TFCItems.woodenBucketEmpty).setUnlocalizedName("Wooden Bucket Blood");
GameRegistry.registerItem(CustomBucketBlood, CustomBucketBlood.getUnlocalizedName());
}
}
}

View File

@ -0,0 +1,93 @@
package com.JAWolfe.terrafirmapunktweaks.minetweaker.Forestry;
import forestry.api.recipes.RecipeManagers;
import minetweaker.IUndoableAction;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import minetweaker.api.liquid.ILiquidStack;
import minetweaker.api.minecraft.MineTweakerMC;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.tfptweaks.Squeezer")
public class Squeezer
{
@ZenMethod
public static void addRecipe(ILiquidStack outputLiquid, int ticks, IItemStack...inputs)
{
ItemStack[] inputStacks = MineTweakerMC.getItemStacks(inputs);
FluidStack outputStack = MineTweakerMC.getLiquidStack(outputLiquid);
MineTweakerAPI.apply(new addSqueezerAction(outputStack, ticks, inputStacks));
}
@ZenMethod
public static void addRecipe(ILiquidStack outputLiquid, IItemStack byProduct, int chance, int ticks, IItemStack...inputs)
{
ItemStack[] inputStacks = MineTweakerMC.getItemStacks(inputs);
FluidStack outputStack = MineTweakerMC.getLiquidStack(outputLiquid);
ItemStack byproductStack = MineTweakerMC.getItemStack(byProduct);
MineTweakerAPI.apply(new addSqueezerAction(outputStack, byproductStack, chance, ticks, inputStacks));
}
private static class addSqueezerAction implements IUndoableAction
{
private ItemStack[] inputStacks;
private ItemStack byProduct;
private FluidStack outputFluid;
private int tickcount;
private int chance;
public addSqueezerAction(FluidStack output, int ticks, ItemStack[] inputs)
{
this.inputStacks = inputs;
this.outputFluid = output;
this.tickcount = ticks;
}
public addSqueezerAction(FluidStack output, ItemStack byproduct, int chance, int ticks, ItemStack[] inputs)
{
this(output, ticks, inputs);
this.byProduct = byproduct;
this.chance = chance;
}
@Override
public void apply()
{
if(byProduct == null)
RecipeManagers.squeezerManager.addRecipe(tickcount, inputStacks, outputFluid);
else
RecipeManagers.squeezerManager.addRecipe(tickcount, inputStacks, outputFluid, byProduct, chance);
}
@Override
public String describe()
{
return null;
}
@Override
public boolean canUndo()
{
return false;
}
@Override
public void undo() {
}
@Override
public String describeUndo() {
return null;
}
@Override
public Object getOverrideKey() {
return null;
}
}
}

View File

@ -1,6 +1,7 @@
package com.JAWolfe.terrafirmapunktweaks.minetweaker;
import com.JAWolfe.terrafirmapunktweaks.minetweaker.Buildcraft.AssemblyTable;
import com.JAWolfe.terrafirmapunktweaks.minetweaker.Forestry.Squeezer;
import com.JAWolfe.terrafirmapunktweaks.minetweaker.TFC.Anvil;
import com.JAWolfe.terrafirmapunktweaks.minetweaker.TFC.Barrel;
import com.JAWolfe.terrafirmapunktweaks.minetweaker.TFC.ItemHeat;
@ -22,11 +23,16 @@ public class TFCTweaker
MineTweakerAPI.registerClass(Quern.class);
MineTweakerAPI.registerClass(Barrel.class);
MineTweakerAPI.registerClass(Anvil.class);
}
if(Loader.isModLoaded("BuildCraft|Core"))
{
MineTweakerAPI.registerClass(AssemblyTable.class);
if(Loader.isModLoaded("BuildCraft|Core"))
{
MineTweakerAPI.registerClass(AssemblyTable.class);
}
if(Loader.isModLoaded("Forestry"))
{
MineTweakerAPI.registerClass(Squeezer.class);
}
}
}
}

View File

@ -1,9 +1,11 @@
package com.JAWolfe.terrafirmapunktweaks.proxy;
import com.JAWolfe.terrafirmapunktweaks.blocks.TFPBlocks;
import com.JAWolfe.terrafirmapunktweaks.items.TFPItems;
import com.JAWolfe.terrafirmapunktweaks.tiles.TEBoiler;
import com.JAWolfe.terrafirmapunktweaks.tiles.TEFlashBoiler;
import com.bioxx.tfc.api.TFCItems;
import com.sirolf2009.necromancy.item.ItemGeneric;
import buildcraft.BuildCraftEnergy;
import cpw.mods.fml.common.Loader;
@ -12,6 +14,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
public class CommonProxy
{
@ -26,7 +29,16 @@ public class CommonProxy
public void setupFluids()
{
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid(BuildCraftEnergy.fluidOil.getName()), new ItemStack(TFPItems.CustomBucketOil), new ItemStack(TFCItems.woodenBucketEmpty));
if(Loader.isModLoaded("BuildCraft|Core"))
{
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluid(BuildCraftEnergy.fluidOil.getName()), new ItemStack(TFPItems.CustomBucketOil), new ItemStack(TFCItems.woodenBucketEmpty));
}
if(Loader.isModLoaded("necromancy"))
{
FluidContainerRegistry.registerFluidContainer(new FluidStack(TFPBlocks.tfpFluidBlood, 1000), new ItemStack(TFPItems.CustomBucketBlood), new ItemStack(TFCItems.woodenBucketEmpty));
FluidContainerRegistry.registerFluidContainer(new FluidStack(TFPBlocks.tfpFluidBlood, 250), ItemGeneric.getItemStackFromName("Jar of Blood"), new ItemStack(TFCItems.glassBottle));
}
}
public void registerWAILA()

View File

@ -11,11 +11,17 @@ public class References
public static final String MODID_SC2 = "steamcraft2";
public static final String MODID_FSP = "Steamcraft";
public static final String MODID_BC = "BuildCraft|Core";
public static final String MODID_FORESTRY = "Forestry";
public static final String ModVersion = "@MOD_VERSION@";
public static final String ModDependencies = "required-after:" + MODID_TFC +
";required-after:" + MODID_SC2 +
";required-after:" + MODID_SC2 +
";required-after:" + MODID_BC +
";required-after:" + MODID_FORESTRY +
";required-after:" + MODID_FSP;
public static final String SERVER_PROXY_CLASS = "com.JAWolfe.terrafirmapunktweaks.proxy.CommonProxy";

View File

@ -14,9 +14,20 @@ gui.tfptweaks.steamtank=Steam Tank
#=========
#= Items =
#=========
item.Wooden Bucket Oil.name=Wooden Bucket Oil
item.Wooden Bucket Oil.name=Wooden Bucket (Oil)
item.Wooden Bucket Blood.name=Wooden Bucket (Blood)
#===========
#= Effects =
#===========
effect.bleed.postfix=Potion of Bleeding
effect.bleed.postfix=Potion of Bleeding
#==========
#= Blocks =
#==========
tile.tfpBlood.name=Blood
#==========
#= Fluids =
#==========
fluid.tfpBlood=Blood

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,3 @@
{
"animation": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@ -0,0 +1,5 @@
{
"animation": {
"frametime": 2
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -14,7 +14,7 @@
"screenshots": [],
"parent": "",
"requiredMods": ["Forge", "terrafirmacraft"],
"dependencies": ["terrafirmacraft", "steamcraft2", "Steamcraft"],
"dependencies": ["terrafirmacraft", "steamcraft2", "Steamcraft", "BuildCraft|Core", "Forestry"],
"dependants": [],
"useDependencyInformation": "true"
}]