Look at Block Logs, and Block Old Logs. They have metadata values. all you have to do is specify the corresponding values with Logs, and Planks, in your recipe.
refined_oak_plank = new SawmillRecipe (new ItemStack(BlockPlanks.EnumType.OAK, 1), new ItemStack(Items.ARROW, 1));
but it gives me an error saying:
Description Resource Path Location Type
The constructor ItemStack(BlockPlanks.EnumType, int) is undefined SawmillRecipes.java /Kenneths Mod/src/main/java/kenneths_mod/medieval_mod/objects/machines/sawmill line 27 Java Problem
Rollback Post to RevisionRollBack
Finds a server that says "No PvP"
*Pushes AFK player off cliff*
Steals Player's Stuff
Admin Can't do anything cause I didn't hit him so "no actual PvP".
I am trying to make a sawmill that when people place logs in the sawmill's GUI, it saws the log into its corresponding plank.
Is there any way to specify what log creates what planks?
Finds a server that says "No PvP"
*Pushes AFK player off cliff*
Steals Player's Stuff
Admin Can't do anything cause I didn't hit him so "no actual PvP".
Look at Block Logs, and Block Old Logs. They have metadata values. all you have to do is specify the corresponding values with Logs, and Planks, in your recipe.
Okay I tried:
but it gives me an error saying:
Description Resource Path Location Type
The constructor ItemStack(BlockPlanks.EnumType, int) is undefined SawmillRecipes.java /Kenneths Mod/src/main/java/kenneths_mod/medieval_mod/objects/machines/sawmill line 27 Java Problem
Finds a server that says "No PvP"
*Pushes AFK player off cliff*
Steals Player's Stuff
Admin Can't do anything cause I didn't hit him so "no actual PvP".
Ok I now tried:
and it seems to work thanks.
Edit: actually now when I put the planks in it does nothing.... not working
Finds a server that says "No PvP"
*Pushes AFK player off cliff*
Steals Player's Stuff
Admin Can't do anything cause I didn't hit him so "no actual PvP".
made more changes:
But it does not seem to work for oak planks. plz help.
Finds a server that says "No PvP"
*Pushes AFK player off cliff*
Steals Player's Stuff
Admin Can't do anything cause I didn't hit him so "no actual PvP".
But your Birch, and Spruce, are working?
yes
Finds a server that says "No PvP"
*Pushes AFK player off cliff*
Steals Player's Stuff
Admin Can't do anything cause I didn't hit him so "no actual PvP".
Here is the container code:
(Also it now only seems to work with birch)
package kenneths_mod.medieval_mod.objects.machines.sawmill;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;
public class SawmillContainer extends Container {
private final SawmillTE tileentity;
private int sawTime;
public SawmillContainer(InventoryPlayer player, SawmillTE tileentity) {
this.tileentity = tileentity;
IItemHandler handler = tileentity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
this.addSlotToContainer(new SlotItemHandler(handler, 0, 39, 34));
this.addSlotToContainer(new SlotItemHandler(handler, 1, 72, 34) {
public boolean isItemValid (ItemStack stack) {
return false;
}
});
for(int y = 0; y < 3; y++) {
for(int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(player, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
}
}
for(int x = 0; x < 9; x++) {
this.addSlotToContainer(new Slot(player, x, 8 + x * 18, 142));
}
}
@Override
public boolean canInteractWith(EntityPlayer playerIn) {
return true;
}
@Override
public void detectAndSendChanges() {
super.detectAndSendChanges();
for(int i = 0; i < this.listeners.size(); i++) {
IContainerListener listener = (IContainerListener)this.listeners.get(i);
if(this.sawTime != this.tileentity.getField(0)) {
listener.sendWindowProperty(this, 0, this.tileentity.getField(0));
}
}
this.sawTime = this.tileentity.getField(0);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = (Slot) this.inventorySlots.get(index);
if(slot != null && slot.getHasStack()) {
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if(index >= 0 && index < 27) {
if(!this.mergeItemStack(itemstack1, 27, 36, false)) {
return ItemStack.EMPTY;
}
} else if (index >= 27 && index < 36) {
if(!this.mergeItemStack(itemstack1, 0, 27, false)) {
return ItemStack.EMPTY;
}
} else if (!this.mergeItemStack(itemstack1, 0, 36, false)) {
return ItemStack.EMPTY;
}
if(itemstack1.isEmpty()) {
slot.putStack(ItemStack.EMPTY);
} else {
slot.onSlotChanged();
}
if(itemstack1.getCount() == itemstack.getCount()) {
return ItemStack.EMPTY;
}
slot.onTake(playerIn, itemstack1);
}
return itemstack;
}
public void onContainerClosed(EntityPlayer playerIn) {
super.onContainerClosed(playerIn);
}
}
Finds a server that says "No PvP"
*Pushes AFK player off cliff*
Steals Player's Stuff
Admin Can't do anything cause I didn't hit him so "no actual PvP".