Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TaoismDeepLake committed May 12, 2022
2 parents bff90be + e564b44 commit 0542954
Show file tree
Hide file tree
Showing 38 changed files with 319 additions and 94 deletions.
14 changes: 7 additions & 7 deletions GenBlockJson.lua
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ end
--GenItem("weapon", "fire_club");


--GenBlock("artifact_ore");
GenBlock("zl_pillar_deco");

-- GenItem("misc", "nano_mender_greater");
-- GenItem("misc", "package_fade_armor_diamond");
for i = 0,8 do
GenItem("misc", "attr_report_"..i);
end
for i = 0,8 do
GenItem("misc", "weapon_stone_"..i);
end
-- for i = 0,8 do
-- GenItem("misc", "attr_report_"..i);
-- end
-- for i = 0,8 do
-- GenItem("misc", "weapon_stone_"..i);
-- end

-- for i = 1,4 do
-- GenItem("misc", "mor_armor_"..i);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/deeplake/genshin12/blocks/ModBlocks.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.deeplake.genshin12.blocks;

import com.deeplake.genshin12.blocks.blockMisc.BlockZhongliPillar;
import com.deeplake.genshin12.blocks.blockMisc.BlockZhongliPillarDeco;
import com.deeplake.genshin12.blocks.ore.BlockOreArtifact;
import com.deeplake.genshin12.init.ModCreativeTab;
import com.deeplake.genshin12.item.ModItems;
Expand All @@ -27,6 +28,7 @@ public class ModBlocks {


public static final Block ZL_PILLAR = new BlockZhongliPillar("zl_pillar", Material.ROCK).setCreativeTab(ModCreativeTab.IDL_MISC).setHardness(20f);
public static final Block ZL_PILLAR_DECO = new BlockZhongliPillarDeco("zl_pillar_deco", Material.ROCK).setCreativeTab(ModCreativeTab.IDL_MISC).setHardness(20f);

public static final BlockOreBase COR_LAPIS_ORE = (BlockOreBase) new BlockOreBase("cor_lapis_ore").setHardness(10f);
public static final Block COR_LAPIS_BLOCK = new BlockOreBase("cor_lapis_block").setHardness(80f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,11 @@

import javax.annotation.Nullable;

public class BlockZhongliPillar extends BlockBase implements ITileEntityProvider {

static final float UNIT = 0.31f;
public static final AxisAlignedBB AABB_Y = new AxisAlignedBB(UNIT, 0, UNIT, 1-UNIT, 1, 1-UNIT);
public class BlockZhongliPillar extends BlockZhongliPillarDeco implements ITileEntityProvider {

public BlockZhongliPillar(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;
}

@Nullable
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
Expand Down
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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ public void update() {
{
resonate();
}

//when under block is broken
IBlockState state = world.getBlockState(pos.down());
if (!state.getMaterial().isSolid())
{
destroy();
}
}

void destroy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,12 @@ public static void onDrop(LivingDropsEvent event)
{
for (EntityItem item :
oriList) {
EntityItem copy = new EntityItem(item.world, item.posX, item.posY, item.posZ, item.getItem());
item.world.spawnEntity(copy);
totalList.add(copy);
if (item.getItem().getMaxStackSize() > 1)
{
EntityItem copy = new EntityItem(item.world, item.posX, item.posY, item.posZ, item.getItem());
item.world.spawnEntity(copy);
totalList.add(copy);
}
}
level -= dropFactor;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.deeplake.genshin12.Idealland;
import com.deeplake.genshin12.entity.creatures.mob.EntityHilichurl;
import com.deeplake.genshin12.entity.projectiles.EntityArrowFixed;
import com.deeplake.genshin12.entity.special.EntityEnergyOrb;
import com.deeplake.genshin12.init.ModConfig;
import com.deeplake.genshin12.util.Reference;
Expand All @@ -21,6 +22,7 @@ public static void registerEntities()
registerEntityNoEgg("planet_befall", EntityPlanetBefall.class);
registerEntityNoEgg("energy_orb", EntityEnergyOrb.class);
registerEntityNoEgg("glacial_waltz", EntityGlacialWaltz.class);
registerEntityNoEgg("fixed_arrow", EntityArrowFixed.class);
if (ModConfig.DEBUG_CONF.DEBUG_MODE)
{
registerEntity("test_boss", EntityTestBoss.class,0xff00ff, 0x000033);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ public void setAttr(double sight, double speed, double attack, double armor, dou
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(attack * modifier);
this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(armor * modifier);
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(hp * modifier);
setHealth(getMaxHealth());
if (is_pinned_on_ground) {
this.getEntityAttribute(SharedMonsterAttributes.KNOCKBACK_RESISTANCE).setBaseValue(2.0f);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@Mod.EventBusSubscriber(modid = Idealland.MODID)
public class EventsAttrCrit {

//only used in EntityPlayer::attackTargetEntityWithCurrentItem
@SubscribeEvent
public static void onCritCheck(CriticalHitEvent event)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public static class HiliEntry extends WeightedRandom.Item
{
public final EnumHiliType content;

public HiliEntry(EnumHiliType biome, int weight)
public HiliEntry(EnumHiliType hiliType, int weight)
{
super(weight);

this.content = biome;
this.content = hiliType;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.deeplake.genshin12.entity.creatures.EntityGeneralMob;
import com.deeplake.genshin12.entity.creatures.ai.EntityAIStrafeRangedAttack;
//import com.deeplake.genshin12.entity.projectiles.EntityMoroonBullet;
import com.deeplake.genshin12.entity.projectiles.EntityArrowFixed;
import com.deeplake.genshin12.entity.projectiles.EntityIdlProjectile;
import com.deeplake.genshin12.entity.projectiles.ProjectileArgs;
//import com.deeplake.genshin12.item.weapon.ItemPistolBase;
Expand Down Expand Up @@ -34,6 +35,7 @@ public class EntityMobRanged extends EntityGeneralMob implements IRangedAttackMo
private float bulletAccel = 0.1f;
private float errorModifier = 0.2f;
public boolean useBulletForRanged = true;
public boolean useFixedArrow = true;//damage unrelated to speed.

public EntityMobRanged(World worldIn) {
super(worldIn);
Expand Down Expand Up @@ -195,7 +197,11 @@ protected EntityArrow getArrow(float p_190726_1_) {
entityspectralarrow.setEnchantmentEffectsFromEntity(this, p_190726_1_);
return entityspectralarrow;
} else {
EntityTippedArrow entityarrow = new EntityTippedArrow(this.world, this);
EntityArrowFixed entityarrow = new EntityArrowFixed(this.world, this);
if (useFixedArrow)
{
entityarrow.setDamage(EntityUtil.getAttack(this));
}
entityarrow.setEnchantmentEffectsFromEntity(this, p_190726_1_);

if (itemstack.getItem() == Items.TIPPED_ARROW) {
Expand Down
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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void onUpdate()
++this.xpColor;
++this.xpOrbAge;

if (this.xpOrbAge >= 6000)
if (this.xpOrbAge >= CommonDef.TICK_PER_SECOND * 15)
{
this.setDead();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.deeplake.genshin12.events;

import com.deeplake.genshin12.Idealland;
import com.deeplake.genshin12.init.ModConfig;
import com.deeplake.genshin12.item.ModItems;
import com.deeplake.genshin12.util.CommonFunctions;
Expand All @@ -9,8 +10,10 @@
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.AdvancementEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@Mod.EventBusSubscriber(modid = Idealland.MODID)
public class EventsAdvancements {
@SubscribeEvent
public static void onAdv(AdvancementEvent event)
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/deeplake/genshin12/init/ModConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public static class GeneralConf {
@Config.LangKey("genshin12.conf.general.safe_drop")
@Config.Comment("Loot is directly given to players.")
public boolean SAFE_DROP = true;

@Config.LangKey("genshin12.conf.general.swim_disable_skill")
@Config.Comment("Skills can not be cast when submerged.")
public boolean SWIM_DISABLE_SKILL = false;
}

@Config.LangKey("configgui.genshin12.category.Menu0.GachaConf")
Expand Down
Loading

0 comments on commit 0542954

Please sign in to comment.