I'm working on making a "furnace" that pretty much is supposed to work without an actual fuel supply (so just input and output with the burn time and image to show the process).The problem i'm receiving is that when i pick up an item in the normal inventory or hot bar it instantly un-picks itself up. If I shift click which i got working then it goes to the input slot but is still in the original slot in your inventory (ghost item).
public class Container_Basic_Extractor extends Container{
private Basic_ExtractorTileEntity extractor;
private int extractTime;
private int infPower;
public Container_Basic_Extractor(InventoryPlayer invPlayer, Basic_ExtractorTileEntity basic_ExtractorTE) {
extractTime = 0;
infPower = 0;
extractor = basic_ExtractorTE;
this.addSlotToContainer(new ExtractorSlotItemInv50(basic_ExtractorTE, 0, 80, 37));
this.addSlotToContainer(new Slot(basic_ExtractorTE, 1, 80, 53));
int i;
for (i = 0; i < 3; ++i)
{
for (int j = 0; j < 9; ++j)
{
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 92 + i * 18));
}
}
for (i = 0; i < 9; ++i)
{
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 150));
}
}
public void addCraftingToCrafters (ICrafting crafting) {
super.addCraftingToCrafters(crafting);
crafting.sendProgressBarUpdate(this, 0, this.extractor.extractTime);
crafting.sendProgressBarUpdate(this, 1, this.extractor.infPower);
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return extractor.isUseableByPlayer(player);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slot) {
ItemStack stack = null;
Slot slotObject = (Slot) inventorySlots.get(slot);
if (slotObject != null && slotObject.getHasStack()) {
ItemStack stackInSlot = slotObject.getStack();
stack = stackInSlot.copy();
if (slot < 9) {
if (!this.mergeItemStack(stackInSlot, 0, 35, true)) {
return null;
}
}
else if (!this.mergeItemStack(stackInSlot, 0, 9, false)) {
return null;
}
if (stackInSlot.stackSize == 0) {
slotObject.putStack(null);
} else {
slotObject.onSlotChanged();
}
if (stackInSlot.stackSize == stack.stackSize) {
return null;
}
slotObject.onPickupFromSlot(player, stackInSlot);
}
return stack;
}
}
I would assume that isn't the problem and that it's in the tile entity folder or something else.I'm willing to bet anyone that could help would need to see more code and I'm willing to give it if need be.While i'm on the topic of it, how would I set it to run either without a fuel source or with a never lowering fuel source. I have been following a guide that uses a source and I tried to work around it but to no avail so far.To any potential helpers, thanks
I don't have one of those functions (and didn't) but I got it to work now.
To be quite frank I don't understand why it works now and not before even thought i went bit by bit.
After so many hours of testing it starts to get in my head and blur even with notes t.t
Shift clicking is a pain at the moment though. Spending a bunch of time on that now. It keeps duping the item or locking it in the custom slot.
I don't have one of those functions (and didn't) but I got it to work now.
To be quite frank I don't understand why it works now and not before even thought i went bit by bit.
After so many hours of testing it starts to get in my head and blur even with notes t.t
Shift clicking is a pain at the moment though. Spending a bunch of time on that now. It keeps duping the item or locking it in the custom slot.
Yeah, I had that same problem before when I started just making guis Make sure to actually add your slots in, before adding the player's inventory slots. Oh, and, if you don't want an item to go into a certain gui, you have to make a new slot class file.
Yeah, I had that same problem before when I started just making guis Make sure to actually add your slots in, before adding the player's inventory slots. Oh, and, if you don't want an item to go into a certain gui, you have to make a new slot class file.
Slot classes have already been taken care of and work fully And I got shift clicking to abide by it. I guess it's more tinkering for me. I can't believe i'm going into my third almost full day of work on a custom rendered, custom inventory, custom furnace type dealio. I was expecting it to only take one.
It's nice though. Being able to look at what was accomplished. Plus I learned a lot more about java. Speaking of which,
I was creating the recipe list and it's organized as such:
public Basic_Extractor_Recipes() {
}
public static ItemStack getExtractorResult(Item item) {
return getOutput(item);
}
public static ItemStack getOutput(Item item) {
if (item == Etc.Sword_Level_100) {
return new ItemStack(Etc.Advanced_Item_Crystal, 1);
}
return null;
}
}
How would I turn the return into two possible results using a random integer. I looked up a bunch of different methods for a randomizer but it wouldn't work with the other methods used in the class. I'm not sure if it's possible but heck, it's worth a shot.
How you even tried yet? Well, first, you have to make sure the random integer is positive, and not negative. Then you have to make an if else statement. I'm not really sure how to do that, but I'm taking a guess.
How you even tried yet? Well, first, you have to make sure the random integer is positive, and not negative. Then you have to make an if else statement. I'm not really sure how to do that, but I'm taking a guess.
I have tried but I haven't had any working results. How would you personally generate a random integer in this file. That's the problem i'm hitting (the agreement). I can easily test if it's a certain number.
I have tried but I haven't had any working results. How would you personally generate a random integer in this file. That's the problem i'm hitting (the agreement). I can easily test if it's a certain number.
Something like this maybe? I don't know, I'm not quite sure...
Random random = new Random();
final int randomInt = random.nextInt(3);
if (randomInt > -1) {
Do something?
}
Something like this maybe? I don't know, I'm not quite sure...
Random random = new Random();
final int randomInt = random.nextInt(3);
if (randomInt > -1) {
Do something?
}
either im insanely unlucky or all of my tests failed. oh well. it'd prob end up causing errors with the itemstack dealio anyway so w/e
it's not necessary. it'd just add a little cool bonus and more randomized output like it should be.
thanks for the tips though ^.^
either im insanely unlucky or all of my tests failed. oh well. it'd prob end up causing errors with the itemstack dealio anyway so w/e
it's not necessary. it'd just add a little cool bonus and more randomized output like it should be.
thanks for the tips though ^.^
I would assume that isn't the problem and that it's in the tile entity folder or something else.I'm willing to bet anyone that could help would need to see more code and I'm willing to give it if need be.While i'm on the topic of it, how would I set it to run either without a fuel source or with a never lowering fuel source. I have been following a guide that uses a source and I tried to work around it but to no avail so far.To any potential helpers, thanks
Yeah, something like, isStackValidForSlot?
I don't have one of those functions (and didn't) but I got it to work now.
To be quite frank I don't understand why it works now and not before even thought i went bit by bit.
After so many hours of testing it starts to get in my head and blur even with notes t.t
Shift clicking is a pain at the moment though. Spending a bunch of time on that now. It keeps duping the item or locking it in the custom slot.
Yeah, I had that same problem before when I started just making guis Make sure to actually add your slots in, before adding the player's inventory slots. Oh, and, if you don't want an item to go into a certain gui, you have to make a new slot class file.
Slot classes have already been taken care of and work fully And I got shift clicking to abide by it. I guess it's more tinkering for me. I can't believe i'm going into my third almost full day of work on a custom rendered, custom inventory, custom furnace type dealio. I was expecting it to only take one.
It's nice though. Being able to look at what was accomplished. Plus I learned a lot more about java. Speaking of which,
I was creating the recipe list and it's organized as such:
How would I turn the return into two possible results using a random integer. I looked up a bunch of different methods for a randomizer but it wouldn't work with the other methods used in the class. I'm not sure if it's possible but heck, it's worth a shot.
How you even tried yet? Well, first, you have to make sure the random integer is positive, and not negative. Then you have to make an if else statement. I'm not really sure how to do that, but I'm taking a guess.
I have tried but I haven't had any working results. How would you personally generate a random integer in this file. That's the problem i'm hitting (the agreement). I can easily test if it's a certain number.
Something like this maybe? I don't know, I'm not quite sure...
either im insanely unlucky or all of my tests failed. oh well. it'd prob end up causing errors with the itemstack dealio anyway so w/e
it's not necessary. it'd just add a little cool bonus and more randomized output like it should be.
thanks for the tips though ^.^
You are welcome.