pushing 1.11 and 1.10.2 changes

This commit is contained in:
kitsushadow
2016-12-11 13:13:25 -05:00
parent 101c28e7d4
commit e389a25900
107 changed files with 3441 additions and 33 deletions

View File

@@ -1,20 +0,0 @@
package com.example.examplemod;
import net.minecraft.init.Blocks;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
@Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
public class ExampleMod
{
public static final String MODID = "examplemod";
public static final String VERSION = "1.0";
@EventHandler
public void init(FMLInitializationEvent event)
{
// some example code
System.out.println("DIRT BLOCK >> "+Blocks.DIRT.getUnlocalizedName());
}
}

View File

@@ -0,0 +1,41 @@
package nmd.primal.forgecraft;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.*;
import net.minecraftforge.fml.common.registry.GameRegistry;
/**
* Created by kitsu on 11/23/2016.
*/
public class CommonUtils {
public static int getVanillaItemBurnTime(ItemStack stack)
{
if (stack == null)
{
return 0;
}
Item item = stack.getItem();
if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.AIR)
{
Block block = Block.getBlockFromItem(item);
if (block == Blocks.WOODEN_SLAB) return 150;
if (block.getDefaultState().getMaterial() == Material.WOOD) return 300;
if (block == Blocks.COAL_BLOCK) return 16000;
}
if (item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD")) return 200;
if (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD")) return 200;
if (item instanceof ItemHoe && ((ItemHoe)item).getMaterialName().equals("WOOD")) return 200;
if(item == Items.STICK) return 100;
if(item == Items.COAL) return 1600;
if (item == Item.getItemFromBlock(Blocks.SAPLING)) return 100;
if (item == Items.BLAZE_ROD) return 2400;
if (item == Items.BLAZE_POWDER) return 800;
return GameRegistry.getFuelValue(stack);
}
}

View File

@@ -0,0 +1,71 @@
package nmd.primal.forgecraft;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModCrafting;
import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.init.ModTiles;
import nmd.primal.forgecraft.proxy.CommonProxy;
//import nmd.primal.forgecraft.common.init.*;
import java.util.Locale;
@Mod( modid = ModInfo.MOD_ID,
name = ModInfo.MOD_NAME,
version = ModInfo.MOD_VERSION,
acceptedMinecraftVersions = ModInfo.MC_VERSIONS
//dependencies = ModInfo.DEPENDENCIES,
//guiFactory = ModInfo.GUI_FACTORY,
//updateJSON = ModInfo.UPDATE_JSON
)
public class ForgeCraft
{
@Instance
public static ForgeCraft instance;
@SidedProxy(clientSide = ModInfo.CLIENT_PROXY, serverSide = ModInfo.SERVER_PROXY)
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
ModItems.init();
ModBlocks.init();
ModItems.register();
ModBlocks.register();
ModTiles.registerTileEntities();
}
@EventHandler
public void init(FMLInitializationEvent event)
{
//this.proxy.init(event);
proxy.init();
ModCrafting.register();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
//this.proxy.postInit(event);
}
/*@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
//event.registerServerCommand(new PrimalCommand());
}
//public File getConfigDirectory()
//{
// return CONFIG_DIRECTORY;
//}
*/
}

View File

@@ -0,0 +1,81 @@
package nmd.primal.forgecraft;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.fml.client.config.GuiConfigEntries;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.init.ModBlocks;
import nmd.primal.forgecraft.init.ModItems;
//import nmd.primal.forgecraft.Item.ModItems;
/**
* Created by kitsu on 11/24/2016.
*/
public class ModInfo {
/** Mod Details**/
//public static final String DEPENDENCIES = "after:primal;";
public static final String MOD_ID = "forgecraft";
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.0.1";
public static final String MC_VERSIONS = "[1.9.4, 1.11.0)";
/** Mod Structures **/
public static final String SERVER_PROXY = "nmd.primal.forgecraft.proxy.ServerProxy";
public static final String CLIENT_PROXY = "nmd.primal.forgecraft.proxy.ClientProxy";
//public static final String GUI_FACTORY = "nmd.primal.forgecraft.gui.GuiFactory";
//public static final String UPDATE_JSON = "";
public enum ForgecraftItems {
TEST("test", "ItemTest");
private String unlocalizedName;
private String registryName;
ForgecraftItems(String unlocalizedName, String registryName) {
this.unlocalizedName = unlocalizedName;
this.registryName = registryName;
}
public String getUnlocalizedName() {
return unlocalizedName;
}
public String getRegistryName() {
return registryName;
}
}
public enum ForgecraftBlocks {
FIREBOX("firebox", "firebox");
private String unlocalizedName;
private String registryName;
ForgecraftBlocks(String unlocalizedName, String registryName) {
this.unlocalizedName = unlocalizedName;
this.registryName = registryName;
}
public String getUnlocalizedName() {
return unlocalizedName;
}
public String getRegistryName() {
return registryName;
}
}
/** Creative Tabs **/
public static CreativeTabs TAB_FORGECRAFT = new CreativeTabs(MOD_ID)
{
@Override
@SideOnly(Side.CLIENT)
public Item getTabIconItem() {
return Item.getItemFromBlock(ModBlocks.firebox);
}
};
}

View File

@@ -0,0 +1,25 @@
package nmd.primal.forgecraft.blocks;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyDirection;
import net.minecraft.util.EnumFacing;
/**
* Created by kitsu on 12/3/2016.
*/
public abstract class CustomContainerFacing extends BlockContainer {
public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
protected CustomContainerFacing(Material material)
{
super(material);
}
protected CustomContainerFacing(Material material, MapColor color)
{
super(material, color);
}
}

View File

