Skip to content

Commit

Permalink
bit a messy start
Browse files Browse the repository at this point in the history
  • Loading branch information
Jsinco committed Jan 17, 2025
1 parent a059fe9 commit 9865e28
Show file tree
Hide file tree
Showing 8 changed files with 287 additions and 18 deletions.
38 changes: 20 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,26 @@ version = "3.4.8"
val langVersion: Int = 17
val encoding: String = "UTF-8"

repositories {
mavenCentral()
maven("https://repo.jsinco.dev/releases") // UniversalScheduler
maven("https://jitpack.io") // GriefPrevention, SlimeFun, PlaceholderAPI
maven("https://repo.md-5.net/content/groups/public/") // Bungee
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") // Spigot
maven("https://nexus.hc.to/content/repositories/pub_releases") // Vault
maven("https://maven.enginehub.org/repo/") // WorldEdit, WorldGuard
maven("https://ci.ender.zone/plugin/repository/everything/") // LWC Extended
maven("https://repo.minebench.de/") // ChestShop
maven("https://repo.codemc.org/repository/maven-public/") // BlockLocker
maven("https://nexus.phoenixdevt.fr/repository/maven-public/") // MythicLib (MMOItems)
maven("https://repo.projectshard.dev/repository/releases/") // Shopkeepers
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") // PlaceholderAPI
maven("https://repo.glaremasters.me/repository/towny/") // Towny
maven("https://repo.oraxen.com/releases") // Oraxen
maven("https://storehouse.okaeri.eu/repository/maven-public/") // Okaeri Config
maven("https://repo.papermc.io/repository/maven-public/") // PaperLib
allprojects {
repositories {
mavenCentral()
maven("https://repo.jsinco.dev/releases") // UniversalScheduler
maven("https://jitpack.io") // GriefPrevention, SlimeFun, PlaceholderAPI
maven("https://repo.md-5.net/content/groups/public/") // Bungee
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") // Spigot
maven("https://nexus.hc.to/content/repositories/pub_releases") // Vault
maven("https://maven.enginehub.org/repo/") // WorldEdit, WorldGuard
maven("https://ci.ender.zone/plugin/repository/everything/") // LWC Extended
maven("https://repo.minebench.de/") // ChestShop
maven("https://repo.codemc.org/repository/maven-public/") // BlockLocker
maven("https://nexus.phoenixdevt.fr/repository/maven-public/") // MythicLib (MMOItems)
maven("https://repo.projectshard.dev/repository/releases/") // Shopkeepers
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") // PlaceholderAPI
maven("https://repo.glaremasters.me/repository/towny/") // Towny
maven("https://repo.oraxen.com/releases") // Oraxen
maven("https://storehouse.okaeri.eu/repository/maven-public/") // Okaeri Config
maven("https://repo.papermc.io/repository/maven-public/") // PaperLib
}
}

dependencies {
Expand Down
38 changes: 38 additions & 0 deletions nms/v1_21_3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* BreweryX Bukkit-Plugin for an alternate brewing process
* Copyright (C) 2024-2025 The Brewery Team
*
* This file is part of BreweryX.
*
* BreweryX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BreweryX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BreweryX. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.
*/

plugins {
id("java")
id("io.papermc.paperweight.userdev") version "1.7.7"
}

// TODO: finish setting up modules
group = "com.dre.brewery"
version = "3.4.8"

repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}

dependencies {
implementation(project(":"))
paperweight.paperDevBundle("1.21.3-R0.1-SNAPSHOT")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* BreweryX Bukkit-Plugin for an alternate brewing process
* Copyright (C) 2024-2025 The Brewery Team
*
* This file is part of BreweryX.
*
* BreweryX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BreweryX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BreweryX. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.
*/

package com.dre.brewery;

import com.dre.brewery.packets.CustomBiomeArea;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.dedicated.DedicatedServer;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeGenerationSettings;
import net.minecraft.world.level.biome.BiomeSpecialEffects;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.CraftWorld;

public class CustomBiomeAreaImplV1_21_3 extends CustomBiomeArea {

Server server = Bukkit.getServer();
CraftServer craftserver = (CraftServer) server;
//DedicatedServer dedicatedserver = craftserver.getServer();
//ResourceKey<Biome.BiomeBuilder> newKey = ResourceKey.a(IRegistry.aO, new MinecraftKey("test", "fancybiome"));

private Biome biome;

public CustomBiomeAreaImplV1_21_3(Location parentBiomeLocation) {
super(parentBiomeLocation);
CraftWorld craftWorld = (CraftWorld) parentBiomeLocation.getWorld();
Biome parentBiome = craftWorld.getHandle().getBiome(new BlockPos(parentBiomeLocation.getBlockX(), parentBiomeLocation.getBlockY(), parentBiomeLocation.getBlockZ())).value();
BiomeSpecialEffects parentSpecialEffects = parentBiome.getSpecialEffects();

BiomeSpecialEffects specialEffects = new BiomeSpecialEffects.Builder()
.ambientAdditionsSound(parentSpecialEffects.getAmbientAdditionsSettings().orElse(null))
.ambientMoodSound(parentSpecialEffects.getAmbientMoodSettings().orElse(null))
.ambientLoopSound(parentSpecialEffects.getAmbientLoopSoundEvent().orElse(null))
.fogColor()
.skyColor()
.grassColorOverride()
.build()

this.biome = new Biome.BiomeBuilder()
.downfall(0.5F)
.temperature(parentBiome.getBaseTemperature())
.specialEffects()
.generationSettings(parentBiome.getGenerationSettings())
.hasPrecipitation(parentBiome.hasPrecipitation())
.build();
}

@Override
public int getId() {
return 0;
}

@Override
public String getName() {
return "";
}

@Override
public boolean isRegistered() {
return false;
}

@Override
public void setFogColor(String color) {

}

@Override
public void setSkyColor(String color) {

}

@Override
public void setWaterColor(String color) {

}

@Override
public void setWaterFogColor(String color) {

}

@Override
public void setFoliageColor(String color) {

}

@Override
public void setGrassColor(String color) {

}
}
23 changes: 23 additions & 0 deletions nms/v1_21_4/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// TODO: update to gradle 8.12
plugins {
id("java")
//id("io.papermc.paperweight.userdev") version "2.0.0-beta.14"
}

// TODO: set this values equal to parent project
group = "com.dre.brewery"
version = "3.4.8"

repositories {
mavenCentral()
//maven("https://repo.papermc.io/repository/maven-public/")
}

dependencies {
implementation(project(":"))
//paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
}

//java {
// toolchain.languageVersion.set(JavaLanguageVersion.of(21))
//}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.dre.brewery;

public class CustomBiomeAreaImplV1_21_4 {

}
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
rootProject.name = "BreweryX"


plugins {
// add toolchain resolver
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
}
include(":nms:v1_21_3", ":nms:v1_21_4")
50 changes: 50 additions & 0 deletions src/main/java/com/dre/brewery/packets/CustomBiomeArea.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* BreweryX Bukkit-Plugin for an alternate brewing process
* Copyright (C) 2024-2025 The Brewery Team
*
* This file is part of BreweryX.
*
* BreweryX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BreweryX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BreweryX. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.
*/

package com.dre.brewery.packets;

import org.bukkit.Location;

public abstract class CustomBiomeArea {

protected final Location parentBiomeLocation;
protected String fogColor;
protected String skyColor;
protected String waterColor;
protected String waterFogColor;
protected String foliageColor;
protected String grassColor;


public CustomBiomeArea(Location parentBiomeLocation, String fogColor, String skyColor, String waterColor, String waterFogColor, String foliageColor, String grassColor) {
this.parentBiomeLocation = parentBiomeLocation;
this.fogColor = fogColor;
this.skyColor = skyColor;
this.waterColor = waterColor;
this.waterFogColor = waterFogColor;
this.foliageColor = foliageColor;
this.grassColor = grassColor;
}

public abstract int getId();
public abstract String getName();
public abstract boolean isRegistered();

}
36 changes: 36 additions & 0 deletions src/main/java/com/dre/brewery/packets/PacketHandlerProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* BreweryX Bukkit-Plugin for an alternate brewing process
* Copyright (C) 2024-2025 The Brewery Team
*
* This file is part of BreweryX.
*
* BreweryX is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* BreweryX is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with BreweryX. If not, see <http://www.gnu.org/licenses/gpl-3.0.html>.
*/

package com.dre.brewery.packets;

import lombok.Getter;

@Getter
public enum PacketHandlerProvider {
PACKETEVENTS("PacketEvents"),
PROTOCOLLIB("ProtocolLib"),
NONE("None");

private final String formattedName;

PacketHandlerProvider(String formattedName) {
this.formattedName = formattedName;
}
}

0 comments on commit 9865e28

Please sign in to comment.