Skip to content

Commit

Permalink
v1.18.1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Dec 13, 2023
1 parent 271c8fe commit df474ff
Show file tree
Hide file tree
Showing 15 changed files with 223 additions and 120 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Expert-Build
Minecraft build plugin, Expert-Build Documentation

* Latest plugin version : 1.18.1.11
* Latest plugin version : 1.18.1.12
* Author : marodeur
* Contributor : Lison, Cancri
* Depend : FAWE
Expand Down Expand Up @@ -425,7 +425,7 @@ build:

# Version of your configuration file, normally equivalent to the plugin version.
# For reasons of safety and proper operation, do not modify this value !!!
version: 1.18.1.11
version: 1.18.1.12

# Open or close the schematic transfer
# Value : Boolean (true or false)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>fr.marodeur</groupId>
<artifactId>expertbuild</artifactId>
<version>1.18.1.11</version>
<version>1.18.1.12</version>
<name>Expert-Build</name>

<build>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/fr/marodeur/expertbuild/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ public static void removeBrushBuilder(@NotNull Player p) {
BrushBuilder.remove(p.getUniqueId());
}

public static int getBrushBuilderSize() {
return BrushBuilder.size();
}

//goha Builder
public static GOHA_Builder getGohaBuilder(@NotNull Player p) {
return GOHA.get(p.getUniqueId());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package fr.marodeur.expertbuild.commands.CommandsBrush;

import fr.marodeur.expertbuild.Main;
import fr.marodeur.expertbuild.enums.BrushEnum;
import fr.marodeur.expertbuild.object.BlockVec4;
import fr.marodeur.expertbuild.object.BrushBuilder;
import fr.marodeur.expertbuild.object.MessageBuilder;
import fr.marodeur.expertbuild.api.fawe.UtilsFAWE;
import fr.marodeur.expertbuild.object.Configuration;

import com.fastasyncworldedit.core.command.SuggestInputParseException;

import com.sk89q.worldedit.WorldEdit;
Expand All @@ -20,6 +12,11 @@
import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockType;

import fr.marodeur.expertbuild.api.fawe.UtilsFAWE;
import fr.marodeur.expertbuild.enums.BrushEnum;
import fr.marodeur.expertbuild.Main;
import fr.marodeur.expertbuild.object.*;

import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Biome;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
public class CommandsInfo implements CommandExecutor, TabCompleter {

private static final MessageBuilder message = Main.getInstance().getMessageConfig();
private final List<String> list = Arrays.asList("info", "version", "help", "reload", "sel_mode");
private final List<String> list = Arrays.asList("info", "version", "help", "reload", "sel_mode", "fly_mode");

@Override
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String msg, String @NotNull [] args) {
Expand Down Expand Up @@ -64,22 +64,24 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N
URL_Youtube.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new ComponentBuilder("§7Open GitHub report bug").create()));
URL_Youtube.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL,
"https://github.com/Marodeurun/Expert-Build-Doc/blob/main/SECURITY.md"));
"https://github.com/LucasT-dev/Expert-Build-Plugin/issues"));
sender.spigot().sendMessage(URL_Youtube);
return false;
}

if (args[0].equalsIgnoreCase("version")) {
sender.sendMessage(Main.prefix + " Version : " + Main.getInstance().getDescription().getVersion());
return false;
}

if (args[0].equalsIgnoreCase("help")) {

sender.sendMessage("§7--- §8[§5§oEXP-Build§8] §7---");
TextComponent github_doc = new TextComponent("§5EXP-Build §7Doc : click here");
github_doc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
new ComponentBuilder("§7Open documentation URL").create()));
github_doc.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL,
"https://github.com/Marodeurun/Expert-Build-Doc"));
"https://github.com/LucasT-dev/Expert-Build-Plugin/blob/master/README.md"));
sender.spigot().sendMessage(github_doc);
return false;
}
Expand All @@ -102,11 +104,33 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @N

if (bb.getSelMode().equals(false)) {
bb.setSelMode(true)
.sendMessage("Shift click executing /sel disable");
.sendMessage("Shift click executing /sel, enable");
return false;

} else {
bb.setSelMode(false)
.sendMessage("Shift click executing /sel enable");
.sendMessage("Shift click executing /sel, disable");
return false;
}

} else {
sender.sendMessage(Main.prefix + message.getConsoleNotExecuteCmd());
return false;
}
}

