First Checkup
This commit is contained in:
@@ -185,9 +185,9 @@ public final class WizardryEventHandler {
|
||||
|
||||
// Prevents any damage to allies from magic if friendly fire is enabled
|
||||
if(!Wizardry.settings.friendlyFire && event.getSource() != null
|
||||
&& event.getSource().getEntity() instanceof EntityPlayer && event.getEntity() instanceof EntityPlayer
|
||||
&& event.getSource().getTrueSource() instanceof EntityPlayer && event.getEntity() instanceof EntityPlayer
|
||||
&& event.getSource() instanceof IElementalDamage){
|
||||
if(WizardryUtilities.isPlayerAlly((EntityPlayer)event.getSource().getEntity(),
|
||||
if(WizardryUtilities.isPlayerAlly((EntityPlayer)event.getSource().getTrueSource(),
|
||||
(EntityPlayer)event.getEntity())){
|
||||
event.setCanceled(true);
|
||||
// This needs to be here, since if the event is cancelled nothing else needs to happen.
|
||||
@@ -198,11 +198,11 @@ public final class WizardryEventHandler {
|
||||
// Retaliatory effects
|
||||
// These are better off here because the revenge effects are pretty similar, and I'd rather keep the (lengthy)
|
||||
// if statement in one place.
|
||||
if(event.getSource() != null && event.getSource().getEntity() instanceof EntityLivingBase
|
||||
if(event.getSource() != null && event.getSource().getTrueSource() instanceof EntityLivingBase
|
||||
&& !event.getSource().isProjectile() && !(event.getSource() instanceof IElementalDamage
|
||||
&& ((IElementalDamage)event.getSource()).isRetaliatory())){
|
||||
|
||||
EntityLivingBase attacker = (EntityLivingBase)event.getSource().getEntity();
|
||||
EntityLivingBase attacker = (EntityLivingBase)event.getSource().getTrueSource();
|
||||
World world = event.getEntityLiving().world;
|
||||
|
||||
// Fireskin
|
||||
@@ -249,12 +249,12 @@ public final class WizardryEventHandler {
|
||||
public static void onLivingHurtEvent(LivingHurtEvent event){
|
||||
|
||||
// Flaming and freezing swords
|
||||
if(event.getSource().getEntity() instanceof EntityLivingBase){
|
||||
if(event.getSource().getTrueSource() instanceof EntityLivingBase){
|
||||
|
||||
EntityLivingBase attacker = (EntityLivingBase)event.getSource().getEntity();
|
||||
EntityLivingBase attacker = (EntityLivingBase)event.getSource().getTrueSource();
|
||||
|
||||
// Players can only ever attack with their main hand, so this is the right method to use here.
|
||||
if(attacker.getHeldItemMainhand() != null && attacker.getHeldItemMainhand().getItem() instanceof ItemSword){
|
||||
if(!attacker.getHeldItemMainhand().isEmpty() && attacker.getHeldItemMainhand().getItem() instanceof ItemSword){
|
||||
|
||||
int level = EnchantmentHelper.getEnchantmentLevel(WizardryEnchantments.flaming_weapon,
|
||||
attacker.getHeldItemMainhand());
|
||||
@@ -271,10 +271,10 @@ public final class WizardryEventHandler {
|
||||
}
|
||||
|
||||
// Freezing bow
|
||||
if(event.getSource().getSourceOfDamage() instanceof EntityArrow
|
||||
&& event.getSource().getSourceOfDamage().getEntityData() != null){
|
||||
if(event.getSource().getImmediateSource() instanceof EntityArrow
|
||||
&& event.getSource().getImmediateSource().getEntityData() != null){
|
||||
|
||||
int level = event.getSource().getSourceOfDamage().getEntityData()
|
||||
int level = event.getSource().getImmediateSource().getEntityData()
|
||||
.getInteger(FreezingWeapon.FREEZING_ARROW_NBT_KEY);
|
||||
|
||||
if(level > 0 && !MagicDamage.isEntityImmune(DamageType.FROST, event.getEntityLiving()))
|
||||
@@ -284,7 +284,7 @@ public final class WizardryEventHandler {
|
||||
// Damage scaling
|
||||
if(event.getSource() != null && event.getSource() instanceof IElementalDamage){
|
||||
|
||||
if(event.getSource().getEntity() instanceof EntityPlayer){
|
||||
if(event.getSource().getTrueSource() instanceof EntityPlayer){
|
||||
event.setAmount((float)(event.getAmount() * Wizardry.settings.playerDamageScale));
|
||||
}else{
|
||||
event.setAmount((float)(event.getAmount() * Wizardry.settings.npcDamageScale));
|
||||
@@ -346,9 +346,9 @@ public final class WizardryEventHandler {
|
||||
@SubscribeEvent
|
||||
public static void onLivingDeathEvent(LivingDeathEvent event){
|
||||
|
||||
if(event.getSource().getEntity() instanceof EntityPlayer){
|
||||
if(event.getSource().getTrueSource() instanceof EntityPlayer){
|
||||
|
||||
EntityPlayer player = (EntityPlayer)event.getSource().getEntity();
|
||||
EntityPlayer player = (EntityPlayer)event.getSource().getTrueSource();
|
||||
|
||||
for(ItemStack stack : WizardryUtilities.getPrioritisedHotbarAndOffhand(player)){
|
||||
|
||||
@@ -378,7 +378,7 @@ public final class WizardryEventHandler {
|
||||
if(event.getEntityLiving() instanceof IMob && !(event.getEntityLiving() instanceof EntityEvilWizard)
|
||||
// TODO: Backport when you backport the new summoned creature system.
|
||||
&& !(event.getEntityLiving() instanceof ISummonedCreature)
|
||||
&& event.getSource().getEntity() instanceof EntityPlayer && Wizardry.settings.spellBookDropChance > 0){
|
||||
&& event.getSource().getTrueSource() instanceof EntityPlayer && Wizardry.settings.spellBookDropChance > 0){
|
||||
|
||||
// This does exactly what the entity drop method does, but with a different random number so that the
|
||||
// spell book doesn't always drop with other rare drops.
|
||||
@@ -397,7 +397,7 @@ public final class WizardryEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onItemPickupEvent(EntityItemPickupEvent event){
|
||||
if(event.getItem().getEntityItem().getItem() == WizardryItems.magic_crystal){
|
||||
if(event.getItem().getItem().getItem() == WizardryItems.magic_crystal){
|
||||
event.getEntityPlayer().addStat(WizardryAchievements.crystal, 1);
|
||||
}
|
||||
}
|
||||
@@ -412,7 +412,7 @@ public final class WizardryEventHandler {
|
||||
* @param player
|
||||
*/
|
||||
private static void hackilyFixContinuousSpellCasting(EntityPlayer player){
|
||||
if(player.isHandActive() && player.getHeldItem(player.getActiveHand()) != null
|
||||
if(player.isHandActive() && !player.getHeldItem(player.getActiveHand()).isEmpty()
|
||||
&& player.getHeldItem(player.getActiveHand()).getItem() instanceof ItemWand
|
||||
&& WandHelper.getCurrentSpell(player.getHeldItem(player.getActiveHand())).isContinuous){
|
||||
if(player.getActiveItemStack() != player.getHeldItem(player.getActiveHand())){
|
||||
|
||||
@@ -43,16 +43,16 @@ public class WizardryGuiHandler implements IGuiHandler {
|
||||
return new electroblob.wizardry.client.GuiArcaneWorkbench(player.inventory,
|
||||
(TileEntityArcaneWorkbench)tileEntity);
|
||||
}
|
||||
}else if(id == WIZARD_HANDBOOK && ((player.getHeldItemMainhand() != null
|
||||
}else if(id == WIZARD_HANDBOOK && ((!player.getHeldItemMainhand().isEmpty()
|
||||
&& player.getHeldItemMainhand().getItem() instanceof ItemWizardHandbook)
|
||||
|| (player.getHeldItemOffhand() != null
|
||||
|| (!player.getHeldItemOffhand().isEmpty()
|
||||
&& player.getHeldItemOffhand().getItem() instanceof ItemWizardHandbook))){
|
||||
return new electroblob.wizardry.client.GuiWizardHandbook();
|
||||
}else if(id == SPELL_BOOK){
|
||||
if(player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemSpellBook){
|
||||
if(!player.getHeldItemMainhand().isEmpty() && player.getHeldItemMainhand().getItem() instanceof ItemSpellBook){
|
||||
return new electroblob.wizardry.client.GuiSpellBook(
|
||||
Spell.get(player.getHeldItemMainhand().getItemDamage()));
|
||||
}else if(player.getHeldItemOffhand() != null
|
||||
}else if(!player.getHeldItemOffhand().isEmpty()
|
||||
&& player.getHeldItemOffhand().getItem() instanceof ItemSpellBook){
|
||||
return new electroblob.wizardry.client.GuiSpellBook(
|
||||
Spell.get(player.getHeldItemOffhand().getItemDamage()));
|
||||
|
||||
@@ -124,8 +124,8 @@ public class WizardryWorldGenerator implements IWorldGenerator {
|
||||
int k1 = randPosZ + random.nextInt(8) - random.nextInt(8);
|
||||
|
||||
BlockPos pos = new BlockPos(i1, j1, k1);
|
||||
|
||||
if(world.isBlockLoaded(pos) && world.isAirBlock(pos) && (!world.provider.hasNoSky() || j1 < 127)
|
||||
|
||||
if(world.isBlockLoaded(pos) && world.isAirBlock(pos) && (!world.provider.isNether() || j1 < 127)
|
||||
&& state.getBlock().canPlaceBlockOnSide(world, pos, EnumFacing.UP)){
|
||||
|
||||
world.setBlockState(pos, state, 2);
|
||||
|
||||
@@ -25,43 +25,43 @@ public class BlockArcaneWorkbench extends BlockContainer {
|
||||
|
||||
private static final AxisAlignedBB AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D);
|
||||
|
||||
public BlockArcaneWorkbench(){
|
||||
public BlockArcaneWorkbench() {
|
||||
super(Material.ROCK);
|
||||
this.setLightLevel(0.8f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos){
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
||||
return AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int metadata){
|
||||
public TileEntity createNewTileEntity(World world, int metadata) {
|
||||
return new TileEntityArcaneWorkbench();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos){
|
||||
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state){
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state){
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState block, EntityPlayer player, EnumHand hand,
|
||||
EnumFacing side, float hitX, float hitY, float hitZ){
|
||||
EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
TileEntity tileEntity = world.getTileEntity(pos);
|
||||
|
||||
if(tileEntity == null || player.isSneaking()){
|
||||
if (tileEntity == null || player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -71,45 +71,44 @@ public class BlockArcaneWorkbench extends BlockContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState block){
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState block) {
|
||||
|
||||
Random random = new Random();
|
||||
TileEntityArcaneWorkbench tileentityarcaneworkbench = (TileEntityArcaneWorkbench)world.getTileEntity(pos);
|
||||
TileEntityArcaneWorkbench tileentityarcaneworkbench = (TileEntityArcaneWorkbench) world.getTileEntity(pos);
|
||||
|
||||
if(tileentityarcaneworkbench != null){
|
||||
if (tileentityarcaneworkbench != null) {
|
||||
|
||||
for(int j1 = 0; j1 < tileentityarcaneworkbench.getSizeInventory(); ++j1){
|
||||
for (int j1 = 0; j1 < tileentityarcaneworkbench.getSizeInventory(); ++j1) {
|
||||
|
||||
ItemStack itemstack = tileentityarcaneworkbench.getStackInSlot(j1);
|
||||
|
||||
if(!itemstack.isEmpty()){
|
||||
if (!itemstack.isEmpty()) {
|
||||
|
||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for(float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.getCount() > 0; world
|
||||
.spawnEntity(entityitem)){
|
||||
for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.getCount() > 0; world
|
||||
.spawnEntity(entityitem)) {
|
||||
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if(k1 > itemstack.getCount()){
|
||||
if (k1 > itemstack.getCount()) {
|
||||
k1 = itemstack.getCount();
|
||||
}
|
||||
|
||||
itemstack.shrink(k1);
|
||||
|
||||
entityitem = new EntityItem(world, (double)((float)pos.getX() + f),
|
||||
(double)((float)pos.getY() + f1), (double)((float)pos.getZ() + f2),
|
||||
entityitem = new EntityItem(world, (double) ((float) pos.getX() + f),
|
||||
(double) ((float) pos.getY() + f1), (double) ((float) pos.getZ() + f2),
|
||||
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (double)((float)random.nextGaussian() * f3);
|
||||
entityitem.motionY = (double)((float)random.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ = (double)((float)random.nextGaussian() * f3);
|
||||
entityitem.motionX = (double) ((float) random.nextGaussian() * f3);
|
||||
entityitem.motionY = (double) ((float) random.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ = (double) ((float) random.nextGaussian() * f3);
|
||||
|
||||
if(itemstack.hasTagCompound()){
|
||||
entityitem.getEntityItem()
|
||||
.setTagCompound(((NBTTagCompound)itemstack.getTagCompound().copy()));
|
||||
if (itemstack.hasTagCompound()) {
|
||||
entityitem.getItem().setTagCompound(((NBTTagCompound) itemstack.getTagCompound().copy()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class BlockCrystalFlower extends BlockBush {
|
||||
event.getWorld().rand.nextInt(8) - event.getWorld().rand.nextInt(8));
|
||||
|
||||
if(event.getWorld().isAirBlock(new BlockPos(pos))
|
||||
&& (!event.getWorld().provider.hasNoSky() || pos.getY() < 127)
|
||||
&& (!event.getWorld().provider.isNether() || pos.getY() < 127)
|
||||
&& WizardryBlocks.crystal_flower.canPlaceBlockAt(event.getWorld(), pos)){
|
||||
event.getWorld().setBlockState(pos, WizardryBlocks.crystal_flower.getDefaultState(), 2);
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ public class ClientProxy extends CommonProxy {
|
||||
|
||||
Source source = Source.OTHER;
|
||||
|
||||
if(((EntityPlayer)caster).getHeldItem(message.hand) != null){
|
||||
if(!((EntityPlayer)caster).getHeldItem(message.hand).isEmpty()){
|
||||
Item item = ((EntityPlayer)caster).getHeldItem(message.hand).getItem();
|
||||
if(item instanceof ItemWand){
|
||||
source = Source.WAND;
|
||||
|
||||
@@ -37,8 +37,8 @@ public class EntityNameEntry extends StringEntry {
|
||||
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY,
|
||||
boolean isSelected){
|
||||
// super.drawEntry(slotIndex, x, y, listWidth, slotHeight, tessellator, mouseX, mouseY, isSelected);
|
||||
this.btnValue.xPosition = listWidth / 4;
|
||||
this.btnValue.yPosition = y;
|
||||
this.btnValue.x = listWidth / 4;
|
||||
this.btnValue.y = y;
|
||||
|
||||
String trans = I18n.format(this.textFieldValue.getText());
|
||||
if(!trans.equals(this.textFieldValue.getText()))
|
||||
|
||||
@@ -53,10 +53,10 @@ public class GuiArcaneWorkbench extends GuiContainer {
|
||||
if(this.inventorySlots.getSlot(ContainerArcaneWorkbench.WAND_SLOT).getHasStack() && this.inventorySlots
|
||||
.getSlot(ContainerArcaneWorkbench.WAND_SLOT).getStack().getItem() instanceof ItemWand){
|
||||
guiLeft = (this.width - this.xSize - tooltipWidth) / 2;
|
||||
this.applyBtn.xPosition = (this.width - tooltipWidth) / 2 + 48;
|
||||
this.applyBtn.x = (this.width - tooltipWidth) / 2 + 48;
|
||||
}else{
|
||||
guiLeft = (this.width - this.xSize) / 2;
|
||||
this.applyBtn.xPosition = this.width / 2 + 48;
|
||||
this.applyBtn.x = this.width / 2 + 48;
|
||||
}
|
||||
|
||||
if(this.inventorySlots.getSlot(ContainerArcaneWorkbench.WAND_SLOT).getHasStack()){
|
||||
@@ -130,7 +130,7 @@ public class GuiArcaneWorkbench extends GuiContainer {
|
||||
ItemStack stack = new ItemStack(item, level);
|
||||
GlStateManager.enableDepth();
|
||||
this.itemRender.renderItemAndEffectIntoGUI(stack, guiLeft + xSize + 6 + x, y);
|
||||
this.itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, stack, guiLeft + xSize + 6 + x, y,
|
||||
this.itemRender.renderItemOverlayIntoGUI(this.fontRenderer, stack, guiLeft + xSize + 6 + x, y,
|
||||
null);
|
||||
x += 18;
|
||||
GlStateManager.disableDepth();
|
||||
@@ -150,10 +150,10 @@ public class GuiArcaneWorkbench extends GuiContainer {
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY){
|
||||
|
||||
this.fontRendererObj
|
||||
this.fontRenderer
|
||||
.drawString(this.arcaneWorkbenchInventory.hasCustomName() ? this.arcaneWorkbenchInventory.getName()
|
||||
: I18n.format(this.arcaneWorkbenchInventory.getName()), 8, 6, 4210752);
|
||||
this.fontRendererObj.drawString(this.playerInventory.hasCustomName() ? this.playerInventory.getName()
|
||||
this.fontRenderer.drawString(this.playerInventory.hasCustomName() ? this.playerInventory.getName()
|
||||
: I18n.format(this.playerInventory.getName()), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
if(this.inventorySlots.getSlot(ContainerArcaneWorkbench.WAND_SLOT).getHasStack() && this.inventorySlots
|
||||
@@ -161,8 +161,8 @@ public class GuiArcaneWorkbench extends GuiContainer {
|
||||
|
||||
ItemStack wand = this.inventorySlots.getSlot(ContainerArcaneWorkbench.WAND_SLOT).getStack();
|
||||
|
||||
this.fontRendererObj.drawStringWithShadow("\u00A7f" + wand.getDisplayName(), xSize + 6, 6, 0);
|
||||
this.fontRendererObj.drawStringWithShadow(
|
||||
this.fontRenderer.drawStringWithShadow("\u00A7f" + wand.getDisplayName(), xSize + 6, 6, 0);
|
||||
this.fontRenderer.drawStringWithShadow(
|
||||
"\u00A77" + I18n.format("container.wizardry:arcane_workbench.mana") + " "
|
||||
+ (wand.getMaxDamage() - wand.getItemDamage()) + "/" + wand.getMaxDamage(),
|
||||
xSize + 6, 20, 0);
|
||||
@@ -180,7 +180,7 @@ public class GuiArcaneWorkbench extends GuiContainer {
|
||||
}
|
||||
|
||||
if(discovered){
|
||||
this.fontRendererObj.drawStringWithShadow(spell.getDisplayNameWithFormatting(), xSize + 16, y, 0);
|
||||
this.fontRenderer.drawStringWithShadow(spell.getDisplayNameWithFormatting(), xSize + 16, y, 0);
|
||||
}else{
|
||||
this.mc.standardGalacticFontRenderer.drawStringWithShadow(
|
||||
"\u00A79" + SpellGlyphData.getGlyphName(spell, this.mc.world), xSize + 16, y, 0);
|
||||
@@ -190,7 +190,7 @@ public class GuiArcaneWorkbench extends GuiContainer {
|
||||
|
||||
if(WandHelper.getTotalUpgrades(wand) > 0){
|
||||
|
||||
this.fontRendererObj.drawStringWithShadow(
|
||||
this.fontRenderer.drawStringWithShadow(
|
||||
"\u00A7f" + I18n.format("container.wizardry:arcane_workbench.upgrades"), xSize + 6, y + 6, 0);
|
||||
|
||||
int x = 0;
|
||||
|
||||
@@ -19,8 +19,8 @@ class GuiButtonApply extends GuiButton {
|
||||
public void drawButton(Minecraft minecraft, int mouseX, int mouseY){
|
||||
|
||||
// Whether the button is highlighted
|
||||
this.hovered = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width
|
||||
&& mouseY < this.yPosition + this.height;
|
||||
this.hovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width
|
||||
&& mouseY < this.y + this.height;
|
||||
|
||||
int k = 36;
|
||||
int l = 220;
|
||||
@@ -36,8 +36,8 @@ class GuiButtonApply extends GuiButton {
|
||||
colour = 10526880;
|
||||
}
|
||||
|
||||
WizardryUtilities.drawTexturedRect(this.xPosition, this.yPosition, k, l, this.width, this.height, 256, 256);
|
||||
this.drawCenteredString(minecraft.fontRendererObj, this.displayString, this.xPosition + this.width / 2,
|
||||
this.yPosition + (this.height - 8) / 2, colour);
|
||||
WizardryUtilities.drawTexturedRect(this.x, this.y, k, l, this.width, this.height, 256, 256);
|
||||
this.drawCenteredString(minecraft.fontRenderer, this.displayString, this.x + this.width / 2,
|
||||
this.y + (this.height - 8) / 2, colour);
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,8 @@ class GuiButtonInvisible extends GuiButton {
|
||||
* Draws this button to the screen.
|
||||
*/
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3){
|
||||
this.hovered = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width
|
||||
&& par3 < this.yPosition + this.height;
|
||||
this.hovered = par2 >= this.x && par3 >= this.y && par2 < this.x + this.width
|
||||
&& par3 < this.y + this.height;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ class GuiButtonTurnPage extends GuiButton {
|
||||
*/
|
||||
public void drawButton(Minecraft par1Minecraft, int par2, int par3){
|
||||
if(this.visible){
|
||||
boolean flag = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width
|
||||
&& par3 < this.yPosition + this.height;
|
||||
boolean flag = par2 >= this.x && par3 >= this.y && par2 < this.x + this.width
|
||||
&& par3 < this.y + this.height;
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
par1Minecraft.getTextureManager().bindTexture(texture);
|
||||
int k = 0;
|
||||
@@ -42,7 +42,7 @@ class GuiButtonTurnPage extends GuiButton {
|
||||
l += 13;
|
||||
}
|
||||
|
||||
WizardryUtilities.drawTexturedRect(this.xPosition, this.yPosition, k, l, 23, 13, 288, 256);
|
||||
WizardryUtilities.drawTexturedRect(this.x, this.y, k, l, 23, 13, 288, 256);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ public class GuiPortableCrafting extends GuiContainer {
|
||||
* Draw the foreground layer for the GuiContainer (everything in front of the items)
|
||||
*/
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_){
|
||||
this.fontRendererObj.drawString(I18n.format("container.crafting"), 28, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
this.fontRenderer.drawString(I18n.format("container.crafting"), 28, 6, 4210752);
|
||||
this.fontRenderer.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_){
|
||||
|
||||
@@ -54,8 +54,8 @@ public class GuiSpellBook extends GuiScreen {
|
||||
super.drawScreen(par1, par2, par3);
|
||||
|
||||
if(discovered){
|
||||
this.fontRendererObj.drawString(spell.getDisplayName(), xPos + 17, yPos + 14, 0);
|
||||
this.fontRendererObj.drawString(spell.type.getDisplayName(), xPos + 17, yPos + 25, 0x777777);
|
||||
this.fontRenderer.drawString(spell.getDisplayName(), xPos + 17, yPos + 14, 0);
|
||||
this.fontRenderer.drawString(spell.type.getDisplayName(), xPos + 17, yPos + 25, 0x777777);
|
||||
}else{
|
||||
this.mc.standardGalacticFontRenderer.drawString(SpellGlyphData.getGlyphName(spell, player.world), xPos + 17,
|
||||
yPos + 14, 0);
|
||||
@@ -63,27 +63,27 @@ public class GuiSpellBook extends GuiScreen {
|
||||
0x777777);
|
||||
}
|
||||
|
||||
this.fontRendererObj.drawString("-------------------", xPos + 17, yPos + 34, 0);
|
||||
this.fontRenderer.drawString("-------------------", xPos + 17, yPos + 34, 0);
|
||||
|
||||
if(spell.tier == Tier.BASIC){
|
||||
// Basic is usually white but this doesn't show up.
|
||||
this.fontRendererObj.drawString("Tier: \u00A77" + Tier.BASIC.getDisplayName(), xPos + 17, yPos + 44, 0);
|
||||
this.fontRenderer.drawString("Tier: \u00A77" + Tier.BASIC.getDisplayName(), xPos + 17, yPos + 44, 0);
|
||||
}else{
|
||||
this.fontRendererObj.drawString("Tier: " + spell.tier.getDisplayNameWithFormatting(), xPos + 17, yPos + 44,
|
||||
this.fontRenderer.drawString("Tier: " + spell.tier.getDisplayNameWithFormatting(), xPos + 17, yPos + 44,
|
||||
0);
|
||||
}
|
||||
|
||||
String element = "Element: " + spell.element.getFormattingCode() + spell.element.getDisplayName();
|
||||
if(!discovered) element = "Element: ?";
|
||||
this.fontRendererObj.drawString(element, xPos + 17, yPos + 56, 0);
|
||||
this.fontRenderer.drawString(element, xPos + 17, yPos + 56, 0);
|
||||
|
||||
String manaCost = "Mana Cost: " + spell.cost;
|
||||
if(spell.isContinuous) manaCost = "Mana Cost: " + spell.cost + "/second";
|
||||
if(!discovered) manaCost = "Mana Cost: ?";
|
||||
this.fontRendererObj.drawString(manaCost, xPos + 17, yPos + 68, 0);
|
||||
this.fontRenderer.drawString(manaCost, xPos + 17, yPos + 68, 0);
|
||||
|
||||
if(discovered){
|
||||
this.fontRendererObj.drawSplitString(spell.getDescription(), xPos + 17, yPos + 82, 118, 0);
|
||||
this.fontRenderer.drawSplitString(spell.getDescription(), xPos + 17, yPos + 82, 118, 0);
|
||||
}else{
|
||||
this.mc.standardGalacticFontRenderer.drawSplitString(
|
||||
SpellGlyphData.getGlyphDescription(spell, player.world), xPos + 17, yPos + 82, 118, 0);
|
||||
|
||||
@@ -47,10 +47,10 @@ public class GuiSpellDisplay extends Gui {
|
||||
|
||||
ItemStack wand = player.getHeldItemMainhand();
|
||||
|
||||
if(wand == null || !(wand.getItem() instanceof ItemWand)){
|
||||
if(wand.isEmpty() || !(wand.getItem() instanceof ItemWand)){
|
||||
wand = player.getHeldItemOffhand();
|
||||
// If the player isn't holding a wand, then nothing else needs to be done.
|
||||
if(wand == null || !(wand.getItem() instanceof ItemWand)) return;
|
||||
if(wand.isEmpty() || !(wand.getItem() instanceof ItemWand)) return;
|
||||
}
|
||||
|
||||
int width = event.getResolution().getScaledWidth();
|
||||
@@ -101,7 +101,7 @@ public class GuiSpellDisplay extends Gui {
|
||||
: spell.element.getFormattingCode();
|
||||
if(!discovered) colour = "\u00A79";
|
||||
String spellName = discovered ? spell.getDisplayName() : SpellGlyphData.getGlyphName(spell, player.world);
|
||||
FontRenderer font = discovered ? this.mc.fontRendererObj : this.mc.standardGalacticFontRenderer;
|
||||
FontRenderer font = discovered ? this.mc.fontRenderer : this.mc.standardGalacticFontRenderer;
|
||||
|
||||
int maxWidth = 90;
|
||||
|
||||
|
||||
@@ -100,8 +100,8 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
|
||||
}
|
||||
|
||||
this.fontRendererObj.drawString("" + (pageNumber * 2 + 1), xPos + xSize / 4 - 3, yPos + ySize - 20, 0);
|
||||
this.fontRendererObj.drawString("" + (pageNumber * 2 + 2), xPos + 3 * xSize / 4 - 5, yPos + ySize - 20, 0);
|
||||
this.fontRenderer.drawString("" + (pageNumber * 2 + 1), xPos + xSize / 4 - 3, yPos + ySize - 20, 0);
|
||||
this.fontRenderer.drawString("" + (pageNumber * 2 + 2), xPos + 3 * xSize / 4 - 5, yPos + ySize - 20, 0);
|
||||
|
||||
super.drawScreen(mouseX, mouseY, par3);
|
||||
|
||||
@@ -119,11 +119,11 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
|
||||
for(String paragraph : text.get(pageNumber * 2)){
|
||||
|
||||
this.fontRendererObj.drawSplitString(paragraph, xPos + 17,
|
||||
yPos + 14 + lineNumber * this.fontRendererObj.FONT_HEIGHT, PAGE_WIDTH, BLACK);
|
||||
this.fontRenderer.drawSplitString(paragraph, xPos + 17,
|
||||
yPos + 14 + lineNumber * this.fontRenderer.FONT_HEIGHT, PAGE_WIDTH, BLACK);
|
||||
|
||||
List<String> list = new ArrayList<String>(
|
||||
this.fontRendererObj.listFormattedStringToWidth(paragraph, GuiWizardHandbook.PAGE_WIDTH));
|
||||
this.fontRenderer.listFormattedStringToWidth(paragraph, GuiWizardHandbook.PAGE_WIDTH));
|
||||
|
||||
lineNumber += list.size();
|
||||
}
|
||||
@@ -137,16 +137,16 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
// First page is centred
|
||||
if(pageNumber == 0){
|
||||
int startX = this.width / 2 + 7 + PAGE_WIDTH / 2
|
||||
- this.fontRendererObj.getStringWidth(paragraph) / 2;
|
||||
this.fontRendererObj.drawSplitString(paragraph, startX,
|
||||
yPos + 14 + lineNumber * this.fontRendererObj.FONT_HEIGHT, PAGE_WIDTH, BLACK);
|
||||
- this.fontRenderer.getStringWidth(paragraph) / 2;
|
||||
this.fontRenderer.drawSplitString(paragraph, startX,
|
||||
yPos + 14 + lineNumber * this.fontRenderer.FONT_HEIGHT, PAGE_WIDTH, BLACK);
|
||||
}else{
|
||||
this.fontRendererObj.drawSplitString(paragraph, this.width / 2 + 7,
|
||||
yPos + 14 + lineNumber * this.fontRendererObj.FONT_HEIGHT, PAGE_WIDTH, BLACK);
|
||||
this.fontRenderer.drawSplitString(paragraph, this.width / 2 + 7,
|
||||
yPos + 14 + lineNumber * this.fontRenderer.FONT_HEIGHT, PAGE_WIDTH, BLACK);
|
||||
}
|
||||
|
||||
List<String> list = new ArrayList<String>(
|
||||
this.fontRendererObj.listFormattedStringToWidth(paragraph, GuiWizardHandbook.PAGE_WIDTH));
|
||||
this.fontRenderer.listFormattedStringToWidth(paragraph, GuiWizardHandbook.PAGE_WIDTH));
|
||||
|
||||
lineNumber += list.size();
|
||||
}
|
||||
@@ -502,17 +502,17 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
|
||||
for(int i = 0; i < craftingGrid.length; i++){
|
||||
for(int j = 0; j < craftingGrid[i].length; j++){
|
||||
if(craftingGrid[i][j] != null){
|
||||
if(!craftingGrid[i][j].isEmpty()){
|
||||
itemRender.renderItemAndEffectIntoGUI(craftingGrid[i][j], xPos + 18 * i, yPos + 18 * j);
|
||||
itemRender.renderItemOverlays(this.fontRendererObj, craftingGrid[i][j], xPos + 18 * i,
|
||||
itemRender.renderItemOverlays(this.fontRenderer, craftingGrid[i][j], xPos + 18 * i,
|
||||
yPos + 18 * j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(craftingResult != null){
|
||||
if(!craftingResult.isEmpty()){
|
||||
itemRender.renderItemAndEffectIntoGUI(craftingResult, xPos + 86, yPos + 18);
|
||||
itemRender.renderItemOverlays(this.fontRendererObj, craftingResult, xPos + 86, yPos + 18);
|
||||
itemRender.renderItemOverlays(this.fontRenderer, craftingResult, xPos + 86, yPos + 18);
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
@@ -538,14 +538,14 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
|
||||
for(int i = 0; i < craftingGrid.length; i++){
|
||||
for(int j = 0; j < craftingGrid[i].length; j++){
|
||||
if(craftingGrid[i][j] != null
|
||||
if(!craftingGrid[i][j].isEmpty()
|
||||
&& isPointInRegion(xPos + 18 * i, yPos + 18 * j, 16, 16, mouseX + guiLeft, mouseY + guiTop)){
|
||||
this.renderToolTip(craftingGrid[i][j], mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(craftingResult != null && isPointInRegion(xPos + 86, yPos + 18, 16, 16, mouseX + guiLeft, mouseY + guiTop)){
|
||||
if(!craftingResult.isEmpty() && isPointInRegion(xPos + 86, yPos + 18, 16, 16, mouseX + guiLeft, mouseY + guiTop)){
|
||||
this.renderToolTip(craftingResult, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@@ -641,7 +641,7 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
sections.add(
|
||||
new Section(paragraph.replace("SECTION ", ""), text.size() + 1, this.width / 2 + 7,
|
||||
this.height / 2 - this.ySize / 2 + 14
|
||||
+ (sections.size() + 2) * this.fontRendererObj.FONT_HEIGHT,
|
||||
+ (sections.size() + 2) * this.fontRenderer.FONT_HEIGHT,
|
||||
nextButtonId++));
|
||||
paragraph = bufferedreader.readLine();
|
||||
|
||||
@@ -682,7 +682,7 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
paragraph = paragraph.replaceAll("RESET_COLOUR", "\u00A70");
|
||||
paragraph = paragraph.replaceAll("VERSION", Wizardry.VERSION);
|
||||
|
||||
int linesInParagraph = this.fontRendererObj
|
||||
int linesInParagraph = this.fontRenderer
|
||||
.listFormattedStringToWidth(paragraph, GuiWizardHandbook.PAGE_WIDTH).size();
|
||||
|
||||
// Ignores empty lines at the top of a page.
|
||||
@@ -709,7 +709,7 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
|
||||
int i = 0;
|
||||
|
||||
List<String> strings = this.fontRendererObj.listFormattedStringToWidth(paragraph,
|
||||
List<String> strings = this.fontRenderer.listFormattedStringToWidth(paragraph,
|
||||
GuiWizardHandbook.PAGE_WIDTH);
|
||||
|
||||
for(Object s : strings){
|
||||
@@ -759,7 +759,7 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
this.y = y;
|
||||
this.buttonId = id;
|
||||
GuiWizardHandbook.this.buttonList.add(new GuiButtonInvisible(id, x, y, GuiWizardHandbook.PAGE_WIDTH,
|
||||
GuiWizardHandbook.this.fontRendererObj.FONT_HEIGHT));
|
||||
GuiWizardHandbook.this.fontRenderer.FONT_HEIGHT));
|
||||
}
|
||||
|
||||
void hideButton(){
|
||||
@@ -770,20 +770,20 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
|
||||
GuiWizardHandbook.this.buttonList.get(buttonId).visible = true;
|
||||
|
||||
GuiWizardHandbook.this.fontRendererObj.drawString(name, x, y,
|
||||
GuiWizardHandbook.this.fontRenderer.drawString(name, x, y,
|
||||
GuiWizardHandbook.this.buttonList.get(buttonId).isMouseOver() ? HIGHLIGHT_COLOUR : BLACK);
|
||||
|
||||
int nameWidth = GuiWizardHandbook.this.fontRendererObj.getStringWidth(name);
|
||||
int nameWidth = GuiWizardHandbook.this.fontRenderer.getStringWidth(name);
|
||||
|
||||
String dotsAndNumber = " " + this.pageNumber;
|
||||
|
||||
while(GuiWizardHandbook.this.fontRendererObj.getStringWidth(dotsAndNumber) < GuiWizardHandbook.PAGE_WIDTH
|
||||
while(GuiWizardHandbook.this.fontRenderer.getStringWidth(dotsAndNumber) < GuiWizardHandbook.PAGE_WIDTH
|
||||
- nameWidth - 2){
|
||||
dotsAndNumber = "." + dotsAndNumber;
|
||||
}
|
||||
|
||||
GuiWizardHandbook.this.fontRendererObj.drawString(dotsAndNumber, x + GuiWizardHandbook.PAGE_WIDTH
|
||||
- GuiWizardHandbook.this.fontRendererObj.getStringWidth(dotsAndNumber), y, BLACK);
|
||||
GuiWizardHandbook.this.fontRenderer.drawString(dotsAndNumber, x + GuiWizardHandbook.PAGE_WIDTH
|
||||
- GuiWizardHandbook.this.fontRenderer.getStringWidth(dotsAndNumber), y, BLACK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ public class MixedFontRenderer extends FontRenderer {
|
||||
l += Minecraft.getMinecraft().standardGalacticFontRenderer.drawString(section, x, y, colour, shadow);
|
||||
x += Minecraft.getMinecraft().standardGalacticFontRenderer.getStringWidth(section);
|
||||
}else{
|
||||
l += Minecraft.getMinecraft().fontRendererObj.drawString(section, x, y, colour, shadow);
|
||||
x += Minecraft.getMinecraft().fontRendererObj.getStringWidth(section);
|
||||
l += Minecraft.getMinecraft().fontRenderer.drawString(section, x, y, colour, shadow);
|
||||
x += Minecraft.getMinecraft().fontRenderer.getStringWidth(section);
|
||||
}
|
||||
|
||||
string = string.substring(string.indexOf('#') + 1);
|
||||
@@ -47,7 +47,7 @@ public class MixedFontRenderer extends FontRenderer {
|
||||
if(sga){
|
||||
l += Minecraft.getMinecraft().standardGalacticFontRenderer.drawString(string, x, y, colour, shadow);
|
||||
}else{
|
||||
l += Minecraft.getMinecraft().fontRendererObj.drawString(string, x, y, colour, shadow);
|
||||
l += Minecraft.getMinecraft().fontRenderer.drawString(string, x, y, colour, shadow);
|
||||
}
|
||||
|
||||
return l;
|
||||
@@ -67,7 +67,7 @@ public class MixedFontRenderer extends FontRenderer {
|
||||
if(sga){
|
||||
l += Minecraft.getMinecraft().standardGalacticFontRenderer.getStringWidth(section);
|
||||
}else{
|
||||
l += Minecraft.getMinecraft().fontRendererObj.getStringWidth(section);
|
||||
l += Minecraft.getMinecraft().fontRenderer.getStringWidth(section);
|
||||
}
|
||||
|
||||
string = string.substring(string.indexOf('#') + 1);
|
||||
@@ -77,7 +77,7 @@ public class MixedFontRenderer extends FontRenderer {
|
||||
if(sga){
|
||||
l += Minecraft.getMinecraft().standardGalacticFontRenderer.getStringWidth(string);
|
||||
}else{
|
||||
l += Minecraft.getMinecraft().fontRendererObj.getStringWidth(string);
|
||||
l += Minecraft.getMinecraft().fontRenderer.getStringWidth(string);
|
||||
}
|
||||
|
||||
return l;
|
||||
@@ -91,7 +91,7 @@ public class MixedFontRenderer extends FontRenderer {
|
||||
Minecraft.getMinecraft().standardGalacticFontRenderer.drawSplitString(string.substring(1), x, y, width,
|
||||
colour);
|
||||
}else{
|
||||
Minecraft.getMinecraft().fontRendererObj.drawSplitString(string, x, y, width, colour);
|
||||
Minecraft.getMinecraft().fontRenderer.drawSplitString(string, x, y, width, colour);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,13 +79,13 @@ public final class WizardryClientEventHandler {
|
||||
EntityPlayer player = Minecraft.getMinecraft().player;
|
||||
ItemStack wand = player.getHeldItemMainhand();
|
||||
|
||||
if(wand == null || !(wand.getItem() instanceof ItemWand)){
|
||||
if(wand.isEmpty() || !(wand.getItem() instanceof ItemWand)){
|
||||
wand = player.getHeldItemOffhand();
|
||||
// If the player isn't holding a wand, then nothing else needs to be done.
|
||||
if(wand == null || !(wand.getItem() instanceof ItemWand)) return;
|
||||
if(wand.isEmpty() || !(wand.getItem() instanceof ItemWand)) return;
|
||||
}
|
||||
|
||||
if(Minecraft.getMinecraft().inGameHasFocus && wand != null && event.getDwheel() != 0 && player.isSneaking()
|
||||
if(Minecraft.getMinecraft().inGameHasFocus && !wand.isEmpty() && event.getDwheel() != 0 && player.isSneaking()
|
||||
&& Wizardry.settings.enableShiftScrolling){
|
||||
|
||||
event.setCanceled(true);
|
||||
@@ -107,7 +107,7 @@ public final class WizardryClientEventHandler {
|
||||
public static void onFOVUpdateEvent(FOVUpdateEvent event){
|
||||
|
||||
// Bow zoom. Taken directly from AbstractClientPlayer so it works exactly like vanilla.
|
||||
if(event.getEntity().isHandActive() && event.getEntity().getActiveItemStack() != null
|
||||
if(event.getEntity().isHandActive() && !event.getEntity().getActiveItemStack().isEmpty()
|
||||
&& event.getEntity().getActiveItemStack().getItem() instanceof ItemSpectralBow){
|
||||
|
||||
int maxUseTicks = event.getEntity().getItemInUseMaxCount();
|
||||
@@ -223,12 +223,12 @@ public final class WizardryClientEventHandler {
|
||||
|
||||
ItemStack wand = mc.player.getHeldItemMainhand();
|
||||
|
||||
if(wand == null || !(wand.getItem() instanceof ItemWand)){
|
||||
if(wand.isEmpty() || !(wand.getItem() instanceof ItemWand)){
|
||||
wand = mc.player.getHeldItemOffhand();
|
||||
}
|
||||
|
||||
// Target selection pointer
|
||||
if(mc.player.isSneaking() && wand != null && wand.getItem() instanceof ItemWand && rayTrace != null
|
||||
if(mc.player.isSneaking() && !wand.isEmpty() && wand.getItem() instanceof ItemWand && rayTrace != null
|
||||
&& rayTrace.entityHit instanceof EntityLivingBase && rayTrace.entityHit == event.getEntity()
|
||||
&& properties != null && properties.selectedMinion != null){
|
||||
|
||||
@@ -430,7 +430,7 @@ public final class WizardryClientEventHandler {
|
||||
private static void renderShadowWardFirstPerson(EntityPlayer entityplayer){
|
||||
ItemStack wand = entityplayer.getActiveItemStack();
|
||||
if(WizardData.get(entityplayer) != null && WizardData.get(entityplayer).currentlyCasting() instanceof ShadowWard
|
||||
|| (entityplayer.isHandActive() && wand != null && wand.getItemDamage() < wand.getMaxDamage()
|
||||
|| (entityplayer.isHandActive() && !wand.isEmpty() && wand.getItemDamage() < wand.getMaxDamage()
|
||||
&& wand.getItem() instanceof ItemWand
|
||||
&& WandHelper.getCurrentSpell(wand) instanceof ShadowWard)){
|
||||
|
||||
@@ -490,7 +490,7 @@ public final class WizardryClientEventHandler {
|
||||
private static void renderShadowWardIfActive(EntityPlayer entityplayer){
|
||||
ItemStack wand = entityplayer.getActiveItemStack();
|
||||
if(WizardData.get(entityplayer).currentlyCasting() instanceof ShadowWard || (entityplayer.isHandActive()
|
||||
&& wand != null && wand.getItemDamage() < wand.getMaxDamage() && wand.getItem() instanceof ItemWand
|
||||
&& !wand.isEmpty() && wand.getItemDamage() < wand.getMaxDamage() && wand.getItem() instanceof ItemWand
|
||||
&& WandHelper.getCurrentSpell(wand) instanceof ShadowWard)){
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
@@ -541,7 +541,7 @@ public final class WizardryClientEventHandler {
|
||||
private static void renderWingsIfActive(EntityPlayer entityplayer, float partialTickTime){
|
||||
ItemStack wand = entityplayer.getActiveItemStack();
|
||||
if(WizardData.get(entityplayer).currentlyCasting() instanceof Flight
|
||||
|| (entityplayer.isHandActive() && wand != null && wand.getItemDamage() < wand.getMaxDamage()
|
||||
|| (entityplayer.isHandActive() && !wand.isEmpty() && wand.getItemDamage() < wand.getMaxDamage()
|
||||
&& wand.getItem() instanceof ItemWand && WandHelper.getCurrentSpell(wand) instanceof Flight)){
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
@@ -620,7 +620,7 @@ public final class WizardryClientEventHandler {
|
||||
ItemStack wand = entityplayer.getActiveItemStack();
|
||||
if(WizardData.get(entityplayer) != null && WizardData.get(entityplayer).shield != null
|
||||
&& (WizardData.get(entityplayer).currentlyCasting() instanceof Shield || (entityplayer.isHandActive()
|
||||
&& wand != null && wand.getItemDamage() < wand.getMaxDamage()
|
||||
&& !wand.isEmpty() && wand.getItemDamage() < wand.getMaxDamage()
|
||||
&& wand.getItem() instanceof ItemWand && WandHelper.getCurrentSpell(wand) instanceof Shield))){
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
@@ -660,7 +660,7 @@ public final class WizardryClientEventHandler {
|
||||
ItemStack wand = entityplayer.getActiveItemStack();
|
||||
if(WizardData.get(entityplayer).shield != null
|
||||
&& (WizardData.get(entityplayer).currentlyCasting() instanceof Shield || (entityplayer.isHandActive()
|
||||
&& wand != null && wand.getItemDamage() < wand.getMaxDamage()
|
||||
&& !wand.isEmpty() && wand.getItemDamage() < wand.getMaxDamage()
|
||||
&& wand.getItem() instanceof ItemWand && WandHelper.getCurrentSpell(wand) instanceof Shield))){
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
@@ -40,14 +40,14 @@ public interface Imbuement {
|
||||
public static void onLivingDropsEvent(LivingDropsEvent event){
|
||||
// Instantly disenchants an imbued weapon if it is dropped when the player dies.
|
||||
for(EntityItem item : event.getDrops()){
|
||||
removeImbuements(item.getEntityItem());
|
||||
removeImbuements(item.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onItemTossEvent(ItemTossEvent event){
|
||||
// Instantly disenchants an imbued weapon if it is thrown on the ground.
|
||||
removeImbuements(event.getEntityItem().getEntityItem());
|
||||
removeImbuements(event.getEntityItem().getItem());
|
||||
}
|
||||
|
||||
/** Removes all imbuements from the given itemstack. */
|
||||
@@ -70,7 +70,7 @@ public interface Imbuement {
|
||||
// Still not sure if it's better to set stacks in slots or modify the itemstack list directly, but I would
|
||||
// imagine it's the former.
|
||||
for(Slot slot : event.getContainer().inventorySlots){
|
||||
if(slot.getStack() != null && slot.getStack().getItem() instanceof ItemEnchantedBook){
|
||||
if(!slot.getStack().isEmpty() && slot.getStack().getItem() instanceof ItemEnchantedBook){
|
||||
// We don't care about the level of the enchantments
|
||||
Map<Enchantment, Integer> enchantments = EnchantmentHelper.getEnchantments(slot.getStack());
|
||||
// Removes all imbuements
|
||||
@@ -104,9 +104,9 @@ public interface Imbuement {
|
||||
|
||||
ItemStack bow = archer.getHeldItemMainhand();
|
||||
|
||||
if(bow == null || !(bow.getItem() instanceof ItemBow)){
|
||||
if(bow.isEmpty() || !(bow.getItem() instanceof ItemBow)){
|
||||
bow = archer.getHeldItemOffhand();
|
||||
if(bow == null || !(bow.getItem() instanceof ItemBow)) return;
|
||||
if(bow.isEmpty() || !(bow.getItem() instanceof ItemBow)) return;
|
||||
}
|
||||
|
||||
// Taken directly from ItemBow, so it works exactly the same as the power enchantment.
|
||||
|
||||
@@ -30,8 +30,8 @@ public class EntityShield extends Entity {
|
||||
this.height = 1.4f;
|
||||
this.player = new WeakReference<EntityPlayer>(player);
|
||||
this.noClip = true;
|
||||
this.setPositionAndRotation(player.posX + player.getLookVec().xCoord,
|
||||
player.posY + 1 + player.getLookVec().yCoord, player.posZ + player.getLookVec().zCoord,
|
||||
this.setPositionAndRotation(player.posX + player.getLookVec().x,
|
||||
player.posY + 1 + player.getLookVec().y, player.posZ + player.getLookVec().z,
|
||||
player.rotationYawHead, player.rotationPitch);
|
||||
this.setEntityBoundingBox(new AxisAlignedBB(this.posX - 0.6f, this.posY - 0.7f, this.posZ - 0.6f,
|
||||
this.posX + 0.6f, this.posY + 0.7f, this.posZ + 0.6f));
|
||||
@@ -42,11 +42,11 @@ public class EntityShield extends Entity {
|
||||
// System.out.println("Shield exists, ID: " + this.getUniqueID().toString());
|
||||
EntityPlayer entityplayer = player != null ? player.get() : null;
|
||||
if(entityplayer != null){
|
||||
this.setPositionAndRotation(entityplayer.posX + entityplayer.getLookVec().xCoord * 0.3,
|
||||
entityplayer.posY + 1 + entityplayer.getLookVec().yCoord * 0.3,
|
||||
entityplayer.posZ + entityplayer.getLookVec().zCoord * 0.3, entityplayer.rotationYawHead,
|
||||
this.setPositionAndRotation(entityplayer.posX + entityplayer.getLookVec().x * 0.3,
|
||||
entityplayer.posY + 1 + entityplayer.getLookVec().y * 0.3,
|
||||
entityplayer.posZ + entityplayer.getLookVec().z * 0.3, entityplayer.rotationYawHead,
|
||||
entityplayer.rotationPitch);
|
||||
if(!entityplayer.isHandActive() || entityplayer.getHeldItem(entityplayer.getActiveHand()) == null
|
||||
if(!entityplayer.isHandActive() || entityplayer.getHeldItem(entityplayer.getActiveHand()).isEmpty()
|
||||
|| !(entityplayer.getHeldItem(entityplayer.getActiveHand()).getItem() instanceof ItemWand)){
|
||||
WizardData.get(entityplayer).shield = null;
|
||||
this.setDead();
|
||||
@@ -64,8 +64,8 @@ public class EntityShield extends Entity {
|
||||
}
|
||||
|
||||
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2){
|
||||
if(par1DamageSource != null && par1DamageSource.getSourceOfDamage() instanceof IProjectile){
|
||||
par1DamageSource.getSourceOfDamage().playSound(WizardrySounds.SPELL_DEFLECTION, 0.3f, 1.3f);
|
||||
if(par1DamageSource != null && par1DamageSource.getImmediateSource() instanceof IProjectile){
|
||||
par1DamageSource.getImmediateSource().playSound(WizardrySounds.SPELL_DEFLECTION, 0.3f, 1.3f);
|
||||
}
|
||||
super.attackEntityFrom(par1DamageSource, par2);
|
||||
return false;
|
||||
|
||||
@@ -77,9 +77,9 @@ public class EntityForcefield extends EntityMagicConstruct {
|
||||
|
||||
public boolean attackEntityFrom(DamageSource source, float par2){
|
||||
|
||||
if(source != null && source.getSourceOfDamage() != null){
|
||||
if(source != null && source.getImmediateSource() != null){
|
||||
// Now works for any source of damage.
|
||||
source.getSourceOfDamage().playSound(WizardrySounds.SPELL_DEFLECTION, 0.3f, 1.3f);
|
||||
source.getImmediateSource().playSound(WizardrySounds.SPELL_DEFLECTION, 0.3f, 1.3f);
|
||||
}
|
||||
super.attackEntityFrom(source, par2);
|
||||
return false;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class EntityAIAttackSpell extends EntityAIBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean continueExecuting(){
|
||||
public boolean shouldContinueExecuting(){
|
||||
return this.shouldExecute() || !this.attacker.getNavigator().noPath();
|
||||
}
|
||||
|
||||
|
||||
@@ -322,8 +322,8 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
||||
public void onDeath(DamageSource source){
|
||||
|
||||
super.onDeath(source);
|
||||
if(source.getEntity() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getEntity()).addStat(WizardryAchievements.defeat_evil_wizard);
|
||||
if(source.getTrueSource() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getTrueSource()).addStat(WizardryAchievements.defeat_evil_wizard);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -168,8 +168,8 @@ public class EntityIceGiant extends EntityIronGolem implements ISummonedCreature
|
||||
public void onSuccessfulAttack(EntityLivingBase target){
|
||||
|
||||
target.motionY += 0.2;
|
||||
target.motionX += this.getLookVec().xCoord * 0.2;
|
||||
target.motionZ += this.getLookVec().xCoord * 0.2;
|
||||
target.motionX += this.getLookVec().x * 0.2;
|
||||
target.motionZ += this.getLookVec().x * 0.2;
|
||||
|
||||
target.addPotionEffect(new PotionEffect(WizardryPotions.frost, 300, 0));
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
this.motionZ = 0.0D;
|
||||
}
|
||||
|
||||
this.world.theProfiler.startSection("ai");
|
||||
this.world.profiler.startSection("ai");
|
||||
|
||||
if(this.isMovementBlocked()){
|
||||
this.isJumping = false;
|
||||
@@ -133,13 +133,13 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
this.moveForward = 0.0F;
|
||||
this.randomYawVelocity = 0.0F;
|
||||
}else if(this.isServerWorld()){
|
||||
this.world.theProfiler.startSection("newAi");
|
||||
this.world.profiler.startSection("newAi");
|
||||
this.updateEntityActionState();
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.profiler.endSection();
|
||||
}
|
||||
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.theProfiler.startSection("jump");
|
||||
this.world.profiler.endSection();
|
||||
this.world.profiler.startSection("jump");
|
||||
|
||||
if(this.isJumping){
|
||||
if(this.isInWater()){
|
||||
@@ -154,16 +154,16 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
this.jumpTicks = 0;
|
||||
}
|
||||
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.theProfiler.startSection("travel");
|
||||
this.world.profiler.endSection();
|
||||
this.world.profiler.startSection("travel");
|
||||
this.moveStrafing *= 0.98F;
|
||||
this.moveForward *= 0.98F;
|
||||
this.randomYawVelocity *= 0.9F;
|
||||
this.moveEntityWithHeading(this.moveStrafing, this.moveForward);
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.theProfiler.startSection("push");
|
||||
this.world.profiler.endSection();
|
||||
this.world.profiler.startSection("push");
|
||||
this.collideWithNearbyEntities();
|
||||
this.world.theProfiler.endSection();
|
||||
this.world.profiler.endSection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -123,7 +123,7 @@ public class EntitySkeletonMinion extends EntitySkeleton implements ISummonedCre
|
||||
}
|
||||
|
||||
// Halloween pumpkin heads! Why not?
|
||||
if(this.getItemStackFromSlot(EntityEquipmentSlot.HEAD) == null){
|
||||
if(this.getItemStackFromSlot(EntityEquipmentSlot.HEAD).isEmpty()){
|
||||
Calendar calendar = this.world.getCurrentDate();
|
||||
|
||||
if(calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F){
|
||||
|
||||
@@ -125,7 +125,7 @@ public class EntityWitherSkeletonMinion extends EntityWitherSkeleton implements
|
||||
}
|
||||
|
||||
// Halloween pumpkin heads! Why not?
|
||||
if(this.getItemStackFromSlot(EntityEquipmentSlot.HEAD) == null){
|
||||
if(this.getItemStackFromSlot(EntityEquipmentSlot.HEAD).isEmpty()){
|
||||
Calendar calendar = this.world.getCurrentDate();
|
||||
|
||||
if(calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F){
|
||||
|
||||
@@ -774,8 +774,8 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float damage){
|
||||
|
||||
if(source.getEntity() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getEntity()).addStat(WizardryAchievements.anger_wizard);
|
||||
if(source.getTrueSource() instanceof EntityPlayer){
|
||||
((EntityPlayer)source.getTrueSource()).addStat(WizardryAchievements.anger_wizard);
|
||||
}
|
||||
|
||||
return super.attackEntityFrom(source, damage);
|
||||
|
||||
@@ -330,9 +330,9 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData {
|
||||
|
||||
// Rather than bother overriding entire attack methods in ISummonedCreature implementations, it's easier (and
|
||||
// more robust) to use LivingAttackEvent to modify the damage source.
|
||||
if(event.getSource().getEntity() instanceof ISummonedCreature){
|
||||
if(event.getSource().getTrueSource() instanceof ISummonedCreature){
|
||||
|
||||
EntityLivingBase summoner = ((ISummonedCreature)event.getSource().getEntity()).getCaster();
|
||||
EntityLivingBase summoner = ((ISummonedCreature)event.getSource().getTrueSource()).getCaster();
|
||||
|
||||
if(summoner != null){
|
||||
|
||||
@@ -349,11 +349,11 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData {
|
||||
// All summoned creatures are classified as magic, so it makes sense to do it this way.
|
||||
if(event.getSource() instanceof EntityDamageSourceIndirect){
|
||||
newSource = new IndirectMinionDamage(event.getSource().damageType,
|
||||
event.getSource().getSourceOfDamage(), event.getSource().getEntity(), summoner, type,
|
||||
event.getSource().getImmediateSource(), event.getSource().getTrueSource(), summoner, type,
|
||||
isRetaliatory);
|
||||
}else if(event.getSource() instanceof EntityDamageSource){
|
||||
// Name is copied over so it uses the appropriate vanilla death message
|
||||
newSource = new MinionDamage(event.getSource().damageType, event.getSource().getEntity(), summoner,
|
||||
newSource = new MinionDamage(event.getSource().damageType, event.getSource().getTrueSource(), summoner,
|
||||
type, isRetaliatory);
|
||||
}
|
||||
|
||||
@@ -365,8 +365,8 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData {
|
||||
// For some reason Minecraft calculates knockback relative to DamageSource#getEntity. In vanilla this
|
||||
// is unnoticeable, but it looks a bit weird with summoned creatures involved - so this fixes that.
|
||||
if(WizardryUtilities.attackEntityWithoutKnockback(event.getEntity(), newSource, event.getAmount())){
|
||||
WizardryUtilities.applyStandardKnockback(event.getSource().getEntity(), event.getEntityLiving());
|
||||
((ISummonedCreature)event.getSource().getEntity()).onSuccessfulAttack(event.getEntityLiving());
|
||||
WizardryUtilities.applyStandardKnockback(event.getSource().getTrueSource(), event.getEntityLiving());
|
||||
((ISummonedCreature)event.getSource().getTrueSource()).onSuccessfulAttack(event.getEntityLiving());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -277,7 +277,7 @@ public abstract class EntityMagicArrow extends Entity implements IProjectile, IE
|
||||
AxisAlignedBB axisalignedbb = iblockstate.getCollisionBoundingBox(this.world, blockpos);
|
||||
|
||||
if(axisalignedbb != Block.NULL_AABB
|
||||
&& axisalignedbb.offset(blockpos).isVecInside(new Vec3d(this.posX, this.posY, this.posZ))){
|
||||
&& axisalignedbb.offset(blockpos).contains(new Vec3d(this.posX, this.posY, this.posZ))){
|
||||
this.inGround = true;
|
||||
}
|
||||
}
|
||||
@@ -305,13 +305,13 @@ public abstract class EntityMagicArrow extends Entity implements IProjectile, IE
|
||||
vec3d = new Vec3d(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
||||
|
||||
if(raytraceresult != null){
|
||||
vec3d = new Vec3d(raytraceresult.hitVec.xCoord, raytraceresult.hitVec.yCoord,
|
||||
raytraceresult.hitVec.zCoord);
|
||||
vec3d = new Vec3d(raytraceresult.hitVec.x, raytraceresult.hitVec.y,
|
||||
raytraceresult.hitVec.z);
|
||||
}
|
||||
|
||||
Entity entity = null;
|
||||
List<?> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()
|
||||
.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
|
||||
.expand(this.motionX, this.motionY, this.motionZ).grow(1.0D, 1.0D, 1.0D));
|
||||
double d0 = 0.0D;
|
||||
int i;
|
||||
float f1;
|
||||
@@ -321,7 +321,7 @@ public abstract class EntityMagicArrow extends Entity implements IProjectile, IE
|
||||
|
||||
if(entity1.canBeCollidedWith() && (entity1 != this.getShootingEntity() || this.ticksInAir >= 5)){
|
||||
f1 = 0.3F;
|
||||
AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().expand((double)f1, (double)f1,
|
||||
AxisAlignedBB axisalignedbb1 = entity1.getEntityBoundingBox().grow((double)f1, (double)f1,
|
||||
(double)f1);
|
||||
RayTraceResult RayTraceResult1 = axisalignedbb1.calculateIntercept(vec3d1, vec3d);
|
||||
|
||||
@@ -418,9 +418,9 @@ public abstract class EntityMagicArrow extends Entity implements IProjectile, IE
|
||||
this.blockY = raytraceresult.getBlockPos().getY();
|
||||
this.blockZ = raytraceresult.getBlockPos().getZ();
|
||||
this.stuckInBlock = this.world.getBlockState(raytraceresult.getBlockPos());
|
||||
this.motionX = (double)((float)(raytraceresult.hitVec.xCoord - this.posX));
|
||||
this.motionY = (double)((float)(raytraceresult.hitVec.yCoord - this.posY));
|
||||
this.motionZ = (double)((float)(raytraceresult.hitVec.zCoord - this.posZ));
|
||||
this.motionX = (double)((float)(raytraceresult.hitVec.x - this.posX));
|
||||
this.motionY = (double)((float)(raytraceresult.hitVec.y - this.posY));
|
||||
this.motionZ = (double)((float)(raytraceresult.hitVec.z - this.posZ));
|
||||
// f2 = MathHelper.sqrt(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ *
|
||||
// this.motionZ);
|
||||
// this.posX -= this.motionX / (double)f2 * 0.05000000074505806D;
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface IConjuredItem {
|
||||
public static void onLivingDropsEvent(LivingDropsEvent event){
|
||||
// Destroys conjured items if their caster dies.
|
||||
for(EntityItem item : event.getDrops()){
|
||||
if(item.getEntityItem().getItem() instanceof IConjuredItem){
|
||||
if(item.getItem().getItem() instanceof IConjuredItem){
|
||||
item.setDead();
|
||||
}
|
||||
}
|
||||
@@ -55,9 +55,9 @@ public interface IConjuredItem {
|
||||
@SubscribeEvent
|
||||
public static void onItemTossEvent(ItemTossEvent event){
|
||||
// Prevents conjured items being thrown by dragging and dropping outside the inventory.
|
||||
if(event.getEntityItem().getEntityItem().getItem() instanceof IConjuredItem){
|
||||
if(event.getEntityItem().getItem().getItem() instanceof IConjuredItem){
|
||||
event.setCanceled(true);
|
||||
event.getPlayer().inventory.addItemStackToInventory(event.getEntityItem().getEntityItem());
|
||||
event.getPlayer().inventory.addItemStackToInventory(event.getEntityItem().getItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ItemFlamingAxe extends ItemAxe implements IConjuredItem {
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected){
|
||||
int damage = stack.getItemDamage();
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, null);
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, ItemStack.EMPTY);
|
||||
stack.setItemDamage(damage + 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ItemFrostAxe extends ItemAxe implements IConjuredItem {
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected){
|
||||
int damage = stack.getItemDamage();
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, null);
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, ItemStack.EMPTY);
|
||||
stack.setItemDamage(damage + 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ItemIdentificationScroll extends Item {
|
||||
|
||||
for(ItemStack stack1 : WizardryUtilities.getPrioritisedHotbarAndOffhand(player)){
|
||||
|
||||
if(stack1 != null){
|
||||
if(!stack1.isEmpty()){
|
||||
Spell spell = Spell.get(stack1.getItemDamage());
|
||||
if((stack1.getItem() instanceof ItemSpellBook || stack1.getItem() instanceof ItemScroll)
|
||||
&& !properties.hasSpellBeenDiscovered(spell)){
|
||||
|
||||
@@ -97,7 +97,7 @@ public class ItemSpectralBow extends ItemBow implements IConjuredItem {
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected){
|
||||
int damage = stack.getItemDamage();
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, null);
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, ItemStack.EMPTY);
|
||||
// Can't damage it whilst in use because for some reason it causes the item use to constantly reset.
|
||||
if(!(entity instanceof EntityLivingBase) || !((EntityLivingBase)entity).isHandActive()){
|
||||
stack.setItemDamage(damage + 1);
|
||||
@@ -159,7 +159,7 @@ public class ItemSpectralBow extends ItemBow implements IConjuredItem {
|
||||
// player.getItemInUseMaxCount() is named incorrectly; you only have to look at the method to see what it really
|
||||
// does.
|
||||
if(stack.getItemDamage() + player.getItemInUseMaxCount() > stack.getMaxDamage())
|
||||
player.replaceItemInInventory(player.getActiveHand() == EnumHand.MAIN_HAND ? 98 : 99, null);
|
||||
player.replaceItemInInventory(player.getActiveHand() == EnumHand.MAIN_HAND ? 98 : 99, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ItemSpectralPickaxe extends ItemPickaxe implements IConjuredItem {
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected){
|
||||
int damage = stack.getItemDamage();
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, null);
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, ItemStack.EMPTY);
|
||||
stack.setItemDamage(damage + 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ItemSpectralSword extends ItemSword implements IConjuredItem {
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean selected){
|
||||
int damage = stack.getItemDamage();
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, null);
|
||||
if(damage > stack.getMaxDamage()) entity.replaceItemInInventory(slot, ItemStack.EMPTY);
|
||||
stack.setItemDamage(damage + 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ public class ItemWizardArmour extends ItemArmor implements ISpecialArmor {
|
||||
ItemStack itemstackR = leftHanded ? entityLiving.getHeldItemOffhand() : entityLiving.getHeldItemMainhand();
|
||||
ItemStack itemstackL = leftHanded ? entityLiving.getHeldItemMainhand() : entityLiving.getHeldItemOffhand();
|
||||
|
||||
if(itemstackR != null){
|
||||
if(!itemstackR.isEmpty()){
|
||||
model.rightArmPose = net.minecraft.client.model.ModelBiped.ArmPose.ITEM;
|
||||
|
||||
if(entityLiving.getItemInUseCount() > 0){
|
||||
@@ -109,7 +109,7 @@ public class ItemWizardArmour extends ItemArmor implements ISpecialArmor {
|
||||
}
|
||||
}
|
||||
|
||||
if(itemstackL != null){
|
||||
if(!itemstackL.isEmpty()){
|
||||
model.leftArmPose = net.minecraft.client.model.ModelBiped.ArmPose.ITEM;
|
||||
|
||||
if(entityLiving.getItemInUseCount() > 0){
|
||||
@@ -232,7 +232,7 @@ public class ItemWizardArmour extends ItemArmor implements ISpecialArmor {
|
||||
EntityPlayer player = (EntityPlayer)event.getEntityLiving();
|
||||
|
||||
for(ItemStack stack : player.getArmorInventoryList()){
|
||||
if(stack == null || !(stack.getItem() instanceof ItemWizardArmour)){
|
||||
if(stack.isEmpty() || !(stack.getItem() instanceof ItemWizardArmour)){
|
||||
return; // If any of the armour slots doesn't contain wizard armour, don't trigger the achievement.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,9 +74,9 @@ public class PacketClairvoyance implements IMessageHandler<Message, IMessage> {
|
||||
|
||||
PathPoint point = path.getPathPointFromIndex(i);
|
||||
|
||||
buf.writeInt(point.xCoord);
|
||||
buf.writeInt(point.yCoord);
|
||||
buf.writeInt(point.zCoord);
|
||||
buf.writeInt(point.x);
|
||||
buf.writeInt(point.y);
|
||||
buf.writeInt(point.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class PacketControlInput implements IMessageHandler<Message, IMessage> {
|
||||
// Just to make sure that the side is correct
|
||||
if(ctx.side.isServer()){
|
||||
|
||||
final EntityPlayerMP player = ctx.getServerHandler().playerEntity;
|
||||
final EntityPlayerMP player = ctx.getServerHandler().player;
|
||||
|
||||
player.getServerWorld().addScheduledTask(new Runnable(){
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PacketControlInput implements IMessageHandler<Message, IMessage> {
|
||||
|
||||
ItemStack wand = player.getHeldItemMainhand();
|
||||
|
||||
if(wand == null || !(wand.getItem() instanceof ItemWand)){
|
||||
if(wand.isEmpty() || !(wand.getItem() instanceof ItemWand)){
|
||||
wand = player.getHeldItemOffhand();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class PacketControlInput implements IMessageHandler<Message, IMessage> {
|
||||
|
||||
case NEXT_SPELL_KEY:
|
||||
|
||||
if(wand != null && wand.getItem() instanceof ItemWand){
|
||||
if(!wand.isEmpty() && wand.getItem() instanceof ItemWand){
|
||||
|
||||
WandHelper.selectNextSpell(wand);
|
||||
// This line fixes the bug with continuous spells casting when they shouldn't be
|
||||
@@ -52,7 +52,7 @@ public class PacketControlInput implements IMessageHandler<Message, IMessage> {
|
||||
|
||||
case PREVIOUS_SPELL_KEY:
|
||||
|
||||
if(wand != null && wand.getItem() instanceof ItemWand){
|
||||
if(!wand.isEmpty() && wand.getItem() instanceof ItemWand){
|
||||
|
||||
WandHelper.selectPreviousSpell(wand);
|
||||
// This line fixes the bug with continuous spells casting when they shouldn't be
|
||||
|
||||
@@ -295,9 +295,10 @@ public final class WizardryRegistry {
|
||||
GameRegistry.addShapelessRecipe(firebombStack, bottleStack, gunpowderStack, blazePowderStack, blazePowderStack);
|
||||
if(Wizardry.settings.poisonBombIsCraftable)
|
||||
GameRegistry.addShapelessRecipe(poisonBombStack, bottleStack, gunpowderStack, spiderEyeStack, spiderEyeStack);
|
||||
|
||||
if(Wizardry.settings.smokeBombIsCraftable)
|
||||
GameRegistry.addShapelessRecipe(smokeBombStack, bottleStack, gunpowderStack, coalStack, coalStack);
|
||||
|
||||
|
||||
if(Wizardry.settings.useAlternateScrollRecipe){
|
||||
GameRegistry.addShapelessRecipe(scrollStack, paperStack, stringStack, magicCrystalStack);
|
||||
}else{
|
||||
|
||||
@@ -53,10 +53,10 @@ public class ArcaneJammer extends Spell {
|
||||
}
|
||||
if(world.isRemote){
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
|
||||
12 + world.rand.nextInt(8), 0.9f, 0.3f, 0.7f);
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ public class ArrowRain extends Spell {
|
||||
|
||||
if(rayTrace != null && rayTrace.typeOfHit == RayTraceResult.Type.BLOCK){
|
||||
if(!world.isRemote){
|
||||
double x = rayTrace.hitVec.xCoord;
|
||||
double y = rayTrace.hitVec.yCoord;
|
||||
double z = rayTrace.hitVec.zCoord;
|
||||
double x = rayTrace.hitVec.x;
|
||||
double y = rayTrace.hitVec.y;
|
||||
double z = rayTrace.hitVec.z;
|
||||
// Moves the entity back towards the caster a bit, so the area of effect is better centred on the
|
||||
// position.
|
||||
// 3.0d is the distance to move the entity back towards the caster.
|
||||
|
||||
@@ -81,10 +81,10 @@ public class Banish extends Spell {
|
||||
|
||||
if(world.isRemote){
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
|
||||
world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
|
||||
|
||||
@@ -52,9 +52,9 @@ public class BlackHole extends Spell {
|
||||
}
|
||||
|
||||
}else{
|
||||
int x = (int)(Math.floor(caster.posX) + caster.getLookVec().xCoord * 8);
|
||||
int y = (int)(Math.floor(caster.posY) + caster.eyeHeight + caster.getLookVec().yCoord * 8);
|
||||
int z = (int)(Math.floor(caster.posZ) + caster.getLookVec().zCoord * 8);
|
||||
int x = (int)(Math.floor(caster.posX) + caster.getLookVec().x * 8);
|
||||
int y = (int)(Math.floor(caster.posY) + caster.eyeHeight + caster.getLookVec().y * 8);
|
||||
int z = (int)(Math.floor(caster.posZ) + caster.getLookVec().z * 8);
|
||||
if(!world.isRemote){
|
||||
world.spawnEntity(new EntityBlackHole(world, x, y, z, caster,
|
||||
(int)(600 * modifiers.get(WizardryItems.duration_upgrade)),
|
||||
|
||||
@@ -35,9 +35,9 @@ public class Blizzard extends Spell {
|
||||
|
||||
if(rayTrace != null && rayTrace.typeOfHit == RayTraceResult.Type.BLOCK){
|
||||
if(!world.isRemote){
|
||||
double x = rayTrace.hitVec.xCoord;
|
||||
double y = rayTrace.hitVec.yCoord;
|
||||
double z = rayTrace.hitVec.zCoord;
|
||||
double x = rayTrace.hitVec.x;
|
||||
double y = rayTrace.hitVec.y;
|
||||
double z = rayTrace.hitVec.z;
|
||||
EntityBlizzard blizzard = new EntityBlizzard(world, x, y + 0.5, z, caster,
|
||||
(int)(600 * modifiers.get(WizardryItems.duration_upgrade)),
|
||||
modifiers.get(SpellModifiers.DAMAGE));
|
||||
|
||||
@@ -54,10 +54,10 @@ public class Bubble extends Spell {
|
||||
}
|
||||
if(world.isRemote){
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
|
||||
world.spawnParticle(EnumParticleTypes.WATER_SPLASH, x1, y1, z1, 0.0d, 0.0d, 0.0d);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_BUBBLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0);
|
||||
|
||||
@@ -81,10 +81,10 @@ public class Clairvoyance extends Spell {
|
||||
256 * modifiers.get(WizardryItems.range_upgrade));
|
||||
|
||||
if(path != null && path.getFinalPathPoint() != null){
|
||||
|
||||
int x = path.getFinalPathPoint().xCoord;
|
||||
int y = path.getFinalPathPoint().xCoord;
|
||||
int z = path.getFinalPathPoint().xCoord;
|
||||
// TODO Corail : is it normal to have x in each ???
|
||||
int x = path.getFinalPathPoint().x;
|
||||
int y = path.getFinalPathPoint().y;
|
||||
int z = path.getFinalPathPoint().z;
|
||||
|
||||
if(x == destination.getX() && y == destination.getY() && z == destination.getZ()){
|
||||
|
||||
@@ -129,10 +129,10 @@ public class Clairvoyance extends Spell {
|
||||
nextPoint = path.getCurrentPathLength() - path.getCurrentPathIndex() <= 2 ? path.getFinalPathPoint()
|
||||
: path.getPathPointFromIndex(path.getCurrentPathIndex() + 2);
|
||||
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.PATH, world, point.xCoord + 0.5, point.yCoord + 0.5,
|
||||
point.zCoord + 0.5, (nextPoint.xCoord - point.xCoord) / (float)PARTICLE_MOVEMENT_INTERVAL,
|
||||
(nextPoint.yCoord - point.yCoord) / (float)PARTICLE_MOVEMENT_INTERVAL,
|
||||
(nextPoint.zCoord - point.zCoord) / (float)PARTICLE_MOVEMENT_INTERVAL,
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.PATH, world, point.x + 0.5, point.y + 0.5,
|
||||
point.z + 0.5, (nextPoint.x - point.x) / (float)PARTICLE_MOVEMENT_INTERVAL,
|
||||
(nextPoint.y - point.y) / (float)PARTICLE_MOVEMENT_INTERVAL,
|
||||
(nextPoint.z - point.z) / (float)PARTICLE_MOVEMENT_INTERVAL,
|
||||
(int)(1800 * durationMultiplier), 0, 1, 0.3f);
|
||||
|
||||
path.incrementPathIndex();
|
||||
@@ -141,8 +141,8 @@ public class Clairvoyance extends Spell {
|
||||
|
||||
point = path.getFinalPathPoint();
|
||||
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.PATH, world, point.xCoord + 0.5, point.yCoord + 0.5,
|
||||
point.zCoord + 0.5, 0, 0, 0, (int)(1800 * durationMultiplier), 1, 1, 1);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.PATH, world, point.x + 0.5, point.y + 0.5,
|
||||
point.z + 0.5, 0, 0, 0, (int)(1800 * durationMultiplier), 1, 1, 1);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -153,7 +153,7 @@ public class Clairvoyance extends Spell {
|
||||
// The event now has an ItemStack, which greatly simplifies hand-related stuff.
|
||||
ItemStack wand = event.getItemStack();
|
||||
|
||||
if(wand != null && wand.getItem() instanceof ItemWand
|
||||
if(!wand.isEmpty() && wand.getItem() instanceof ItemWand
|
||||
&& WandHelper.getCurrentSpell(wand) instanceof Clairvoyance){
|
||||
|
||||
WizardData properties = WizardData.get(event.getEntityPlayer());
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ConjureBow extends Spell {
|
||||
// TODO: When spells get superclassed, this method needs to be in the conjuration superclass.
|
||||
/** Adds the given item to the given player's inventory, placing it in the main hand if the main hand is empty. */
|
||||
public static boolean conjureItemInInventory(EntityPlayer caster, ItemStack item){
|
||||
if(caster.getHeldItemMainhand() == null){
|
||||
if(caster.getHeldItemMainhand().isEmpty()){
|
||||
caster.setHeldItem(EnumHand.MAIN_HAND, item);
|
||||
return true;
|
||||
}else{
|
||||
|
||||
@@ -47,10 +47,10 @@ public class CurseOfSoulbinding extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
// I figured it out! when on client side, entityplayer.posY is at the eyes, not the feet!
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
|
||||
0.4f, 0.0f, 0.0f);
|
||||
|
||||
@@ -29,7 +29,7 @@ public class Decoy extends Spell {
|
||||
if(!world.isRemote){
|
||||
EntityDecoy decoy = new EntityDecoy(world, caster.posX, caster.posY, caster.posZ, caster, 600);
|
||||
decoy.setLocationAndAngles(caster.posX, caster.posY, caster.posZ, caster.rotationYaw, caster.rotationPitch);
|
||||
decoy.addVelocity(-caster.getLookVec().zCoord * splitSpeed, 0, caster.getLookVec().xCoord * splitSpeed);
|
||||
decoy.addVelocity(-caster.getLookVec().z * splitSpeed, 0, caster.getLookVec().x * splitSpeed);
|
||||
// Ignores the show names setting, since this would allow a player to easily detect a decoy
|
||||
decoy.setCustomNameTag(caster.getName());
|
||||
world.spawnEntity(decoy);
|
||||
@@ -44,7 +44,7 @@ public class Decoy extends Spell {
|
||||
}
|
||||
}
|
||||
|
||||
caster.addVelocity(caster.getLookVec().zCoord * splitSpeed, 0, -caster.getLookVec().xCoord * splitSpeed);
|
||||
caster.addVelocity(caster.getLookVec().z * splitSpeed, 0, -caster.getLookVec().x * splitSpeed);
|
||||
|
||||
WizardryUtilities.playSoundAtPlayer(caster, WizardrySounds.SPELL_CONJURATION, 1.0F,
|
||||
0.4F / (world.rand.nextFloat() * 0.4F + 0.8F));
|
||||
@@ -61,7 +61,7 @@ public class Decoy extends Spell {
|
||||
if(!world.isRemote){
|
||||
EntityDecoy decoy = new EntityDecoy(world, caster.posX, caster.posY, caster.posZ, caster, 600);
|
||||
decoy.setLocationAndAngles(caster.posX, caster.posY, caster.posZ, caster.rotationYaw, caster.rotationPitch);
|
||||
decoy.addVelocity(-caster.getLookVec().zCoord * splitSpeed, 0, caster.getLookVec().xCoord * splitSpeed);
|
||||
decoy.addVelocity(-caster.getLookVec().z * splitSpeed, 0, caster.getLookVec().x * splitSpeed);
|
||||
world.spawnEntity(decoy);
|
||||
|
||||
// Tricks any mobs that are targeting the caster into targeting the decoy instead.
|
||||
@@ -73,7 +73,7 @@ public class Decoy extends Spell {
|
||||
}
|
||||
}
|
||||
}
|
||||
caster.addVelocity(caster.getLookVec().zCoord * splitSpeed, 0, -caster.getLookVec().xCoord * splitSpeed);
|
||||
caster.addVelocity(caster.getLookVec().z * splitSpeed, 0, -caster.getLookVec().x * splitSpeed);
|
||||
|
||||
caster.playSound(WizardrySounds.SPELL_CONJURATION, 1.0F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F));
|
||||
return true;
|
||||
|
||||
@@ -36,23 +36,23 @@ public class Detonate extends Spell {
|
||||
if(rayTrace != null && rayTrace.typeOfHit == RayTraceResult.Type.BLOCK){
|
||||
if(!world.isRemote){
|
||||
List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(
|
||||
3.0d * modifiers.get(WizardryItems.blast_upgrade), (rayTrace.hitVec.xCoord + 0.5),
|
||||
(rayTrace.hitVec.yCoord + 0.5), (rayTrace.hitVec.zCoord + 0.5), world);
|
||||
3.0d * modifiers.get(WizardryItems.blast_upgrade), (rayTrace.hitVec.x + 0.5),
|
||||
(rayTrace.hitVec.y + 0.5), (rayTrace.hitVec.z + 0.5), world);
|
||||
for(int i = 0; i < targets.size(); i++){
|
||||
targets.get(i).attackEntityFrom(MagicDamage.causeDirectMagicDamage(caster, DamageType.BLAST),
|
||||
// Damage decreases with distance but cannot be less than 0, naturally.
|
||||
Math.max(12.0f - (float)((EntityLivingBase)targets.get(i)).getDistance(
|
||||
(rayTrace.hitVec.xCoord + 0.5), (rayTrace.hitVec.yCoord + 0.5),
|
||||
(rayTrace.hitVec.zCoord + 0.5)) * 4, 0) * modifiers.get(SpellModifiers.DAMAGE));
|
||||
(rayTrace.hitVec.x + 0.5), (rayTrace.hitVec.y + 0.5),
|
||||
(rayTrace.hitVec.z + 0.5)) * 4, 0) * modifiers.get(SpellModifiers.DAMAGE));
|
||||
|
||||
}
|
||||
}
|
||||
if(world.isRemote){
|
||||
double dx = (rayTrace.hitVec.xCoord + 0.5) - caster.posX;
|
||||
double dy = (rayTrace.hitVec.yCoord + 0.5) - WizardryUtilities.getPlayerEyesPos(caster);
|
||||
double dz = (rayTrace.hitVec.zCoord + 0.5) - caster.posZ;
|
||||
world.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, (rayTrace.hitVec.xCoord + 0.5),
|
||||
(rayTrace.hitVec.yCoord + 0.5), (rayTrace.hitVec.zCoord + 0.5), 0, 0, 0);
|
||||
double dx = (rayTrace.hitVec.x + 0.5) - caster.posX;
|
||||
double dy = (rayTrace.hitVec.y + 0.5) - WizardryUtilities.getPlayerEyesPos(caster);
|
||||
double dz = (rayTrace.hitVec.z + 0.5) - caster.posZ;
|
||||
world.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, (rayTrace.hitVec.x + 0.5),
|
||||
(rayTrace.hitVec.y + 0.5), (rayTrace.hitVec.z + 0.5), 0, 0, 0);
|
||||
for(int i = 1; i < 5; i++){
|
||||
world.spawnParticle(EnumParticleTypes.FLAME,
|
||||
caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5,
|
||||
@@ -64,8 +64,8 @@ public class Detonate extends Spell {
|
||||
caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
world.playSound(caster, (rayTrace.hitVec.xCoord + 0.5), (rayTrace.hitVec.yCoord + 0.5),
|
||||
(rayTrace.hitVec.zCoord + 0.5), SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.BLOCKS, 4.0F,
|
||||
world.playSound(caster, (rayTrace.hitVec.x + 0.5), (rayTrace.hitVec.y + 0.5),
|
||||
(rayTrace.hitVec.z + 0.5), SoundEvents.ENTITY_GENERIC_EXPLODE, SoundCategory.BLOCKS, 4.0F,
|
||||
(1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
caster.swingArm(hand);
|
||||
return true;
|
||||
|
||||
@@ -52,10 +52,10 @@ public class Entrapment extends Spell {
|
||||
}
|
||||
if(world.isRemote){
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
|
||||
world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
|
||||
|
||||
@@ -34,9 +34,9 @@ public class FireSigil extends Spell {
|
||||
|
||||
if(rayTrace != null && rayTrace.typeOfHit == RayTraceResult.Type.BLOCK && rayTrace.sideHit == EnumFacing.UP){
|
||||
if(!world.isRemote){
|
||||
double x = rayTrace.hitVec.xCoord;
|
||||
double y = rayTrace.hitVec.yCoord;
|
||||
double z = rayTrace.hitVec.zCoord;
|
||||
double x = rayTrace.hitVec.x;
|
||||
double y = rayTrace.hitVec.y;
|
||||
double z = rayTrace.hitVec.z;
|
||||
EntityFireSigil firesigil = new EntityFireSigil(world, x, y, z, caster,
|
||||
modifiers.get(SpellModifiers.DAMAGE));
|
||||
world.spawnEntity(firesigil);
|
||||
|
||||
@@ -34,10 +34,10 @@ public class Fireball extends Spell {
|
||||
|
||||
if(!world.isRemote){
|
||||
EntitySmallFireball fireball = new EntitySmallFireball(world, caster, 1, 1, 1);
|
||||
fireball.setPosition(caster.posX + look.xCoord, caster.posY + look.yCoord + 1.3, caster.posZ + look.zCoord);
|
||||
fireball.accelerationX = look.xCoord * 0.1;
|
||||
fireball.accelerationY = look.yCoord * 0.1;
|
||||
fireball.accelerationZ = look.zCoord * 0.1;
|
||||
fireball.setPosition(caster.posX + look.x, caster.posY + look.y + 1.3, caster.posZ + look.z);
|
||||
fireball.accelerationX = look.x * 0.1;
|
||||
fireball.accelerationY = look.y * 0.1;
|
||||
fireball.accelerationZ = look.z * 0.1;
|
||||
world.spawnEntity(fireball);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,18 +66,18 @@ public class Firestorm extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 40; i++){
|
||||
// I figured it out! when on client side, entityplayer.posY is at the eyes, not the feet!
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() * 0.6f - 0.3f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() * 0.6f - 0.3f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() * 0.4f - 0.2f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() * 0.6f - 0.3f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() * 0.6f - 0.3f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1,
|
||||
look.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.zCoord * modifiers.get(WizardryItems.range_upgrade), 0, 3 + world.rand.nextFloat(), 0, 0);
|
||||
look.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.z * modifiers.get(WizardryItems.range_upgrade), 0, 3 + world.rand.nextFloat(), 0, 0);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1,
|
||||
look.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.zCoord * modifiers.get(WizardryItems.range_upgrade), 0, 3 + world.rand.nextFloat(), 0, 0);
|
||||
look.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.z * modifiers.get(WizardryItems.range_upgrade), 0, 3 + world.rand.nextFloat(), 0, 0);
|
||||
}
|
||||
}
|
||||
if(ticksInUse % 16 == 0){
|
||||
|
||||
@@ -54,18 +54,18 @@ public class FlameRay extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 20; i++){
|
||||
// I figured it out! when on client side, entityplayer.posY is at the eyes, not the feet!
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1,
|
||||
look.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.zCoord * modifiers.get(WizardryItems.range_upgrade), 0);
|
||||
look.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.z * modifiers.get(WizardryItems.range_upgrade), 0);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1,
|
||||
look.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.zCoord * modifiers.get(WizardryItems.range_upgrade), 0);
|
||||
look.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.z * modifiers.get(WizardryItems.range_upgrade), 0);
|
||||
}
|
||||
}
|
||||
if(ticksInUse % 16 == 0){
|
||||
@@ -90,18 +90,18 @@ public class FlameRay extends Spell {
|
||||
}
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 20; i++){
|
||||
double x1 = caster.posX + vec.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.yCoord * i / 2 + world.rand.nextFloat() / 5
|
||||
double x1 = caster.posX + vec.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2 + world.rand.nextFloat() / 5
|
||||
- 0.1f;
|
||||
double z1 = caster.posZ + vec.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1,
|
||||
vec.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.zCoord * modifiers.get(WizardryItems.range_upgrade), 0);
|
||||
vec.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.z * modifiers.get(WizardryItems.range_upgrade), 0);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1,
|
||||
vec.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.zCoord * modifiers.get(WizardryItems.range_upgrade), 0);
|
||||
vec.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.z * modifiers.get(WizardryItems.range_upgrade), 0);
|
||||
}
|
||||
}
|
||||
if(ticksInUse % 16 == 0){
|
||||
|
||||
@@ -25,14 +25,14 @@ public class Flight extends Spell {
|
||||
if(!caster.isInWater() && !caster.isElytraFlying()){
|
||||
// The division thingy checks if the look direction is the opposite way to the velocity. If this is the
|
||||
// case then the velocity should be added regardless of the player's current speed.
|
||||
if((Math.abs(caster.motionX) < 0.6 || caster.motionX / caster.getLookVec().xCoord < 0)
|
||||
&& (Math.abs(caster.motionZ) < 0.6 || caster.motionZ / caster.getLookVec().zCoord < 0)){
|
||||
caster.addVelocity(caster.getLookVec().xCoord / 20, 0, caster.getLookVec().zCoord / 20);
|
||||
if((Math.abs(caster.motionX) < 0.6 || caster.motionX / caster.getLookVec().x < 0)
|
||||
&& (Math.abs(caster.motionZ) < 0.6 || caster.motionZ / caster.getLookVec().z < 0)){
|
||||
caster.addVelocity(caster.getLookVec().x / 20, 0, caster.getLookVec().z / 20);
|
||||
}
|
||||
// y velocity is handled separately to stop the player from falling from the sky when they reach maximum
|
||||
// horizontal speed.
|
||||
if(Math.abs(caster.motionY) < 0.6 || caster.motionY / caster.getLookVec().yCoord < 0){
|
||||
caster.motionY += caster.getLookVec().yCoord / 20 + 0.075;
|
||||
if(Math.abs(caster.motionY) < 0.6 || caster.motionY / caster.getLookVec().y < 0){
|
||||
caster.motionY += caster.getLookVec().y / 20 + 0.075;
|
||||
}
|
||||
caster.fallDistance = 0.0f;
|
||||
}
|
||||
|
||||
@@ -66,24 +66,24 @@ public class FrostRay extends Spell {
|
||||
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 20; i++){
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1,
|
||||
look.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.zCoord * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f,
|
||||
look.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f,
|
||||
0.6f, 1.0f);
|
||||
|
||||
x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1,
|
||||
look.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.zCoord * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f,
|
||||
look.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f,
|
||||
1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
@@ -122,24 +122,24 @@ public class FrostRay extends Spell {
|
||||
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 20; i++){
|
||||
double x1 = caster.posX + vec.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.yCoord * i / 2
|
||||
double x1 = caster.posX + vec.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + vec.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1,
|
||||
vec.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.zCoord * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f,
|
||||
vec.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f,
|
||||
0.6f, 1.0f);
|
||||
|
||||
x1 = caster.posX + vec.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.yCoord * i / 2 + world.rand.nextFloat() / 5
|
||||
x1 = caster.posX + vec.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2 + world.rand.nextFloat() / 5
|
||||
- 0.1f;
|
||||
z1 = caster.posZ + vec.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1,
|
||||
vec.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.zCoord * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f,
|
||||
vec.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
vec.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f,
|
||||
1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ public class FrostSigil extends Spell {
|
||||
|
||||
if(rayTrace != null && rayTrace.typeOfHit == RayTraceResult.Type.BLOCK && rayTrace.sideHit == EnumFacing.UP){
|
||||
if(!world.isRemote){
|
||||
double x = rayTrace.hitVec.xCoord;
|
||||
double y = rayTrace.hitVec.yCoord;
|
||||
double z = rayTrace.hitVec.zCoord;
|
||||
double x = rayTrace.hitVec.x;
|
||||
double y = rayTrace.hitVec.y;
|
||||
double z = rayTrace.hitVec.z;
|
||||
EntityFrostSigil frostsigil = new EntityFrostSigil(world, x, y, z, caster,
|
||||
modifiers.get(SpellModifiers.DAMAGE));
|
||||
world.spawnEntity(frostsigil);
|
||||
|
||||
@@ -25,7 +25,7 @@ public class Glide extends Spell {
|
||||
if(caster.motionY < -0.1 && !caster.isInWater()){
|
||||
caster.motionY = -0.1;
|
||||
if(Math.abs(caster.motionX) < 0.4 && Math.abs(caster.motionZ) < 0.4){
|
||||
caster.addVelocity(caster.getLookVec().xCoord / 8, 0, caster.getLookVec().zCoord / 8);
|
||||
caster.addVelocity(caster.getLookVec().x / 8, 0, caster.getLookVec().z / 8);
|
||||
// entityplayer.moveEntity(entityplayer.motionX*10, 0, entityplayer.motionZ*10);
|
||||
}
|
||||
caster.fallDistance = 0.0f;
|
||||
|
||||
@@ -33,10 +33,10 @@ public class GreaterFireball extends Spell {
|
||||
|
||||
if(!world.isRemote){
|
||||
EntityLargeFireball fireball = new EntityLargeFireball(world, caster, 1, 1, 1);
|
||||
fireball.setPosition(caster.posX + look.xCoord, caster.posY + look.yCoord + 1.3, caster.posZ + look.zCoord);
|
||||
fireball.accelerationX = look.xCoord * 0.1;
|
||||
fireball.accelerationY = look.yCoord * 0.1;
|
||||
fireball.accelerationZ = look.zCoord * 0.1;
|
||||
fireball.setPosition(caster.posX + look.x, caster.posY + look.y + 1.3, caster.posZ + look.z);
|
||||
fireball.accelerationX = look.x * 0.1;
|
||||
fireball.accelerationY = look.y * 0.1;
|
||||
fireball.accelerationZ = look.z * 0.1;
|
||||
world.spawnEntity(fireball);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ public class Hailstorm extends Spell {
|
||||
|
||||
if(rayTrace != null && rayTrace.typeOfHit == RayTraceResult.Type.BLOCK){
|
||||
if(!world.isRemote){
|
||||
double x = rayTrace.hitVec.xCoord;
|
||||
double y = rayTrace.hitVec.yCoord;
|
||||
double z = rayTrace.hitVec.zCoord;
|
||||
double x = rayTrace.hitVec.x;
|
||||
double y = rayTrace.hitVec.y;
|
||||
double z = rayTrace.hitVec.z;
|
||||
// Moves the entity back towards the caster a bit, so the area of effect is better centred on the
|
||||
// position.
|
||||
// 3.0d is the distance to move the entity back towards the caster.
|
||||
|
||||
@@ -40,9 +40,9 @@ public class IceSpikes extends Spell {
|
||||
|
||||
if(!world.isRemote){
|
||||
|
||||
double x = rayTrace.hitVec.xCoord;
|
||||
double y = rayTrace.hitVec.yCoord;
|
||||
double z = rayTrace.hitVec.zCoord;
|
||||
double x = rayTrace.hitVec.x;
|
||||
double y = rayTrace.hitVec.y;
|
||||
double z = rayTrace.hitVec.z;
|
||||
|
||||
for(int i = 0; i < (int)(18 * modifiers.get(WizardryItems.blast_upgrade)); i++){
|
||||
|
||||
|
||||
@@ -110,10 +110,10 @@ public class IceStatue extends Spell {
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
float brightness = 0.5f + (world.rand.nextFloat() / 2);
|
||||
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
|
||||
12 + world.rand.nextInt(8), brightness, brightness + 0.1f, 1.0f);
|
||||
|
||||
@@ -100,12 +100,12 @@ public class Intimidate extends Spell {
|
||||
|
||||
if(!target.getNavigator().noPath()){
|
||||
PathPoint point = target.getNavigator().getPath().getFinalPathPoint();
|
||||
if(point != null) flag = caster.getDistance(point.xCoord, point.yCoord, point.zCoord) < 16;
|
||||
if(point != null) flag = caster.getDistance(point.x, point.y, point.z) < 16;
|
||||
}
|
||||
// Has a built in mind trick effect because for whatever reason this makes it work with skeletons.
|
||||
target.setAttackTarget(null);
|
||||
|
||||
if(flag) return target.getNavigator().tryMoveToXYZ(Vec3d.xCoord, Vec3d.yCoord, Vec3d.zCoord, 1.25);// target.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue());
|
||||
if(flag) return target.getNavigator().tryMoveToXYZ(Vec3d.x, Vec3d.y, Vec3d.z, 1.25);// target.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Leap extends Spell {
|
||||
if(caster.onGround){
|
||||
|
||||
caster.motionY = 0.65 * modifiers.get(SpellModifiers.DAMAGE);
|
||||
caster.addVelocity(caster.getLookVec().xCoord * 0.3, 0, caster.getLookVec().zCoord * 0.3);
|
||||
caster.addVelocity(caster.getLookVec().x * 0.3, 0, caster.getLookVec().z * 0.3);
|
||||
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 10; i++){
|
||||
|
||||
@@ -49,17 +49,17 @@ public class LifeDrain extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 5; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
// I figured it out! when on client side, entityplayer.posY is at the eyes, not the feet!
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
|
||||
if(i % 5 == 0){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
|
||||
0, 0.1f, 0.0f, 0.0f);
|
||||
}
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, -0.05 * look.xCoord * i,
|
||||
-0.05 * look.yCoord * i, -0.05 * look.zCoord * i, 8 + world.rand.nextInt(6), 0.5f, 0.0f, 0.0f);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, -0.05 * look.x * i,
|
||||
-0.05 * look.y * i, -0.05 * look.z * i, 8 + world.rand.nextInt(6), 0.5f, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
if(ticksInUse % 18 == 0){
|
||||
@@ -87,17 +87,17 @@ public class LifeDrain extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 5; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
// I figured it out! when on client side, entityplayer.posY is at the eyes, not the feet!
|
||||
double x1 = caster.posX + vec.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.yCoord * i / 2 + world.rand.nextFloat() / 5
|
||||
double x1 = caster.posX + vec.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2 + world.rand.nextFloat() / 5
|
||||
- 0.1f;
|
||||
double z1 = caster.posZ + vec.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
|
||||
if(i % 5 == 0){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
|
||||
0, 0.1f, 0.0f, 0.0f);
|
||||
}
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, -0.05 * vec.xCoord * i,
|
||||
-0.05 * vec.yCoord * i, -0.05 * vec.zCoord * i, 8 + world.rand.nextInt(6), 0.5f, 0.0f, 0.0f);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, -0.05 * vec.x * i,
|
||||
-0.05 * vec.y * i, -0.05 * vec.z * i, 8 + world.rand.nextInt(6), 0.5f, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
if(ticksInUse % 18 == 0){
|
||||
|
||||
@@ -52,9 +52,9 @@ public class Light extends Spell {
|
||||
}
|
||||
}else{
|
||||
|
||||
int x = (int)(Math.floor(caster.posX) + caster.getLookVec().xCoord * 4);
|
||||
int y = (int)(Math.floor(caster.posY) + caster.eyeHeight + caster.getLookVec().yCoord * 4);
|
||||
int z = (int)(Math.floor(caster.posZ) + caster.getLookVec().zCoord * 4);
|
||||
int x = (int)(Math.floor(caster.posX) + caster.getLookVec().x * 4);
|
||||
int y = (int)(Math.floor(caster.posY) + caster.eyeHeight + caster.getLookVec().y * 4);
|
||||
int z = (int)(Math.floor(caster.posZ) + caster.getLookVec().z * 4);
|
||||
|
||||
BlockPos pos = new BlockPos(x, y, z);
|
||||
|
||||
|
||||
@@ -87,9 +87,9 @@ public class LightningRay extends Spell {
|
||||
EntityArc arc = new EntityArc(world);
|
||||
|
||||
arc.setEndpointCoords(caster.posX, caster.posY + 1.2, caster.posZ,
|
||||
caster.posX + caster.getLookVec().xCoord * 8,
|
||||
caster.posY + caster.eyeHeight + caster.getLookVec().yCoord * 8,
|
||||
caster.posZ + caster.getLookVec().zCoord * 8);
|
||||
caster.posX + caster.getLookVec().x * 8,
|
||||
caster.posY + caster.eyeHeight + caster.getLookVec().y * 8,
|
||||
caster.posZ + caster.getLookVec().z * 8);
|
||||
|
||||
arc.lifetime = 1;
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ public class LightningSigil extends Spell {
|
||||
if(rayTrace != null && rayTrace.typeOfHit == RayTraceResult.Type.BLOCK && rayTrace.sideHit == EnumFacing.UP){
|
||||
|
||||
if(!world.isRemote){
|
||||
double x = rayTrace.hitVec.xCoord;
|
||||
double y = rayTrace.hitVec.yCoord;
|
||||
double z = rayTrace.hitVec.zCoord;
|
||||
double x = rayTrace.hitVec.x;
|
||||
double y = rayTrace.hitVec.y;
|
||||
double z = rayTrace.hitVec.z;
|
||||
EntityLightningSigil lightningsigil = new EntityLightningSigil(world, x, y, z, caster,
|
||||
modifiers.get(SpellModifiers.DAMAGE));
|
||||
world.spawnEntity(lightningsigil);
|
||||
|
||||
@@ -200,9 +200,9 @@ public class LightningWeb extends Spell {
|
||||
if(ticksInUse % 2 == 0){
|
||||
EntityArc arc = new EntityArc(world);
|
||||
arc.setEndpointCoords(caster.posX, caster.posY + 1.2, caster.posZ,
|
||||
caster.posX + caster.getLookVec().xCoord * 8,
|
||||
caster.posY + caster.eyeHeight + caster.getLookVec().yCoord * 8,
|
||||
caster.posZ + caster.getLookVec().zCoord * 8);
|
||||
caster.posX + caster.getLookVec().x * 8,
|
||||
caster.posY + caster.eyeHeight + caster.getLookVec().y * 8,
|
||||
caster.posZ + caster.getLookVec().z * 8);
|
||||
arc.lifetime = 1;
|
||||
// arc.setOffset(entityplayer.getLookVec().zCoord * 0.5, entityplayer.getLookVec().xCoord * 0.5);
|
||||
world.spawnEntity(arc);
|
||||
|
||||
@@ -97,10 +97,10 @@ public class Metamorphosis extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
// I figured it out! when on client side, entityplayer.posY is at the eyes, not the feet!
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
|
||||
12 + world.rand.nextInt(8), 0.2f, 0.0f, 0.1f);
|
||||
|
||||
@@ -113,7 +113,7 @@ public class MindTrick extends Spell {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onLivingAttackEvent(LivingAttackEvent event){
|
||||
if(event.getSource() != null && event.getSource().getEntity() instanceof EntityLivingBase){
|
||||
if(event.getSource() != null && event.getSource().getTrueSource() instanceof EntityLivingBase){
|
||||
// Cancels the mind trick effect if the creature takes damage
|
||||
// This has been moved to within an (event.getSource().getEntity() instanceof EntityLivingBase) check so it
|
||||
// doesn't
|
||||
|
||||
@@ -107,10 +107,10 @@ public class Petrify extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
// I figured it out! when on client side, entityplayer.posY is at the eyes, not the feet!
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
|
||||
0.1f, 0.1f, 0.1f);
|
||||
|
||||
@@ -55,10 +55,10 @@ public class Poison extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
// I figured it out! when on client side, entityplayer.posY is at the eyes, not the feet!
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
|
||||
0.3f, 0.7f, 0.0f);
|
||||
|
||||
@@ -49,11 +49,11 @@ public class ShadowWard extends Spell {
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onLivingAttackEvent(LivingAttackEvent event){
|
||||
if(event.getSource() != null && event.getSource().getEntity() instanceof EntityLivingBase){
|
||||
if(event.getSource() != null && event.getSource().getTrueSource() instanceof EntityLivingBase){
|
||||
// There used to be a check that the target was a player here, but I don't see any reason for it.
|
||||
ItemStack wand = event.getEntityLiving().getActiveItemStack();
|
||||
|
||||
if(wand != null && wand.getItemDamage() < wand.getMaxDamage() && wand.getItem() instanceof ItemWand
|
||||
if(!wand.isEmpty() && wand.getItemDamage() < wand.getMaxDamage() && wand.getItem() instanceof ItemWand
|
||||
&& WandHelper.getCurrentSpell(wand) instanceof ShadowWard && !event.getSource().isUnblockable()
|
||||
&& !(event.getSource() instanceof IElementalDamage
|
||||
&& ((IElementalDamage)event.getSource()).isRetaliatory())){
|
||||
@@ -61,9 +61,9 @@ public class ShadowWard extends Spell {
|
||||
event.setCanceled(true);
|
||||
// Now we can preserve the original daage source (sort of) as long as we make it retaliatory.
|
||||
event.getEntityLiving().attackEntityFrom(
|
||||
MagicDamage.causeDirectMagicDamage(event.getSource().getEntity(), DamageType.MAGIC, true),
|
||||
MagicDamage.causeDirectMagicDamage(event.getSource().getTrueSource(), DamageType.MAGIC, true),
|
||||
event.getAmount() / 2);
|
||||
((EntityLivingBase)event.getSource().getEntity()).attackEntityFrom(
|
||||
((EntityLivingBase)event.getSource().getTrueSource()).attackEntityFrom(
|
||||
MagicDamage.causeDirectMagicDamage(event.getEntityLiving(), DamageType.MAGIC, true),
|
||||
event.getAmount() / 2);
|
||||
}
|
||||
|
||||
@@ -60,10 +60,10 @@ public class Slime extends Spell {
|
||||
|
||||
if(world.isRemote){
|
||||
for(int i = 1; i < (int)(25 * modifiers.get(WizardryItems.range_upgrade)); i += 2){
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
|
||||
world.spawnParticle(EnumParticleTypes.SLIME, x1, y1, z1, 0.0d, 0.0d, 0.0d);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
@@ -53,7 +54,7 @@ public class Telekinesis extends Spell {
|
||||
|
||||
EntityPlayer target = (EntityPlayer)rayTrace.entityHit;
|
||||
|
||||
if(target.getHeldItemMainhand() != null){
|
||||
if(!target.getHeldItemMainhand().isEmpty()){
|
||||
|
||||
if(!world.isRemote){
|
||||
EntityItem item = target.entityDropItem(target.getHeldItemMainhand(), 0.0f);
|
||||
@@ -62,7 +63,7 @@ public class Telekinesis extends Spell {
|
||||
item.motionZ = (caster.posZ - target.posZ) / 20;
|
||||
}
|
||||
|
||||
target.setHeldItem(EnumHand.MAIN_HAND, null);
|
||||
target.setHeldItem(EnumHand.MAIN_HAND, ItemStack.EMPTY);
|
||||
|
||||
target.playSound(WizardrySounds.SPELL_CONJURATION, 1.0F, 1.0f);
|
||||
caster.swingArm(hand);
|
||||
@@ -88,7 +89,7 @@ public class Telekinesis extends Spell {
|
||||
public boolean cast(World world, EntityLiving caster, EnumHand hand, int ticksInUse, EntityLivingBase target,
|
||||
SpellModifiers modifiers){
|
||||
|
||||
if(target instanceof EntityPlayer && target.getHeldItemMainhand() != null){
|
||||
if(target instanceof EntityPlayer && !target.getHeldItemMainhand().isEmpty()){
|
||||
|
||||
// IDEA: Disarm the offhand if the mainhand is empty or otherwise harmless?
|
||||
|
||||
@@ -99,7 +100,7 @@ public class Telekinesis extends Spell {
|
||||
item.motionZ = (caster.posZ - target.posZ) / 20;
|
||||
}
|
||||
|
||||
target.setHeldItem(EnumHand.MAIN_HAND, null);
|
||||
target.setHeldItem(EnumHand.MAIN_HAND, ItemStack.EMPTY);
|
||||
|
||||
target.playSound(WizardrySounds.SPELL_CONJURATION, 1.0F, 1.0f);
|
||||
caster.swingArm(hand);
|
||||
|
||||
@@ -30,13 +30,13 @@ public class Tornado extends Spell {
|
||||
public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers){
|
||||
|
||||
if(!world.isRemote){
|
||||
double x = caster.posX + caster.getLookVec().xCoord;
|
||||
double x = caster.posX + caster.getLookVec().x;
|
||||
double y = caster.posY;
|
||||
double z = caster.posZ + caster.getLookVec().zCoord;
|
||||
double z = caster.posZ + caster.getLookVec().z;
|
||||
|
||||
EntityTornado tornado = new EntityTornado(world, x, y, z, caster,
|
||||
(int)(200 * modifiers.get(WizardryItems.duration_upgrade)), caster.getLookVec().xCoord / 3,
|
||||
caster.getLookVec().zCoord / 3, modifiers.get(SpellModifiers.DAMAGE));
|
||||
(int)(200 * modifiers.get(WizardryItems.duration_upgrade)), caster.getLookVec().x / 3,
|
||||
caster.getLookVec().z / 3, modifiers.get(SpellModifiers.DAMAGE));
|
||||
world.spawnEntity(tornado);
|
||||
}
|
||||
caster.swingArm(hand);
|
||||
@@ -51,13 +51,13 @@ public class Tornado extends Spell {
|
||||
if(target != null){
|
||||
|
||||
if(!world.isRemote){
|
||||
double x = caster.posX + caster.getLookVec().xCoord;
|
||||
double x = caster.posX + caster.getLookVec().x;
|
||||
double y = caster.posY;
|
||||
double z = caster.posZ + caster.getLookVec().zCoord;
|
||||
double z = caster.posZ + caster.getLookVec().z;
|
||||
|
||||
EntityTornado tornado = new EntityTornado(world, x, y, z, caster,
|
||||
(int)(200 * modifiers.get(WizardryItems.duration_upgrade)), caster.getLookVec().xCoord / 3,
|
||||
caster.getLookVec().zCoord / 3, modifiers.get(SpellModifiers.DAMAGE));
|
||||
(int)(200 * modifiers.get(WizardryItems.duration_upgrade)), caster.getLookVec().x / 3,
|
||||
caster.getLookVec().z / 3, modifiers.get(SpellModifiers.DAMAGE));
|
||||
world.spawnEntity(tornado);
|
||||
}
|
||||
caster.swingArm(hand);
|
||||
|
||||
@@ -57,8 +57,8 @@ public class Transience extends Spell {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
// Prevents transient entities from causing any damage
|
||||
if(event.getSource().getEntity() instanceof EntityLivingBase
|
||||
&& ((EntityLivingBase)event.getSource().getEntity()).isPotionActive(WizardryPotions.transience)){
|
||||
if(event.getSource().getTrueSource() instanceof EntityLivingBase
|
||||
&& ((EntityLivingBase)event.getSource().getTrueSource()).isPotionActive(WizardryPotions.transience)){
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,24 +70,24 @@ public class WallOfFrost extends Spell {
|
||||
|
||||
if(world.isRemote){
|
||||
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1,
|
||||
look.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.zCoord * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f,
|
||||
look.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f,
|
||||
0.6f, 1.0f);
|
||||
|
||||
x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1,
|
||||
look.xCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.yCoord * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.zCoord * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f,
|
||||
look.x * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.y * modifiers.get(WizardryItems.range_upgrade),
|
||||
look.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f,
|
||||
1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ public class Whirlwind extends Spell {
|
||||
|
||||
if(!world.isRemote){
|
||||
|
||||
target.motionX = caster.getLookVec().xCoord * 2;
|
||||
target.motionY = caster.getLookVec().yCoord * 2 + 1;
|
||||
target.motionZ = caster.getLookVec().zCoord * 2;
|
||||
target.motionX = caster.getLookVec().x * 2;
|
||||
target.motionY = caster.getLookVec().y * 2 + 1;
|
||||
target.motionZ = caster.getLookVec().z * 2;
|
||||
|
||||
// Player motion is handled on that player's client so needs packets
|
||||
if(target instanceof EntityPlayerMP){
|
||||
@@ -48,13 +48,13 @@ public class Whirlwind extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 10; i++){
|
||||
double x2 = (double)(caster.posX + world.rand.nextFloat() - 0.5F
|
||||
+ caster.getLookVec().xCoord * caster.getDistanceToEntity(target) * 0.5);
|
||||
+ caster.getLookVec().x * caster.getDistanceToEntity(target) * 0.5);
|
||||
double y2 = (double)(WizardryUtilities.getPlayerEyesPos(caster) + world.rand.nextFloat() - 0.5F
|
||||
+ caster.getLookVec().yCoord * caster.getDistanceToEntity(target) * 0.5);
|
||||
+ caster.getLookVec().y * caster.getDistanceToEntity(target) * 0.5);
|
||||
double z2 = (double)(caster.posZ + world.rand.nextFloat() - 0.5F
|
||||
+ caster.getLookVec().zCoord * caster.getDistanceToEntity(target) * 0.5);
|
||||
world.spawnParticle(EnumParticleTypes.CLOUD, x2, y2, z2, caster.getLookVec().xCoord,
|
||||
caster.getLookVec().yCoord, caster.getLookVec().zCoord);
|
||||
+ caster.getLookVec().z * caster.getDistanceToEntity(target) * 0.5);
|
||||
world.spawnParticle(EnumParticleTypes.CLOUD, x2, y2, z2, caster.getLookVec().x,
|
||||
caster.getLookVec().y, caster.getLookVec().z);
|
||||
// Minecraft.getMinecraft().effectRenderer.addEffect(new EntitySparkleFX(world, x2, y2, z2,
|
||||
// entityplayer.getLookVec().xCoord, entityplayer.getLookVec().yCoord,
|
||||
// entityplayer.getLookVec().zCoord, null, 1.0f, 1.0f, 0.8f, 10));
|
||||
@@ -75,9 +75,9 @@ public class Whirlwind extends Spell {
|
||||
if(target != null){
|
||||
|
||||
if(!world.isRemote){
|
||||
target.motionX = caster.getLookVec().xCoord * 2;
|
||||
target.motionY = caster.getLookVec().yCoord * 2 + 1;
|
||||
target.motionZ = caster.getLookVec().zCoord * 2;
|
||||
target.motionX = caster.getLookVec().x * 2;
|
||||
target.motionY = caster.getLookVec().y * 2 + 1;
|
||||
target.motionZ = caster.getLookVec().z * 2;
|
||||
|
||||
// Player motion is handled on that player's client so needs packets
|
||||
if(target instanceof EntityPlayerMP){
|
||||
@@ -87,13 +87,13 @@ public class Whirlwind extends Spell {
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 10; i++){
|
||||
double x2 = (double)(caster.posX + world.rand.nextFloat() - 0.5F
|
||||
+ caster.getLookVec().xCoord * caster.getDistanceToEntity(target) * 0.5);
|
||||
+ caster.getLookVec().x * caster.getDistanceToEntity(target) * 0.5);
|
||||
double y2 = (double)(caster.posY + caster.getEyeHeight() + world.rand.nextFloat() - 0.5F
|
||||
+ caster.getLookVec().yCoord * caster.getDistanceToEntity(target) * 0.5);
|
||||
+ caster.getLookVec().y * caster.getDistanceToEntity(target) * 0.5);
|
||||
double z2 = (double)(caster.posZ + world.rand.nextFloat() - 0.5F
|
||||
+ caster.getLookVec().zCoord * caster.getDistanceToEntity(target) * 0.5);
|
||||
world.spawnParticle(EnumParticleTypes.CLOUD, x2, y2, z2, caster.getLookVec().xCoord,
|
||||
caster.getLookVec().yCoord, caster.getLookVec().zCoord);
|
||||
+ caster.getLookVec().z * caster.getDistanceToEntity(target) * 0.5);
|
||||
world.spawnParticle(EnumParticleTypes.CLOUD, x2, y2, z2, caster.getLookVec().x,
|
||||
caster.getLookVec().y, caster.getLookVec().z);
|
||||
}
|
||||
}
|
||||
caster.swingArm(hand);
|
||||
|
||||
@@ -61,10 +61,10 @@ public class Wither extends Spell {
|
||||
* + world.rand.nextFloat()/5 - 0.1f; double y1 = origin.yCoord + look.yCoord*i/2 +
|
||||
* world.rand.nextFloat()/5 - 0.1f; double z1 = origin.zCoord + look.zCoord*i/2 +
|
||||
* world.rand.nextFloat()/5 - 0.1f; */
|
||||
double x1 = caster.posX + look.xCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.yCoord * i / 2
|
||||
double x1 = caster.posX + look.x * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
|
||||
+ world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.zCoord * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
|
||||
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
|
||||
0.1f, 0.0f, 0.0f);
|
||||
|
||||
@@ -33,11 +33,11 @@ public class WitherSkull extends Spell {
|
||||
|
||||
if(!world.isRemote){
|
||||
EntityWitherSkull witherskull = new EntityWitherSkull(world, caster, 1, 1, 1);
|
||||
witherskull.setPosition(caster.posX + look.xCoord, caster.posY + look.yCoord + 1.3,
|
||||
caster.posZ + look.zCoord);
|
||||
witherskull.accelerationX = look.xCoord * 0.1;
|
||||
witherskull.accelerationY = look.yCoord * 0.1;
|
||||
witherskull.accelerationZ = look.zCoord * 0.1;
|
||||
witherskull.setPosition(caster.posX + look.x, caster.posY + look.y + 1.3,
|
||||
caster.posZ + look.z);
|
||||
witherskull.accelerationX = look.x * 0.1;
|
||||
witherskull.accelerationY = look.y * 0.1;
|
||||
witherskull.accelerationZ = look.z * 0.1;
|
||||
world.spawnEntity(witherskull);
|
||||
WizardryUtilities.playSoundAtPlayer(caster, SoundEvents.ENTITY_WITHER_SHOOT, 1.0F,
|
||||
world.rand.nextFloat() * 0.2F + 1.0F);
|
||||
|
||||
@@ -42,8 +42,8 @@ public interface IElementalDamage {
|
||||
// Charges creepers when they are hit by shock damage
|
||||
WizardryUtilities.chargeCreeper((EntityCreeper)event.getEntityLiving());
|
||||
// Gives the player that caused the shock damage the 'It's Gonna Blow' achievement
|
||||
if(event.getSource().getEntity() instanceof EntityPlayer){
|
||||
((EntityPlayer)event.getSource().getEntity()).addStat(WizardryAchievements.charge_creeper);
|
||||
if(event.getSource().getTrueSource() instanceof EntityPlayer){
|
||||
((EntityPlayer)event.getSource().getTrueSource()).addStat(WizardryAchievements.charge_creeper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ public final class WizardryUtilities {
|
||||
|
||||
Vec3d start = new Vec3d(entity.posX, entity.getEntityBoundingBox().minY + entity.getEyeHeight(), entity.posZ);
|
||||
Vec3d look = entity.getLookVec();
|
||||
Vec3d end = start.addVector(look.xCoord * range, look.yCoord * range, look.zCoord * range);
|
||||
Vec3d end = start.addVector(look.x * range, look.y * range, look.z * range);
|
||||
return world.rayTraceBlocks(start, end, hitLiquids);
|
||||
}
|
||||
|
||||
@@ -521,9 +521,9 @@ public final class WizardryUtilities {
|
||||
*/
|
||||
@Nullable
|
||||
public static RayTraceResult standardEntityRayTrace(World world, EntityLivingBase entity, double range){
|
||||
double dx = entity.getLookVec().xCoord * range;
|
||||
double dy = entity.getLookVec().yCoord * range;
|
||||
double dz = entity.getLookVec().zCoord * range;
|
||||
double dx = entity.getLookVec().x * range;
|
||||
double dy = entity.getLookVec().y * range;
|
||||
double dz = entity.getLookVec().z * range;
|
||||
HashSet<Entity> hashset = new HashSet<Entity>(1);
|
||||
hashset.add(entity);
|
||||
return WizardryUtilities.tracePath(world, (float)entity.posX,
|
||||
@@ -545,9 +545,9 @@ public final class WizardryUtilities {
|
||||
@Nullable
|
||||
public static RayTraceResult standardEntityRayTrace(World world, EntityLivingBase entity, double range,
|
||||
float borderSize){
|
||||
double dx = entity.getLookVec().xCoord * range;
|
||||
double dy = entity.getLookVec().yCoord * range;
|
||||
double dz = entity.getLookVec().zCoord * range;
|
||||
double dx = entity.getLookVec().x * range;
|
||||
double dy = entity.getLookVec().y * range;
|
||||
double dz = entity.getLookVec().z * range;
|
||||
HashSet<Entity> hashset = new HashSet<Entity>(1);
|
||||
hashset.add(entity);
|
||||
return WizardryUtilities.tracePath(world, (float)entity.posX,
|
||||
@@ -585,7 +585,7 @@ public final class WizardryUtilities {
|
||||
float maxX = x > tx ? x : tx;
|
||||
float maxY = y > ty ? y : ty;
|
||||
float maxZ = z > tz ? z : tz;
|
||||
AxisAlignedBB bb = new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ).expand(borderSize, borderSize,
|
||||
AxisAlignedBB bb = new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ).grow(borderSize, borderSize,
|
||||
borderSize);
|
||||
List<Entity> allEntities = world.getEntitiesWithinAABBExcludingEntity(null, bb);
|
||||
RayTraceResult blockHit = world.rayTraceBlocks(startVec, endVec);
|
||||
@@ -606,7 +606,7 @@ public final class WizardryUtilities {
|
||||
float entBorder = ent.getCollisionBorderSize();
|
||||
entityBb = ent.getEntityBoundingBox();
|
||||
if(entityBb != null){
|
||||
entityBb = entityBb.expand(entBorder, entBorder, entBorder);
|
||||
entityBb = entityBb.grow(entBorder, entBorder, entBorder);
|
||||
intercept = entityBb.calculateIntercept(startVec, endVec);
|
||||
if(intercept != null){
|
||||
currentHit = (float)intercept.hitVec.distanceTo(startVec);
|
||||
|
||||
Reference in New Issue
Block a user