mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-27 17:52:57 +00:00
Ability Trap & Hazard Update
This commit is contained in:
1 parent
70ed5a0717
commit
3500b0f55f
13 files changed
+2561
-929
No files matched your search
@@ -91,6 +91,7 @@ import kamkeel.npcs.entity.EntityAbilityDisc;
|
||||
import kamkeel.npcs.entity.EntityAbilityLaser;
|
||||
import kamkeel.npcs.entity.EntityAbilityBeam;
|
||||
import kamkeel.npcs.entity.EntityAbilitySweeper;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone;
|
||||
import noppes.npcs.entity.old.EntityNPCDwarfFemale;
|
||||
import noppes.npcs.entity.old.EntityNPCDwarfMale;
|
||||
import noppes.npcs.entity.old.EntityNPCElfFemale;
|
||||
@@ -292,6 +293,7 @@ public class CustomNpcs {
|
||||
registerNewEntity(EntityAbilityLaser.class, "abilitylaser", 64, 3, true);
|
||||
registerNewEntity(EntityAbilityBeam.class, "abilitybeam", 64, 3, true);
|
||||
registerNewEntity(EntityAbilitySweeper.class, "abilitysweeper", 64, 3, true);
|
||||
registerNewEntity(EntityAbilityZone.class, "abilityzone", 64, 3, true);
|
||||
|
||||
new RecipeController();
|
||||
|
||||
|
||||
@@ -151,12 +151,14 @@ import kamkeel.npcs.client.renderer.RenderAbilityDisc;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityLaser;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityBeam;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilitySweeper;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityZone;
|
||||
import kamkeel.npcs.client.renderer.lightning.LightningHandler;
|
||||
import kamkeel.npcs.entity.EntityAbilityOrb;
|
||||
import kamkeel.npcs.entity.EntityAbilityDisc;
|
||||
import kamkeel.npcs.entity.EntityAbilityLaser;
|
||||
import kamkeel.npcs.entity.EntityAbilityBeam;
|
||||
import kamkeel.npcs.entity.EntityAbilitySweeper;
|
||||
import kamkeel.npcs.entity.EntityAbilityZone;
|
||||
import noppes.npcs.client.renderer.blocks.BlockBannerRenderer;
|
||||
import noppes.npcs.client.renderer.blocks.BlockBarrelRenderer;
|
||||
import noppes.npcs.client.renderer.blocks.BlockBeamRenderer;
|
||||
@@ -270,6 +272,7 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAbilityLaser.class, new RenderAbilityLaser());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAbilityBeam.class, new RenderAbilityBeam());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAbilitySweeper.class, new RenderAbilitySweeper());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAbilityZone.class, new RenderAbilityZone());
|
||||
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityCustomNpc.class, new RenderCustomNpc());
|
||||
|
||||
|
||||
@@ -84,6 +84,10 @@ public class CustomFX extends EntityFX {
|
||||
this.imageData = ClientCacheHandler.getImageData(this.directory);
|
||||
}
|
||||
|
||||
public void setMaxAge(int age) {
|
||||
this.particleMaxAge = age;
|
||||
}
|
||||
|
||||
public static CustomFX fromScriptedParticle(ScriptParticle particle, World worldObj, Entity entity) {
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
if (entity == player) {
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package noppes.npcs.client.fx;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Simple particle for zone visual effects (Trap/Hazard styles).
|
||||
* Uses vanilla particle atlas with color tinting. Fades out over lifetime.
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ZoneParticleFX extends EntityFX {
|
||||
|
||||
private final float startAlpha;
|
||||
private final boolean glow;
|
||||
|
||||
public ZoneParticleFX(World world, double x, double y, double z,
|
||||
double motionX, double motionY, double motionZ,
|
||||
float r, float g, float b, float alpha,
|
||||
float scale, int maxAge, float gravity, boolean glow) {
|
||||
super(world, x, y, z, 0, 0, 0);
|
||||
this.motionX = motionX;
|
||||
this.motionY = motionY;
|
||||
this.motionZ = motionZ;
|
||||
this.particleRed = r;
|
||||
this.particleGreen = g;
|
||||
this.particleBlue = b;
|
||||
this.particleAlpha = alpha;
|
||||
this.startAlpha = alpha;
|
||||
this.particleScale = scale;
|
||||
this.particleMaxAge = maxAge;
|
||||
this.particleGravity = gravity;
|
||||
this.glow = glow;
|
||||
this.noClip = true;
|
||||
this.setParticleTextureIndex(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBrightnessForRender(float partialTick) {
|
||||
return glow ? 0xF000F0 : super.getBrightnessForRender(partialTick);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if (this.particleAge++ >= this.particleMaxAge) {
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
// Linear fade out
|
||||
float lifeRatio = (float) this.particleAge / (float) this.particleMaxAge;
|
||||
this.particleAlpha = this.startAlpha * (1.0f - lifeRatio);
|
||||
|
||||
// Movement
|
||||
this.motionY -= 0.04D * (double) this.particleGravity;
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ public class ImageData {
|
||||
|
||||
public ImageData(String directory) {
|
||||
this.location = new ResourceLocation(directory);
|
||||
if (directory.startsWith("https://")) {
|
||||
if (directory.startsWith("https://") || directory.startsWith("http://")) {
|
||||
this.isUrl = true;
|
||||
TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
|
||||
this.imageDownloadAlt = new ImageDownloadAlt(null, directory, new ResourceLocation("customnpcs:textures/gui/invisible.png"), new ImageBufferDownloadAlt(true, false));
|
||||
|
||||
Reference in new issue
Block a user