@@ -0,0 +1,403 @@
package nmd.primal.forgecraft.blocks;
import akka.actor.SystemGuardian;
import akka.actor.dsl.Creators;
import net.minecraft.block.*;
import net.minecraft.block.material.Material;
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.client.Minecraft;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.inventory.InventoryHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumBlockRenderType;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.tiles.TileFirebox;
import javax.annotation.Nullable;
import static net.minecraft.block.BlockHorizontal.FACING;
/**
* Created by kitsu on 11/26/2016.
*/
public class Firebox extends CustomContainerFacing implements ITileEntityProvider {
public static final PropertyBool ACTIVE = PropertyBool.create("active");
public Firebox(Material material) {
super(material);
setUnlocalizedName(ModInfo.ForgecraftBlocks.FIREBOX.getUnlocalizedName());
setRegistryName(ModInfo.ForgecraftBlocks.FIREBOX.getRegistryName());
setCreativeTab(ModInfo.TAB_FORGECRAFT);
setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, Boolean.valueOf(false)));
setHardness(3.0f);
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta)
{
return new TileFirebox();
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
{
if (!world.isRemote)
{
TileFirebox tile = (TileFirebox) world.getTileEntity(pos);
if (tile != null)
{
ItemStack playerStack = player.getHeldItemMainhand();
Item playerItem;
ItemStack tileStack = tile.getStackInSlot(0);
if(playerStack != null){
playerItem = playerStack.getItem();
if (playerItem.equals(Items.FLINT_AND_STEEL) || playerItem.equals(Item.getItemFromBlock(Blocks.TORCH))) {
if (CommonUtils.getVanillaItemBurnTime(tileStack) > 0) {
world.setBlockState(pos, state.withProperty(ACTIVE, true), 2);
BlockPos tempPos = new BlockPos(pos.getX(), pos.getY()+1, pos.getZ());
if(world.getBlockState(tempPos).getBlock().equals(Blocks.AIR)){
world.setBlockState(tempPos, Blocks.FIRE.getDefaultState(), 2);
tile.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
}
if(playerItem.equals(Items.FLINT_AND_STEEL)){
player.inventory.getCurrentItem().damageItem(1, player);
}
}
}
if(tile.getStackInSlot(0)!=null){
if(CommonUtils.getVanillaItemBurnTime(playerStack) > 0) {
if (tileStack.getItem() == playerItem && tileStack.getItemDamage() == playerStack.getItemDamage()) {
//tile.setInventorySlotContents(0, playerStack);
ItemStack tempStack = new ItemStack(tileStack.getItem(), tileStack.stackSize + 1, tileStack.getItemDamage());
if(tileStack.stackSize < 64) {
tile.setInventorySlotContents(0, tempStack);
player.inventory.decrStackSize(player.inventory.currentItem, 1);
//player.setHeldItem(EnumHand.MAIN_HAND, null);
tile.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
}
}
}
}
if(tile.getStackInSlot(0)==null){
if(CommonUtils.getVanillaItemBurnTime(playerStack) > 0) {
if (playerItem != Items.FLINT_AND_STEEL || playerItem != Item.getItemFromBlock(Blocks.TORCH)) {
tile.setInventorySlotContents(0, playerStack);
player.setHeldItem(EnumHand.MAIN_HAND, null);
tile.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
}
}
}
}
if(tileStack != null && playerStack == null && player.isSneaking()){
if(state.getValue(ACTIVE)==true){
world.setBlockState(pos, state.withProperty(ACTIVE, false), 2);
ItemStack returnStack = new ItemStack(tileStack.getItem(), tileStack.stackSize - 1);
player.setHeldItem(EnumHand.MAIN_HAND, returnStack);
tile.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
} else {
player.setHeldItem(EnumHand.MAIN_HAND, tileStack);
tile.setInventorySlotContents(0, null);
tile.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
}
tile.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
}
if(!player.isSneaking()){
if(playerStack == null) {
if (tileStack != null) {
ItemStack tempStack1 = new ItemStack(tileStack.getItem(), 1, tileStack.getItemDamage());
ItemStack resetStack = new ItemStack(tileStack.getItem(), tileStack.stackSize - 1, tileStack.getItemDamage());
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, tempStack1));
tile.setInventorySlotContents(0,resetStack);
world.notifyBlockUpdate(pos, state, state, 2);
}
}
}
}
}
return true;
}
public void onBlockClicked(World world, BlockPos pos, EntityPlayer player) {
/*if(!world.isRemote){
TileFirebox tile = (TileFirebox) world.getTileEntity(pos);
IBlockState state = world.getBlockState(pos);
if (tile != null) {
ItemStack playerStack = player.getHeldItemMainhand();
Item playerItem;
ItemStack tileStack = tile.getStackInSlot(0);
if (!player.isSneaking()) {
if( tileStack !=null) {
if (playerStack == null) {
ItemStack tempStack1 = tileStack;
ItemStack tempStack2 = tileStack;
tempStack1.stackSize = 1;
tempStack2.stackSize = tileStack.stackSize - 1;
System.out.println(tileStack.stackSize + "|" + "|" + tempStack2.stackSize);
//int tileSize = tile.decrStackSize()
//ItemStack tempReset = new ItemStack(tileStack.getItem(), tileSize - 1, tileStack.getItemDamage());
//System.out.println(tileSize + "|" + tempReset.stackSize);
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, tempStack1));
tile.setInventorySlotContents(0, tempStack2);
world.notifyBlockUpdate(pos, state, state, 2);
}
}
}
//RETURN THE WHOLE STACK
if (playerStack == null && player.isSneaking()) {
if (tileStack != null) {
if(state.getValue(ACTIVE)) {
ItemStack tempStack = new ItemStack(tileStack.getItem(), tileStack.stackSize - 1, tileStack.getItemDamage());
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, tempStack));
tile.setInventorySlotContents(0, null);
world.notifyBlockUpdate(pos, state, state, 2);
} else {
world.spawnEntityInWorld(new EntityItem(world, player.posX, player.posY, player.posZ, tileStack));
tile.setInventorySlotContents(0, null);
world.notifyBlockUpdate(pos, state, state, 2);
}
}
}
//RETURN 1
}
}*/
}
@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
{
if(state.getValue(ACTIVE) == true){
return 15;
}
return 0;
}
public int getFlammability(IBlockAccess world, BlockPos pos, EnumFacing face)
{
return 0;
}
public boolean isFlammable(IBlockAccess world, BlockPos pos, EnumFacing face)
{
return true;
}
@Override
public boolean isFireSource(World world, BlockPos pos, EnumFacing side)
{
if (side == EnumFacing.UP)
{
if(!world.isRemote){
TileFirebox tile = (TileFirebox) world.getTileEntity(pos);
if(tile.getStackInSlot(0) != null){
if(world.getBlockState(pos).getValue(ACTIVE)==true){
return true;
}
}
}
}
return false;
}
/**
* Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
*/
@Override
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
{
if (!worldIn.isRemote && worldIn.getGameRules().getBoolean("doTileDrops"))
{
TileEntity tileentity = worldIn.getTileEntity(pos);
if (tileentity instanceof TileFirebox)
{
InventoryHelper.dropInventoryItems(worldIn, pos, (TileFirebox)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
}
}
super.breakBlock(worldIn, pos, state);
}
@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
IBlockState state = super.onBlockPlaced(worldIn, pos, facing, hitX, hitY, hitZ, meta, placer);
return state.withProperty(FACING, placer.getHorizontalFacing()).withProperty(ACTIVE, Boolean.valueOf(false));
}
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack){
if (stack.hasDisplayName()){
((TileFirebox) world.getTileEntity(pos)).setCustomName(stack.getDisplayName());
}
System.out.println(state.getBlock().getMetaFromState(state));
}
@Override
public int getMetaFromState(IBlockState state) {
int i = 0;
if( (state.getValue(FACING) == EnumFacing.EAST) && state.getValue(ACTIVE) == false){
i = 0;
return i;
}
if( (state.getValue(FACING) == EnumFacing.WEST) && state.getValue(ACTIVE) == false){
i = 1;
return i;
}
if( (state.getValue(FACING) == EnumFacing.SOUTH) && state.getValue(ACTIVE) == false){
i = 2;
return i;
}
if( (state.getValue(FACING) == EnumFacing.NORTH) && state.getValue(ACTIVE) == false){
i = 3;
return i;
}
if( (state.getValue(FACING) == EnumFacing.EAST) && state.getValue(ACTIVE) == true){
i = 4;
return i;
}
if( (state.getValue(FACING) == EnumFacing.WEST) && state.getValue(ACTIVE) == true){
i = 5;
return i;
}
if( (state.getValue(FACING) == EnumFacing.SOUTH) && state.getValue(ACTIVE) == true){
i = 6;
return i;
}
if( (state.getValue(FACING) == EnumFacing.NORTH) && state.getValue(ACTIVE) == true){
i = 7;
return i;
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta) {
EnumFacing enumfacing;
Boolean active;
switch (meta & 7)
{
case 0:
enumfacing = EnumFacing.EAST;
active = false;
break;
case 1:
enumfacing = EnumFacing.WEST;
active = false;
break;
case 2:
enumfacing = EnumFacing.SOUTH;
active = false;
break;
case 3:
enumfacing = EnumFacing.NORTH;
active = false;
break;
case 4:
enumfacing = EnumFacing.EAST;
active = true;
break;
case 5:
enumfacing = EnumFacing.WEST;
active = true;
break;
case 6:
enumfacing = EnumFacing.SOUTH;
active = true;
break;
case 7:
enumfacing = EnumFacing.NORTH;
active = true;
break;
default:
enumfacing = EnumFacing.NORTH;
active = false;
}
return this.getDefaultState().withProperty(FACING, enumfacing).withProperty(ACTIVE, Boolean.valueOf(active));
}
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, new IProperty[] {FACING, ACTIVE});
}
@Override
public boolean isFullCube(IBlockState state)
{
return false;
}
@Override
public boolean isFullyOpaque(IBlockState state)
{
return false;
}
@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
return true;
}
@Override
public EnumBlockRenderType getRenderType(IBlockState state)
{
return EnumBlockRenderType.MODEL;
}
}
/*
Firebox States
Off
On
*/

