Skip to content

Commit

Permalink
Develop (#63)
Browse files Browse the repository at this point in the history
* Create readme.md

* Added VoxelSniperAbstractionClassDiagram

* Update VoxelSniperAbstractionClassDiagram

* Update VoxelSniperAbstractionClassDiagram

* Update VoxelSniperAbstractionClassDiagram

* Update VoxelSniperAbstractionClassDiagram

* Class diagram v1

* Update VoxelSniperAbstractionClassDiagram

* Added VoxelSniperAbstractionClassDiagram.drawio.svg

* Update readme.md

* Formatting + World:set/getMaterial

* Update svg

* Started abstracting

* Update class diagram

* Moved main plugin to folder bukkit, started abstracting functionality

* Broke more stuff, but also fixed some stuff (WILL NOT COMPILE)

* Changed all Material. to new bukkitmaterial and all references of Material to IMaterial (ONLY IN BRUSHES) (WILL NOT COMPILE)

* Fixed a bunch more errors

* Less than 500 errors!

* Less than 250 errors!

* Added VoxelSniperAbstractionClassDiagram.drawio.svg

* Feature/materials (#36)

* created VoxelMaterial

* Some updates to versioning

* finished v1 of materials

* Added VoxelSniperAbstractionClassDiagram.drawio.svg

* Fixed part of diagram

* Probably fixed getVersion method

* Update src/main/java/com/thevoxelbox/voxelsniper/voxelsniper/Version.java

Co-authored-by: Lennart99 <le.le@live.nl>

* Update src/main/java/com/thevoxelbox/voxelsniper/voxelsniper/material/VoxelMaterial.java

Co-authored-by: Lennart99 <le.le@live.nl>

* Update src/main/java/com/thevoxelbox/voxelsniper/voxelsniper/material/VoxelMaterial.java

Co-authored-by: Lennart99 <le.le@live.nl>

* removed wrong setBlock

* Update VoxelSniperAbstractionClassDiagram.drawio

* update svg

Co-authored-by: Lennart99 <le.le@live.nl>

* Less than 100 errors!!!!

* Fixed stuff but somehow more errors

* Created Voxelbiome, converted more code

* More abstraction, 76 errors left

* 99 errors left

* 88 errors

* 48 errors

* 31 errors left

* 16 errors

* It compiles!!!! (With maven skip tests enabled)

* Update VoxelSniperListener.java

* Fixed some issues snipe brush kinda works

Next up:  find out why snipe brush does things double, find out why snipe target block is not visible at range

* Fixed worldheight bug

* Fixed issue with ranged sniper where it would point to the wrong position

* removed println

* Unit tests

* Code cleanup

* Made all exceptions print, revert commit before closing PR

* Fixes

* Fix errors

* Optimize imports

* Move VoxelMessage back to util - no longer uses any Bukkit code

* Fix tests (yey)

* fixes, remove all IVoxelsniper main fields

* Even more fixes

* Mostly fix StampBrush, only fallsOff needs fixing

* Overhaul Materials, now uses VoxelMaterial everywhere, instead of the Bukkit Material

* Make Lang fully multi-platform, no more usage of Bukkit

* Fix CloneStamp, make it possible to add more 'tags' to blocks in the same way

* Remove getVoxelMaterial from IMaterial

* Make SniperManagerTest platform-independent

* Changed an unfortunate choice of words

* Updated method to be nullable

* Fixed issue converting location to chunk

* Fixed EntityRemovalBrush

* Removed ability to use off hand, since this causes a double event

* Don't use black chatcolor, as it is unreadable

* fixed SignOverwriteBrush, only need to fix the printing of the colors to the chat

* fixed SnipeBrush (and probably some others as well) with powder

* fixed chatcolor for SignOverwriteBrush

* Fixed double block removal on rightclick on block

* Delete MaterialTranslator.java

* partially fix jockeybrush, at least doesn't generate stacktraces anymore, still not 100% on what it should do

* Clean up some command code

* prevent VoxelMaterial::getMaterial from returning invalid materials that don't exist

* remove IEntityType - use VoxelEntityType instead

* Move some entity-related classes around

* Fix PaintingBrush, abstract Painting

* Renamed regenerateBrush

* Update BukkitWorld.java

* replace Art by ArtIds, so that we don't need to abstract something that is pretty much just a number

* implemented copy correctly this time

* Fixed TreeSnipeBrush

* fix SplineBrush, still not sure what it does, but it at least does something now

* fix SplineBrush not working after undo

* fix arguments for PullBrush, powder is still severally broken (overloads server)

* clamp arguments for PullBrush between 0 and 1, also made other general improvements to the code

* Make it possible to undo PullBrush, improve Undo a bit

* Fixed DiscBrush

* Fix VoltMeterBrush, introduced IRedstoneWire

* Remove unnecessary method

* Fix GenerateTreeBrush

* Fix arguments for GenerateTreeBrush

* Improve MoveBrush a bit

* replace BukkitVector with a general multi-platform class, remove the use of BlockIterator in the line brushes

* replace BukkitLocation with a general multi-platform class, removing the need for LocationFactory

* fix parameter parsing for rotate 2D brushes, but something still seems off

* improve rotation brush code

* Update VoxelSniperAbstractionClassDiagram.drawio

* updated VoxelSniperAbstractionClassDiagram.drawio.svg

* WIP: improve ScannerBrush

* Create VoxelVectorTest.java

* THIS TOOK TOO LONG

* Move back some classes that are not bukkit-specific

* Removed bukkit references

* replace all equality checks for VoxelMaterial.AIR with type.isAir()

* Fix clone methods for vector and location

* return VoxelMaterial.AIR from getMaterial when the type is cave_air or void_air

* cache World and Player instances instead of recreating them every time

* Abstract most of the functionality of commands - still need to abstract VoxelCommandManager, and decide what to do with the events

* Removed use of PlayerTeleportEvent, instead try to teleport (which has the same effect)

* Abstracted VoxelCommandManager

* Fix tab completion for some commands

* another fix

* change UndoDelegate to be bukkit-specific, remove bukkit import from Undo

* Fix test

* Fix treesnipe Undo

* Create AbstractBlockState, moved some methods around

* removed MaterialFactory

* Abstract TreeType to VoxelTreeType

* Remove Bukkit usage from IPlayer and CometBrush

* Abstract events

* Abstract Action

* Change VoxelSniperConfiguration

* Removed setBlock method

* Plugin now starts on spigot 1.16.5

* reformat code

* fixed some problems in the JockeyBrush, make some general improvements to chunk/world/entity

* Some small improvements to brushes

* fixes to CanyonBrush (also CanyonSelectionBrush)

* small improvements to overlay/underlay brushes

* add to authors 😉

* Update DrainBrush.java

* removed temp exception

* Start on migration to gradle

* add rules to shadowJar

* fix plugin.yml

* delete output folder when cleaning

* Start migrating actions

* Start migrating actions

* make gradlew executable

* update release action

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update plugin.yml

Co-authored-by: KevDaDev <65958288+KevinDaGame@users.noreply.github.com>

* update website in plugin.yml

* clean up gitignore

* change default output name, change logic to only export 'implementation' jars

* Move classes

* move tests

* renamed packages

* fix build errors

* Refactored Bukkit in classnames to Spigot

* version bump

* Cleanup: Remove fully qualified name usage

* Move VoxelSniperCore dependency to "voxel-implementation" plugin

* Got runpaper to work for 1.17+

* Change testImplementation for spigot to 1.16.5

* also build when targeting develop

* Renamed Brush to AbstractBrush

this changed should be pulled asap to forge to prevent conflicts

* Fixed voxelsniper.*

* Implemented bstats

* Added permission descriptions

* Version bump

Co-authored-by: Lennart99 <le.le@live.nl>
  • Loading branch information
KevinDaGame and Lennart99 authored Oct 8, 2022
1 parent 606061b commit f811b4e
Show file tree
Hide file tree
Showing 229 changed files with 11,272 additions and 6,636 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: maven-build
name: gradle-build

on:
push:
branches: [ master ]
branches: [ master, develop ]
pull_request:
branches: [ master ]
branches: [ master, develop ]

jobs:
build:
Expand All @@ -17,6 +17,9 @@ jobs:
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
15 changes: 9 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: maven-release
name: gradle-release
on:
release:
types: [published]

jobs:
create-zip:
create-build:
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -15,12 +15,15 @@ jobs:
with:
java-version: '17'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: build
- name: Release with Notes
uses: softprops/action-gh-release@v1
with:
files: target/VoxelSniper*.jar
files: output/voxelsniper-*.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
# netbeans
nbproject

# maven
/*/target/
target/
dependency-reduced-pom.xml

# gradle
.gradle/
build/
output/

# vim
.*.sw[a-p]
Expand All @@ -39,3 +36,4 @@ dependency-reduced-pom.xml
# Testfiles
test.sh
/bin/
/VoxelSniperSpigot/run/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ VoxelSniper is being built against the Spigot 1.19 API.
Compilation
-----------
Pre-compiled JARs are available in [Releases](https://github.com/KevinDaGame/VoxelSniper/releases).
Alternatively, you can compile the project yourself using Gradle.
We strongly recommend that you use Intellij to compile the project.

Alternatively, you can compile the project yourself
We strongly recommend that you use Intellij to compile the project
Other methods of compiling are at your own risk.

Issue Tracker Notes
Expand Down
5 changes: 5 additions & 0 deletions VoxelSniperCore/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugins {
id("voxel-core")
}

description = "VoxelSniperCore"
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package com.thevoxelbox.voxelsniper;
package com.github.kevindagame;

import com.google.common.base.Preconditions;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
import com.thevoxelbox.voxelsniper.brush.*;
import com.github.kevindagame.brush.*;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;

/**
* Brush registration manager.
Expand Down Expand Up @@ -109,14 +105,14 @@ public static VoxelBrushManager initialize() {
brushManager.registerSniperBrush(VoxelDiscBrush.class, "vd", "voxeldisc");
brushManager.registerSniperBrush(VoxelDiscFaceBrush.class, "vdf", "voxeldiscface");
brushManager.registerSniperBrush(WarpBrush.class, "w", "warp");

return getInstance();
}

/**
* Register a brush for VoxelSniper to be able to use.
*
* @param clazz Brush implementing IBrush interface.
* @param clazz Brush implementing IBrush interface.
* @param handles Handles under which the brush can be accessed ingame.
*/
public void registerSniperBrush(Class<? extends IBrush> clazz, String... handles) {
Expand Down Expand Up @@ -162,7 +158,6 @@ public int registeredSniperBrushHandles() {
}

/**
*
* @param clazz Brush class
* @return All Sniper registered handles for the brush.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package com.thevoxelbox.voxelsniper;
package com.github.kevindagame;

import com.google.common.collect.Maps;
import com.thevoxelbox.voxelsniper.snipe.Sniper;
import com.github.kevindagame.snipe.Sniper;
import com.github.kevindagame.voxelsniper.entity.player.IPlayer;

import java.util.Map;
import java.util.UUID;

import org.bukkit.entity.Player;

/**
* Profile manager for Sniper instances. Each SniperProfile object represents a single player.
*/
Expand All @@ -26,13 +25,12 @@ public static void initialize() {

if (profileManager == null) {
instance = new VoxelProfileManager();
profileManager = getInstance();
}
}

public Sniper getSniperForPlayer(Player player) {
public Sniper getSniperForPlayer(IPlayer player) {
if (sniperInstances.get(player.getUniqueId()) == null) {
sniperInstances.put(player.getUniqueId(), new Sniper(VoxelSniper.getInstance(), player));
sniperInstances.put(player.getUniqueId(), new Sniper(player));
}
return sniperInstances.get(player.getUniqueId());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.github.kevindagame;

import com.github.kevindagame.voxelsniper.IVoxelsniper;

public class VoxelSniper {
public static IVoxelsniper voxelsniper;
}
Loading

0 comments on commit f811b4e

Please sign in to comment.