-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Showing
8 changed files
with
287 additions
and
18 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
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") | ||
} |
113 changes: 113 additions & 0 deletions
113
nms/v1_21_3/src/main/java/com/dre/brewery/CustomBiomeAreaImplV1_21_3.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,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) { | ||
|
||
} | ||
} |
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,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)) | ||
//} |
5 changes: 5 additions & 0 deletions
5
nms/v1_21_4/src/main/java/com/dre/brewery/CustomBiomeAreaImplV1_21_4.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,5 @@ | ||
package com.dre.brewery; | ||
|
||
public class CustomBiomeAreaImplV1_21_4 { | ||
|
||
} |
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 |
---|---|---|
@@ -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
50
src/main/java/com/dre/brewery/packets/CustomBiomeArea.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 @@ | ||
/* | ||
* 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
36
src/main/java/com/dre/brewery/packets/PacketHandlerProvider.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,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; | ||
} | ||
} |