View File

@@ -0,0 +1,28 @@
package nmd.primal.forgecraft.compat;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.IFuelHandler;
import java.util.Map;
/**
* Created by kitsu on 12/3/2016.
*/
//public class FuelHandler implements IFuelHandler {
/*@Override
public int getBurnTime(ItemStack fuelStack)
{
//if (ModConfig.FEATURE_ENABLE_FUELS) {
//CommonUtils.debugLogger(2, "fuel", "size: " + ModRegistries.FUEL_REGISTRY.size() + ", value: " + ModRegistries.FUEL_REGISTRY.get(fuelStack));
for (Map.Entry<ItemStack, Integer> entry : ForgeCraftRegistries.FUEL_REGISTRY.entrySet())
{
if (entry.getKey().isItemEqual(fuelStack))
return entry.getValue();
}
//}
return 0;
}*/
//}

View File

@@ -0,0 +1,46 @@
package nmd.primal.forgecraft.init;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraftforge.fml.common.registry.GameRegistry;
import nmd.primal.forgecraft.blocks.Firebox;
/**
* Created by kitsu on 11/26/2016.
*/
public class ModBlocks {
public static Block firebox;
public static void init() {
firebox = new Firebox(Material.ROCK);
}
public static void register() {
registerBlock(firebox);
}
public static void registerRenders() {
registerRender(firebox);
}
private static void registerBlock(Block block) {
GameRegistry.register(block);
ItemBlock item = new ItemBlock(block);
item.setRegistryName(block.getRegistryName());
GameRegistry.register(item);
}
private static void registerRender(Block block) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
}
}

