updates and fixes

This commit is contained in:
Mohammad-Ali Minaie
2017-04-01 00:02:30 -04:00
parent ad6483810a
commit 4d01df0df7
23 changed files with 191 additions and 206 deletions

View File

@@ -2,16 +2,13 @@ To-Dos
*** Priority ***
- [ ] OreDict Stuff
- [ ] Hot Ingots should cool down
- [ ] Remove hot or cool ingots and tool heads from inventories
- [ ] Update Crafting for tools to include leatherStrap
*** Backlog ***
- [ ] Add Iron Ring Recipe
- [ ] Add chainmail recipe
- [ ] Add Iron Shield
- [ ] Gold Smelting
- [ ] Coal is not being removed from the forge or firebox
*** Backlog ***
- [ ] Create a method which adds the types of NBT upgrades and creates a unique float instead of using magic numbers
- [ ] Add forgehammer to oreDict
- [ ] WeaponHead recipes
@@ -21,6 +18,13 @@ To-Dos
- [ ] Crafting recipes
*** Completed ***
- [x] Forge Setting Player on fire but not taking damage
- [x] Forge and Bloomery make Smoke
- [x] Remove cool ingots from inventories with Hand
- [x] Remove cool tools heads from inventories with Hand
- [x] Add rendering in anvil renderer for Cool Ingots
- [x] Hot Ingots should cool down
- [x] Coal is not being removed from the forge or firebox
- [x] Tool Disassembly
- [x] Tool Repair

View File

@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx3G
mod_group=nmd.primal.forgecraft
mod_name=ForgeCraft
mod_version=1.2.08
mod_version=1.2.10
forge_version=13.20.0.2226
mcp_mappings=snapshot_20161220
mc_version=1.11.2

View File

@@ -1,77 +0,0 @@
{
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
"textures": {
"particle": "blocks/e_particle",
"texture": "blocks/e_texture",
"texture1": "blocks/e_texture"
},
"elements": [
{
"__comment": "Cube1",
"from": [ 7.5, 0, 7 ],
"to": [ 8.5, 13, 9 ],
"faces": {
"down": { "uv": [ 7.5, 7, 8.5, 9 ], "texture": "#texture" },
"up": { "uv": [ 7.5, 7, 8.5, 9 ], "texture": "#texture" },
"north": { "uv": [ 7.5, 3, 8.5, 16 ], "texture": "#texture" },
"south": { "uv": [ 7.5, 3, 8.5, 16 ], "texture": "#texture" },
"west": { "uv": [ 7, 3, 9, 16 ], "texture": "#texture" },
"east": { "uv": [ 7, 3, 9, 16 ], "texture": "#texture" }
}
},
{
"__comment": "Cube2",
"from": [ 7, 13, 4.5 ],
"to": [ 9, 14, 11.5 ],
"faces": {
"down": { "uv": [ 7, 4.5, 9, 11.5 ], "texture": "#texture1" },
"up": { "uv": [ 7, 4.5, 9, 11.5 ], "texture": "#texture1" },
"north": { "uv": [ 7, 2, 9, 3 ], "texture": "#texture1" },
"south": { "uv": [ 7, 2, 9, 3 ], "texture": "#texture1" },
"west": { "uv": [ 4.5, 2, 11.5, 3 ], "texture": "#texture1" },
"east": { "uv": [ 4.5, 2, 11.5, 3 ], "texture": "#texture1" }
}
},
{
"__comment": "Cube3",
"from": [ 7.5, 14, 7 ],
"to": [ 8.5, 14.5, 9 ],
"faces": {
"down": { "uv": [ 7.5, 7, 8.5, 9 ], "texture": "#texture" },
"up": { "uv": [ 7.5, 7, 8.5, 9 ], "texture": "#texture" },
"north": { "uv": [ 7.5, 1.5, 8.5, 2 ], "texture": "#texture" },
"south": { "uv": [ 7.5, 1.5, 8.5, 2 ], "texture": "#texture" },
"west": { "uv": [ 7, 1.5, 9, 2 ], "texture": "#texture" },
"east": { "uv": [ 7, 1.5, 9, 2 ], "texture": "#texture" }
}
},
{
"__comment": "Cube5",
"from": [ 7.5, 13, 11 ],
"to": [ 8.5, 14, 14.5 ],
"rotation": { "origin": [ 7.5, 13, 11 ], "axis": "x", "angle": 22.5 },
"faces": {
"down": { "uv": [ 7.5, 1.5, 8.5, 5.5 ], "texture": "#texture1" },
"up": { "uv": [ 7.5, 10.5, 8.5, 14.5 ], "texture": "#texture1" },
"north": { "uv": [ 7.5, 2.5, 8.5, 3 ], "texture": "#texture1" },
"south": { "uv": [ 7.5, 2.5, 8.5, 3 ], "texture": "#texture1" },
"west": { "uv": [ 10.5, 2.5, 14.5, 3 ], "texture": "#texture1" },
"east": { "uv": [ 1.5, 2.5, 5.5, 3 ], "texture": "#texture1" }
}
},
{
"__comment": "Cube5",
"from": [ 7.5, 13, 1.5 ],
"to": [ 8.5, 14, 5 ],
"rotation": { "origin": [ 8.5, 13, 5 ], "axis": "x", "angle": -22.5 },
"faces": {
"down": { "uv": [ 7.5, 1.5, 8.5, 5.5 ], "texture": "#texture1", "rotation": 180 },
"up": { "uv": [ 7.5, 10.5, 8.5, 14.5 ], "texture": "#texture1", "rotation": 180 },
"north": { "uv": [ 7.5, 2.5, 8.5, 3 ], "texture": "#texture1" },
"south": { "uv": [ 7.5, 2.5, 8.5, 3 ], "texture": "#texture1" },
"west": { "uv": [ 1.5, 2.5, 5.5, 3 ], "texture": "#texture1" },
"east": { "uv": [ 10.5, 2.5, 14.5, 3 ], "texture": "#texture1" }
}
}
]
}

