-
-
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
7 changed files
with
142 additions
and
41 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
54 changes: 54 additions & 0 deletions
54
nms/v1_21_3/src/main/java/com/dre/brewery/ProtocolLibPacketListenerV1_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,54 @@ | ||
/* | ||
* 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.comphenix.protocol.PacketType; | ||
import com.comphenix.protocol.ProtocolLibrary; | ||
import com.comphenix.protocol.ProtocolManager; | ||
import com.comphenix.protocol.events.ListenerPriority; | ||
import com.comphenix.protocol.events.PacketAdapter; | ||
import com.comphenix.protocol.events.PacketContainer; | ||
import com.comphenix.protocol.events.PacketEvent; | ||
import com.dre.brewery.packets.ChunkBiomePacketListener; | ||
import net.minecraft.network.protocol.Packet; | ||
import net.minecraft.network.protocol.game.ClientboundChunksBiomesPacket; | ||
import net.minecraft.server.packs.repository.Pack; | ||
|
||
public class ProtocolLibPacketListenerV1_21_3 implements ChunkBiomePacketListener<PacketContainer> { | ||
|
||
private final ProtocolManager protocolManager; | ||
|
||
public ProtocolLibPacketListenerV1_21_3() { | ||
this.protocolManager = ProtocolLibrary.getProtocolManager(); | ||
|
||
protocolManager.addPacketListener(new PacketAdapter(BreweryPlugin.getInstance(), | ||
ListenerPriority.NORMAL, | ||
PacketType.Play.Server.CHUNKS_BIOMES) { | ||
@Override | ||
public void onPacketSending(PacketEvent event) { | ||
// Something like, if cauldron is preset and xyz location, change the biome in that area to a custom biome | ||
PacketContainer packet = event.getPacket(); | ||
packet. | ||
} | ||
}); | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/dre/brewery/packets/ChunkBiomePacketListener.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,26 @@ | ||
/* | ||
* 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; | ||
|
||
public interface ChunkBiomePacketListener<T> { | ||
|
||
T onServerSendChunkBiomePacket(T packet); | ||
} |
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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/dre/brewery/packets/CustomBiomeHandler.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,24 @@ | ||
/* | ||
* 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; | ||
|
||
public class CustomBiomeHandler { | ||
} |