Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<dependency>
<groupId>com.github.LoneDev6</groupId>
<artifactId>api-itemsadder</artifactId>
<version>3.0.0</version>
<version>3.2.5</version>
<scope>provided</scope>
</dependency>

Expand All @@ -259,4 +259,4 @@

</dependencies>

</project>
</project>
15 changes: 8 additions & 7 deletions core/src/main/java/com/github/sachin/tweakin/Tweakin.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,16 @@ public final class Tweakin extends JavaPlugin {
private List<Permission> permissions;
private List<Player> placedPlayers = new ArrayList<>();


@Override
public void onLoad() {
plugin = this;
isWorldGuardEnabled = Bukkit.getPluginManager().getPlugin("WorldGuard") != null;
if(isWorldGuardEnabled){

if(Bukkit.getPluginManager().getPlugin("WorldGuard") != null){
wgFlagManager = new WGFlagManager(this);
plugin.getLogger().info("Found WorldGuard, initializing flags support");
wgFlagManager.registerFlags();
if (wgFlagManager.registerFlags()) {
isWorldGuardEnabled = true;
}
}
}

Expand Down Expand Up @@ -250,12 +251,12 @@ public void addPlacedPlayer(Player player){
}

public boolean isPost1_17(){
return Arrays.asList("v1_17_R1","v1_18_R1","v1_18_R2","v1_19_R1").contains(version);
return Arrays.asList("v1_17_R1","v1_18_R1","v1_18_R2","v1_19_R1","v1_19_R2","v1_19_R3").contains(version);
}

public boolean is1_18() {return Arrays.asList("v1_18_R1","v1_18_R2","v1_19_R1").contains(version);}
public boolean is1_18() {return Arrays.asList("v1_18_R1","v1_18_R2","v1_19_R1","v1_19_R2","v1_19_R3").contains(version);}

public boolean isPost1_19() {return Arrays.asList("v1_19_R1").contains(version);}
public boolean isPost1_19() {return Arrays.asList("v1_19_R1","v1_19_R2","v1_19_R3").contains(version);}

public List<Player> getPlacedPlayers() {
return placedPlayers;
Expand Down
16 changes: 11 additions & 5 deletions core/src/main/java/com/github/sachin/tweakin/WGFlagManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;

public class WGFlagManager {

Expand All @@ -35,11 +36,16 @@ public FlagRegistry getRegistry() {
}


public void registerFlags(){

registeredFlags.put(TConstants.BSE_FLAG, new BSEFlag(plugin));
registeredFlags.put(TConstants.SIF_FLAG, new SIFFlag(plugin));
registeredFlags.put(TConstants.SBK_FLAG, new SBKFlag(plugin));
public boolean registerFlags(){
try {
registeredFlags.put(TConstants.BSE_FLAG, new BSEFlag(plugin));
registeredFlags.put(TConstants.SIF_FLAG, new SIFFlag(plugin));
registeredFlags.put(TConstants.SBK_FLAG, new SBKFlag(plugin));
} catch (Throwable t) {
plugin.getLogger().log(Level.WARNING, "Unable to initialize flags support:", t);
return false;
}
return true;
}
public BaseFlag getFlag(String name){
return registeredFlags.get(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ public void shulkerGuiClickEvent(InventoryClickEvent e){
ShulkerGui gui = (ShulkerGui) e.getView().getTopInventory().getHolder();
gui.update(false);

if((e.getClick() == ClickType.NUMBER_KEY && gui.getSlot() == e.getHotbarButton()) || getConfig().getBoolean("preview-only") || (e.getCurrentItem() != null && e.getCurrentItem().getType().name().endsWith("SHULKER_BOX"))){
if(((e.getClick() == ClickType.NUMBER_KEY && gui.getSlot() == e.getHotbarButton())
|| (e.getClick() == ClickType.SWAP_OFFHAND && gui.getSlot() == 40))
|| getConfig().getBoolean("preview-only")
|| (e.getCurrentItem() != null && e.getCurrentItem().getType().name().endsWith("SHULKER_BOX"))){
e.setCancelled(true);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ public NBTAPI(){

public boolean loadVersions(@Nonnull JavaPlugin plugin,String version,String mcVersion){
String newVersion = version;
if(mcVersion.equals("1.19")){
newVersion = "v1_19_R1";
}
else if(mcVersion.equals("1.19.1") || mcVersion.equals("1.19.2")){
if (mcVersion.equals("1.19.1") || mcVersion.equals("1.19.2")) {
newVersion = "v1_19_R11";
}
try {
Expand Down
6 changes: 6 additions & 0 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,11 @@
<version>3.8.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.sachin</groupId>
<artifactId>nms1_19_3</artifactId>
<version>3.8.6</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
97 changes: 97 additions & 0 deletions nms1_19_3/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>Tweakin</artifactId>
<groupId>com.github.sachin</groupId>
<version>3.8.6</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>nms1_19_3</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<compilerId>eclipse</compilerId>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
<dependencies>
<!-- Compiler -->
<!-- The default compiler has troubles with the class PlayerDataInfo -->
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-eclipse</artifactId>
<version>2.8.8</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.19.3-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT:jar:remapped-mojang
</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>
${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar
</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.19.3-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.19.3-R0.1-SNAPSHOT:jar:remapped-obf
</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>


<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19.3-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<classifier>remapped-mojang</classifier>
</dependency>

<dependency>
<groupId>com.github.sachin</groupId>
<artifactId>core</artifactId>
<version>3.8.6</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
Loading