Added 1.20.4 support
This commit is contained in:
parent
3975898e59
commit
81f0fc417a
|
@ -78,7 +78,7 @@
|
|||
<dependency>
|
||||
<groupId>net.wesjd</groupId>
|
||||
<artifactId>anvilgui</artifactId>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<version>1.9.2-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -18,8 +18,9 @@ public class NMSInterface_1_20_R3 implements NMSInterface {
|
|||
@Override
|
||||
public void registerCustomFoxEntity() {
|
||||
try { // Replace the fox entity
|
||||
Field field = EntityType.FOX.getClass().getDeclaredField("bz"); // bz = factory
|
||||
FieldHelper.setFieldUsingUnsafe(field, EntityType.FOX, (EntityType.EntityFactory<Fox>) EntityTamableFox::new);
|
||||
Field field = EntityType.FOX.getClass().getDeclaredField("bC"); // bC = factory
|
||||
field.setAccessible(true);
|
||||
field.set(EntityType.FOX, (EntityType.EntityFactory<Fox>) EntityTamableFox::new);
|
||||
Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.GREEN + LanguageConfig.getSuccessReplaced());
|
||||
} catch (Exception e) {
|
||||
Bukkit.getServer().getConsoleSender().sendMessage(Config.getPrefix() + ChatColor.RED + LanguageConfig.getFailureReplace());
|
||||
|
|
|
@ -83,6 +83,10 @@
|
|||
</pluginRepositories>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>codemc-snapshots-anvilgui</id>
|
||||
<url>https://repo.codemc.io/repository/maven-snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
|
@ -223,7 +227,7 @@
|
|||
<dependency>
|
||||
<groupId>net.wesjd</groupId>
|
||||
<artifactId>anvilgui</artifactId>
|
||||
<version>1.7.0-SNAPSHOT</version>
|
||||
<version>1.9.2-SNAPSHOT</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.seanomik.tamablefoxes.util;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import sun.misc.Unsafe;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
|
Loading…
Reference in New Issue