Browse Source

initial commit

master
thiesyy 2 years ago
commit
5c261ef315
No known key found for this signature in database
GPG Key ID: 3560E52BC0B3CA40
  1. 11
      .classpath
  2. 17
      .project
  3. 14
      .settings/org.eclipse.jdt.core.prefs
  4. BIN
      bin/de/Anticheat/hf/Antiglitch.class
  5. 7
      plugin.yml
  6. 60
      src/de/Anticheat/hf/Antiglitch.java

11
.classpath

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="/home/thiesyy/Desktop/workspace/Java/Flans/server.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

17
.project

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>HFAntiglitch_Final01</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

14
.settings/org.eclipse.jdt.core.prefs

@ -0,0 +1,14 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

BIN
bin/de/Anticheat/hf/Antiglitch.class

Binary file not shown.

7
plugin.yml

@ -0,0 +1,7 @@
name: Anticheat
version: 1.0
author: thiesyy
main: de.Anticheat.hf.Antiglitch
permissions:
thiesyyantiglitch.*:

60
src/de/Anticheat/hf/Antiglitch.java

@ -0,0 +1,60 @@
package de.Anticheat.hf;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.event.player.PlayerInventoryEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
public class Antiglitch extends JavaPlugin implements Listener{
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
super.onEnable();
}
@EventHandler
public void onChest(InventoryOpenEvent e) {
if(e.getPlayer() instanceof Player) {
Player p =(Player) e.getPlayer();
if(p != null) {
check(p);
}
}}
@EventHandler
public void onplayerInventory(PlayerInventoryEvent e) {
if(e.getPlayer() instanceof Player) {
Player p =(Player) e.getPlayer();
if(p != null) {
check(p);
}
}
}
public void check(Player p) {
if(!p.hasPermission("thiesyyantiglitch.ignore")) {
for(int i = 0; i != p.getInventory().getSize(); i++) {
ItemStack is = p.getInventory().getItem(i);
System.out.println(i);
if(is != null) {
if(is.getType() != Material.AIR) {
if(is.getAmount() < 0) {
System.out.println(p.getName() +" has got " + is.getType().name() + " " + is.getAmount() + " times [ILLEGAL]");
for(Player p2 : Bukkit.getOnlinePlayers()) {
if(p2.hasPermission("thiesyyantiglitch.seeinfo")) {
p2.sendMessage(p.getName() +" has got " + is.getType().name() + " " + is.getAmount() + " times [ILLEGAL]");
}
}
p.getInventory().remove(is);
}
}
}
}
}
}
}