View File

@@ -0,0 +1,17 @@
package nmd.primal.forgecraft.init;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
/**
* Created by kitsu on 11/30/2016.
*/
public class ModCrafting {
public static void register() {
GameRegistry.addShapedRecipe(new ItemStack(ModBlocks.firebox), "X X", "XYX", "X X", 'X', Items.BRICK, 'Y', Blocks.FURNACE);
}
}

View File

@@ -0,0 +1,38 @@
package nmd.primal.forgecraft.init;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.registry.GameRegistry;
import nmd.primal.forgecraft.items.ItemTest;
/**
* Created by kitsu on 11/26/2016.
*/
public class ModItems {
public static Item test;
//public static Item cheese;
public static void init() {
//test = new ItemTest();
//cheese = new ItemCheese();
}
public static void register() {
//GameRegistry.register(test);
//GameRegistry.register(cheese);
}
public static void registerRenders() {
//registerRender(cheese);
//registerRender(test);
}
private static void registerRender(Item item) {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
}
}

View File

@@ -0,0 +1,19 @@
package nmd.primal.forgecraft.init;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
/**
* Created by kitsu on 12/3/2016.
*/
public class ModRegistries {
public static void registerFuels()
{
//if (ModConfig.FEATURE_ENABLE_FUELS)
//{
}
}

View File

@@ -0,0 +1,20 @@
package nmd.primal.forgecraft.init;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityNote;
import net.minecraftforge.fml.common.registry.GameRegistry;
import nmd.primal.forgecraft.tiles.TileFirebox;
/**
* Created by kitsu on 12/2/2016.
*/
public class ModTiles {
public static void registerTileEntities () {
registerTileEntity(TileFirebox.class, "firebox");
}
private static void registerTileEntity(Class<? extends TileEntity> tile_class, String baseName) {
GameRegistry.registerTileEntity(tile_class, "tile.forgecraft." + baseName);
}
}

View File

@@ -0,0 +1,26 @@
package nmd.primal.forgecraft.items;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import nmd.primal.forgecraft.ModInfo;
/**
* Created by kitsu on 11/26/2016.
*/
public class BaseItem extends Item
{
public BaseItem()
{
this.setCreativeTab(ModInfo.TAB_FORGECRAFT);
}
public String getName() {
return this.getRegistryName().toString();
}
public static boolean isHidden()
{
return false;
}
}

View File

@@ -0,0 +1,19 @@
package nmd.primal.forgecraft.items;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.fml.common.Mod;
import nmd.primal.forgecraft.ModInfo;
/**
* Created by kitsu on 11/26/2016.
*/
public class ItemTest extends BaseItem {
public ItemTest() {
setUnlocalizedName(ModInfo.ForgecraftItems.TEST.getUnlocalizedName());
setRegistryName(ModInfo.ForgecraftItems.TEST.getRegistryName());
}
}

View File

@@ -0,0 +1,31 @@
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.TileFireboxRender;
import nmd.primal.forgecraft.tiles.TileFirebox;
import static nmd.primal.forgecraft.init.ModItems.*;
/**
* Created by kitsu on 11/26/2016.
*/
public class ClientProxy implements CommonProxy {
@Override
public void init() {
ModItems.registerRenders();
ModBlocks.registerRenders();
this.registerTileRendering();
}
//@Override
public void registerTileRendering()
{
ClientRegistry.bindTileEntitySpecialRenderer(TileFirebox.class, new TileFireboxRender());
}
}

View File

@@ -0,0 +1,10 @@
package nmd.primal.forgecraft.proxy;
/**
* Created by kitsu on 11/26/2016.
*/
public interface CommonProxy {
public void init();
}

View File

@@ -0,0 +1,12 @@
package nmd.primal.forgecraft.proxy;
/**
* Created by kitsu on 11/26/2016.
*/
public class ServerProxy implements CommonProxy {
@Override
public void init() {
}
}

View File

