Skip to content

Commit

Permalink
Renaming class EntityThrowableWeb
Browse files Browse the repository at this point in the history
  • Loading branch information
OldSerpskiStalker committed Oct 20, 2024
1 parent b13b18d commit b62504b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.world.World;
import org.imesense.dynamicspawncontrol.ai.spider.util.attackweb.EntityThrowableWeb;
import org.imesense.dynamicspawncontrol.gameplay.throwingobjects.DSCThrowItemWeb;
import org.imesense.dynamicspawncontrol.debug.CodeGenericUtils;
import org.imesense.dynamicspawncontrol.technical.config.spiderattackweb.DataSpiderAttackWeb;
import org.imesense.dynamicspawncontrol.technical.customlibrary.Log;

/**
*
Expand Down Expand Up @@ -86,7 +85,7 @@ public void updateTask()

if (this.attackTimer >= DataSpiderAttackWeb.ConfigDataSpiderAttackWeb.instance.getSlingCoolDown())
{
EntityThrowableWeb.sling(world, this.parentEntity);
DSCThrowItemWeb.sling(world, this.parentEntity);

double coolDown =
DataSpiderAttackWeb.ConfigDataSpiderAttackWeb.instance.getSlingCoolDown() +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import org.imesense.dynamicspawncontrol.ProjectStructure;
import org.imesense.dynamicspawncontrol.ai.spider.entityaibase.WebAttackTask;
import org.imesense.dynamicspawncontrol.debug.CodeGenericUtils;
import org.imesense.dynamicspawncontrol.gameplay.throwingobjects.DSCThrowItemWeb;
import org.imesense.dynamicspawncontrol.technical.config.spiderattackweb.DataSpiderAttackWeb;
import org.imesense.dynamicspawncontrol.technical.customlibrary.Log;
import org.imesense.dynamicspawncontrol.technical.customlibrary.thing.EntityThingBase;
import org.imesense.dynamicspawncontrol.technical.customlibrary.thing.IThingBase;

Expand Down Expand Up @@ -191,7 +191,7 @@ private static void tryAttack(Entity immediateSource, Entity source, Entity targ
}

BlockPos pos = new BlockPos(target.posX, target.posY, target.posZ);
EntityThrowableWeb.onHit(world, pos, source, target);
DSCThrowItemWeb.onHit(world, pos, source, target);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import org.imesense.dynamicspawncontrol.ai.spider.util.attackweb.EntityThrowableWeb;
import org.imesense.dynamicspawncontrol.gameplay.throwingobjects.DSCThrowItemWeb;
import org.imesense.dynamicspawncontrol.debug.CodeGenericUtils;
import org.imesense.dynamicspawncontrol.technical.customlibrary.ObjectHandler;

Expand Down Expand Up @@ -51,7 +51,7 @@ public ActionResult<ItemStack> onItemRightClick(@Nonnull World worldIn, EntityPl
itemstack.shrink(1);
}

EntityThrowableWeb.sling(worldIn, playerIn);
DSCThrowItemWeb.sling(worldIn, playerIn);
playerIn.addStat(Objects.requireNonNull(StatList.getObjectUseStats(this)));

return new ActionResult<>(EnumActionResult.SUCCESS, itemstack);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.imesense.dynamicspawncontrol.ai.spider.util.attackweb;
package org.imesense.dynamicspawncontrol.gameplay.throwingobjects;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
Expand All @@ -13,19 +13,16 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.imesense.dynamicspawncontrol.DynamicSpawnControl;
import org.imesense.dynamicspawncontrol.debug.CodeGenericUtils;
import org.imesense.dynamicspawncontrol.technical.config.spiderattackweb.DataSpiderAttackWeb;
import org.imesense.dynamicspawncontrol.technical.customlibrary.Log;
import org.imesense.dynamicspawncontrol.technical.customlibrary.ObjectHandler;
import org.imesense.dynamicspawncontrol.technical.network.PlayerInWebMessage;

/**
*
*/
public final class EntityThrowableWeb extends EntityThrowable
public final class DSCThrowItemWeb extends EntityThrowable
{
/**
*
Expand All @@ -36,7 +33,7 @@ public final class EntityThrowableWeb extends EntityThrowable
*
* @param worldIn
*/
public EntityThrowableWeb(World worldIn)
public DSCThrowItemWeb(World worldIn)
{
super(worldIn);

Expand All @@ -48,7 +45,7 @@ public EntityThrowableWeb(World worldIn)
* @param worldIn
* @param throwerIn
*/
public EntityThrowableWeb(World worldIn, EntityLivingBase throwerIn)
public DSCThrowItemWeb(World worldIn, EntityLivingBase throwerIn)
{
super(worldIn, throwerIn);

Expand Down Expand Up @@ -112,16 +109,16 @@ protected void onImpact(RayTraceResult result)
* @param entityIn
* @return
*/
public static EntityThrowableWeb sling(World worldIn, EntityLivingBase entityIn)
public static DSCThrowItemWeb sling(World worldIn, EntityLivingBase entityIn)
{
EntityThrowableWeb entity = null;
DSCThrowItemWeb entity = null;
float pitch = 1.0f / (entityIn.getRNG().nextFloat() * 0.4f + 0.8f);

entityIn.playSound(ObjectHandler.WEBBING_SHOOT, 1.0f, pitch);

if (!worldIn.isRemote)
{
entity = new EntityThrowableWeb(worldIn, entityIn);
entity = new DSCThrowItemWeb(worldIn, entityIn);
Float inaccuracy = DataSpiderAttackWeb.ConfigDataSpiderAttackWeb.instance.getSlingInaccuracy();
entity.shoot(entityIn, entityIn.rotationPitch, entityIn.rotationYaw, 0.0f, 1.1f, inaccuracy);
worldIn.spawnEntity(entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.registries.IForgeRegistry;
import org.imesense.dynamicspawncontrol.ProjectStructure;
import org.imesense.dynamicspawncontrol.ai.spider.util.attackweb.EntityThrowableWeb;
import org.imesense.dynamicspawncontrol.gameplay.throwingobjects.DSCThrowItemWeb;
import org.imesense.dynamicspawncontrol.debug.CodeGenericUtils;
import org.imesense.dynamicspawncontrol.gameplay.items.DSCWeb;
import org.imesense.dynamicspawncontrol.technical.customlibrary.registrationhelpers.RegistrationHelpers;
Expand Down Expand Up @@ -89,7 +89,7 @@ public static void registerRenders(ModelRegistryEvent event)
{
registerRender(ObjectHandler.webbing);

RenderingRegistry.registerEntityRenderingHandler(EntityThrowableWeb.class, (manager) ->
RenderingRegistry.registerEntityRenderingHandler(DSCThrowItemWeb.class, (manager) ->
new RenderSnowball<>(manager, ObjectHandler.webbing, Minecraft.getMinecraft().getRenderItem()));
}

Expand All @@ -110,7 +110,7 @@ public static void entityRegistration(Register<EntityEntry> event)
protected static void registerEntity(IForgeRegistry<EntityEntry> registry)
{
EntityEntry entry =
EntityEntryBuilder.create().entity(EntityThrowableWeb.class).id(
EntityEntryBuilder.create().entity(DSCThrowItemWeb.class).id(
new ResourceLocation("dynamicspawncontrol", "webbing"),
ObjectHandler.entityID++).name("webbing").tracker(64, 10, true).build();

Expand Down

0 comments on commit b62504b

Please sign in to comment.