if (args[0].equalsIgnoreCase("fly_mode")) {
if (sender instanceof Player p) {

BrushBuilder bb = BrushBuilder.getBrushBuilderPlayer(p, true);

if (bb.getFlyMode().equals(false)) {
bb.setFlyMode(true)
.sendMessage("Click air selection enable");
return false;
} else {
bb.setFlyMode(false)
.sendMessage("Click air selection disable");
return false;
}

Expand Down
46 changes: 25 additions & 21 deletions src/main/java/fr/marodeur/expertbuild/gui/FlowerGUI.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
package fr.marodeur.expertbuild.gui;

import fr.marodeur.expertbuild.Main;
import fr.marodeur.expertbuild.enums.BrushEnum;
import fr.marodeur.expertbuild.object.BrushBuilder;
import fr.marodeur.expertbuild.object.Configuration;
import fr.marodeur.expertbuild.object.MessageBuilder;
import fr.marodeur.expertbuild.api.fawe.UtilsFAWE;
import fr.marodeur.expertbuild.object.ItemBuilder;

import com.fastasyncworldedit.core.registry.state.PropertyKey;

import com.sk89q.worldedit.NotABlockException;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.world.block.BaseBlock;

import fr.marodeur.expertbuild.api.fawe.UtilsFAWE;
import fr.marodeur.expertbuild.enums.BrushEnum;
import fr.marodeur.expertbuild.Main;
import fr.marodeur.expertbuild.object.BrushBuilder;
import fr.marodeur.expertbuild.object.Configuration;
import fr.marodeur.expertbuild.object.ItemBuilder;
import fr.marodeur.expertbuild.object.MessageBuilder;

import io.github.rysefoxx.inventory.plugin.content.IntelligentItem;
import io.github.rysefoxx.inventory.plugin.content.InventoryContents;
import io.github.rysefoxx.inventory.plugin.content.InventoryProvider;
import io.github.rysefoxx.inventory.plugin.enums.TimeSetting;
import io.github.rysefoxx.inventory.plugin.other.EventCreator;
import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory;

Expand All @@ -44,7 +46,9 @@ public void openFlowerInventory(Player p) {
RyseInventory.builder()
.title(Main.prefix + msg.getFlowerGuiTitle())
.rows(6)
.listener(new EventCreator<>(InventoryCloseEvent.class, event -> buildBrush(BrushBuilder.getBrushBuilderPlayer(p, false))))
.period(1, TimeSetting.SECONDS)
.listener(new EventCreator<>(InventoryCloseEvent.class, event ->
buildBrush(BrushBuilder.getBrushBuilderPlayer(p, false))))

.listener(new EventCreator<>(InventoryClickEvent.class, event -> {

Expand Down Expand Up @@ -121,18 +125,18 @@ public void init(Player player, InventoryContents contents) {
contents.set(5, IntelligentItem.of(
new ItemBuilder(msg.getAirText(), Material.POTION, 1)
.addLore(msg.getAirValue(String.valueOf(brushBuilder.getAirBrush())))
.addLore(msg.getTotal((brushBuilder.getFlowerMaterialTaux().stream().mapToInt(j -> j).sum() + brushBuilder.getAirBrush()) + " %"))
.addLore(msg.getTotal((brushBuilder.getFlowerMaterialRate().stream().mapToInt(j -> j).sum() + brushBuilder.getAirBrush()) + " %"))
.build(), event -> brushBuilder.setAirBrush(event.isShiftClick(), event.isRightClick())));

//SET MATERIAL PROPORTION
for (int i = 9; i < 18; i++) {
int finalI = i;
contents.set(i, IntelligentItem.of(
new ItemBuilder(Material.BLACK_STAINED_GLASS_PANE, 1)
.addLore(msg.getRightArrow(brushBuilder.getFlowerMaterialTaux().get(i - 9) + " % of " + brushBuilder.getFlowerMaterial().get(i - 9)))
.addLore(msg.getTotal((brushBuilder.getFlowerMaterialTaux().stream().mapToInt(j -> j).sum() + brushBuilder.getAirBrush()) + " %"))
.addLore(msg.getRightArrow(brushBuilder.getFlowerMaterialRate().get(i - 9) + " % of " + brushBuilder.getFlowerMaterial().get(i - 9)))
.addLore(msg.getTotal((brushBuilder.getFlowerMaterialRate().stream().mapToInt(j -> j).sum() + brushBuilder.getAirBrush()) + " %"))
.addLore(msg.getClickForChange())
.build(), event -> brushBuilder.addFlowerMaterialTaux(finalI - 9, event.isShiftClick(), event.isRightClick())));
.build(), event -> brushBuilder.addFlowerMaterialRate(finalI - 9, event.isShiftClick(), event.isRightClick())));
}

//SET MATERIAL
Expand Down Expand Up @@ -179,11 +183,11 @@ public void update(Player player, InventoryContents contents) {
int finalI = i;
contents.updateOrSet(i, IntelligentItem.of(
new ItemBuilder(Material.BLACK_STAINED_GLASS_PANE, 1)
.addLore(msg.getRightArrow(brushBuilder.getFlowerMaterialTaux().get(i - 9) + " % of " + brushBuilder.getFlowerMaterial().get(i - 9)))
.addLore(msg.getTotal((brushBuilder.getFlowerMaterialTaux().stream().mapToInt(j -> j).sum() + brushBuilder.getAirBrush()) + " %"))
.addLore(msg.getRightArrow(brushBuilder.getFlowerMaterialRate().get(i - 9) + " % of " + brushBuilder.getFlowerMaterial().get(i - 9)))
.addLore(msg.getTotal((brushBuilder.getFlowerMaterialRate().stream().mapToInt(j -> j).sum() + brushBuilder.getAirBrush()) + " %"))
.addLore(msg.getClickForChange())
.build(), event -> {
brushBuilder.addFlowerMaterialTaux(finalI - 9, event.isShiftClick(), event.isRightClick());
brushBuilder.addFlowerMaterialRate(finalI - 9, event.isShiftClick(), event.isRightClick());
}));
}

Expand Down Expand Up @@ -222,7 +226,7 @@ public void update(Player player, InventoryContents contents) {
contents.updateOrSet(5, IntelligentItem.of(
new ItemBuilder(msg.getAirText(), Material.POTION, 1)
.addLore(msg.getAirValue(String.valueOf(brushBuilder.getAirBrush())))
.addLore(msg.getTotal((brushBuilder.getFlowerMaterialTaux().stream().mapToInt(j -> j).sum() + brushBuilder.getAirBrush()) + " %"))
.addLore(msg.getTotal((brushBuilder.getFlowerMaterialRate().stream().mapToInt(j -> j).sum() + brushBuilder.getAirBrush()) + " %"))
.build(), event -> brushBuilder.setAirBrush(event.isShiftClick(), event.isRightClick())));


Expand All @@ -241,7 +245,7 @@ public void update(Player player, InventoryContents contents) {
new BaseBlock(BukkitAdapter.asBlockState(
new ItemBuilder(Material.BARRIER)
.build())), event.getSlot() - 45)
.addFlowerMaterialTaux(0, event.getSlot() - 45);
.addFlowerMaterialRate(0, event.getSlot() - 45);

//Remove property material
for (int j = 0; j < 4; j++) {
Expand All @@ -263,8 +267,8 @@ public void update(Player player, InventoryContents contents) {
return;
}

if (brushBuilder.getFlowerMaterialTaux().get(finalI - 45).equals(0)) {
brushBuilder.getFlowerMaterialTaux().set(finalI - 45, 1);
if (brushBuilder.getFlowerMaterialRate().get(finalI - 45).equals(0)) {
brushBuilder.getFlowerMaterialRate().set(finalI - 45, 1);
}

brushBuilder.addFlowerMaterial(baseBlock, finalI - 45);
Expand Down Expand Up @@ -715,7 +719,7 @@ private static void buildBrush(@NotNull BrushBuilder brushBuilder) {

if (!brushBuilder.getFlowerMaterial().get(i).toBlockState().toString().equalsIgnoreCase("minecraft:barrier")) {

stringBuilder.append(brushBuilder.getFlowerMaterialTaux().get(i))
stringBuilder.append(brushBuilder.getFlowerMaterialRate().get(i))
.append("%")
.append(brushBuilder.getFlowerMaterial().get(i))
.append(',');
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/fr/marodeur/expertbuild/gui/LeatherGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.github.rysefoxx.inventory.plugin.content.IntelligentItem;
import io.github.rysefoxx.inventory.plugin.content.InventoryContents;
import io.github.rysefoxx.inventory.plugin.content.InventoryProvider;
import io.github.rysefoxx.inventory.plugin.enums.TimeSetting;
import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory;

import org.bukkit.Material;
Expand All @@ -26,6 +27,7 @@ public void openLeatherGUI(Player p) {
RyseInventory.builder()
.title(Main.prefix + msg.getLeatherGuiTitle())
.rows(6)
.period(1, TimeSetting.SECONDS)
.provider(new InventoryProvider() {

@Override
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/fr/marodeur/expertbuild/gui/OrganicGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import io.github.rysefoxx.inventory.plugin.content.IntelligentItem;
import io.github.rysefoxx.inventory.plugin.content.InventoryContents;
import io.github.rysefoxx.inventory.plugin.content.InventoryProvider;
import io.github.rysefoxx.inventory.plugin.enums.TimeSetting;
import io.github.rysefoxx.inventory.plugin.pagination.RyseInventory;

import org.bukkit.Bukkit;
Expand All @@ -29,6 +30,7 @@ public void openOrganicGUI(Player p) {
RyseInventory.builder()
.title(Main.prefix + msg.getOrganicGuiTitle())
.rows(6)
.period(1, TimeSetting.SECONDS)
.provider(new InventoryProvider() {

final GOHA_Builder goha_builder = GOHA_Builder.getGOHABuilder(p);
Expand Down Expand Up @@ -88,7 +90,6 @@ public void init(Player player, InventoryContents contents) {
if (goha_builder.getCommutateur() == 2) {
goha_builder.setCommutateur(1);
}
goha_builder.buildGoha(goha_builder);
}));
//Y rotation
contents.set(25, IntelligentItem.of(
Expand All @@ -106,7 +107,6 @@ else if (goha_builder.getCommutateur() == 1) {
else if (goha_builder.getCommutateur() == 2) {
goha_builder.setCommutateur(0);
}
goha_builder.buildGoha(goha_builder);
}));

contents.set(26, IntelligentItem.of(new ItemBuilder(msg.getMemberConf(), Material.BARRIER, 1)
Expand All @@ -122,7 +122,6 @@ else if (goha_builder.getCommutateur() == 1) {
else if (goha_builder.getCommutateur() == 2) {
goha_builder.setCommutateur(0);
}
goha_builder.buildGoha(goha_builder);
}));


Expand Down Expand Up @@ -167,14 +166,14 @@ else if (goha_builder.getCommutateur() == 2) {
.build(), event ->

goha_builder.setPregen(false)
.setStartLoc(null)
.buildGoha(goha_builder)));
.setStartLoc(null)));

} else {
contents.set(43, IntelligentItem.of(
new ItemBuilder(msg.getPregeneration(), Material.ARMOR_STAND, 1)
.addLore(msg.getClickPregen())
.build(), event -> {

}));
}

Expand All @@ -197,6 +196,10 @@ else if (goha_builder.getCommutateur() == 2) {
.generateAllBlock()
.buildBlock();
}

goha_builder.setPregen(false)
.setStartLoc(null);

}));

//tete
Expand Down Expand Up @@ -412,8 +415,7 @@ public void update(Player player, InventoryContents contents) {

goha_builder.setPregen(false)
.setMomentallyParticleStop(false)
.setStartLoc(null)
.buildGoha(goha_builder)));
.setStartLoc(null)));

//Pregeneration
} else {
Expand All @@ -426,8 +428,7 @@ public void update(Player player, InventoryContents contents) {
goha_builder.setPregen(true)
.setMomentallyParticleStop(true)
.setUpdate(true)
.setStartLoc(p.getLocation())
.buildGoha(goha_builder);
.setStartLoc(p.getLocation());

new GOHA_Builder.OrganicGeneration(p)
.getAllPoint()
Expand All @@ -452,7 +453,6 @@ else if (goha_builder.getCommutateur() == 1) {
else if (goha_builder.getCommutateur() == 2) {
goha_builder.setCommutateur(1);
}
goha_builder.buildGoha(goha_builder);

}));
//Y rotation
Expand All @@ -472,7 +472,7 @@ else if (goha_builder.getCommutateur() == 1) {
else if (goha_builder.getCommutateur() == 2) {
goha_builder.setCommutateur(0);
}
goha_builder.buildGoha(goha_builder);

}));

contents.set(26, IntelligentItem.of(new ItemBuilder(msg.getMemberConf(), Material.BARRIER, 1)
Expand All @@ -488,7 +488,7 @@ else if (goha_builder.getCommutateur() == 1) {
else if (goha_builder.getCommutateur() == 2) {
goha_builder.setCommutateur(0);
}
goha_builder.buildGoha(goha_builder);

}));


Expand Down
Loading

0 comments on commit df474ff

Please sign in to comment.