Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a3acb63
Create LICENSE
MagmaGuy Jul 10, 2022
f5eff45
Merge pull request #1 from MagmaGuy/add-license-1
MagmaGuy Jul 10, 2022
c6fbe51
Merge remote-tracking branch 'origin/master'
invalid-email-address Jul 16, 2022
51ec126
Version 1.1.0
invalid-email-address Jul 21, 2022
db302b3
Version 1.2.0
invalid-email-address Aug 7, 2022
3f706e3
Version 1.3.0
invalid-email-address Aug 15, 2022
0a1f2c0
Version 1.3.1
invalid-email-address Aug 15, 2022
d21daef
Version 1.3.2
invalid-email-address Aug 16, 2022
bd28dd2
Version 1.3.3
invalid-email-address Aug 20, 2022
926d12a
Improve ChunkLocationChecker
masmc05 Aug 20, 2022
ee90dc1
Merge pull request #4 from mastermc05/patch-1
MagmaGuy Aug 20, 2022
8702a9f
Version 1.3.3
invalid-email-address Aug 30, 2022
38c6bc1
Version 1.3.5
invalid-email-address Sep 8, 2022
b4b2152
Version 1.3.5
invalid-email-address Sep 8, 2022
ce6bf31
Version 1.4.0
invalid-email-address Jan 29, 2023
c4d674b
Version 1.4.1
invalid-email-address Jan 29, 2023
56dc13b
Version 1.4.2
invalid-email-address Feb 7, 2023
d75583e
feat(third-party): Support for MMOItems and MythicMobs.
CarmJos Apr 2, 2023
6e9ffb1
chore(conf): Removed unnecessary imports.
CarmJos Apr 2, 2023
981f8ce
chore(mmoitems): Changed the delimiter of "type" and "item"
CarmJos Apr 2, 2023
f573839
fix(guard): Removed unhandled WorldGuard protections.
CarmJos Apr 3, 2023
c78e240
feat(third-party): Support sign generates for MythicMobs.
CarmJos Apr 3, 2023
ef53632
fix(block): Fixed the problem that the sign generates MythicMobs not …
CarmJos Apr 3, 2023
c92be34
chore: Removed unnecessary params.
CarmJos Apr 3, 2023
9509552
fix(item): Add the "break" statement.
CarmJos Apr 6, 2023
4df9557
fix(event): fixed the issues of "BuildPlaceEvent can not be cancelled…
CarmJos May 2, 2023
994fd62
Merge pull request #18 from carm-outsource/master
MagmaGuy May 9, 2023
86a76a2
Version 1.5.0
invalid-email-address May 9, 2023
f26063a
Version 1.5.1
invalid-email-address May 15, 2023
acc145e
Version 1.6.0
invalid-email-address Aug 15, 2023
ab0485e
Version 1.6.1
invalid-email-address Aug 18, 2023
990e5c4
Version 1.6.2
invalid-email-address Aug 20, 2023
ee4a998
Version 1.6.3
invalid-email-address Sep 21, 2023
65ebafb
BetterStructures 1.6.4 changelog:
invalid-email-address Nov 28, 2023
9350b46
+ fixed bug with mob spawning for signs from 1.20.4
neermilov Jan 17, 2024
390b9bf
Merge pull request #35 from thehuze/master
MagmaGuy Jan 18, 2024
0482fe5
BetterStructures 1.6.5 changelog:
invalid-email-address Jan 18, 2024
86a9031
BetterStructures 1.6.6 changelog:
invalid-email-address Jan 19, 2024
f361278
BetterStructures 1.6.7 changelog:
invalid-email-address Jan 29, 2024
20f62a2
BetterStructures 1.6.7 changelog:
invalid-email-address Jan 29, 2024
e7f0005
BetterStructures 1.6.9 changelog:
invalid-email-address Mar 17, 2024
253647e
BetterStructures 1.6.10 changelog:
invalid-email-address Mar 19, 2024
cbd8188
[BetterStructures 1.6.11 changelog:
invalid-email-address Jun 25, 2024
8e444de
Fix mob spawning
Kylepoops Jul 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

79 changes: 75 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = 'com.magmaguy'
version = '1.1.0'
version = '1.6.11-SNAPSHOT'

repositories {
mavenCentral()
Expand All @@ -27,14 +27,25 @@ repositories {

//CloudCommands
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
//EliteMobs
maven { url = 'https://s01.oss.sonatype.org/content/repositories/snapshots' }

// carm start - Support MMOItems and MythicMobs
//MMOItems
maven { url = 'https://nexus.phoenixdevt.fr/repository/maven-public/' }
//MythicMobs
maven { url = 'https://mvn.lumine.io/repository/maven-public/' }
// carm end - Support MMOItems and MythicMobs
}

dependencies {
compileOnly 'org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT'
compileOnly 'org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT'
//BStats API
implementation group: 'org.bstats', name: 'bstats-bukkit', version: '2.2.1'
//WorldGuard API
compileOnly group: 'com.sk89q.worldedit', name: 'worldedit-bukkit', version: '7.2.10'
compileOnly group: 'com.sk89q.worldguard', name: 'worldguard-bukkit', version: '7.0.7'
//WorldEdit API
compileOnly group: 'com.sk89q.worldedit', name: 'worldedit-bukkit', version: '7.2.14'
//lombok
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
Expand All @@ -50,6 +61,17 @@ dependencies {
implementation 'org.apache.commons:commons-lang3:3.9'
//reflections - used for config initialization
implementation group: 'org.reflections', name: 'reflections', version: '0.9.12'
//EliteMobs
compileOnly group: 'com.magmaguy', name: 'EliteMobs', version: '8.3.12-SNAPSHOT'

// carm start - Support MMOItems and MythicMobs
//MythicMobs
compileOnly group: 'io.lumine', name: 'Mythic-Dist', version: '5.2.1'
//MythicLib
compileOnly group: 'io.lumine', name: 'MythicLib-dist', version: '1.5.2-SNAPSHOT'
//MMOItems
compileOnly group: 'net.Indyuce', name: 'MMOItems-API', version: '6.9.2-SNAPSHOT'
// carm end - Support MMOItems and MythicMobs

}

Expand Down Expand Up @@ -89,4 +111,53 @@ ext {

processResources {
filter org.apache.tools.ant.filters.ReplaceTokens, tokens: resourceTokens
}
}

//sonatype repo
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
}

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

publishing {
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
}
}
}

