-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4af2927
commit 3ad20df
Showing
9 changed files
with
215 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/com/thevoxelbox/voxelsniper/event/RegisterBrushEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* This file is part of VoxelSniper, licensed under the MIT License (MIT). | ||
* | ||
* Copyright (c) The VoxelBox <http://thevoxelbox.com> | ||
* Copyright (c) contributors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package com.thevoxelbox.voxelsniper.event; | ||
|
||
import com.google.common.collect.Lists; | ||
import com.thevoxelbox.voxelsniper.brush.IBrush; | ||
import org.spongepowered.api.event.cause.Cause; | ||
|
||
import java.util.List; | ||
|
||
public class RegisterBrushEvent extends VoxelSniperEvent { | ||
|
||
private final Class<? extends IBrush> type; | ||
private final List<String> aliases; | ||
|
||
public RegisterBrushEvent(Class<? extends IBrush> type, String[] aliases, Cause c) { | ||
super(c); | ||
this.type = type; | ||
this.aliases = Lists.newArrayList(aliases); | ||
} | ||
|
||
public Class<? extends IBrush> getBrushType() { | ||
return this.type; | ||
} | ||
|
||
public List<String> getAliases() { | ||
return this.aliases; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/com/thevoxelbox/voxelsniper/event/VoxelSniperEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* This file is part of VoxelSniper, licensed under the MIT License (MIT). | ||
* | ||
* Copyright (c) The VoxelBox <http://thevoxelbox.com> | ||
* Copyright (c) contributors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package com.thevoxelbox.voxelsniper.event; | ||
|
||
import org.spongepowered.api.event.Event; | ||
import org.spongepowered.api.event.cause.Cause; | ||
|
||
/** | ||
* Top level event for all voxelsniper events. | ||
*/ | ||
public class VoxelSniperEvent implements Event { | ||
|
||
private final Cause cause; | ||
|
||
public VoxelSniperEvent(Cause c) { | ||
this.cause = c; | ||
} | ||
|
||
@Override | ||
public Cause getCause() { | ||
return this.cause; | ||
} | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/thevoxelbox/voxelsniper/event/sniper/ChangeBrushEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* This file is part of VoxelSniper, licensed under the MIT License (MIT). | ||
* | ||
* Copyright (c) The VoxelBox <http://thevoxelbox.com> | ||
* Copyright (c) contributors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package com.thevoxelbox.voxelsniper.event.sniper; | ||
|
||
import com.thevoxelbox.voxelsniper.SnipeData; | ||
import com.thevoxelbox.voxelsniper.brush.IBrush; | ||
import org.spongepowered.api.event.cause.Cause; | ||
|
||
public class ChangeBrushEvent extends VoxelSniperPlayerEvent { | ||
|
||
private final IBrush brush; | ||
private final Class<? extends IBrush> previous; | ||
|
||
public ChangeBrushEvent(IBrush brush, Class<? extends IBrush> prev, SnipeData v, Cause c) { | ||
super(v, c); | ||
this.brush = brush; | ||
this.previous = prev; | ||
} | ||
|
||
public IBrush getNewBrush() { | ||
return this.brush; | ||
} | ||
|
||
public Class<? extends IBrush> getPreviousBrush() { | ||
return this.previous; | ||
} | ||
|
||
} |
54 changes: 54 additions & 0 deletions
54
src/main/java/com/thevoxelbox/voxelsniper/event/sniper/VoxelSniperPlayerEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* This file is part of VoxelSniper, licensed under the MIT License (MIT). | ||
* | ||
* Copyright (c) The VoxelBox <http://thevoxelbox.com> | ||
* Copyright (c) contributors | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package com.thevoxelbox.voxelsniper.event.sniper; | ||
|
||
import com.thevoxelbox.voxelsniper.SnipeData; | ||
import com.thevoxelbox.voxelsniper.Sniper; | ||
import com.thevoxelbox.voxelsniper.event.VoxelSniperEvent; | ||
import org.spongepowered.api.entity.living.player.Player; | ||
import org.spongepowered.api.event.cause.Cause; | ||
|
||
public class VoxelSniperPlayerEvent extends VoxelSniperEvent { | ||
|
||
private final SnipeData v; | ||
|
||
public VoxelSniperPlayerEvent(SnipeData v, Cause c) { | ||
super(c); | ||
this.v = v; | ||
} | ||
|
||
public SnipeData getSnipeData() { | ||
return this.v; | ||
} | ||
|
||
public Sniper getSniper() { | ||
return this.v.owner(); | ||
} | ||
|
||
public Player getPlayer() { | ||
return this.v.owner().getPlayer(); | ||
} | ||
|
||
} |