Skip to content

Commit

Permalink
update to Minecraft version 1.16.2
Browse files Browse the repository at this point in the history
Took 1 hour 10 minutes
  • Loading branch information
DerFrZocker committed Aug 23, 2020
1 parent 3cc173f commit 5f3cae2
Show file tree
Hide file tree
Showing 47 changed files with 2,332 additions and 82 deletions.
6 changes: 6 additions & 0 deletions custom-ore-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.derfrzocker</groupId>
<artifactId>custom-ore-generator-impl-v1_16_R2</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
import de.derfrzocker.custom.ore.generator.impl.v1_15_R1.oregenerator.MinableGenerator_v1_15_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_16_R1.WorldHandler_v1_16_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_16_R1.oregenerator.MinableGenerator_v1_16_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_16_R2.WorldHandler_v1_16_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_16_R2.oregenerator.MinableGenerator_v1_16_R2;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R1.CustomOreBlockPopulator_v1_8_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R1.oregenerator.MinableGenerator_v1_8_R1;
import de.derfrzocker.custom.ore.generator.impl.v1_8_R2.CustomOreBlockPopulator_v1_8_R2;
Expand Down Expand Up @@ -160,6 +162,7 @@ private void registerStandardOreGenerators(@NotNull final RegisterUtil registerU
registerUtil.register(Version.v1_14_R1, Version.v1_14_R1, () -> new MinableGenerator_v1_14_R1(infoFunction, oreSettingInfoBiFunction), true);
registerUtil.register(Version.v1_15_R1, Version.v1_15_R1, () -> new MinableGenerator_v1_15_R1(infoFunction, oreSettingInfoBiFunction), true);
registerUtil.register(Version.v1_16_R1, Version.v1_16_R1, () -> new MinableGenerator_v1_16_R1(infoFunction, oreSettingInfoBiFunction), true);
registerUtil.register(Version.v1_16_R2, Version.v1_16_R2, () -> new MinableGenerator_v1_16_R2(infoFunction, oreSettingInfoBiFunction), true);
}

