Skip to content

Commit ecd7930

Browse files
committed
Fix #93 and #98 (both major bugs)
1 parent 945780e commit ecd7930

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>ch.njol</groupId>
44
<artifactId>skript</artifactId>
5-
<version>2.2-dev15</version>
5+
<version>2.2-dev16</version>
66
<name>Skript</name>
77
<description>A plugin for the Minecraft server API Bukkit that allows to create scripts in natural language.</description>
88
<url>http://njol.ch/projects/skript/</url>

src/main/java/ch/njol/skript/aliases/ItemType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,8 @@ public boolean removeAll(final Inventory invi) {
794794
* @return Whether everything could be removed from the inventory
795795
*/
796796
public boolean removeFrom(final Inventory invi) {
797-
final ItemStack[] buf = getStorageContents(invi);
798-
final ItemStack[] armour = invi instanceof PlayerInventory ? ((PlayerInventory) invi).getArmorContents() : null;
797+
final ItemStack[] buf = oldInvSize ? getStorageContents(invi) : getCopiedContents(invi);
798+
final ItemStack[] armour = invi instanceof PlayerInventory && !oldInvSize ? ((PlayerInventory) invi).getArmorContents() : null;
799799

800800
@SuppressWarnings("unchecked")
801801
final boolean ok = removeFrom(Arrays.asList(buf), armour == null ? null : Arrays.asList(armour));

src/main/java/ch/njol/skript/events/EvtClick.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.bukkit.block.Block;
2828
import org.bukkit.entity.Entity;
2929
import org.bukkit.entity.Player;
30+
import org.bukkit.entity.Vehicle;
3031
import org.bukkit.event.Event;
3132
import org.bukkit.event.block.Action;
3233
import org.bukkit.event.player.PlayerInteractEntityEvent;
@@ -333,6 +334,9 @@ public static boolean checkUseOffHand(Player player, int clickType, @Nullable Bl
333334
default:
334335
mainOnly = false;
335336
}
337+
338+
if (entity instanceof Vehicle)
339+
mainOnly = true;
336340
}
337341

338342
boolean isSneaking = player.isSneaking();

0 commit comments

Comments
 (0)