This repository has been archived by the owner on May 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'encyclopedia', remove Yttric Steel, add Blunderbuss, new textures
- Loading branch information
Aesen Vismea
committed
Mar 6, 2015
1 parent
87aa78a
commit debf6e2
Showing
20 changed files
with
244 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.gameminers.farrago; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
|
||
import org.lwjgl.input.Keyboard; | ||
|
||
import com.gameminers.farrago.kahur.KahurIota; | ||
import com.google.common.collect.Maps; | ||
|
||
|
||
public class Encyclopedia { | ||
private static final Map<Item, String> descriptions = Maps.newHashMap(); | ||
public static void init() { | ||
descriptions.put(KahurIota.KAHUR, "A strange weapon that uses everyday items as ammunition. The more complex they are, the more damage they do."); | ||
descriptions.put(FarragoMod.RUBBLE, "Leftover trash from scrapping an object. Can be used as fuel in a furnace, but it will only last until all flammable material is burnt."); | ||
descriptions.put(FarragoMod.VIVID_ORB, "This orb is capable of storing the very essence of a color."); | ||
descriptions.put(Item.getItemFromBlock(FarragoMod.COMBUSTOR), "This machine uses gunpowder or TNT as an alternate, and very fast, way to smelt items."); | ||
descriptions.put(Item.getItemFromBlock(FarragoMod.SCRAPPER), "This machine can break down items and blocks into what was used to craft them. It can only recover metals and gems, however."); | ||
descriptions.put(Item.getItemFromBlock(FarragoMod.NETHER_STAR_BLOCK), "A solid block of Nether Stars. You're either rich or insane."); | ||
descriptions.put(FarragoMod.BLUNDERBUSS, "This somewhat shoddy gun uses gunpowder to detonate cobblestone and fire the shards in the general direction it's pointed in. Good for crowd control."); | ||
} | ||
@SuppressWarnings("unchecked") | ||
public static void process(ItemStack itemStack, EntityPlayer entityPlayer, List<String> toolTip, boolean showAdvancedItemTooltips) { | ||
if (descriptions.containsKey(itemStack.getItem())) { | ||
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { | ||
toolTip.add("\u00A7bInformation"); | ||
String descr = descriptions.get(itemStack.getItem()); | ||
toolTip.addAll(Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(descr, 200)); | ||
} else { | ||
toolTip.add("Hold \u00A7b<Shift> \u00A77for more information"); | ||
} | ||
} | ||
} | ||
|
||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/gameminers/farrago/client/render/ModelNull.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,12 @@ | ||
package com.gameminers.farrago.client.render; | ||
|
||
import net.minecraft.client.model.ModelBase; | ||
|
||
public class ModelNull extends ModelBase { | ||
|
||
public ModelNull(int w, int h) { | ||
textureWidth = w; | ||
textureHeight = h; | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/gameminers/farrago/client/render/RenderBlunderbussProjectile.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,31 @@ | ||
package com.gameminers.farrago.client.render; | ||
|
||
import net.minecraft.client.model.ModelBox; | ||
import net.minecraft.client.model.ModelRenderer; | ||
import net.minecraft.client.renderer.Tessellator; | ||
import net.minecraft.client.renderer.entity.Render; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
import org.lwjgl.opengl.GL11; | ||
|
||
public class RenderBlunderbussProjectile extends Render { | ||
private static final ResourceLocation TEX = new ResourceLocation("textures/blocks/cobblestone.png"); | ||
@Override | ||
public void doRender(Entity projectile, double x, double y, double z, float yaw, float partialTicks) { | ||
GL11.glPushMatrix(); | ||
GL11.glTranslatef((float)x, (float)y, (float)z); | ||
GL11.glScalef(0.25f, 0.25f, 0.25f); | ||
bindEntityTexture(projectile); | ||
Tessellator tess = Tessellator.instance; | ||
ModelBox box = new ModelBox(new ModelRenderer(new ModelNull(16, 16)), 0, 0, 0f, 0f, 0f, 4, 4, 4, 1f); | ||
box.render(tess, 0.0625f); | ||
GL11.glPopMatrix(); | ||
} | ||
|
||
@Override | ||
protected ResourceLocation getEntityTexture(Entity projectile) { | ||
return TEX; | ||
} | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/gameminers/farrago/entity/EntityBlunderbussProjectile.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,50 @@ | ||
package com.gameminers.farrago.entity; | ||
|
||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.entity.projectile.EntityThrowable; | ||
import net.minecraft.util.DamageSource; | ||
import net.minecraft.util.MathHelper; | ||
import net.minecraft.util.MovingObjectPosition; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.WorldServer; | ||
|
||
public class EntityBlunderbussProjectile extends EntityThrowable { | ||
public EntityBlunderbussProjectile(World p_i1773_1_) { | ||
super(p_i1773_1_); | ||
} | ||
|
||
public EntityBlunderbussProjectile(World world, EntityLivingBase shooter) { | ||
super(world, shooter); | ||
this.setSize(0.25F, 0.25F); | ||
this.setLocationAndAngles(shooter.posX, shooter.posY + (double)shooter.getEyeHeight(), shooter.posZ, shooter.rotationYaw, shooter.rotationPitch); | ||
this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); | ||
this.posY -= 0.10000000149011612D; | ||
this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); | ||
this.setPosition(this.posX, this.posY, this.posZ); | ||
this.yOffset = 0.0F; | ||
float f = (rand.nextFloat()*0.8f)+0.2f; | ||
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); | ||
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * f); | ||
this.motionY = (double)(-MathHelper.sin((this.rotationPitch + this.func_70183_g()) / 180.0F * (float)Math.PI) * f); | ||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.func_70182_d(), 25.0F); | ||
} | ||
|
||
public EntityBlunderbussProjectile(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) { | ||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_); | ||
} | ||
|
||
@Override | ||
protected void onImpact(MovingObjectPosition pos) { | ||
setDead(); | ||
if (!worldObj.isRemote) { | ||
if (pos.entityHit != null && pos.entityHit instanceof EntityLivingBase) { | ||
((EntityLivingBase)pos.entityHit).attackEntityFrom(DamageSource.causeMobDamage(getThrower()), (rand.nextFloat()*1f)+0.6f); | ||
((EntityLivingBase)pos.entityHit).hurtResistantTime = 1; | ||
} | ||
if (worldObj instanceof WorldServer) { | ||
((WorldServer)worldObj).func_147487_a("smoke", pos.hitVec.xCoord, pos.hitVec.yCoord, pos.hitVec.zCoord, 1, 0.2f, 0.2f, 0.2f, 0f); | ||
((WorldServer)worldObj).playSoundAtEntity(this, "step.stone", 1.0f, 0.3f); | ||
} | ||
} | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
src/main/java/com/gameminers/farrago/item/ItemBlunderbuss.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,77 @@ | ||
package com.gameminers.farrago.item; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.init.Blocks; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.ChatComponentText; | ||
import net.minecraft.util.DamageSource; | ||
import net.minecraft.world.World; | ||
|
||
import com.gameminers.farrago.FarragoMod; | ||
import com.gameminers.farrago.entity.EntityBlunderbussProjectile; | ||
|
||
public class ItemBlunderbuss extends Item { | ||
public ItemBlunderbuss() { | ||
setUnlocalizedName("blunderbuss"); | ||
setTextureName("farrago:blunderbuss"); | ||
setCreativeTab(FarragoMod.creativeTab); | ||
} | ||
|
||
@Override | ||
public boolean isFull3D() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public int getItemStackLimit() { | ||
return 1; | ||
} | ||
|
||
@Override | ||
public boolean isDamageable() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public int getMaxDamage() { | ||
return 840; | ||
} | ||
|
||
@Override | ||
public ItemStack onItemRightClick(ItemStack gun, World world, EntityPlayer player) { | ||
if (player.inventory.hasItem(Items.gunpowder)) { | ||
if (player.inventory.hasItem(Item.getItemFromBlock(Blocks.cobblestone))) { | ||
if (!world.isRemote) { | ||
if (itemRand.nextInt(4) == 1) { | ||
player.inventory.consumeInventoryItem(Items.gunpowder); | ||
player.inventory.consumeInventoryItem(Item.getItemFromBlock(Blocks.cobblestone)); | ||
} | ||
if (itemRand.nextInt(12) == 1) { | ||
player.attackEntityFrom(DamageSource.causePlayerDamage(player), 2f); | ||
} | ||
player.inventory.consumeInventoryItem(Item.getItemFromBlock(Blocks.cobblestone)); | ||
gun.damageItem(itemRand.nextInt(3)+1, player); | ||
world.playSoundAtEntity(player, "random.break", 1.0F, (itemRand.nextFloat() * 0.8F)); | ||
world.playSoundAtEntity(player, "random.explode", 0.6F, (itemRand.nextFloat() * 0.8F + 0.3F)); | ||
for (int i = 0; i < itemRand.nextInt(30)+15; i++) { | ||
EntityBlunderbussProjectile proj = new EntityBlunderbussProjectile(world, player); | ||
world.spawnEntityInWorld(proj); | ||
} | ||
} | ||
} else { | ||
if (!world.isRemote) { | ||
world.playSoundAtEntity(player, "random.click", 1.0F, 2.0f); | ||
player.addChatMessage(new ChatComponentText("\u00A7cCan't find any cobblestone.")); | ||
} | ||
} | ||
} else { | ||
if (!world.isRemote) { | ||
world.playSoundAtEntity(player, "random.click", 1.0F, 2.0f); | ||
player.addChatMessage(new ChatComponentText("\u00A7cCan't find any gunpowder.")); | ||
} | ||
} | ||
return gun; | ||
} | ||
} |
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
Binary file modified
BIN
-8 Bytes
(98%)
src/main/resources/assets/farrago/textures/blocks/combustor_bottom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+12 Bytes
(100%)
src/main/resources/assets/farrago/textures/blocks/combustor_front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9 Bytes
(100%)
src/main/resources/assets/farrago/textures/blocks/combustor_side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+24 Bytes
(110%)
src/main/resources/assets/farrago/textures/blocks/combustor_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-346 Bytes
src/main/resources/assets/farrago/textures/items/ingot_yttrium_steel.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+329 Bytes
src/main/resources/assets/farrago/textures/items/yttrium_rifle_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+329 Bytes
src/main/resources/assets/farrago/textures/items/yttrium_rifle_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+333 Bytes
src/main/resources/assets/farrago/textures/items/yttrium_rifle_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+336 Bytes
src/main/resources/assets/farrago/textures/items/yttrium_rifle_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+335 Bytes
src/main/resources/assets/farrago/textures/items/yttrium_rifle_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.