View File

@@ -17,7 +17,7 @@ public class ModInfo {
public static final String MOD_NAME = "Kitsu's ForgeCraft";
//public static final String MOD_PREFIX = MOD_ID + ":";
public static final String MOD_CHANNEL = MOD_ID;
public static final String MOD_VERSION = "1.2.08";
public static final String MOD_VERSION = "1.2.10";
public static final String MC_VERSIONS = "[1.11.0, 1.12.0)";
public static final String DEPENDENCIES = "required-after:forge@[13.20.0.2226,);" + "required-after:primal;";

View File

@@ -1,5 +1,6 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.BlockStateContainer;
@@ -9,6 +10,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
@@ -24,6 +26,7 @@ import nmd.primal.core.api.PrimalItems;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.crafting.AnvilCrafting;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.parts.ToolPart;
import nmd.primal.forgecraft.tiles.TileAnvil;
@@ -437,6 +440,11 @@ public class Anvil extends CustomContainerFacing {
return true;
}
if (Block.getBlockFromItem(tile.getSlotStack(counter).getItem()) instanceof IngotBall ) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.pickaxehead)) {
if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) {

View File

@@ -6,6 +6,7 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@@ -31,6 +32,8 @@ import nmd.primal.forgecraft.tiles.TileBloomery;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import static nmd.primal.core.common.helper.CommonUtils.makeSmoke;
/**
* Created by mminaie on 1/21/17.
*/
@@ -55,6 +58,17 @@ public class Bloomery extends CustomContainerFacing implements ITileEntityProvid
return new TileBloomery();
}
@Override
public void randomTick(World world, BlockPos pos, IBlockState state, Random random)
{
this.updateTick(world, pos, state, random);
if(!world.isRemote){
if(state.getValue(ACTIVE) == true) {
makeSmoke(world, pos);
}
}
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
@@ -191,6 +205,16 @@ public class Bloomery extends CustomContainerFacing implements ITileEntityProvid
return false;
}
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity ent)
{
if(ent instanceof EntityPlayer){
if(state.getValue(ACTIVE) == true){
ent.setFire(1);
}
}
}
/**
* Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
*/

View File

