Permalink
Browse files

Merge pull request #37 from Hypeirochus/dev

Stun baton added.
  • Loading branch information...
Ri5ux committed Oct 20, 2017
2 parents 8552d17 + 6a1cd1b commit 8394de20a46b5496b58ebf3c76b62e74fcf8ffee
@@ -66,6 +66,7 @@
import org.avp.item.ItemShuriken;
import org.avp.item.ItemSpear;
import org.avp.item.ItemStorageDevice;
import org.avp.item.ItemStunBaton;
import org.avp.item.ItemSupplyChute;
import org.avp.item.ItemSupplyChute.SupplyChuteType;
import org.avp.item.ItemWristbracer;
@@ -84,6 +85,7 @@
import net.minecraft.item.ItemHoe;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemSword;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
public class ItemHandler extends ItemRegistrationHandler<AliensVsPredator>
@@ -116,6 +118,7 @@
public Item itemSpear = new ItemSpear(AliensVsPredator.materials().tools().celtic);
public Item itemWristbracer = new ItemWristbracer().setMaxStackSize(1);
public Item itemWristbracerBlades = new HookedItem().setMaxStackSize(1).setMaxDamage(AliensVsPredator.materials().tools().celtic.getMaxUses());
public Item itemStunBaton = new ItemStunBaton(ToolMaterial.DIAMOND);
public Item itemPlasmaCannon = new ItemPlasmaCannon().setFull3D();
public Item itemProximityMine = new ItemLaserMine();
public Item itemDisc = new ItemDisc();
@@ -398,6 +401,7 @@ public void pre(FMLPreInitializationEvent event)
register("apc", itemAPC).setCreativeTab(AliensVsPredator.tabMain());
register("motiontracker", itemMotionTracker).setCreativeTab(AliensVsPredator.tabMain());
register("wristbracer.blades", itemWristbracerBlades).setCreativeTab(AliensVsPredator.tabMain());
register("stun.baton", itemStunBaton).setCreativeTab(AliensVsPredator.tabMain());
register("polycarbonate", itemPolycarbonate).setCreativeTab(AliensVsPredator.tabRecipeItems());
register("royaljelly", itemRoyalJelly).setCreativeTab(AliensVsPredator.tabMain());
register("blackgoo.item", itemBlackGoo).setCreativeTab(AliensVsPredator.tabMain());
@@ -101,6 +101,7 @@
import org.avp.client.render.items.RenderItemSolarPanel;
import org.avp.client.render.items.RenderItemSpear;
import org.avp.client.render.items.RenderItemStasisMechanism;
import org.avp.client.render.items.RenderItemStunBaton;
import org.avp.client.render.items.RenderItemSummoner;
import org.avp.client.render.items.RenderItemSupplyChute;
import org.avp.client.render.items.RenderItemSupplyCrate;
@@ -439,6 +440,7 @@ private void registerItemRenderers(ItemHandler items)
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().medpod), new RenderItemMedpod());
Renderers.registerItemRenderer(Item.getItemFromBlock(AliensVsPredator.blocks().satelliteDish), new RenderItemSatelliteDish());
Renderers.registerItemRenderer(items.itemWristbracer, new RenderItemWristbracer());
Renderers.registerItemRenderer(items.itemStunBaton, new RenderItemStunBaton());
Renderers.registerItemRenderer(items.itemWristbracerBlades, new RenderItemWristbracerBlades());
Renderers.registerItemRenderer(items.itemPlasmaCannon, new RenderItemPlasmaCannon());
Renderers.registerItemRenderer(items.itemSpear, new RenderItemSpear());
@@ -58,6 +58,7 @@
import org.avp.client.model.items.ModelPlasmaCannon;
import org.avp.client.model.items.ModelSevastopolFlamethrower;
import org.avp.client.model.items.ModelSniper;
import org.avp.client.model.items.ModelStunBaton;
import org.avp.client.model.items.ModelWristBlade;
import org.avp.client.model.tile.ModelAmpule;
import org.avp.client.model.tile.ModelBlastdoor;
@@ -122,6 +123,7 @@ public Models models()
public final TexturedModel<ModelBullet> BULLET = new TexturedModel(new ModelBullet(), new Texture(AliensVsPredator.Properties.ID, "textures/misc/renderbullet.png"));
public final TexturedModel<ModelSpear> SPEAR = new TexturedModel(new ModelSpear(), new Texture(AliensVsPredator.Properties.ID, "textures/misc/renderspear.png"));
public final TexturedModel<ModelWristBlade> WRISTBLADES = new TexturedModel(new ModelWristBlade(), new Texture(AliensVsPredator.Properties.ID, "textures/items/models/wristblade.png"));
public final TexturedModel<ModelStunBaton> STUNBATON = new TexturedModel(new ModelStunBaton(), new Texture(AliensVsPredator.Properties.ID, "textures/items/models/stunbaton.png"));
public final TexturedModel<ModelPlasmaCannon> PLASMACANNON = new TexturedModel(new ModelPlasmaCannon(), new Texture(AliensVsPredator.Properties.ID, "textures/items/models/plasmacannon.png"));
public final TexturedModel<ModelM240ICU> M240ICU = new TexturedModel(new ModelM240ICU(), new Texture(AliensVsPredator.Properties.ID, "textures/items/models/m240icu.png"));
public final TexturedModel<ModelM41A> M41A = new TexturedModel(new ModelM41A(), new Texture(AliensVsPredator.Properties.ID, "textures/items/models/pulserifle.png"));
@@ -0,0 +1,164 @@
package org.avp.client.model.items;
import com.arisux.mdx.lib.client.Model;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
/**
* stunBaton - cybercat5555
* Created using Tabula 5.1.0
*/
public class ModelStunBaton extends Model {
public ModelRenderer centralRod;
public ModelRenderer grip;
public ModelRenderer rodTip;
public ModelRenderer rodCone01;
public ModelRenderer rodCone02;
public ModelRenderer rodCone03;
public ModelRenderer coilBase;
public ModelRenderer handGuard;
public ModelRenderer handGuardU;
public ModelRenderer lateralRod010;
public ModelRenderer lateralRod020;
public ModelRenderer coil01;
public ModelRenderer coil02;
public ModelRenderer coil03;
public ModelRenderer coil04;
public ModelRenderer coil05;
public ModelRenderer coil06;
public ModelRenderer coil07;
public ModelRenderer coil08;
public ModelRenderer handGuardLower;
public ModelRenderer handGuardLowerU;
public ModelRenderer lateralRod01A;
public ModelRenderer lateralRod01B;
public ModelRenderer lateralRod01C;
public ModelRenderer lateralRod02A;
public ModelRenderer lateralRod02B;
public ModelRenderer lateralRod02C;
//TODO: Something appears to be goin wrong with the renderin of this model, duplicates one of the handles
public ModelStunBaton() {
this.textureWidth = 64;
this.textureHeight = 32;
this.coil06 = new ModelRenderer(this, 25, 5);
this.coil06.setRotationPoint(0.0F, -0.9F, 0.0F);
this.coil06.addBox(-1.5F, 0.0F, -1.4F, 3, 0, 3, 0.0F);
this.grip = new ModelRenderer(this, 7, 0);
this.grip.setRotationPoint(0.0F, 0.0F, 0.0F);
this.grip.addBox(-0.5F, 0.0F, -0.5F, 1, 5, 1, 0.0F);
this.coil04 = new ModelRenderer(this, 25, 5);
this.coil04.setRotationPoint(0.0F, -1.1F, 0.0F);
this.coil04.addBox(-1.5F, 0.0F, -1.4F, 3, 0, 3, 0.0F);
this.rodCone02 = new ModelRenderer(this, 28, 12);
this.rodCone02.setRotationPoint(0.0F, -10.85F, 0.0F);
this.rodCone02.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, 0.0F);
this.coil02 = new ModelRenderer(this, 25, 5);
this.coil02.setRotationPoint(0.0F, -1.3F, 0.0F);
this.coil02.addBox(-1.5F, 0.0F, -1.4F, 3, 0, 3, 0.0F);
this.lateralRod01B = new ModelRenderer(this, 22, 3);
this.lateralRod01B.setRotationPoint(-1.8F, 0.2F, 0.0F);
this.lateralRod01B.addBox(-0.5F, -0.5F, -0.5F, 1, 12, 1, 0.0F);
this.setRotation(lateralRod01B, 0.0F, 0.0F, 0.5462880558742251F);
this.rodCone01 = new ModelRenderer(this, 28, 9);
this.rodCone01.setRotationPoint(0.0F, -10.65F, 0.0F);
this.rodCone01.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, 0.0F);
this.handGuardLowerU = new ModelRenderer(this, 7, 13);
this.handGuardLowerU.setRotationPoint(0.0F, 13.1F, 0.1F);
this.handGuardLowerU.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, 0.0F);
this.lateralRod020 = new ModelRenderer(this, 0, 0);
this.lateralRod020.setRotationPoint(0.0F, -7.9F, -0.1F);
this.lateralRod020.addBox(-0.5F, 0.0F, -0.5F, 1, 0, 1, 0.0F);
this.setRotation(lateralRod020, 0.0F, -1.5707963267948966F, 0.0F);
this.coil01 = new ModelRenderer(this, 25, 5);
this.coil01.setRotationPoint(0.0F, -1.4F, 0.0F);
this.coil01.addBox(-1.5F, 0.0F, -1.4F, 3, 0, 3, 0.0F);
this.lateralRod01A = new ModelRenderer(this, 15, 0);
this.lateralRod01A.setRotationPoint(-0.1F, 0.0F, 0.0F);
this.lateralRod01A.addBox(-1.9F, -0.5F, -0.49F, 2, 1, 1, 0.0F);
this.setRotation(lateralRod01A, 0.0F, 0.0F, -0.5462880558742251F);
this.centralRod = new ModelRenderer(this, 0, 0);
this.centralRod.setRotationPoint(0.0F, 0.0F, 0.0F);
this.centralRod.addBox(-0.5F, -9.0F, -0.5F, 1, 9, 1, 0.0F);
this.lateralRod010 = new ModelRenderer(this, 0, 0);
this.lateralRod010.setRotationPoint(-0.1F, -6.9F, 0.0F);
this.lateralRod010.addBox(-0.5F, 0.0F, -0.5F, 1, 0, 1, 0.0F);
this.handGuard = new ModelRenderer(this, 7, 7);
this.handGuard.setRotationPoint(0.0F, 0.0F, 0.0F);
this.handGuard.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, 0.0F);
this.handGuardLower = new ModelRenderer(this, 7, 7);
this.handGuardLower.setRotationPoint(0.0F, 10.5F, 0.0F);
this.handGuardLower.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, 0.0F);
this.coil03 = new ModelRenderer(this, 25, 5);
this.coil03.setRotationPoint(0.0F, -1.2F, 0.0F);
this.coil03.addBox(-1.5F, 0.0F, -1.4F, 3, 0, 3, 0.0F);
this.lateralRod02C = new ModelRenderer(this, 15, 0);
this.lateralRod02C.setRotationPoint(-0.2F, 11.1F, 0.0F);
this.lateralRod02C.addBox(0.0F, -0.5F, -0.5F, 2, 1, 1, 0.0F);
this.setRotation(lateralRod02C, 0.0F, 0.0F, 0.5462880558742251F);
this.handGuardU = new ModelRenderer(this, 7, 10);
this.handGuardU.setRotationPoint(0.0F, 0.0F, -0.4F);
this.handGuardU.addBox(-0.5F, -0.5F, -0.6F, 1, 1, 1, 0.0F);
this.coilBase = new ModelRenderer(this, 28, 9);
this.coilBase.setRotationPoint(0.0F, -9.65F, 0.0F);
this.coilBase.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, 0.0F);
this.lateralRod01C = new ModelRenderer(this, 15, 0);
this.lateralRod01C.setRotationPoint(-0.2F, 11.1F, 0.0F);
this.lateralRod01C.addBox(0.0F, -0.5F, -0.49F, 2, 1, 1, 0.0F);
this.setRotation(lateralRod01C, 0.0F, 0.0F, 0.5462880558742251F);
this.lateralRod02B = new ModelRenderer(this, 16, 3);
this.lateralRod02B.setRotationPoint(-1.8F, 0.2F, 0.0F);
this.lateralRod02B.addBox(-0.5F, -0.5F, -0.5F, 1, 12, 1, 0.0F);
this.setRotation(lateralRod02B, 0.0F, 0.0F, 0.5462880558742251F);
this.rodTip = new ModelRenderer(this, 28, 0);
this.rodTip.setRotationPoint(0.0F, -9.1F, 0.0F);
this.rodTip.addBox(-0.5F, -2.6F, -0.5F, 1, 3, 1, 0.0F);
this.coil05 = new ModelRenderer(this, 25, 5);
this.coil05.setRotationPoint(0.0F, -1.0F, 0.0F);
this.coil05.addBox(-1.5F, 0.0F, -1.4F, 3, 0, 3, 0.0F);
this.lateralRod02A = new ModelRenderer(this, 15, 0);
this.lateralRod02A.setRotationPoint(-0.1F, 0.0F, 0.0F);
this.lateralRod02A.addBox(-1.9F, -0.5F, -0.5F, 2, 1, 1, 0.0F);
this.setRotation(lateralRod02A, 0.0F, 0.0F, -0.5462880558742251F);
this.coil07 = new ModelRenderer(this, 25, 5);
this.coil07.setRotationPoint(0.0F, -0.8F, 0.0F);
this.coil07.addBox(-1.5F, 0.0F, -1.4F, 3, 0, 3, 0.0F);
this.rodCone03 = new ModelRenderer(this, 28, 15);
this.rodCone03.setRotationPoint(0.0F, -11.05F, 0.0F);
this.rodCone03.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1, 0.0F);
this.coil08 = new ModelRenderer(this, 25, 5);
this.coil08.setRotationPoint(0.0F, -0.7F, 0.0F);
this.coil08.addBox(-1.5F, 0.0F, -1.4F, 3, 0, 3, 0.0F);
this.rodTip.addChild(this.coil06);
this.rodTip.addChild(this.coil04);
this.rodTip.addChild(this.coil02);
this.lateralRod01A.addChild(this.lateralRod01B);
this.handGuardU.addChild(this.handGuardLowerU);
this.rodTip.addChild(this.coil01);
this.lateralRod010.addChild(this.lateralRod01A);
this.handGuard.addChild(this.handGuardLower);
this.rodTip.addChild(this.coil03);
this.lateralRod02B.addChild(this.lateralRod02C);
this.lateralRod01B.addChild(this.lateralRod01C);
this.lateralRod02A.addChild(this.lateralRod02B);
this.rodTip.addChild(this.coil05);
this.lateralRod020.addChild(this.lateralRod02A);
this.rodTip.addChild(this.coil07);
this.rodTip.addChild(this.coil08);
}
@Override
public void render(Object obj)
{
draw(rodTip);
draw(handGuardU);
draw(lateralRod010);
draw(lateralRod020);
draw(lateralRod01A);
draw(lateralRod01B);
draw(lateralRod02A);
draw(lateralRod02B);
}
}
@@ -0,0 +1,71 @@
package org.avp.client.render.items;
import org.avp.AliensVsPredator;
import org.avp.URLs;
import org.avp.client.model.items.ModelStunBaton;
import org.lwjgl.input.Mouse;
import com.arisux.mdx.lib.client.Model;
import com.arisux.mdx.lib.client.render.ItemRenderer;
import com.arisux.mdx.lib.client.render.OpenGL;
import com.arisux.mdx.lib.client.render.Texture;
import com.arisux.mdx.lib.game.Game;
import com.arisux.mdx.lib.util.Remote;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
public class RenderItemStunBaton extends ItemRenderer<ModelStunBaton>
{
public RenderItemStunBaton()
{
super(AliensVsPredator.resources().models().STUNBATON);
}
//TODO: Once the stun baton model part duplication issue is fixed, adjusted these
@Override
public void renderThirdPersonRight(ItemStack itemstack, EntityLivingBase entity, TransformType cameraTransformType)
{
float glScale = 0.75F;
OpenGL.scale(glScale, glScale, glScale);
OpenGL.translate(0F, 0.3F, 0.2F);
OpenGL.rotate(-180.0F, 1.0F, 0.0F, 1.0F);
this.getModel().draw();
AliensVsPredator.resources().models().STUNBATON.draw();
}
@Override
public void renderFirstPersonRight(ItemStack itemstack, EntityLivingBase entity, TransformType cameraTransformType)
{
float glScale = 0.5F;
OpenGL.scale(glScale, glScale, glScale);
OpenGL.translate(0F, 0.3F, 0.2F);
OpenGL.rotate(-180.0F, 1.0F, 0.3F, -0.2F);
GlStateManager.disableCull();
this.getModel().draw();
AliensVsPredator.resources().models().STUNBATON.draw();
}
@Override
public void renderInInventory(ItemStack itemstack, EntityLivingBase entity, TransformType cameraTransformType)
{
float glScale = 0.75F;
OpenGL.scale(glScale, glScale, glScale);
OpenGL.translate(0.7F, 0.5F, 0F);
OpenGL.rotate(230F, 1F, 0F, 0F);
OpenGL.rotate(45F, 0F, 0F, 1F);
OpenGL.rotate(90F, 0.0F, 1.0F, 0.0F);
this.getModel().draw();
AliensVsPredator.resources().models().STUNBATON.draw();
}
@Override
public void renderInWorld(ItemStack itemstack, EntityLivingBase entity, TransformType cameraTransformType)
{
GlStateManager.disableCull();
this.getModel().draw();
AliensVsPredator.resources().models().STUNBATON.draw();
}
}
@@ -0,0 +1,39 @@
package org.avp.item;
import org.avp.AliensVsPredator;
import org.avp.entities.EntitySpear;
import com.arisux.mdx.lib.client.entityfx.EntityFXElectricArc;
import com.arisux.mdx.lib.game.Game;
import com.arisux.mdx.lib.game.GameSounds;
import com.arisux.mdx.lib.world.entity.player.inventory.Inventories;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
public class ItemStunBaton extends ItemSword
{
//TODO: Fix this, the ToolMaterial passed into this constructor is DIAMOND, didnt know what custom material to put, n dont wanna make a new one that might not be what u guys want
public ItemStunBaton(ToolMaterial material)
{
super(material);
//TODO: Find out if this is a proper max damage. Remove this if a damage is specified later by a custom material
this.setMaxDamage(120);
this.maxStackSize = 1;
}
//TODO: adjust these particles once MDX 2.0.0.25 is added to the dev environment
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
{
Game.minecraft().effectRenderer.addEffect(new EntityFXElectricArc(player.world, entity.posX, entity.posY, entity.posZ, entity.posX, entity.posY + 1, entity.posZ, 1, 1F, 1F, 1F, 0xFF00CCFF));
return super.onLeftClickEntity(stack, player, entity);
}
}

0 comments on commit 8394de2

Please sign in to comment.