private void registerStandardBlockSelector(@NotNull final RegisterUtil registerUtil) {
Expand Down Expand Up @@ -193,6 +196,9 @@ private void registerStandardCustomDatas(@NotNull final RegisterUtil registerUti

private void initWorldHandler() {
switch (Version.getCurrent()) {
case v1_16_R2:
new WorldHandler_v1_16_R2(this, CustomOreGeneratorServiceSupplier.INSTANCE);
return;
case v1_16_R1:
new WorldHandler_v1_16_R1(this, CustomOreGeneratorServiceSupplier.INSTANCE);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.bukkit.block.Biome;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.function.Consumer;
Expand All @@ -48,7 +48,7 @@ public class BiomeGui extends PageGui<Biome> {
@NotNull
private final OreConfigFactory oreConfigFactory;

public BiomeGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
public BiomeGui(@NotNull final Plugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
super(plugin, checkSettings(plugin));

Validate.notNull(oreConfigFactory, "OreConfigFactory can not be null");
Expand All @@ -66,9 +66,9 @@ public BiomeGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<Custom
addItem(biomeGuiSettings.getNextSlot(), MessageUtil.replaceItemStack(plugin, biomeGuiSettings.getNextItemStack()), inventoryClickEvent -> consumer.accept(oreConfigFactory));
}

private static BiomeGuiSettings checkSettings(@NotNull final JavaPlugin javaPlugin) {
private static BiomeGuiSettings checkSettings(@NotNull final Plugin plugin) {
if (biomeGuiSettings == null) {
biomeGuiSettings = new BiomeGuiSettings(javaPlugin, "data/factory/gui/biome-gui.yml", true);
biomeGuiSettings = new BiomeGuiSettings(plugin, "data/factory/gui/biome-gui.yml", true);
}

return biomeGuiSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import de.derfrzocker.spigot.utils.message.MessageUtil;
import de.derfrzocker.spigot.utils.message.MessageValue;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.function.Consumer;
Expand All @@ -43,7 +43,7 @@ public class BlockSelectorGui extends PageGui<BlockSelector> {

private static BlockSelectorGuiSettings blockSelectorGuiSettings;

public BlockSelectorGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
public BlockSelectorGui(@NotNull final Plugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
super(plugin, checkSettings(plugin));


Expand Down Expand Up @@ -74,9 +74,9 @@ public BlockSelectorGui(@NotNull final JavaPlugin plugin, @NotNull final Supplie

}

private static BlockSelectorGuiSettings checkSettings(@NotNull final JavaPlugin javaPlugin) {
private static BlockSelectorGuiSettings checkSettings(@NotNull final Plugin plugin) {
if (blockSelectorGuiSettings == null)
blockSelectorGuiSettings = new BlockSelectorGuiSettings(javaPlugin, "data/factory/gui/block-selector-gui.yml", true);
blockSelectorGuiSettings = new BlockSelectorGuiSettings(plugin, "data/factory/gui/block-selector-gui.yml", true);

return blockSelectorGuiSettings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import de.derfrzocker.spigot.utils.message.MessageValue;
import org.bukkit.conversations.*;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand All @@ -62,7 +62,7 @@ public class CustomDataGui extends BasicGui {
@NotNull
private final CustomData customData;

public CustomDataGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer, @NotNull final CustomData customData) {
public CustomDataGui(@NotNull final Plugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer, @NotNull final CustomData customData) {
super(plugin, checkSettings(plugin));

this.serviceSupplier = serviceSupplier;
Expand Down Expand Up @@ -124,12 +124,12 @@ public CustomDataGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<C
});
}

private static CustomDataGuiSettings checkSettings(@NotNull final JavaPlugin javaPlugin) {
private static CustomDataGuiSettings checkSettings(@NotNull final Plugin plugin) {
if (customDataGuiSettings == null)
customDataGuiSettings = new CustomDataGuiSettings(javaPlugin, "data/factory/gui/custom-data-gui.yml", true);
customDataGuiSettings = new CustomDataGuiSettings(plugin, "data/factory/gui/custom-data-gui.yml", true);

if (booleanGuiSettings == null)
booleanGuiSettings = new BooleanGuiSettings(javaPlugin, "data/factory/gui/boolean-gui.yml", true);
booleanGuiSettings = new BooleanGuiSettings(plugin, "data/factory/gui/boolean-gui.yml", true);

return customDataGuiSettings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import de.derfrzocker.spigot.utils.message.MessageUtil;
import de.derfrzocker.spigot.utils.message.MessageValue;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.LinkedHashSet;
Expand All @@ -46,7 +46,7 @@ public class CustomDatasGui extends PageGui<CustomData> {

private static CustomDatasGuiSettings customDatasGuiSettings;

public CustomDatasGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
public CustomDatasGui(@NotNull final Plugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
super(plugin, checkSettings(plugin));

final Map<CustomData, Object> customDatas = oreConfigFactory.getOreConfigBuilder().customDatas();
Expand Down Expand Up @@ -86,9 +86,9 @@ public CustomDatasGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<

}

private static CustomDatasGuiSettings checkSettings(@NotNull final JavaPlugin javaPlugin) {
private static CustomDatasGuiSettings checkSettings(@NotNull final Plugin plugin) {
if (customDatasGuiSettings == null)
customDatasGuiSettings = new CustomDatasGuiSettings(javaPlugin, "data/factory/gui/custom-datas-gui.yml", true);
customDatasGuiSettings = new CustomDatasGuiSettings(plugin, "data/factory/gui/custom-datas-gui.yml", true);

return customDatasGuiSettings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.LinkedHashSet;
Expand All @@ -51,7 +51,7 @@ public class MenuGui extends BasicGui {
private static MenuGuiSettings menuGuiSettings;
private boolean ready = true;

public MenuGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory) {
public MenuGui(@NotNull final Plugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory) {
super(plugin, checkSettings(plugin));

addDecorations();
Expand Down Expand Up @@ -384,9 +384,9 @@ public MenuGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<CustomO
addItem(menuGuiSettings.getAbortSlot(), MessageUtil.replaceItemStack(plugin, menuGuiSettings.getAbortItemStack()), inventoryClickEvent -> closeSync(inventoryClickEvent.getWhoClicked()));
}

private static MenuGuiSettings checkSettings(@NotNull final JavaPlugin javaPlugin) {
private static MenuGuiSettings checkSettings(@NotNull final Plugin plugin) {
if (menuGuiSettings == null)
menuGuiSettings = new MenuGuiSettings(javaPlugin, "data/factory/gui/menu-gui.yml", true);
menuGuiSettings = new MenuGuiSettings(plugin, "data/factory/gui/menu-gui.yml", true);

return menuGuiSettings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import de.derfrzocker.spigot.utils.message.MessageUtil;
import de.derfrzocker.spigot.utils.message.MessageValue;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.function.Consumer;
Expand All @@ -43,7 +43,7 @@ public class OreGeneratorGui extends PageGui<OreGenerator> {

private static OreGeneratorGuiSettings oreGeneratorGuiSettings;

public OreGeneratorGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
public OreGeneratorGui(@NotNull final Plugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
super(plugin, checkSettings(plugin));

final CustomOreGeneratorService service = serviceSupplier.get();
Expand Down Expand Up @@ -74,9 +74,9 @@ public OreGeneratorGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier
}
}

private static OreGeneratorGuiSettings checkSettings(@NotNull final JavaPlugin javaPlugin) {
private static OreGeneratorGuiSettings checkSettings(@NotNull final Plugin plugin) {
if (oreGeneratorGuiSettings == null)
oreGeneratorGuiSettings = new OreGeneratorGuiSettings(javaPlugin, "data/factory/gui/ore-generator-gui.yml", true);
oreGeneratorGuiSettings = new OreGeneratorGuiSettings(plugin, "data/factory/gui/ore-generator-gui.yml", true);

return oreGeneratorGuiSettings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import de.derfrzocker.spigot.utils.message.MessageValue;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.Locale;
Expand All @@ -54,7 +54,7 @@ public class OreSettingGui extends BasicGui {
private final OreSettingContainer oreSettingContainer;
private final int oreSettingSlot;

public OreSettingGui(@NotNull final JavaPlugin plugin,
public OreSettingGui(@NotNull final Plugin plugin,
@NotNull final Supplier<CustomOreGeneratorService> serviceSupplier,
@NotNull final OreConfigFactory oreConfigFactory,
@NotNull final Consumer<OreConfigFactory> consumer,
Expand Down Expand Up @@ -84,9 +84,9 @@ public OreSettingGui(@NotNull final JavaPlugin plugin,
oreSettingGuiSettings.getItemStackValues().forEach(value -> addItem(value.getSlot(), value.getItemStack(), new SettingConsumer(value.getValue())));
}

private static OreSettingGuiSettings checkSettings(@NotNull final JavaPlugin javaPlugin) {
private static OreSettingGuiSettings checkSettings(@NotNull final Plugin plugin) {
if (oreSettingGuiSettings == null)
oreSettingGuiSettings = new OreSettingGuiSettings(javaPlugin, "data/factory/gui/ore-setting-gui.yml", true);
oreSettingGuiSettings = new OreSettingGuiSettings(plugin, "data/factory/gui/ore-setting-gui.yml", true);

return oreSettingGuiSettings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import de.derfrzocker.spigot.utils.message.MessageUtil;
import de.derfrzocker.spigot.utils.message.MessageValue;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.Set;
Expand All @@ -47,7 +47,7 @@ public class OreSettingsGui extends PageGui<OreSetting> {
@NotNull
private final OreSettingsAble oreSettingsAble;

public OreSettingsGui(@NotNull final JavaPlugin plugin,
public OreSettingsGui(@NotNull final Plugin plugin,
@NotNull final Supplier<CustomOreGeneratorService> serviceSupplier,
@NotNull final OreConfigFactory oreConfigFactory,
@NotNull final Consumer<OreConfigFactory> consumer,
Expand Down Expand Up @@ -81,9 +81,9 @@ public OreSettingsGui(@NotNull final JavaPlugin plugin,

}

private static OreSettingsGuiSettings checkSettings(@NotNull final JavaPlugin javaPlugin) {
private static OreSettingsGuiSettings checkSettings(@NotNull final Plugin plugin) {
if (oreSettingsGuiSettings == null)
oreSettingsGuiSettings = new OreSettingsGuiSettings(javaPlugin, "data/factory/gui/ore-settings-gui.yml", true);
oreSettingsGuiSettings = new OreSettingsGuiSettings(plugin, "data/factory/gui/ore-settings-gui.yml", true);

return oreSettingsGuiSettings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.bukkit.World;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.function.Consumer;
Expand All @@ -49,7 +49,7 @@ public class WorldGui extends PageGui<World> {
@NotNull
private final OreConfigFactory oreConfigFactory;

public WorldGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
public WorldGui(@NotNull final Plugin plugin, @NotNull final Supplier<CustomOreGeneratorService> serviceSupplier, @NotNull final OreConfigFactory oreConfigFactory, @NotNull final Consumer<OreConfigFactory> consumer) {
super(plugin, checkSettings(plugin));

Validate.notNull(oreConfigFactory, "OreConfigFactory can not be null");
Expand All @@ -67,9 +67,9 @@ public WorldGui(@NotNull final JavaPlugin plugin, @NotNull final Supplier<Custom
addItem(worldGuiSettings.getNextSlot(), MessageUtil.replaceItemStack(plugin, worldGuiSettings.getNextItemStack()), inventoryClickEvent -> consumer.accept(oreConfigFactory));
}

private static WorldGuiSettings checkSettings(@NotNull final JavaPlugin javaPlugin) {
private static WorldGuiSettings checkSettings(@NotNull final Plugin plugin) {
if (worldGuiSettings == null) {
worldGuiSettings = new WorldGuiSettings(javaPlugin, "data/factory/gui/world-gui.yml", true);
worldGuiSettings = new WorldGuiSettings(plugin, "data/factory/gui/world-gui.yml", true);
}

return worldGuiSettings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.function.Supplier;

public class BiomeGuiSettings extends PageSettings {

public BiomeGuiSettings(@NotNull final JavaPlugin plugin, @NotNull final String file) {
public BiomeGuiSettings(@NotNull final Plugin plugin, @NotNull final String file) {
super(plugin, file);
}

public BiomeGuiSettings(@NotNull final JavaPlugin plugin, @NotNull final String file, final boolean copy) {
public BiomeGuiSettings(@NotNull final Plugin plugin, @NotNull final String file, final boolean copy) {
super(plugin, file, copy);
}

public BiomeGuiSettings(@NotNull final JavaPlugin plugin, @NotNull final Supplier<ConfigurationSection> configurationSectionSupplier) {
public BiomeGuiSettings(@NotNull final Plugin plugin, @NotNull final Supplier<ConfigurationSection> configurationSectionSupplier) {
super(plugin, configurationSectionSupplier);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
import de.derfrzocker.spigot.utils.gui.PageSettings;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;

import java.util.function.Supplier;

public class BlockSelectorGuiSettings extends PageSettings {

public BlockSelectorGuiSettings(@NotNull final JavaPlugin plugin, @NotNull final String file) {
public BlockSelectorGuiSettings(@NotNull final Plugin plugin, @NotNull final String file) {
super(plugin, file);
}

public BlockSelectorGuiSettings(@NotNull final JavaPlugin plugin, @NotNull final String file, final boolean copy) {
public BlockSelectorGuiSettings(@NotNull final Plugin plugin, @NotNull final String file, final boolean copy) {
super(plugin, file, copy);
}

public BlockSelectorGuiSettings(@NotNull final JavaPlugin plugin, @NotNull final Supplier<ConfigurationSection> configurationSectionSupplier) {
public BlockSelectorGuiSettings(@NotNull final Plugin plugin, @NotNull final Supplier<ConfigurationSection> configurationSectionSupplier) {
super(plugin, configurationSectionSupplier);
}

Expand Down
Loading

0 comments on commit 5f3cae2

Please sign in to comment.