@@ -27,6 +27,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
//import nmd.primal.core.api.PrimalBlocks;
import nmd.primal.core.api.PrimalItems;
import nmd.primal.core.common.PrimalCore;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.init.ModBlocks;
@@ -37,6 +38,8 @@ import javax.annotation.Nullable;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import static nmd.primal.core.common.helper.CommonUtils.makeSmoke;
/**
* Created by kitsu on 11/26/2016.
@@ -236,14 +239,13 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider/
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity ent)
{
if (!world.isRemote)
{
//if (!world.isRemote){
if(ent instanceof EntityPlayer){
if(state.getValue(ACTIVE) == true){
ent.setFire(1);
}
}
}
//}
}
public void onBlockClicked(World world, BlockPos pos, EntityPlayer player) {
@@ -454,6 +456,17 @@ public class Forge extends CustomContainerFacing implements ITileEntityProvider/
return EnumBlockRenderType.MODEL;
}
@Override
public void randomTick(World world, BlockPos pos, IBlockState state, Random random)
{
this.updateTick(world, pos, state, random);
if(!world.isRemote){
if(state.getValue(ACTIVE) == true) {
makeSmoke(world, pos);
}
}
}
@SideOnly(Side.CLIENT)
@SuppressWarnings("incomplete-switch")
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand)

View File

@@ -8,9 +8,11 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
@@ -20,6 +22,9 @@ import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.init.ModBlocks;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 2/6/17.
*/
@@ -33,6 +38,7 @@ public class IngotBall extends BlockCustomBase {
public IngotBall(Material material, String registryName, Float hardness, String type){
super(material, registryName, hardness);
this.type = type;
this.setTickRandomly(true);
}
@@ -88,4 +94,18 @@ public class IngotBall extends BlockCustomBase {
return new BlockStateContainer(this, new IProperty[] {ACTIVE});
}
@Override
public void randomTick(World world, BlockPos pos, IBlockState state, Random random)
{
this.updateTick(world, pos, state, random);
if(!world.isRemote){
if ( ThreadLocalRandom.current().nextInt(0,1) == 0) {
if(state.getValue(ACTIVE) == true) {
world.setBlockState(pos, state.withProperty(ACTIVE, Boolean.valueOf(false)), 2);
world.playSound((EntityPlayer) null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 1.0F, world.rand.nextFloat() * 0.4F + 0.8F);
}
}
}
}
}

View File

@@ -18,14 +18,14 @@ public class ModDictionary {/***************************************************
* LEATHER_CORDAGE = registerItem(new PrimalItem("leather_cordage"), "cordageGeneral, cordageLeather");
*
*/
public static void registerDictionaryNames()
{
public static void registerDictionaryNames()
{
//if (ModConfig.COMPATIBILITY_DICTIONARY_MAGMACREAM_AS_SLIME)
//OreDictionary.registerOre("clayball", Items.CLAY_BALL);
OreDictionary.registerOre("ingotIron", ModBlocks.ironball);
OreDictionary.registerOre("nuggetIron", ModBlocks.ironchunk);
}
}
}

View File

@@ -85,22 +85,28 @@ public class ModCrafting {
" X ", " Y ", 'X', Blocks.IRON_ORE, 'Y', ModBlocks.emptycrucible);
/***Pickaxe Crafting***/
GameRegistry.addShapedRecipe(new ItemStack(ModItems.ironpickaxe, 1),
" X ", " Y ", 'X', ModItems.pickaxehead, 'Y', Items.STICK);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ironpickaxe), "T", "C", "S",
('T'), ModItems.pickaxehead,
('S'), "stickWood",
('C'), "cordageGeneral"));
/***Axe Crafting***/
//GameRegistry.addShapedRecipe(new ItemStack(ModItems.ironaxe, 1),
//" X ", " Y ", 'X', ModItems.ironaxehead, 'Y', Items.STICK);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ironaxe, 1, OreDictionary.WILDCARD_VALUE),
true, "X", "Y", ('X'), new ItemStack(ModItems.ironaxehead, 1, OreDictionary.WILDCARD_VALUE), ('Y'), Items.STICK));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ironaxe), "T", "C", "S",
('T'), ModItems.ironaxehead,
('S'), "stickWood",
('C'), "cordageGeneral"));
/***Shovel Crafting***/
GameRegistry.addShapedRecipe(new ItemStack(ModItems.ironshovel, 1),
" X ", " Y ", 'X', ModItems.ironshovelhead, 'Y', Items.STICK);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ironshovel), "T", "C", "S",
('T'), ModItems.ironshovelhead,
('S'), "stickWood",
('C'), "cordageGeneral"));
/***Hoe Crafting***/
GameRegistry.addShapedRecipe(new ItemStack(ModItems.ironhoe, 1),
" X ", " Y ", 'X', ModItems.ironhoehead, 'Y', Items.STICK);
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.ironhoe), "T", "C", "S",
('T'), ModItems.ironhoehead,
('S'), "stickWood",
('C'), "cordageGeneral"));
/***************************************************************

View File

@@ -8,8 +8,8 @@ import net.minecraftforge.common.util.EnumHelper;
*/
public class ModMaterials {
public static Item.ToolMaterial TOOL_WROUGHT_IRON = EnumHelper.addToolMaterial("wroughtiron", 2, 500, 2.0F, 1.0F, 0);
public static Item.ToolMaterial CLEAN_IRON = EnumHelper.addToolMaterial("cleaniron", 2, 700, 3.0F, 3.0F, 0);
public static Item.ToolMaterial BASIC_STEEL = EnumHelper.addToolMaterial("steelbasic", 3, 900, 5.0F, 5.0F, 0);
public static Item.ToolMaterial WOOTZ_STEEL = EnumHelper.addToolMaterial("wootzsteel", 3, 1100, 7.0F, 7.0F, 0);
public static Item.ToolMaterial TOOL_WROUGHT_IRON = EnumHelper.addToolMaterial("wroughtiron", 2, 500, 4.0F, 1.0F, 0);
public static Item.ToolMaterial CLEAN_IRON = EnumHelper.addToolMaterial("cleaniron", 2, 700, 6.0F, 3.0F, 0);
public static Item.ToolMaterial BASIC_STEEL = EnumHelper.addToolMaterial("steelbasic", 3, 900, 8.0F, 5.0F, 0);
public static Item.ToolMaterial WOOTZ_STEEL = EnumHelper.addToolMaterial("wootzsteel", 3, 1100, 10.0F, 7.0F, 0);
}