@@ -0,0 +1,121 @@
package nmd.primal.forgecraft.renders;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHorizontal;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import nmd.primal.forgecraft.blocks.Firebox;
import nmd.primal.forgecraft.tiles.TileFirebox;
import org.lwjgl.opengl.GL11;
/**
* Created by kitsu on 12/4/2016.
*/
public class TileFireboxRender extends TileEntitySpecialRenderer<TileFirebox>
{
private final RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
private int rotation;
private float translateX, translateZ;
private double textX, textZ;
private EntityItem entItem = null;
@Override
public void renderTileEntityAt(TileFirebox tile, double x, double y, double z, float partialTicks, int destroyStage) {
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y + 0.875D, z + 0.5D);
GL11.glScalef(0.25F, 0.25F, 0.25F);
World world = tile.getWorld();
IBlockState state = world.getBlockState(tile.getPos());
switch(state.getValue(BlockHorizontal.FACING))
{
case NORTH:
rotation = 0;
//Left and Right
translateX = 1.5f;
//Back and Forth
translateZ = 1.05f;
break;
case EAST:
rotation = 3;
translateZ = 1.0f;
translateX = 1.4f;
break;
case SOUTH:
rotation = 2;
//Left and Right
translateX = 1.5f;
//Back and Forth
translateZ = 0.9f;
break;
case WEST:
rotation = 1;
//Back and Forth
translateX = 1.5f;
//Left and Right
translateZ = 1.0f;
break;
}
GL11.glTranslatef(-1.5F, -0.0F, -1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
float prevLGTX = OpenGlHelper.lastBrightnessX;
float prevLGTY = OpenGlHelper.lastBrightnessY;
BlockPos pos = tile.getPos();
int bright = tile.getWorld().getCombinedLight(pos.up(), 0);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, bright % 65536, bright / 65536);
ItemStack stack = tile.getStackInSlot(0);
if (stack != null) {
boolean is_block = stack.getItem() instanceof ItemBlock;
float height = -0.75f;
float scale = is_block ? 0.9F : 1.6F;
int stackSize = stack.stackSize;
GL11.glPushMatrix();
GL11.glTranslatef(translateX, height, translateZ);
GL11.glScalef(scale, scale, scale);
GL11.glRotatef(90.0F * rotation, 0.0F, 1.0F, 0.0F);
Integer temp = tile.getStackInSlot(0).stackSize;
renderItem.renderItem(stack, renderItem.getItemModelMesher().getItemModel(stack));
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
//float scale = is_block ? 0.9F : 1.6F;
if(is_block){
GL11.glScalef(0.08F,0.08F, 0.08f);
textZ = -23.0D;
} else {
GL11.glScalef(0.05F,0.05F, 0.05f);
textZ = -22.0D;
}
GL11.glTranslatef(0.0F, 2.0f, 0.0F);
GL11.glTranslated(0.0F, 0.0D, textZ);
getFontRenderer().drawString(temp.toString(), 0, 0, 4210752);
GL11.glPopMatrix();
}
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, prevLGTX, prevLGTY);
GL11.glPopMatrix();
}
}

View File

@@ -0,0 +1,47 @@
package nmd.primal.forgecraft.tiles;
import net.minecraft.block.state.IBlockState;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/**
* Created by kitsu on 12/3/2016.
*/
public abstract class BaseTile extends TileEntity{
@Override
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate)
{
return oldState.getBlock() != newSate.getBlock();
}
@Override
public void readFromNBT(NBTTagCompound nbt)
{
super.readFromNBT(nbt);
this.readNBT(nbt);
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
{
nbt = super.writeToNBT(nbt);
return this.writeNBT(nbt);
}
public NBTTagCompound readNBT(NBTTagCompound nbt)
{
// Override in lower tile classes
return nbt;
}
public NBTTagCompound writeNBT(NBTTagCompound nbt)
{
// Override in lower tile classes
return nbt;
}
}

View File

