Skip to content

Commit

Permalink
Made the plugin 1.8.8 - 1.15.2 compatible + a million other additions…
Browse files Browse the repository at this point in the history
… and changes
  • Loading branch information
7rory768 committed Apr 2, 2020
1 parent 40f4f93 commit 754c22a
Show file tree
Hide file tree
Showing 94 changed files with 5,542 additions and 4,148 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/1_14_4/target/
/1_15_2/target/
/1_13_2/target/
/1_12_2/target/
/1_11_2/target/
/API/target/
/target/
/RPGHorsesPlugin/target/
/RPGHorsesPlugin/Vault.jar
/1_15_2/spigot-1.15.2.jar
33 changes: 33 additions & 0 deletions 1_11_2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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>RPGHorses</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>1_11_2</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<packaging>jar</packaging>
<version>1.0.0</version>

<dependencies>
<dependency>
<groupId>org.plugins.rpghorses</groupId>
<artifactId>API</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.11.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

</project>
31 changes: 31 additions & 0 deletions 1_11_2/src/main/java/org/plugins/rpghorses/v1_11_2/NMSHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.plugins.rpghorses.v1_11_2;

import com.google.common.collect.Sets;
import net.minecraft.server.v1_11_R1.EntityCreature;
import net.minecraft.server.v1_11_R1.PathfinderGoalSelector;
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftEntity;
import org.bukkit.entity.LivingEntity;
import org.plugins.rpghorses.NMS;

import java.lang.reflect.Field;

public class NMSHandler implements NMS {

@Override
public void removeBehaviour(LivingEntity entity) {
EntityCreature creature = (EntityCreature) (((CraftEntity) entity).getHandle());
try {
Field b = PathfinderGoalSelector.class.getDeclaredField("b");
b.setAccessible(true);
b.set(creature.goalSelector, Sets.newLinkedHashSet());
b.set(creature.targetSelector, Sets.newLinkedHashSet());

Field c = PathfinderGoalSelector.class.getDeclaredField("c");
c.setAccessible(true);
c.set(creature.goalSelector, Sets.newLinkedHashSet());
c.set(creature.targetSelector, Sets.newLinkedHashSet());
} catch (Exception e) {
e.printStackTrace();
}
}
}
33 changes: 33 additions & 0 deletions 1_12_2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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>RPGHorses</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>1_12_2</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<packaging>jar</packaging>
<version>1.0.0</version>

<dependencies>
<dependency>
<groupId>org.plugins.rpghorses</groupId>
<artifactId>API</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

</project>
31 changes: 31 additions & 0 deletions 1_12_2/src/main/java/org/plugins/rpghorses/v1_12_2/NMSHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.plugins.rpghorses.v1_12_2;

import com.google.common.collect.Sets;
import net.minecraft.server.v1_12_R1.EntityCreature;
import net.minecraft.server.v1_12_R1.PathfinderGoalSelector;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftEntity;
import org.bukkit.entity.LivingEntity;
import org.plugins.rpghorses.NMS;

import java.lang.reflect.Field;

public class NMSHandler implements NMS {

@Override
public void removeBehaviour(LivingEntity entity) {
EntityCreature creature = (EntityCreature) (((CraftEntity) entity).getHandle());
try {
Field b = PathfinderGoalSelector.class.getDeclaredField("b");
b.setAccessible(true);
b.set(creature.goalSelector, Sets.newLinkedHashSet());
b.set(creature.targetSelector, Sets.newLinkedHashSet());

Field c = PathfinderGoalSelector.class.getDeclaredField("c");
c.setAccessible(true);
c.set(creature.goalSelector, Sets.newLinkedHashSet());
c.set(creature.targetSelector, Sets.newLinkedHashSet());
} catch (Exception e) {
e.printStackTrace();
}
}
}
33 changes: 33 additions & 0 deletions 1_13_2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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>RPGHorses</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>1_13_2</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<packaging>jar</packaging>
<version>1.0.0</version>

<dependencies>
<dependency>
<groupId>org.plugins.rpghorses</groupId>
<artifactId>API</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

</project>
31 changes: 31 additions & 0 deletions 1_13_2/src/main/java/org/plugins/rpghorses/v1_13_2/NMSHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.plugins.rpghorses.v1_13_2;


