Skip to content

Commit

Permalink
Merge pull request #29 from Paceski/main
Browse files Browse the repository at this point in the history
Add a reload command
  • Loading branch information
zimzaza4 authored Dec 19, 2024
2 parents 5840a63 + 50bb561 commit 4abc985
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 263 deletions.
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions .idea/checkstyle-idea.xml

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/compiler.xml

This file was deleted.

14 changes: 14 additions & 0 deletions .idea/discord.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/easycode.ignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions .idea/encodings.xml

This file was deleted.

65 changes: 0 additions & 65 deletions .idea/jarRepositories.xml

This file was deleted.

18 changes: 0 additions & 18 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

124 changes: 0 additions & 124 deletions .idea/uiDesigner.xml

This file was deleted.

4 changes: 2 additions & 2 deletions src/main/java/re/imc/geysermodelengine/GeyserModelEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.PacketListenerPriority;
import com.github.retrooper.packetevents.protocol.entity.type.EntityType;
import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.ticxo.modelengine.api.ModelEngineAPI;
Expand All @@ -18,6 +16,7 @@
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import re.imc.geysermodelengine.commands.ReloadCommand;
import re.imc.geysermodelengine.listener.ModelListener;
import re.imc.geysermodelengine.listener.MountPacketListener;
import re.imc.geysermodelengine.model.BedrockMountControl;
Expand Down Expand Up @@ -118,6 +117,7 @@ public void onEnable() {
}, 10, entityPositionUpdatePeriod, TimeUnit.MILLISECONDS);


getCommand("geysermodelengine").setExecutor(new ReloadCommand(this));
Bukkit.getPluginManager().registerEvents(new ModelListener(), this);
Bukkit.getScheduler()
.runTaskLater(GeyserModelEngine.getInstance(), () -> {
Expand Down
31 changes: 31 additions & 0 deletions src/main/java/re/imc/geysermodelengine/commands/ReloadCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package re.imc.geysermodelengine.commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import re.imc.geysermodelengine.GeyserModelEngine;

public class ReloadCommand implements CommandExecutor {

private final GeyserModelEngine plugin;

public ReloadCommand(GeyserModelEngine plugin) {
this.plugin = plugin;
}

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

if (sender instanceof Player && !sender.hasPermission("geysermodelengine.reload")) {
sender.sendMessage("§cYou don't have permission to use this command.");
return true;
}

plugin.reloadConfig();
plugin.onEnable();

sender.sendMessage("§aGeyserModelEngine configuration reloaded!");
return true;
}
}
4 changes: 0 additions & 4 deletions src/main/java/re/imc/geysermodelengine/model/EntityTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@
import com.google.common.cache.CacheBuilder;
import com.ticxo.modelengine.api.animation.BlueprintAnimation;
import com.ticxo.modelengine.api.animation.handler.AnimationHandler;
import com.ticxo.modelengine.api.entity.CullType;
import com.ticxo.modelengine.api.generator.blueprint.BlueprintBone;
import com.ticxo.modelengine.api.model.ActiveModel;
import com.ticxo.modelengine.api.model.ModeledEntity;
import com.ticxo.modelengine.api.model.bone.BoneBehaviorTypes;
import com.ticxo.modelengine.api.model.bone.ModelBone;
import com.ticxo.modelengine.api.model.bone.type.Mount;
import com.ticxo.modelengine.api.model.render.DisplayRenderer;
import lombok.Getter;
import lombok.Setter;
import me.zimzaza4.geyserutils.spigot.api.EntityUtils;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.geysermc.floodgate.api.FloodgateApi;
import org.joml.Vector3f;
import re.imc.geysermodelengine.GeyserModelEngine;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/re/imc/geysermodelengine/model/ModelEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes;
import com.google.common.collect.Sets;
import com.ticxo.modelengine.api.entity.BukkitEntity;
import com.ticxo.modelengine.api.model.ActiveModel;
import com.ticxo.modelengine.api.model.ModeledEntity;
import io.github.retrooper.packetevents.util.SpigotConversionUtil;
import lombok.Getter;
import org.bukkit.Location;
import org.bukkit.entity.Player;
Expand Down
Loading

0 comments on commit 4abc985

Please sign in to comment.