mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-11-18 11:29:13 +00:00
added Safety match
This commit is contained in:
1 parent
d1d5f742be
commit
9733da3e31
14 files changed
+210
-8
No files matched your search
+1
-1
@@ -17,7 +17,7 @@ buildscript {
|
||||
|
||||
apply plugin: 'forge'
|
||||
|
||||
version = "1.7.10-v0.9.4-Beta"
|
||||
version = "1.7.10-v0.9.4-Beta-pre1"
|
||||
group= "com.brandon3055.draconicevolution" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "Draconic-Evolution"
|
||||
|
||||
|
||||
@@ -22,18 +22,16 @@ public class BlockDE extends Block {
|
||||
public String getUnlocalizedName()
|
||||
{
|
||||
return String.format("tile.%s%s", References.MODID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
|
||||
//return String.format("tile.%s", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
|
||||
}
|
||||
|
||||
public String getUnwrappedUnlocalizedName(final String unlocalizedName)
|
||||
public String getUnwrappedUnlocalizedName(String unlocalizedName)
|
||||
{
|
||||
|
||||
return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister iconRegister)
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
|
||||
}
|
||||
|
||||
@@ -40,8 +40,9 @@ public class Draconium extends BlockDE {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (int i = 0; i < 3; i++) {
|
||||
icons[i] = iconRegister.registerIcon(References.RESOURCESPREFIX + "draconium_block_" + i);
|
||||
}
|
||||
blockIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + "draconium_block_blank");
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ public class ModBlocks {
|
||||
public static BlockDE invisibleMultiblock;
|
||||
public static BlockDE energyPylon;
|
||||
public static BlockDE placedItem;
|
||||
public static Block safetyFlame;
|
||||
|
||||
public static void init()
|
||||
{
|
||||
@@ -55,6 +56,7 @@ public class ModBlocks {
|
||||
invisibleMultiblock = new InvisibleMultiblock();
|
||||
energyPylon = new EnergyPylon();
|
||||
placedItem = new PlacedItem();
|
||||
safetyFlame = new SafetyFlame();
|
||||
if(ConfigHandler.disable_LRD < 2) longRangeDislocator = new LongRangeDislocator();
|
||||
|
||||
if(DraconicEvolution.debug) testBlock = new TestBlock();
|
||||
@@ -85,4 +87,10 @@ public class ModBlocks {
|
||||
String name = block.getUnwrappedUnlocalizedName(block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(block, item, name.substring(name.indexOf(":") + 1));
|
||||
}
|
||||
|
||||
public static void registerOther(Block block)
|
||||
{
|
||||
String name = block.getUnlocalizedName().substring(block.getUnlocalizedName().indexOf(".") + 1);
|
||||
GameRegistry.registerBlock(block, name.substring(name.indexOf(":") + 1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.brandon3055.draconicevolution.common.blocks;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import net.minecraft.block.BlockFire;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 23/08/2014.
|
||||
*/
|
||||
public class SafetyFlame extends BlockFire{
|
||||
public SafetyFlame(){
|
||||
super();
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabBlocksItems);
|
||||
this.setBlockName(Strings.safetyFlameName);
|
||||
this.setBlockTextureName("fire");
|
||||
this.setLightLevel(1F);
|
||||
ModBlocks.registerOther(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName()
|
||||
{
|
||||
return String.format("tile.%s%s", References.MODID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
|
||||
}
|
||||
|
||||
public String getUnwrappedUnlocalizedName(String unlocalizedName)
|
||||
{
|
||||
return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChange(IBlockAccess world, int x, int y, int z, int tileX, int tileY, int tileZ) {
|
||||
super.onNeighborChange(world, x, y, z, tileX, tileY, tileZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_) {
|
||||
super.onBlockAdded(p_149726_1_, p_149726_2_, p_149726_3_, p_149726_4_);
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -59,7 +59,9 @@ public class CraftingHandler {
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.dragonHeart), " C ", "CEC", " C ", 'C', ModItems.infusedCompound, 'I', Blocks.dragon_egg);
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconiumBlend), " D ", "DID", " D ", 'I', Items.iron_ingot, 'D', ModItems.draconiumDust);
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.draconicCompound, 2), " C ", "CHC", " C ", 'C', ModItems.infusedCompound, 'H', ModItems.dragonHeart);
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.safetyMatch, 1, 1000), " O ", " S ", " ", 'O', new ItemStack(Items.dye, 1, 14), 'S', Items.stick);
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModItems.safetyMatch, 0), "MMM", "MMM", "MMM", 'M', new ItemStack(ModItems.safetyMatch, 1, 1000));
|
||||
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.grinder, 1, 3), "IXI", "DCD", "IFI", 'I', Items.iron_ingot, 'X', ModItems.draconiumIngot, 'D', Items.diamond_sword, 'C', ModItems.draconicCore, 'F', Blocks.furnace);
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.weatherController), "RSR", "TPT", "IEI", 'R', Items.blaze_rod, 'S', ModItems.sunFocus, 'T', Blocks.tnt, 'P', ModItems.draconicCore, 'I', Items.iron_ingot, 'E', Blocks.enchanting_table);
|
||||
CraftingManager.getInstance().addRecipe(new ItemStack(ModBlocks.potentiometer), "ITI", "QCQ", "IRI", 'I', Items.iron_ingot, 'T', Blocks.redstone_torch, 'Q', Items.quartz, 'C', Items.comparator, 'R', Blocks.redstone_block);
|
||||
|
||||
@@ -55,6 +55,7 @@ public class ModItems {
|
||||
public static ItemDE sunFocus;
|
||||
public static ItemDE mobSoul;
|
||||
public static ItemDE enderArrow;
|
||||
public static ItemDE safetyMatch;
|
||||
|
||||
public static ItemDE teleporterMKI;
|
||||
public static ItemDE teleporterMKII;
|
||||
@@ -96,6 +97,7 @@ public class ModItems {
|
||||
sunFocus = new SunFocus();
|
||||
mobSoul = new MobSoul();
|
||||
enderArrow = new EnderArrow();
|
||||
safetyMatch = new SafetyMatch();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public class DraconicAxe extends ItemAxe implements IEnergyContainerItem{
|
||||
if (block.isWood(world, xPos, yPos, zPos)) {
|
||||
world.setBlockToAir(xPos, yPos, zPos);
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
if (block.removedByPlayer(world, player, xPos, yPos, zPos)) {
|
||||
if (block.removedByPlayer(world, player, xPos, yPos, zPos, false)) {
|
||||
block.onBlockDestroyedByPlayer(world, xPos, yPos, zPos, meta);
|
||||
}
|
||||
block.harvestBlock(world, player, xPos, yPos, zPos, meta);
|
||||
@@ -136,10 +136,12 @@ public class DraconicAxe extends ItemAxe implements IEnergyContainerItem{
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
void trimLeavs(int X, int Y, int Z, EntityPlayer player, World world, ItemStack stack) {
|
||||
scedualUpdates(X, Y, Z, player, world, stack);
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
void scedualUpdates(int X, int Y, int Z, EntityPlayer player, World world, ItemStack stack) {
|
||||
for (int xPos = X - 15; xPos <= X + 15; xPos++) {
|
||||
for (int yPos = Y; yPos <= Y + 50; yPos++) {
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
package com.brandon3055.draconicevolution.common.items.tools;
|
||||
|
||||
import com.brandon3055.draconicevolution.DraconicEvolution;
|
||||
import com.brandon3055.draconicevolution.common.blocks.ModBlocks;
|
||||
import com.brandon3055.draconicevolution.common.items.ItemDE;
|
||||
import com.brandon3055.draconicevolution.common.items.ModItems;
|
||||
import com.brandon3055.draconicevolution.common.lib.References;
|
||||
import com.brandon3055.draconicevolution.common.lib.Strings;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Brandon on 23/08/2014.
|
||||
*/
|
||||
public class SafetyMatch extends ItemDE {
|
||||
|
||||
IIcon boxIcon;
|
||||
public SafetyMatch()
|
||||
{
|
||||
this.setUnlocalizedName(Strings.safetyMatchName);
|
||||
this.setCreativeTab(DraconicEvolution.tolkienTabToolsWeapons);
|
||||
this.setHasSubtypes(true);
|
||||
ModItems.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
if (itemStack.getItemDamage() == 1000) return super.getUnlocalizedName(itemStack);
|
||||
else return super.getUnlocalizedName(itemStack) + "Box";
|
||||
}
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs p_150895_2_, List list) {
|
||||
list.add(new ItemStack(item, 1, 0));
|
||||
list.add(new ItemStack(item, 1, 1000));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemStackLimit(ItemStack stack) {
|
||||
return stack.getItemDamage() == 1000 ? 16 : 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxDamage(ItemStack stack) {
|
||||
return stack.getItemDamage() == 1000 ? 1000 : 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
itemIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + "safety_match");
|
||||
boxIcon = iconRegister.registerIcon(References.RESOURCESPREFIX + "box_of_matches");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return stack.getItemDamage() != 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
return damage == 1000 ? itemIcon : boxIcon;
|
||||
}
|
||||
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_)
|
||||
{
|
||||
if (p_77648_7_ == 0)
|
||||
{
|
||||
--y;
|
||||
}
|
||||
|
||||
if (p_77648_7_ == 1)
|
||||
{
|
||||
++y;
|
||||
}
|
||||
|
||||
if (p_77648_7_ == 2)
|
||||
{
|
||||
--z;
|
||||
}
|
||||
|
||||
if (p_77648_7_ == 3)
|
||||
{
|
||||
++z;
|
||||
}
|
||||
|
||||
if (p_77648_7_ == 4)
|
||||
{
|
||||
--x;
|
||||
}
|
||||
|
||||
if (p_77648_7_ == 5)
|
||||
{
|
||||
++x;
|
||||
}
|
||||
|
||||
if (!player.canPlayerEdit(x, y, z, p_77648_7_, stack))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (world.isAirBlock(x, y, z))
|
||||
{
|
||||
world.playSoundEffect((double) x + 0.5D, (double) y + 0.5D, (double) z + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
|
||||
world.setBlock(x, y, z, ModBlocks.safetyFlame);
|
||||
}
|
||||
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
if (stack.getItemDamage() == 1000) stack.stackSize--;
|
||||
else stack.damageItem(1, player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack p_77624_1_, EntityPlayer p_77624_2_, List list, boolean p_77624_4_) {
|
||||
list.add(""+EnumChatFormatting.DARK_PURPLE+""+EnumChatFormatting.ITALIC+"Light a fire that will NOT burn your house down!");
|
||||
}
|
||||
}
|
||||
@@ -53,4 +53,6 @@ public class Strings {// public sta
|
||||
public static final String energyPylonName = "energyPylon";
|
||||
public static final String placedItemName = "placedItem";
|
||||
public static final String enderArrowName = "enderArrow";
|
||||
public static final String safetyFlameName = "safetyFlame";
|
||||
public static final String safetyMatchName = "safetyMatch";
|
||||
}
|
||||
@@ -55,6 +55,8 @@ item.draconicevolution:draconicBoots.name=Draconic Boots
|
||||
item.draconicevolution:draconicDistructionStaff.name=Draconic Staff of Power
|
||||
item.draconicevolution:mobSoul.name=Mob Soul
|
||||
item.draconicevolution:enderArrow.name=Ender Arrow
|
||||
item.draconicevolution:safetyMatch.name=Safety Match
|
||||
item.draconicevolution:safetyMatchBox.name=Box of Safety Matches
|
||||
|
||||
//###################################Item Groups###################################//
|
||||
itemGroup.toolsAndWeapons=Draconic Evolution Tools & Weapons
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Reference in new issue
Block a user