View File

@@ -351,7 +351,7 @@ public class CustomAxe extends ItemAxe implements ToolNBT {
if(material != Material.WOOD && material != Material.PLANTS && material != Material.VINE){
return super.getStrVsBlock(stack, state);
} else {
return this.efficiencyOnProperMaterial * ( ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) ) + 1);
return this.efficiencyOnProperMaterial * ( (this.getRedstoneLevel(stack) * 2 ) + 1);
}
}

View File

@@ -379,7 +379,7 @@ public class CustomPickaxe extends ItemPickaxe implements ToolNBT{
if(material != Material.IRON && material != Material.ANVIL && material != Material.ROCK){
return super.getStrVsBlock(stack, state);
} else {
return this.efficiencyOnProperMaterial * ( ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) ) + 1);
return this.efficiencyOnProperMaterial * ( (this.getRedstoneLevel(stack) * 2 ) + 1);
}
}

View File

@@ -1,12 +1,15 @@
package nmd.primal.forgecraft.items.tools;
import com.google.common.collect.Sets;
import com.mojang.realmsclient.gui.ChatFormatting;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.IItemPropertyGetter;
import net.minecraft.item.Item;
import net.minecraft.item.ItemSpade;
@@ -22,6 +25,7 @@ import nmd.primal.forgecraft.ToolNBT;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ThreadLocalRandom;
/**
@@ -29,6 +33,8 @@ import java.util.concurrent.ThreadLocalRandom;
*/
public class CustomShovel extends ItemSpade implements ToolNBT {
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.CLAY, Blocks.DIRT, Blocks.FARMLAND, Blocks.GRASS, Blocks.GRAVEL, Blocks.MYCELIUM, Blocks.SAND, Blocks.SNOW, Blocks.SNOW_LAYER, Blocks.SOUL_SAND, Blocks.GRASS_PATH});
public CustomShovel(String name, Item.ToolMaterial material) {
super(material);
this.setUnlocalizedName(name);
@@ -342,17 +348,12 @@ public class CustomShovel extends ItemSpade implements ToolNBT {
@Override
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
Material material = state.getMaterial();
//return material != Material.IRON && material != Material.ANVIL && material != Material.ROCK ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
if(material != Material.IRON && material != Material.ANVIL && material != Material.ROCK){
return super.getStrVsBlock(stack, state);
} else if (this.getRedstoneLevel(stack) > 0) {
return this.efficiencyOnProperMaterial * ((this.getRedstoneLevel(stack) / 2) * this.getRedstoneLevel(stack) );
} else {
return this.efficiencyOnProperMaterial;
for (String type : getToolClasses(stack))
{
if (state.getBlock().isToolEffective(type, state))
return efficiencyOnProperMaterial;
}
return this.EFFECTIVE_ON.contains(state.getBlock()) ? (this.efficiencyOnProperMaterial * ( (this.getRedstoneLevel(stack) * 2 ) + 1)) : 1.0F;
}
@SideOnly(Side.CLIENT)

View File

@@ -3,10 +3,10 @@ package nmd.primal.forgecraft.proxy;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.renders.TileAnvilRender;
import nmd.primal.forgecraft.renders.TileBloomeryRender;
import nmd.primal.forgecraft.renders.TileForgeRender;
import nmd.primal.forgecraft.renders.TilePistonBellowsRender;
import nmd.primal.forgecraft.renders.blocks.TileAnvilRender;
import nmd.primal.forgecraft.renders.blocks.TileBloomeryRender;
import nmd.primal.forgecraft.renders.blocks.TileForgeRender;
import nmd.primal.forgecraft.renders.blocks.TilePistonBellowsRender;
import nmd.primal.forgecraft.tiles.TileAnvil;
import nmd.primal.forgecraft.tiles.TileBloomery;
import nmd.primal.forgecraft.tiles.TileForge;

View File

@@ -1,5 +1,6 @@
package nmd.primal.forgecraft.renders;
package nmd.primal.forgecraft.renders.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
@@ -9,6 +10,7 @@ import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
@@ -16,6 +18,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import nmd.primal.core.api.PrimalItems;
import nmd.primal.forgecraft.blocks.Anvil;
import nmd.primal.forgecraft.blocks.IngotBall;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.tiles.TileAnvil;
@@ -140,7 +143,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
if(tile.getSlotStack(counter).getItem() == ModItems.ironingotballhot ){
if(Block.getBlockFromItem(tile.getSlotStack(counter).getItem()) instanceof IngotBall){
GL11.glPushMatrix();
double scale = 1.0D;
GL11.glScaled(scale, scale, scale);
@@ -148,14 +151,14 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
if(tile.getSlotStack(counter).getItem() == ModItems.ironchunkhot){
/*if( (tile.getSlotStack(counter).getItem() == ModItems.ironchunkhot) || (tile.getSlotStack(counter).getItem() == Item.getItemFromBlock(ModBlocks.ironchunk))) {
GL11.glPushMatrix();
double scale = 1.0D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated(tile.getNormalX(a), -0.455D, tile.getNormalZ(i));
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
}*/
}
counter++;
@@ -217,7 +220,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
if(tile.getSlotStack(counter).getItem() == ModItems.ironingotballhot ){
if(Block.getBlockFromItem(tile.getSlotStack(counter).getItem()) instanceof IngotBall){
GL11.glPushMatrix();
double scale = 1.0D;
GL11.glScaled(scale, scale, scale);
@@ -225,14 +228,14 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
if(tile.getSlotStack(counter).getItem() == ModItems.ironchunkhot){
/*if( (tile.getSlotStack(counter).getItem() == ModItems.ironingotballhot) || (tile.getSlotStack(counter).getItem() == Item.getItemFromBlock(ModBlocks.ironball)) ){
GL11.glPushMatrix();
double scale = 1.0D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated( tile.getReverseX(a), -0.455D, tile.getReverseZ(i) );
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
}*/
}
counter++;
@@ -296,7 +299,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
if(tile.getSlotStack(counter).getItem() == ModItems.ironingotballhot ){
if(Block.getBlockFromItem(tile.getSlotStack(counter).getItem()) instanceof IngotBall){
GL11.glPushMatrix();
double scale = 1.0D;
GL11.glScaled(scale, scale, scale);
@@ -304,15 +307,14 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
if(tile.getSlotStack(counter).getItem() == ModItems.ironchunkhot){
/*if(tile.getSlotStack(counter).getItem() == ModItems.ironchunkhot){
GL11.glPushMatrix();
double scale = 1.0D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated( tile.getNormalX(a), -0.455D, tile.getReverseZ(i) );
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
}*/
}
counter++;
}
@@ -377,7 +379,7 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
if(tile.getSlotStack(counter).getItem() == ModItems.ironingotballhot ){
if(Block.getBlockFromItem(tile.getSlotStack(counter).getItem()) instanceof IngotBall){
GL11.glPushMatrix();
double scale = 1.0D;
GL11.glScaled(scale, scale, scale);
@@ -385,15 +387,14 @@ public class TileAnvilRender extends TileEntitySpecialRenderer<TileAnvil>
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
if(tile.getSlotStack(counter).getItem() == ModItems.ironchunkhot){
/*if(tile.getSlotStack(counter).getItem() == ModItems.ironchunkhot){
GL11.glPushMatrix();
double scale = 1.0D;
GL11.glScaled(scale, scale, scale);
GL11.glTranslated( tile.getReverseX(a), -0.455D, tile.getNormalZ(i) );
renderItem.renderItem(tile.getSlotStack(counter), ItemCameraTransforms.TransformType.FIXED);
GL11.glPopMatrix();
}
}*/
}
counter++;
}

View File

@@ -1,4 +1,4 @@
package nmd.primal.forgecraft.renders;
package nmd.primal.forgecraft.renders.blocks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;

View File

@@ -1,4 +1,4 @@
package nmd.primal.forgecraft.renders;
package nmd.primal.forgecraft.renders.blocks;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;

View File

@@ -1,4 +1,4 @@
package nmd.primal.forgecraft.renders;
package nmd.primal.forgecraft.renders.blocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;

View File

@@ -1,12 +1,20 @@
package nmd.primal.forgecraft.tiles;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ITickable;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.items.parts.ToolPart;
import java.util.concurrent.ThreadLocalRandom;
/**
* Created by mminaie on 3/4/17.
*/
public class TileAnvil extends TileBaseSlot {
public class TileAnvil extends TileBaseSlot implements ITickable {
double[] normalX = {0.125,0.3125,0.5,0.6875,0.875};
@@ -35,4 +43,40 @@ public class TileAnvil extends TileBaseSlot {
public NonNullList<ItemStack> slotList = NonNullList.<ItemStack>withSize(100, ItemStack.EMPTY);
@Override
public void update () {
World world = this.getWorld();
if (!world.isRemote) {
IBlockState state = world.getBlockState(this.pos);
if ( ThreadLocalRandom.current().nextInt(0,500) == 0 ) {
for(int i=0; i<this.getSlotListSize(); i++){
if(this.getSlotStack(i).getItem() == ModItems.ironchunkhot){
if(ThreadLocalRandom.current().nextInt(0,10) == 0){
this.setSlotStack(i, new ItemStack(ModBlocks.ironchunk, 1));
this.updateBlock();
this.markDirty();
}
}
if(this.getSlotStack(i).getItem() == ModItems.ironingotballhot){
if(ThreadLocalRandom.current().nextInt(0,10) == 0){
this.setSlotStack(i, new ItemStack(ModBlocks.ironball, 1));
this.updateBlock();
this.markDirty();
}
}
if(this.getSlotStack(i).getItem() instanceof ToolPart){
if(ThreadLocalRandom.current().nextInt(0,10) == 0){
((ToolPart) this.getSlotStack(i).getItem()).setHot(this.getSlotStack(i), false);
this.updateBlock();
this.markDirty();
}
}
}
}
}
}
}

View File

@@ -33,8 +33,8 @@ public class TileBloomery extends TileBaseSlot implements ITickable {
if(!world.isRemote){
IBlockState state = world.getBlockState(this.pos);
if(state.getValue(Bloomery.ACTIVE) == true){
if(this.getHeat() < 400){
this.setHeat(400);
if(this.getHeat() < 100){
this.setHeat(100);
}
}
this.iteration ++;

View File

@@ -2,7 +2,7 @@
"modid": "forgecraft",
"name": "Kitsu's Forgecraft",
"description": "Forged with sweat and blood",
"version": "1.2.08",
"version": "1.2.10",
"mcversion": "1.11.2",
"url": "",
"updateUrl": "",

View File

@@ -1,59 +0,0 @@
{
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
"parent": "block/block",
"textures": {
"particle": "blocks/particle",
"texture": "blocks/texture",
"texture1": "blocks/texture1"
},
"elements": [
{
"__comment": "Cube1",
"from": [ 0, 0, 0 ],
"to": [ 16, 14, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" },
"north": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"south": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"west": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" },
"east": { "uv": [ 0, 2, 16, 16 ], "texture": "#texture" }
}
},
{
"__comment": "Cube2",
"from": [ 0, 14, 0 ],
"to": [ 16, 16, 16 ],
"faces": {
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture1" },
"north": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"south": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"west": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" },
"east": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture1" }
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [ 75, 45, 0 ],
"translation": [ 0, 2.5, 0 ],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 45, 0 ],
"scale": [ 0.4, 0.4, 0.4 ]
},
"gui": {
"rotation": [ 30, 225, 0 ],
"scale": [ 0.625, 0.625, 0.625 ]
},
"ground": {
"translation": [ 0, 3, 0 ],
"scale": [ 0.25, 0.25, 0.25 ]
},
"fixed": {
"scale": [ 0.5, 0.5, 0.5 ]
}
},
"overrides": [
]
}