publications {
mavenJava(MavenPublication) {
pom {
groupId = 'com.magmaguy'
name = 'betterstructures'
description = 'BetterStructures repo'
url = 'https://example.com/'
from components.java
licenses {
license {
name = 'GPLV3'
url = 'https://www.gnu.org/licenses/gpl-3.0.en.html'
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
import com.magmaguy.betterstructures.config.ValidWorldsConfig;
import com.magmaguy.betterstructures.config.generators.GeneratorConfig;
import com.magmaguy.betterstructures.config.schematics.SchematicConfig;
import com.magmaguy.betterstructures.config.treasures.TreasureConfig;
import com.magmaguy.betterstructures.configurationimporter.Import;
import com.magmaguy.betterstructures.listeners.NewChunkLoadEvent;
import com.magmaguy.betterstructures.schematics.SchematicContainer;
import com.magmaguy.betterstructures.thirdparty.WorldGuard;
import com.magmaguy.betterstructures.util.InfoMessage;
import com.magmaguy.betterstructures.util.VersionChecker;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

Expand All @@ -17,20 +23,48 @@ public final class BetterStructures extends JavaPlugin {
@Override
public void onEnable() {
MetadataHandler.PLUGIN = this;
new InfoMessage(" ____ __ __ _____ __ __ ");
new InfoMessage(" / __ )___ / /_/ /____ _____/ ___// /________ _______/ /___ __________ _____");
new InfoMessage(" / __ / _ \\/ __/ __/ _ \\/ ___/\\__ \\/ __/ ___/ / / / ___/ __/ / / / ___/ _ \\/ ___/");
new InfoMessage(" / /_/ / __/ /_/ /_/ __/ / ___/ / /_/ / / /_/ / /__/ /_/ /_/ / / / __(__ ) ");
new InfoMessage("/_____/\\___/\\__/\\__/\\___/_/ /____/\\__/_/ \\__,_/\\___/\\__/\\__,_/_/ \\___/____/");
// Plugin startup logic
Bukkit.getLogger().info("[BetterStructures] Initialized!");
Bukkit.getLogger().info("[BetterStructures] Initialized version " + this.getDescription().getVersion() + "!");
Bukkit.getPluginManager().registerEvents(new NewChunkLoadEvent(), this);
Bukkit.getPluginManager().registerEvents(new ValidWorldsConfig.ValidWorldsConfigEvents(), this);
Bukkit.getPluginManager().registerEvents(new VersionChecker.VersionCheckerEvents(), this);
try {
this.getConfig().save("config.yml");
} catch (IOException e) {
throw new RuntimeException(e);
}
DefaultConfig.initializeConfig();
ValidWorldsConfig.initializeConfig();
//Creates import folder if one doesn't exist, imports any content inside
Import.initialize();

new TreasureConfig();
new GeneratorConfig();
new SchematicConfig();
new CommandHandler();
VersionChecker.checkPluginVersion();
if (Bukkit.getPluginManager().getPlugin("WorldGuard") != null &&
Bukkit.getPluginManager().getPlugin("EliteMobs") != null)
Bukkit.getPluginManager().registerEvents(new WorldGuard(), this);
new Metrics(this, 19523);
}

@Override
public void onLoad() {
try {
if (Bukkit.getPluginManager().getPlugin("WorldGuard") != null &&
Bukkit.getPluginManager().getPlugin("EliteMobs") != null)
WorldGuard.initializeFlag();
else
new InfoMessage("WorldGuard is not enabled! WorldGuard is recommended when using the EliteMobs integration.");
} catch (Exception ex) {
new InfoMessage("WorldGuard could not be detected! Some BetterStructures features use WorldGuard, and they will not work until it is installed.");
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.magmaguy.betterstructures.api;

import com.magmaguy.betterstructures.buildingfitter.FitAnything;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;

public class BuildPlaceEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean isCancelled = false;
private final FitAnything fitAnything;

public BuildPlaceEvent(FitAnything fitAnything) {
this.fitAnything = fitAnything;
}

@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}

@Override
public boolean isCancelled() {
return this.isCancelled;
}

@Override
public void setCancelled(boolean b) {
this.isCancelled = b;
}

/**
* {@FitAnything} contains all of the data related to the schematic that is about to get pasted.
*
* @return The key object involved.
*/
public FitAnything getFitAnything() {
return fitAnything;
}

public static HandlerList getHandlerList() {
return handlers;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.magmaguy.betterstructures.api;

import org.bukkit.block.Container;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;

public class ChestFillEvent extends Event implements Cancellable {

private static final HandlerList handlers = new HandlerList();
private boolean isCancelled = false;
private Container container;

public ChestFillEvent(Container container) {
this.container = container;
}

@NotNull
@Override
public HandlerList getHandlers() {
return handlers;
}

@Override
public boolean isCancelled() {
return this.isCancelled;
}

@Override
public void setCancelled(boolean b) {
this.isCancelled = b;
}

/**
* Returns the container in this event. This chest has the inventory snapshot modified, and if the
* event is not cancelled it will force an update.
* <p>
* If you want to modify the chest contents, simply #addItem(itemStack) or #removeItem(itemStack) to the
* Inventory.getSnapshotInventory()
*
* @return The container to be filled
*/
public Container getContainer() {
return container;
}

public static HandlerList getHandlerList() {
return handlers;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
public class FitAirBuilding extends FitAnything {

public FitAirBuilding(Chunk chunk, SchematicContainer schematicContainer) {
super.structureType = GeneratorConfigFields.StructureType.SKY;
this.schematicContainer = schematicContainer;
this.schematicClipboard = schematicContainer.getClipboard();
scan(chunk);
}

public FitAirBuilding(Chunk chunk) {
super.structureType = GeneratorConfigFields.StructureType.SKY;
scan(chunk);
}

Expand Down
Loading