Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
1.8 Version Ready to GO
Browse files Browse the repository at this point in the history
Easy enough upgrade, items/blocks have models.json now, pulled the same
scaling that a potato has.

Everything else was a clean port.
  • Loading branch information
renevo committed Feb 3, 2015
1 parent 50c928e commit 8327360
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 29 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ Minecraft Portable Workbench

Working with the code

gradlew setupDevWorkspace
gradlew eclipse
gradlew setupDecompWorkspace
gradlew build


1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ archivesBaseName = "portablecraftbench"
minecraft {
version = "1.8-11.14.0.1298"
runDir = "eclipse"
mappings = 'snapshot_nodoc_20141130'
}

processResources
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/renevo/pcb/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.renevo.pcb;

import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.model.ModelResourceLocation;

public class ClientProxy extends CommonProxy {

@Override
Expand All @@ -26,4 +29,9 @@ public void postInitialization() {
// Railcraft
NeiIntegration.registerCraftingContainers("mods.railcraft.client.gui.GuiCartWork");
}

@Override
public void initialization() {
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(ItemPortableCraftBench.portableCraftBench, 0, new ModelResourceLocation(PortableCraftBenchMod.MODID + ":" + "portableCraftBench", "inventory"));
}
}
4 changes: 4 additions & 0 deletions src/main/java/com/renevo/pcb/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ public class CommonProxy {
public void postInitialization() {

}

public void initialization() {

}
}
6 changes: 3 additions & 3 deletions src/main/java/com/renevo/pcb/ContainerPortableCraftBench.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.*;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;

public class ContainerPortableCraftBench extends net.minecraft.inventory.ContainerWorkbench {

public ContainerPortableCraftBench(InventoryPlayer inventoryPlayer, World world, int x, int y, int z) {
super(inventoryPlayer, world, x, y, z);
public ContainerPortableCraftBench(InventoryPlayer inventoryPlayer, World world, BlockPos pos) {
super(inventoryPlayer, world, pos);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/renevo/pcb/GuiPortableCraftBench.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
Expand All @@ -13,8 +13,8 @@ public class GuiPortableCraftBench extends GuiContainer {

private static final ResourceLocation backgroundResourceLocation = new ResourceLocation("textures/gui/container/crafting_table.png");

public GuiPortableCraftBench(InventoryPlayer playerInventory, World world, int x, int y, int z) {
super(new ContainerPortableCraftBench(playerInventory, world, x, y, z));
public GuiPortableCraftBench(InventoryPlayer playerInventory, World world, BlockPos pos) {
super(new ContainerPortableCraftBench(playerInventory, world, pos));
}

@Override
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/renevo/pcb/ItemPortableCraftBench.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.renevo.pcb;

import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.*;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
Expand Down Expand Up @@ -32,7 +29,6 @@ public ItemPortableCraftBench() {
setMaxStackSize(1);
setUnlocalizedName("portableCraftBench");
setCreativeTab(CreativeTabs.tabTools);
setTextureName(PortableCraftBenchMod.MODID + ":" + "portableCraftBench");
}

@Override
Expand All @@ -45,10 +41,4 @@ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer
return player.getCurrentEquippedItem();
}
}

@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister) {
this.itemIcon = iconRegister.registerIcon(PortableCraftBenchMod.MODID + ":" + "portableCraftBench");
}
}
2 changes: 0 additions & 2 deletions src/main/java/com/renevo/pcb/NeiIntegration.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import net.minecraftforge.fml.common.FMLLog;

import net.minecraft.client.gui.inventory.GuiContainer;

public class NeiIntegration
{
public static void registerCraftingContainers(Class<?> craftingContainer) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.renevo.pcb;

import net.minecraft.client.gui.inventory.GuiCrafting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ContainerWorkbench;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.network.IGuiHandler;
Expand All @@ -13,7 +11,7 @@ public class PortableCraftBenchGuiHandler implements IGuiHandler {
@Override
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
if (id == PortableCraftBenchMod.GUI_PORTABLE_CRAFT_BENCH_ID && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ItemPortableCraftBench.portableCraftBench)
return new GuiPortableCraftBench(player.inventory, world, x, y, z);
return new GuiPortableCraftBench(player.inventory, world, new BlockPos(x, y, z));

FMLLog.info("No GUI to show");
return null;
Expand All @@ -22,7 +20,7 @@ public Object getClientGuiElement(int id, EntityPlayer player, World world, int
@Override
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
if (id == PortableCraftBenchMod.GUI_PORTABLE_CRAFT_BENCH_ID && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ItemPortableCraftBench.portableCraftBench)
return new ContainerPortableCraftBench(player.inventory, world, x, y, z);
return new ContainerPortableCraftBench(player.inventory, world, new BlockPos(x, y, z));

FMLLog.info("No GUI to show");

Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/renevo/pcb/PortableCraftBenchMod.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package com.renevo.pcb;

import org.apache.logging.log4j.Level;

import net.minecraft.init.Blocks;
import net.minecraft.stats.*;
import net.minecraftforge.common.*;
import net.minecraftforge.common.config.*;
import net.minecraftforge.fml.common.*;
import net.minecraftforge.fml.common.Mod.*;
import net.minecraftforge.fml.common.event.*;
Expand Down Expand Up @@ -41,6 +37,8 @@ public void init(FMLInitializationEvent event) {
// 6 left, 0 up/down - since we are just adding a new achievement, we don't need an achievement page, this somehow just works...
achievementPcb = new Achievement("achievement.pcb", "pcb", 6, 0, ItemPortableCraftBench.portableCraftBench, net.minecraft.stats.AchievementList.buildWorkBench);
achievementPcb.registerStat();

proxy.initialization();
}

@EventHandler
Expand Down
18 changes: 18 additions & 0 deletions src/main/resources/assets/pcb/models/item/portableCraftBench.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"parent": "builtin/generated",
"textures": {
"layer0": "pcb:items/portableCraftBench"
},
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}

0 comments on commit 8327360

Please sign in to comment.