import com.google.common.collect.Sets;
import net.minecraft.server.v1_13_R2.EntityCreature;
import net.minecraft.server.v1_13_R2.PathfinderGoalSelector;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity;
import org.bukkit.entity.LivingEntity;
import org.plugins.rpghorses.NMS;

import java.lang.reflect.Field;

public class NMSHandler implements NMS {
@Override
public void removeBehaviour(LivingEntity entity) {
EntityCreature creature = (EntityCreature) (((CraftEntity) entity).getHandle());
try {
Field b = PathfinderGoalSelector.class.getDeclaredField("b");
b.setAccessible(true);
b.set(creature.goalSelector, Sets.newLinkedHashSet());
b.set(creature.targetSelector, Sets.newLinkedHashSet());

Field c = PathfinderGoalSelector.class.getDeclaredField("c");
c.setAccessible(true);
c.set(creature.goalSelector, Sets.newLinkedHashSet());
c.set(creature.targetSelector, Sets.newLinkedHashSet());
} catch (Exception e) {
e.printStackTrace();
}
}
}
33 changes: 33 additions & 0 deletions 1_14_4/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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>RPGHorses</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>1_14_4</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<packaging>jar</packaging>
<version>1.0.0</version>

<dependencies>
<dependency>
<groupId>org.plugins.rpghorses</groupId>
<artifactId>API</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.14.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.plugins.rpghorses.v_1_14_4;

import com.google.common.collect.Sets;
import net.minecraft.server.v1_14_R1.EntityCreature;
import net.minecraft.server.v1_14_R1.PathfinderGoalSelector;
import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity;
import org.bukkit.entity.LivingEntity;
import org.plugins.rpghorses.NMS;

import java.lang.reflect.Field;

public class NMSHandler implements NMS {

@Override
public void removeBehaviour(LivingEntity entity) {
EntityCreature creature = (EntityCreature) (((CraftEntity) entity).getHandle());
try {
Field d = PathfinderGoalSelector.class.getDeclaredField("d");
d.setAccessible(true);
d.set(creature.goalSelector, Sets.newLinkedHashSet());
d.set(creature.targetSelector, Sets.newLinkedHashSet());
} catch (Exception e) {
e.printStackTrace();
}
}
}
33 changes: 33 additions & 0 deletions 1_15_2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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>RPGHorses</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>1_15_2</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<packaging>jar</packaging>
<version>1.0.0</version>

<dependencies>
<dependency>
<groupId>org.plugins.rpghorses</groupId>
<artifactId>API</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>local.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.15.2</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
</dependencies>

</project>
26 changes: 26 additions & 0 deletions 1_15_2/src/main/java/org/plugins/rpghorses/v1_15_2/NMSHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.plugins.rpghorses.v1_15_2;

import com.google.common.collect.Sets;
import net.minecraft.server.v1_15_R1.EntityCreature;
import net.minecraft.server.v1_15_R1.PathfinderGoalSelector;
import org.bukkit.craftbukkit.v1_15_R1.entity.CraftEntity;
import org.bukkit.entity.LivingEntity;
import org.plugins.rpghorses.NMS;

import java.lang.reflect.Field;

public class NMSHandler implements NMS {

@Override
public void removeBehaviour(LivingEntity entity) {
EntityCreature creature = (EntityCreature) (((CraftEntity) entity).getHandle());
try {
Field d = PathfinderGoalSelector.class.getDeclaredField("d");
d.setAccessible(true);
d.set(creature.goalSelector, Sets.newLinkedHashSet());
d.set(creature.targetSelector, Sets.newLinkedHashSet());
} catch (Exception e) {
e.printStackTrace();
}
}
}
25 changes: 25 additions & 0 deletions API/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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>RPGHorses</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>API</artifactId>
<groupId>org.plugins.rpghorses</groupId>
<packaging>jar</packaging>
<version>1.0.0</version>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.15.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency></dependencies>

</project>
9 changes: 9 additions & 0 deletions API/src/main/java/org/plugins/rpghorses/NMS.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.plugins.rpghorses;

import org.bukkit.entity.LivingEntity;

public interface NMS {

void removeBehaviour(LivingEntity entity);

}
Loading

0 comments on commit 754c22a

Please sign in to comment.