@@ -0,0 +1,291 @@
package nmd.primal.forgecraft.tiles;
import com.sun.org.apache.xpath.internal.operations.Bool;
import net.minecraft.block.Block;
import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.blocks.Firebox;
import nmd.primal.forgecraft.init.ModBlocks;
import org.omg.PortableInterceptor.ACTIVE;
import net.minecraft.block.BlockFurnace;
import static net.minecraft.block.BlockHorizontal.FACING;
import static nmd.primal.forgecraft.CommonUtils.getVanillaItemBurnTime;
/**
* Created by mminaie on 11/30/16.
*/
public class TileFirebox extends BaseTile implements IInventory, ITickable {
private ItemStack[] inventory = new ItemStack [0];
private String customName;
private int iteration = 0;
public TileFirebox() {
this.inventory = new ItemStack[this.getSizeInventory()];
}
@Override
public void update () {
if(!worldObj.isRemote){
World world = this.getWorld();
this.iteration ++;
if(this.iteration == 200 ) {
//System.out.println(iteration);
this.iteration = 0;
IBlockState state = world.getBlockState(this.pos);
BlockPos abovePos = new BlockPos(this.getPos().getX(), this.getPos().getY()+1, this.getPos().getZ());
IBlockState aboveState = world.getBlockState(abovePos);
if (worldObj.getBlockState(this.getPos()).getValue(Firebox.ACTIVE)) {
if (this.getStackInSlot(0) == null) {
worldObj.setBlockState(this.getPos(), state.withProperty(Firebox.ACTIVE, false), 2);
this.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
} else {
if(this.getStackInSlot(0) != null) {
if (worldObj.rand.nextInt((int) Math.floor(getVanillaItemBurnTime(this.getStackInSlot(0)) / 20)) == 0) {
this.decrStackSize(0, 1);
this.markDirty();
world.notifyBlockUpdate(pos, state, state, 2);
}
if(world.getBlockState(abovePos).getBlock() instanceof BlockFurnace){
//System.out.println("Trying to set Block Furnace State active");
IBlockState iblockstate = world.getBlockState(abovePos);
TileEntityFurnace tileFurnace = (TileEntityFurnace) world.getTileEntity(abovePos);
if(world.getBlockState(abovePos).getBlock() == Blocks.LIT_FURNACE){
tileFurnace.setField(0,1000);
}
if(world.getBlockState(abovePos).getBlock() == Blocks.FURNACE){
BlockFurnace.setState(true, world, abovePos);
//world.setBlockState(abovePos, Blocks.LIT_FURNACE.getDefaultState().withProperty(FACING, iblockstate.getValue(FACING)), 3);
tileFurnace.setField(0,1000);
}
}
}
}
}
}
}
/*if (worldObj.isRemote){
World world = this.getWorld();
if(this.getStackInSlot(0)!=null){
renderItem = new EntityItem(world, this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), this.getStackInSlot(0));
}
}*/
}
public String getCustomName() {
return customName;
}
public void setCustomName (String customName){
this.customName = customName;
}
@Override
public String getName(){
//if custName is true return this.customName if false return --v
// ? means if true : means if false
return this.hasCustomName() ? this.customName : "container.firebox";
}
@Override
public boolean hasCustomName() {
return this.customName != null && !this.customName.equals("");
}
public int getSizeInventory() {
return 1;
}
@Override
public ItemStack getStackInSlot(int index) {
if (index < 0 || index >= this.getSizeInventory())
return null;
return this.inventory[index];
}
@Override
public ItemStack decrStackSize(int index, int count) {
if (this.getStackInSlot(index) != null) {
ItemStack itemstack;
if (this.getStackInSlot(index).stackSize <= count) {
itemstack = this.getStackInSlot(index);
this.setInventorySlotContents(index, null);
this.markDirty();
return itemstack;
} else {
itemstack = this.getStackInSlot(index).splitStack(count);
if (this.getStackInSlot(index).stackSize <= 0) {
this.setInventorySlotContents(index, null);
} else {
//Just to show that changes happened
this.setInventorySlotContents(index, this.getStackInSlot(index));
}
this.markDirty();
return itemstack;
}
} else {
return null;
}
}
@Override
public void setInventorySlotContents(int index, ItemStack stack) {
if (index < 0 || index >= this.getSizeInventory()) {
return;
}
if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
stack.stackSize = this.getInventoryStackLimit();
}
if (stack != null && stack.stackSize == 0) {
stack = null;
}
this.inventory[index] = stack;
this.markDirty();
World world = this.getWorld();
IBlockState state = world.getBlockState(this.pos);
world.notifyBlockUpdate(this.pos, state, state, 3);
}
@Override
public ItemStack removeStackFromSlot(int index) {
ItemStack stack = this.getStackInSlot(index);
this.setInventorySlotContents(index, null);
return stack;
}
@Override
public int getInventoryStackLimit() {
return 64;
}
@Override
public boolean isUseableByPlayer(EntityPlayer player){
return this.worldObj.getTileEntity(this.getPos()) == this && player.getDistanceSq(this.pos.add(0.5, 0.5, 0.5f)) <= 64;
}
@Override
public void openInventory(EntityPlayer player) {
}
public void closeInventory(EntityPlayer player){
}
@Override
public boolean isItemValidForSlot(int index, ItemStack stack) {
return true;
}
public int getField(int id) {
return 0;
}
@Override
public void setField(int id, int value) {
}
@Override
public int getFieldCount() {
return 0;
}
@Override
public void clear() {
for(int i = 0; i < this.getSizeInventory(); i++){
this.setInventorySlotContents(i, null);
}
}
// ***************************************************************************** //
// NBT
// ***************************************************************************** //
@Override
public NBTTagCompound readNBT(NBTTagCompound nbt)
{
NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
inventory = new ItemStack[this.getSizeInventory()];
for (int i = 0; i < list.tagCount(); ++i)
{
NBTTagCompound tag = list.getCompoundTagAt(i);
this.inventory[tag.getByte("slot")] = ItemStack.loadItemStackFromNBT(tag);
}
if (nbt.hasKey("CustomName", 8)) {
this.setCustomName(nbt.getString("CustomName"));
}
return nbt;
}
@Override
public NBTTagCompound writeNBT(NBTTagCompound nbt)
{
NBTTagList list = new NBTTagList();
///
// RackMatrix
///
for (int i = 0; i < this.getSizeInventory(); ++i)
{
if (inventory[i] != null) {
NBTTagCompound tag = new NBTTagCompound();
tag.setByte("slot", (byte) i);
inventory[i].writeToNBT(tag);
list.appendTag(tag);
}
}
nbt.setTag("Items", list);
return nbt;
}
@Override
public NBTTagCompound getUpdateTag()
{
return writeToNBT(new NBTTagCompound());
}
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
return new SPacketUpdateTileEntity(this.pos, 0, this.writeToNBT(new NBTTagCompound()));
}
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
this.readFromNBT(packet.getNbtCompound());
}
}

View File

@@ -0,0 +1,12 @@
{
"variants": {
"active=false,facing=north": { "model": "forgecraft:firebox" },
"active=false,facing=east": { "model": "forgecraft:firebox", "y": 90 },
"active=false,facing=south": { "model": "forgecraft:firebox", "y": 180 },
"active=false,facing=west": { "model": "forgecraft:firebox", "y": 270 },
"active=true,facing=north": { "model": "forgecraft:firebox_lit" },
"active=true,facing=east": { "model": "forgecraft:firebox_lit", "y": 90 },
"active=true,facing=south": { "model": "forgecraft:firebox_lit", "y": 180 },
"active=true,facing=west": { "model": "forgecraft:firebox_lit", "y": 270 }
}
}

View File

@@ -0,0 +1,3 @@
item.test.name=test
tile.firebox.name=Firebox
itemGroup.forgecraft=ForgeCraft

View File

