-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/TaoismDeepLake/Genshin12
- Loading branch information
Showing
38 changed files
with
319 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/main/java/com/deeplake/genshin12/blocks/blockMisc/BlockZhongliPillarDeco.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package com.deeplake.genshin12.blocks.blockMisc; | ||
|
||
import com.deeplake.genshin12.blocks.BlockBase; | ||
import com.deeplake.genshin12.blocks.tileEntity.genshin.TEZhongliPillar; | ||
import net.minecraft.block.ITileEntityProvider; | ||
import net.minecraft.block.material.Material; | ||
import net.minecraft.block.state.BlockFaceShape; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.util.EnumFacing; | ||
import net.minecraft.util.math.AxisAlignedBB; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.IBlockAccess; | ||
import net.minecraft.world.World; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
public class BlockZhongliPillarDeco extends BlockBase { | ||
|
||
static final float UNIT = 0.31f; | ||
public static final AxisAlignedBB AABB_Y = new AxisAlignedBB(UNIT, 0, UNIT, 1-UNIT, 1, 1-UNIT); | ||
|
||
public BlockZhongliPillarDeco(String name, Material material) { | ||
super(name, material); | ||
} | ||
|
||
@Override | ||
public boolean isOpaqueCube(IBlockState state) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isFullCube(IBlockState state) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean causesSuffocation(IBlockState state) { | ||
return false; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { | ||
return AABB_Y; | ||
} | ||
|
||
@Override | ||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { | ||
return AABB_Y; | ||
} | ||
|
||
@Override | ||
public boolean isLadder(IBlockState state, IBlockAccess world, BlockPos pos, EntityLivingBase entity) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public BlockFaceShape getBlockFaceShape(IBlockAccess worldIn, IBlockState state, BlockPos pos, EnumFacing face) { | ||
if (face.getAxis() == EnumFacing.Axis.Y) | ||
{ | ||
return BlockFaceShape.MIDDLE_POLE_THICK; | ||
} | ||
else { | ||
return BlockFaceShape.UNDEFINED; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
src/main/java/com/deeplake/genshin12/entity/projectiles/EntityArrowFixed.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.deeplake.genshin12.entity.projectiles; | ||
|
||
import net.minecraft.block.material.Material; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.enchantment.EnchantmentHelper; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.monster.EntityEnderman; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.entity.player.EntityPlayerMP; | ||
import net.minecraft.entity.projectile.EntityArrow; | ||
import net.minecraft.entity.projectile.EntityTippedArrow; | ||
import net.minecraft.init.Enchantments; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.init.PotionTypes; | ||
import net.minecraft.init.SoundEvents; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.network.play.server.SPacketChangeGameState; | ||
import net.minecraft.potion.PotionUtils; | ||
import net.minecraft.util.DamageSource; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.MathHelper; | ||
import net.minecraft.util.math.RayTraceResult; | ||
import net.minecraft.world.World; | ||
|
||
public class EntityArrowFixed extends EntityTippedArrow { | ||
public EntityArrowFixed(World worldIn) { | ||
super(worldIn); | ||
} | ||
|
||
public EntityArrowFixed(World worldIn, double x, double y, double z) | ||
{ | ||
super(worldIn, x, y, z); | ||
} | ||
|
||
public EntityArrowFixed(World worldIn, EntityLivingBase shooter) | ||
{ | ||
super(worldIn, shooter); | ||
} | ||
|
||
|
||
/** | ||
* Called when the arrow hits a block or an entity | ||
* Makes the damage unrelated to speed. | ||
*/ | ||
protected void onHit(RayTraceResult raytraceResultIn) | ||
{ | ||
float f = MathHelper.sqrt(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); | ||
if (f != 0) | ||
{ | ||
this.setDamage(this.getDamage()/f); | ||
} | ||
|
||
super.onHit(raytraceResultIn); | ||
} | ||
|
||
public void setEnchantmentEffectsFromEntity(EntityLivingBase p_190547_1_, float p_190547_2_) | ||
{ | ||
int i = EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.POWER, p_190547_1_); | ||
int j = EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.PUNCH, p_190547_1_); | ||
this.setDamage(getDamage() + this.rand.nextGaussian() * 0.25D + (double)((float)this.world.getDifficulty().getDifficultyId() * 0.11F)); | ||
|
||
if (i > 0) | ||
{ | ||
this.setDamage(this.getDamage() + (double)i * 0.5D + 0.5D); | ||
} | ||
|
||
if (j > 0) | ||
{ | ||
this.setKnockbackStrength(j); | ||
} | ||
|
||
if (EnchantmentHelper.getMaxEnchantmentLevel(Enchantments.FLAME, p_190547_1_) > 0) | ||
{ | ||
this.setFire(100); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.