1.1.3
All checks were successful
SorceryCraft/pipeline/head This commit looks good

Fix Shift-Clicking in Casting Table
This commit is contained in:
TheBrokenRail 2020-03-08 22:00:36 -04:00
parent 738037137d
commit 7dac950cca
4 changed files with 45 additions and 2 deletions

View File

@ -1,5 +1,8 @@
### Changelog ### Changelog
**1.1.3**
* Fix Shift-Clicking in Casting Table
**1.1.2** **1.1.2**
* Update Casting Table Texture * Update Casting Table Texture
* Generate Spells in Pillager Outposts and Woodland Mansions * Generate Spells in Pillager Outposts and Woodland Mansions

View File

@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
loader_version = 0.7.8+build.186 loader_version = 0.7.8+build.186
# Mod Properties # Mod Properties
mod_version = 1.1.2 mod_version = 1.1.3
maven_group = com.thebrokenrail maven_group = com.thebrokenrail
archives_base_name = sorcerycraft archives_base_name = sorcerycraft

View File

@ -133,6 +133,46 @@ public class CastingTableContainer extends Container {
} }
} }
public ItemStack transferSlot(PlayerEntity player, int invSlot) {
ItemStack itemStack = ItemStack.EMPTY;
Slot slot = slots.get(invSlot);
if (slot != null && slot.hasStack()) {
ItemStack itemStack2 = slot.getStack();
itemStack = itemStack2.copy();
if (invSlot == 2) {
if (!insertItem(itemStack2, 3, 39, true)) {
return ItemStack.EMPTY;
}
slot.onStackChanged(itemStack2, itemStack);
} else if (invSlot != 0 && invSlot != 1) {
if (invSlot < 30) {
if (!insertItem(itemStack2, 30, 39, false)) {
return ItemStack.EMPTY;
}
} else if (invSlot < 39 && !insertItem(itemStack2, 3, 30, false)) {
return ItemStack.EMPTY;
}
} else if (!insertItem(itemStack2, 3, 39, false)) {
return ItemStack.EMPTY;
}
if (itemStack2.isEmpty()) {
slot.setStack(ItemStack.EMPTY);
} else {
slot.markDirty();
}
if (itemStack2.getCount() == itemStack.getCount()) {
return ItemStack.EMPTY;
}
slot.onTakeItem(player, itemStack2);
}
return itemStack;
}
@Override @Override
public void close(PlayerEntity player) { public void close(PlayerEntity player) {
super.close(player); super.close(player);

View File

@ -169,7 +169,7 @@ public class CastingTableScreen extends ContainerScreen<CastingTableContainer> {
scrolling = false; scrolling = false;
int i = (width - containerWidth) / 2; int i = (width - containerWidth) / 2;
int j = (height - containerHeight) / 2; int j = (height - containerHeight) / 2;
if (this.canScroll(container.getRecipes().length) && mouseX > (double) (i + 94) && mouseX < (double) (i + 94 + 6) && mouseY > (double) (j + 18) && mouseY <= (double) (j + 18 + 139 + 1)) { if (canScroll(container.getRecipes().length) && mouseX > (double) (i + 94) && mouseX < (double) (i + 94 + 6) && mouseY > (double) (j + 18) && mouseY <= (double) (j + 18 + 139 + 1)) {
scrolling = true; scrolling = true;
} }