@@ -0,0 +1,239 @@
{
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
"parent": "block/block",
"textures": {
"texture": "forgecraft:blocks/checker_test",
"texture2": "forgecraft:blocks/firebox_racks",
"firebox_leg": "forgecraft:blocks/firebox_legs",
"texture4": "forgecraft:blocks/brick"
},
"elements": [
{
"__comment": "Back",
"from": [ 0, 8, 0 ],
"to": [ 16, 16, 2 ],
"faces": {
"down": { "uv": [ 0, 14.5, 16, 16 ], "texture": "#texture4" },
"up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture4" },
"north": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture4" },
"south": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture4" },
"west": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"east": { "uv": [ 14, 0, 16, 8 ], "texture": "#texture4" }
}
},
{
"__comment": "Bot",
"from": [ 0, 5, 0 ],
"to": [ 16, 8, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture4" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture4" },
"north": { "uv": [ 0, 8, 16, 11 ], "texture": "#texture4" },
"south": { "uv": [ 0, 8, 16, 11 ], "texture": "#texture4" },
"west": { "uv": [ 0, 8, 16, 11 ], "texture": "#texture4" },
"east": { "uv": [ 0, 8, 16, 11 ], "texture": "#texture4" }
}
},
{
"__comment": "AirSideLeft",
"from": [ 0, 8, 2 ],
"to": [ 2, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 2, 16 ], "texture": "#texture4" },
"up": { "uv": [ 0, 0, 2, 15 ], "texture": "#texture4" },
"north": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"south": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"west": { "uv": [ 0, 0, 14, 8 ], "texture": "#texture4" },
"east": { "uv": [ 0, 0, 14, 8 ], "texture": "#texture4" }
}
},
{
"__comment": "AirSideRight",
"from": [ 14, 8, 2 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 2, 16 ], "texture": "#texture4" },
"up": { "uv": [ 0, 0, 2, 15 ], "texture": "#texture4" },
"north": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"south": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"west": { "uv": [ 0, 0, 14, 8 ], "texture": "#texture4" },
"east": { "uv": [ 0, 0, 14, 8 ], "texture": "#texture4" }
}
},
{
"__comment": "Front0",
"from": [ 2, 8, 14 ],
"to": [ 4, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 2, 2 ], "texture": "#texture4" },
"up": { "uv": [ 0, 14, 2, 12 ], "texture": "#texture4" },
"north": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"south": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"west": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"east": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" }
}
},
{
"__comment": "Front1",
"from": [ 12, 8, 14 ],
"to": [ 14, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 2, 2 ], "texture": "#texture4" },
"up": { "uv": [ 0, 14, 2, 12 ], "texture": "#texture4" },
"north": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"south": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"west": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"east": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" }
}
},
{
"__comment": "Front2",
"from": [ 4, 13, 14 ],
"to": [ 12, 16, 16 ],
"faces": {
"down": { "uv": [ 4, 5, 12, 7 ], "texture": "#texture4" },
"up": { "uv": [ 4, 5, 12, 7 ], "texture": "#texture4" },
"north": { "uv": [ 4, 4, 12, 7 ], "texture": "#texture4" },
"south": { "uv": [ 4, 4, 12, 7 ], "texture": "#texture4" },
"west": { "uv": [ 15, 0, 16, 4 ], "texture": "#texture" },
"east": { "uv": [ 0, 0, 1, 4 ], "texture": "#texture4" }
}
},
{
"__comment": "Holder0",
"from": [ 6.5, 15, 2 ],
"to": [ 7.3, 15.8, 14 ],
"rotation": { "origin": [ 6.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Leg0",
"from": [ 12, 0, 0 ],
"to": [ 16, 5, 4 ],
"faces": {
"down": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"up": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"north": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"south": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"west": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"east": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" }
}
},
{
"__comment": "Leg1",
"from": [ 0, 0, 12 ],
"to": [ 4, 5, 16 ],
"faces": {
"down": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"up": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"north": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"south": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"west": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"east": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" }
}
},
{
"__comment": "Leg2",
"from": [ 0, 0, 0 ],
"to": [ 4, 5, 4 ],
"faces": {
"down": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"up": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"north": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"south": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"west": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"east": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" }
}
},
{
"__comment": "Leg3",
"from": [ 12, 0, 12 ],
"to": [ 16, 5, 16 ],
"faces": {
"down": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"up": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"north": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"south": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"west": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"east": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" }
}
},
{
"__comment": "Holder1",
"from": [ 10.5, 15, 2 ],
"to": [ 11.3, 15.8, 14 ],
"rotation": { "origin": [ 10.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Holder2",
"from": [ 12.5, 15, 2 ],
"to": [ 13.3, 15.8, 14 ],
"rotation": { "origin": [ 12.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Holder3",
"from": [ 2.5, 15, 2 ],
"to": [ 3.3, 15.8, 14 ],
"rotation": { "origin": [ 2.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Holder4",
"from": [ 4.5, 15, 2 ],
"to": [ 5.3, 15.8, 14 ],
"rotation": { "origin": [ 4.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Holder5",
"from": [ 8.5, 15, 2 ],
"to": [ 9.3, 15.8, 14 ],
"rotation": { "origin": [ 8.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
}
]
}

View File

@@ -0,0 +1,240 @@
{
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
"parent": "forgecraft:block/firebox",
"textures": {
"texture": "forgecraft:blocks/checker_test",
"texture2": "forgecraft:blocks/firebox_racks",
"firebox_leg": "forgecraft:blocks/firebox_legs",
"texture4": "forgecraft:blocks/brick",
"texture4_lit": "forgecraft:blocks/brick_lit"
},
"elements": [
{
"__comment": "Back",
"from": [ 0, 8, 0 ],
"to": [ 16, 16, 2 ],
"faces": {
"down": { "uv": [ 0, 14.5, 16, 16 ], "texture": "#texture4" },
"up": { "uv": [ 0, 0, 16, 2 ], "texture": "#texture4" },
"north": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture4" },
"south": { "uv": [ 0, 0, 16, 8 ], "texture": "#texture4_lit" },
"west": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"east": { "uv": [ 14, 0, 16, 8 ], "texture": "#texture4" }
}
},
{
"__comment": "Bot",
"from": [ 0, 5, 0 ],
"to": [ 16, 8, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture4" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture4_lit" },
"north": { "uv": [ 0, 8, 16, 11 ], "texture": "#texture4" },
"south": { "uv": [ 0, 8, 16, 11 ], "texture": "#texture4" },
"west": { "uv": [ 0, 8, 16, 11 ], "texture": "#texture4" },
"east": { "uv": [ 0, 8, 16, 11 ], "texture": "#texture4" }
}
},
{
"__comment": "AirSideLeft",
"from": [ 0, 8, 2 ],
"to": [ 2, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 2, 16 ], "texture": "#texture4" },
"up": { "uv": [ 0, 0, 2, 15 ], "texture": "#texture4" },
"north": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"south": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"west": { "uv": [ 0, 0, 14, 8 ], "texture": "#texture4" },
"east": { "uv": [ 0, 0, 14, 8 ], "texture": "#texture4_lit" }
}
},
{
"__comment": "AirSideRight",
"from": [ 14, 8, 2 ],
"to": [ 16, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 2, 16 ], "texture": "#texture4" },
"up": { "uv": [ 0, 0, 2, 15 ], "texture": "#texture4" },
"north": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"south": { "uv": [ 0, 0, 2, 8 ], "texture": "#texture4" },
"west": { "uv": [ 0, 0, 14, 8 ], "texture": "#texture4_lit" },
"east": { "uv": [ 0, 0, 14, 8 ], "texture": "#texture4" }
}
},
{
"__comment": "Front0",
"from": [ 2, 8, 14 ],
"to": [ 4, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 2, 2 ], "texture": "#texture4" },
"up": { "uv": [ 0, 14, 2, 12 ], "texture": "#texture4" },
"north": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"south": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"west": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"east": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4_lit" }
}
},
{
"__comment": "Front1",
"from": [ 12, 8, 14 ],
"to": [ 14, 16, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 2, 2 ], "texture": "#texture4" },
"up": { "uv": [ 0, 14, 2, 12 ], "texture": "#texture4" },
"north": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"south": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" },
"west": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4_lit" },
"east": { "uv": [ 13, 0, 15, 8 ], "texture": "#texture4" }
}
},
{
"__comment": "Front2",
"from": [ 4, 13, 14 ],
"to": [ 12, 16, 16 ],
"faces": {
"down": { "uv": [ 4, 5, 12, 7 ], "texture": "#texture4_lit" },
"up": { "uv": [ 4, 5, 12, 7 ], "texture": "#texture4" },
"north": { "uv": [ 4, 4, 12, 7 ], "texture": "#texture4" },
"south": { "uv": [ 4, 4, 12, 7 ], "texture": "#texture4" },
"west": { "uv": [ 15, 0, 16, 4 ], "texture": "#texture" },
"east": { "uv": [ 0, 0, 1, 4 ], "texture": "#texture4" }
}
},
{
"__comment": "Holder0",
"from": [ 6.5, 15, 2 ],
"to": [ 7.3, 15.8, 14 ],
"rotation": { "origin": [ 6.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Leg0",
"from": [ 12, 0, 0 ],
"to": [ 16, 5, 4 ],
"faces": {
"down": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"up": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"north": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"south": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"west": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"east": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" }
}
},
{
"__comment": "Leg1",
"from": [ 0, 0, 12 ],
"to": [ 4, 5, 16 ],
"faces": {
"down": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"up": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"north": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"south": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"west": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"east": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" }
}
},
{
"__comment": "Leg2",
"from": [ 0, 0, 0 ],
"to": [ 4, 5, 4 ],
"faces": {
"down": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"up": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"north": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"south": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"west": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"east": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" }
}
},
{
"__comment": "Leg3",
"from": [ 12, 0, 12 ],
"to": [ 16, 5, 16 ],
"faces": {
"down": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"up": { "uv": [ 0, 12, 4, 16 ], "texture": "#firebox_leg" },
"north": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"south": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"west": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" },
"east": { "uv": [ 0, 10.5, 4, 15.5 ], "texture": "#firebox_leg" }
}
},
{
"__comment": "Holder1",
"from": [ 10.5, 15, 2 ],
"to": [ 11.3, 15.8, 14 ],
"rotation": { "origin": [ 10.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Holder2",
"from": [ 12.5, 15, 2 ],
"to": [ 13.3, 15.8, 14 ],
"rotation": { "origin": [ 12.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Holder3",
"from": [ 2.5, 15, 2 ],
"to": [ 3.3, 15.8, 14 ],
"rotation": { "origin": [ 2.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Holder4",
"from": [ 4.5, 15, 2 ],
"to": [ 5.3, 15.8, 14 ],
"rotation": { "origin": [ 4.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
},
{
"__comment": "Holder5",
"from": [ 8.5, 15, 2 ],
"to": [ 9.3, 15.8, 14 ],
"rotation": { "origin": [ 8.5, 15, 2 ], "axis": "z", "angle": -45 },
"faces": {
"down": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"up": { "uv": [ 0, 0, 1, 12 ], "texture": "#texture2", "tintindex": 0 },
"north": { "uv": [ 0, 0, 1, 1 ], "texture": "#texture2", "tintindex": 0 },
"south": { "uv": [ 0, 16, 1, 15 ], "texture": "#texture2", "tintindex": 0 },
"west": { "uv": [ 0, 16, 12, 15 ], "texture": "#texture2", "tintindex": 0 },
"east": { "uv": [ 16, 16, 4, 15 ], "texture": "#texture2", "tintindex": 0 }
}
}
]
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "forgecraft:items/test"
}
}

View File

@@ -0,0 +1,3 @@
{
"parent": "forgecraft:/block/firebox"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

View File

@@ -1,16 +1,14 @@
[
{
"modid": "examplemod",
"name": "Example Mod",
"description": "Example placeholder mod.",
"version": "${version}",
"mcversion": "${mcversion}",
[{
"modid": "forgecraft",
"name": "Kitsu's Forgecraft",
"description": "Forged with sweat and blood",
"version": "1.0.0",
"mcversion": "1.10.2",
"url": "",
"updateUrl": "",
"authorList": ["ExampleDude"],
"credits": "The Forge and FML guys, for making this example",
"logoFile": "",
"authorList": ["KitsuShadow"],
"credits": "KitsuShadow, Fluid1C3, Ishvad, Sygmarr, An Sar",
"logoFile": "assets/forgecraft/textures/logo.png",
"screenshots": [],
"dependencies": []
}
]
}]