Skip to content

Commit

Permalink
Update to 1.14(.1)
Browse files Browse the repository at this point in the history
Fixed MineTinker-Item-Interaction with Gridstone
Fixed Permissions of Commands
  • Loading branch information
Flo56958 committed May 25, 2019
1 parent 800e8bf commit ecbdd06
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 29 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>de.flo56958</groupId>
<artifactId>MineTinker</artifactId>
<version>a13</version>
<version>a16.1</version>

<repositories>
<repository>
Expand All @@ -23,13 +23,13 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.13-R0.1-SNAPSHOT</version>
<version>1.14-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<version>1.14-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/de/flo56958/MineTinker/Commands/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,25 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
break;
case "checkupdate":
case "cu":
if (p.hasPermission("minetinker.command.checkupdate")) {
if (p.hasPermission("minetinker.commands.checkupdate")) {
Functions.checkUpdate(p);
} else noPerm(p);
break;
case "convert":
case "c":
if (p.hasPermission("minetinker.command.convert")) {
if (p.hasPermission("minetinker.commands.convert")) {
Functions.convert(p, args);
} else noPerm(p);
break;
case "give":
case "g":
if (p.hasPermission("minetinker.command.give")) {
if (p.hasPermission("minetinker.commands.give")) {
Functions.give(p, args);
} else noPerm(p);
break;
case "givemodifieritem":
case "gm":
if (p.hasPermission("minetinker.command.givemodifieritem")) {
if (p.hasPermission("minetinker.commands.givemodifieritem")) {
Functions.giveModifierItem(p, args);
} else noPerm(p);
break;
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/de/flo56958/MineTinker/Listeners/AnvilListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.PrepareAnvilEvent;
import org.bukkit.inventory.AnvilInventory;
import org.bukkit.inventory.GrindstoneInventory;
import org.bukkit.inventory.ItemStack;

import java.util.List;
Expand Down Expand Up @@ -170,4 +171,14 @@ public void onAnvilPrepare(PrepareAnvilEvent e) {
i.setRepairCost(0);
}
}

@EventHandler
public void onGrind(InventoryClickEvent e) {
if (!(e.getInventory() instanceof GrindstoneInventory)) return;
if (e.getSlot() != 9) return;
ItemStack results = e.getCurrentItem();
if (modManager.isToolViable(results) || modManager.isArmorViable(results)) {
e.setCancelled(true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import de.flo56958.MineTinker.Utilities.ChatWriter;
import de.flo56958.MineTinker.Utilities.ConfigurationManager;
import de.flo56958.MineTinker.Utilities.PlayerInfo;
import net.minecraft.server.v1_13_R2.NBTTagInt;
import net.minecraft.server.v1_13_R2.NBTTagList;
import net.minecraft.server.v1_13_R2.NBTTagString;
import net.minecraft.server.v1_14_R1.NBTTagInt;
import net.minecraft.server.v1_14_R1.NBTTagList;
import net.minecraft.server.v1_14_R1.NBTTagString;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import de.flo56958.MineTinker.Modifiers.Types.ModifierType;
import de.flo56958.MineTinker.Modifiers.Types.Power;
import de.flo56958.MineTinker.Utilities.PlayerInfo;
import net.minecraft.server.v1_13_R2.BlockPosition;
import net.minecraft.server.v1_14_R1.BlockPosition;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftInventory;
import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftInventory;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/de/flo56958/MineTinker/Modifiers/ModManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import de.flo56958.MineTinker.Modifiers.Types.*;
import de.flo56958.MineTinker.Utilities.ChatWriter;
import de.flo56958.MineTinker.Utilities.ConfigurationManager;
import net.minecraft.server.v1_13_R2.*;
import net.minecraft.server.v1_14_R1.*;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Sound;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_14_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.inventory.ItemFlag;
Expand Down Expand Up @@ -436,7 +436,7 @@ public boolean isToolViable(ItemStack tool) {
public boolean isWandViable(ItemStack wand) { return wand != null && hasNBTTag(wand, "IdentifierBuilderswand"); }

public void setNBTTag(ItemStack is, String key, NBTBase value) {
net.minecraft.server.v1_13_R2.ItemStack nmsItem = CraftItemStack.asNMSCopy(is);
net.minecraft.server.v1_14_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(is);
NBTTagCompound comp = nmsItem.getTag();
if (comp == null) { comp = new NBTTagCompound(); }
comp.set(key, value);
Expand All @@ -447,7 +447,7 @@ public void setNBTTag(ItemStack is, String key, NBTBase value) {
}

private void removeNBTTag(ItemStack is, String key) {
net.minecraft.server.v1_13_R2.ItemStack nmsItem = CraftItemStack.asNMSCopy(is);
net.minecraft.server.v1_14_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(is);
NBTTagCompound comp = nmsItem.getTag();
if (comp == null) { comp = new NBTTagCompound(); }
comp.remove(key);
Expand All @@ -458,7 +458,7 @@ private void removeNBTTag(ItemStack is, String key) {
}

private NBTBase getNBTTag(ItemStack is, String key) {
net.minecraft.server.v1_13_R2.ItemStack nmsItem = CraftItemStack.asNMSCopy(is);
net.minecraft.server.v1_14_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(is);
NBTTagCompound comp = nmsItem.getTag();
if (comp == null) { return null; }
return comp.get(key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
import de.flo56958.MineTinker.Modifiers.Enchantable;
import de.flo56958.MineTinker.Modifiers.Modifier;
import de.flo56958.MineTinker.Utilities.*;
import net.minecraft.server.v1_13_R2.BlockPosition;
import net.minecraft.server.v1_14_R1.BlockPosition;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import de.flo56958.MineTinker.Utilities.ConfigurationManager;
import de.flo56958.MineTinker.Utilities.ItemGenerator;
import de.flo56958.MineTinker.Utilities.Modifiers_Config;
import net.minecraft.server.v1_13_R2.NBTTagInt;
import net.minecraft.server.v1_14_R1.NBTTagInt;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import de.flo56958.MineTinker.Utilities.ConfigurationManager;
import de.flo56958.MineTinker.Utilities.ItemGenerator;
import de.flo56958.MineTinker.Utilities.Modifiers_Config;
import net.minecraft.server.v1_13_R2.BlockPosition;
import net.minecraft.server.v1_14_R1.BlockPosition;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/de/flo56958/MineTinker/Utilities/ChatWriter.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package de.flo56958.MineTinker.Utilities;

import de.flo56958.MineTinker.Main;
import net.minecraft.server.v1_13_R2.ChatComponentText;
import net.minecraft.server.v1_13_R2.ChatMessageType;
import net.minecraft.server.v1_13_R2.PacketPlayOutChat;
import net.minecraft.server.v1_13_R2.PlayerConnection;
import net.minecraft.server.v1_14_R1.ChatComponentText;
import net.minecraft.server.v1_14_R1.ChatMessageType;
import net.minecraft.server.v1_14_R1.PacketPlayOutChat;
import net.minecraft.server.v1_14_R1.PlayerConnection;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: MineTinker
author: Flo56958
version: a16
version: a16.1
main: de.flo56958.MineTinker.Main
prefix: MineTinker

Expand Down

0 comments on commit ecbdd06

Please sign in to comment.