Fixed the Dynamic Mace so that it looks at the material of the block as well.
This commit is contained in:
parent
b2c013e8c6
commit
79f86a3a37
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
#Sun Jul 19 14:39:17 EDT 2015
|
#Mon Jul 20 20:59:46 EDT 2015
|
||||||
mod_name=BloodMagic
|
mod_name=BloodMagic
|
||||||
forge_version=10.13.4.1448-1.7.10
|
forge_version=10.13.4.1448-1.7.10
|
||||||
ccc_version=1.0.4.29
|
ccc_version=1.0.4.29
|
||||||
|
@ -9,5 +9,5 @@ guideapi_version=1.0.1-20
|
||||||
package_group=com.wayoftime.bloodmagic
|
package_group=com.wayoftime.bloodmagic
|
||||||
mod_version=1.3.3
|
mod_version=1.3.3
|
||||||
minetweaker_version=Dev-1.7.10-3.0.9B
|
minetweaker_version=Dev-1.7.10-3.0.9B
|
||||||
|
build_number=12
|
||||||
mc_version=1.7.10
|
mc_version=1.7.10
|
||||||
build_number=11
|
|
||||||
|
|
|
@ -285,7 +285,12 @@ public class ItemSpellMultiTool extends Item
|
||||||
|
|
||||||
if (toolClass == null || toolClass.equals(""))
|
if (toolClass == null || toolClass.equals(""))
|
||||||
{
|
{
|
||||||
return 1.0f;
|
toolClass = getToolClassOfMaterial(block.getMaterial());
|
||||||
|
|
||||||
|
if(toolClass == "")
|
||||||
|
{
|
||||||
|
return 1.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
if (stack.hasTagCompound())
|
if (stack.hasTagCompound())
|
||||||
|
@ -301,6 +306,26 @@ public class ItemSpellMultiTool extends Item
|
||||||
|
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getToolClassOfMaterial(Material mat)
|
||||||
|
{
|
||||||
|
if(mat == Material.iron || mat == Material.anvil || mat == Material.rock)
|
||||||
|
{
|
||||||
|
return "pickaxe";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mat == Material.wood || mat == Material.plants || mat == Material.vine)
|
||||||
|
{
|
||||||
|
return "axe";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mat == Material.ground || mat == Material.grass)
|
||||||
|
{
|
||||||
|
return "shovel";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getHarvestLevel(ItemStack stack, String toolClass)
|
public int getHarvestLevel(ItemStack stack, String toolClass)
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
package WayofTime.alchemicalWizardry.client;
|
package WayofTime.alchemicalWizardry.client;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.event.RenderBlockOverlayEvent;
|
import net.minecraftforge.client.event.RenderBlockOverlayEvent;
|
||||||
|
import net.minecraftforge.client.event.RenderHandEvent;
|
||||||
import net.minecraftforge.client.event.sound.SoundEvent;
|
import net.minecraftforge.client.event.sound.SoundEvent;
|
||||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||||
import WayofTime.alchemicalWizardry.ModBlocks;
|
import WayofTime.alchemicalWizardry.ModBlocks;
|
||||||
|
@ -14,6 +16,8 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||||
import cpw.mods.fml.common.gameevent.InputEvent;
|
import cpw.mods.fml.common.gameevent.InputEvent;
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent;
|
import cpw.mods.fml.common.gameevent.TickEvent.RenderTickEvent;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
public class ClientEventHandler
|
public class ClientEventHandler
|
||||||
{
|
{
|
||||||
|
@ -21,18 +25,18 @@ public class ClientEventHandler
|
||||||
|
|
||||||
public static ResourceLocation currentPlayerTexture = null;
|
public static ResourceLocation currentPlayerTexture = null;
|
||||||
|
|
||||||
// @SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
// @SubscribeEvent
|
@SubscribeEvent
|
||||||
// public void renderPOVArmour(RenderHandEvent event)
|
public void renderPOVArmour(RenderHandEvent event)
|
||||||
// {
|
{
|
||||||
// if (this.mc.thePlayer.worldObj.isRemote && this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode())
|
if (this.mc.thePlayer.worldObj.isRemote && this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode())
|
||||||
// {
|
{
|
||||||
// currentPlayerTexture = ((AbstractClientPlayer) mc.thePlayer).getLocationSkin();
|
currentPlayerTexture = ((AbstractClientPlayer) mc.thePlayer).getLocationSkin();
|
||||||
//
|
|
||||||
// ClientUtils.renderPlayerArmourInPOV(mc.thePlayer, event.partialTicks);
|
ClientUtils.renderPlayerArmourInPOV(mc.thePlayer, event.partialTicks);
|
||||||
// event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// @SubscribeEvent(priority = EventPriority.LOWEST)
|
// @SubscribeEvent(priority = EventPriority.LOWEST)
|
||||||
// public void onPlayerRenderTick(RenderPlayerEvent.Pre event)
|
// public void onPlayerRenderTick(RenderPlayerEvent.Pre event)
|
||||||
|
|
Loading…
Reference in a new issue