This commit is contained in:
Jesse Boyd 2017-07-31 16:38:14 +10:00
parent 6305919397
commit 6ce0e2d9f0
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 111 additions and 0 deletions

View File

@ -11,6 +11,8 @@ import com.thevoxelbox.voxelsniper.SnipeData;
import com.thevoxelbox.voxelsniper.Sniper;
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;
import com.thevoxelbox.voxelsniper.command.VoxelVoxelCommand;
import com.thevoxelbox.voxelsniper.event.SniperBrushChangedEvent;
import com.thevoxelbox.voxelsniper.event.SniperMaterialChangedEvent;
import java.io.File;
import java.io.FileOutputStream;
import org.bukkit.Bukkit;
@ -58,6 +60,8 @@ public class Favs extends JavaPlugin {
VoxelVoxelCommand.inject();
PerformBrush.inject();
RangeBlockHelper.inject();
SniperBrushChangedEvent.inject();
SniperMaterialChangedEvent.inject();
// Forward the commands so //p and //d will work
setupCommand("/p", new FaweCommand("voxelsniper.sniper") {
@Override

View File

@ -0,0 +1,51 @@
package com.thevoxelbox.voxelsniper.event;
import com.boydti.fawe.Fawe;
import com.thevoxelbox.voxelsniper.Sniper;
import com.thevoxelbox.voxelsniper.brush.IBrush;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
public class SniperBrushChangedEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Sniper sniper;
private final IBrush originalBrush;
private final IBrush newBrush;
private final String toolId;
public SniperBrushChangedEvent(Sniper sniper, String toolId, IBrush originalBrush, IBrush newBrush) {
super(!Fawe.isMainThread());
this.sniper = sniper;
this.originalBrush = originalBrush;
this.newBrush = newBrush;
this.toolId = toolId;
}
public static HandlerList getHandlerList() {
return handlers;
}
public IBrush getOriginalBrush() {
return this.originalBrush;
}
public IBrush getNewBrush() {
return this.newBrush;
}
public Sniper getSniper() {
return this.sniper;
}
public String getToolId() {
return this.toolId;
}
public HandlerList getHandlers() {
return handlers;
}
public static Class<?> inject() {
return SniperBrushChangedEvent.class;
}
}

View File

@ -0,0 +1,56 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//
package com.thevoxelbox.voxelsniper.event;
import com.boydti.fawe.Fawe;
import com.thevoxelbox.voxelsniper.Sniper;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.bukkit.material.MaterialData;
public class SniperMaterialChangedEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Sniper sniper;
private final MaterialData originalMaterial;
private final MaterialData newMaterial;
private final String toolId;
public SniperMaterialChangedEvent(Sniper sniper, String toolId, MaterialData originalMaterial, MaterialData newMaterial) {
super(!Fawe.get().isMainThread());
this.sniper = sniper;
this.originalMaterial = originalMaterial;
this.newMaterial = newMaterial;
this.toolId = toolId;
}
public static HandlerList getHandlerList() {
return handlers;
}
public MaterialData getOriginalMaterial() {
return this.originalMaterial;
}
public MaterialData getNewMaterial() {
return this.newMaterial;
}
public Sniper getSniper() {
return this.sniper;
}
public String getToolId() {
return this.toolId;
}
public HandlerList getHandlers() {
return handlers;
}
public static Class<?> inject() {
return SniperMaterialChangedEvent.class;
}
}