Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ChestsPlusPlus/ChestsPlusPlus
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ceze88/ChestsPlusPlus
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Mar 8, 2022

  1. 1.18.2 support

    ceze88 committed Mar 8, 2022
    Copy the full SHA
    7c4f02e View commit details
  2. 2.6.2-Beta

    ceze88 committed Mar 8, 2022
    Copy the full SHA
    41dec7f View commit details

Commits on Mar 9, 2022

  1. Update NMSProviderDefault.java

    ceze88 committed Mar 9, 2022
    Copy the full SHA
    e180e4f View commit details
  2. Update build-1.18+.sh

    ceze88 committed Mar 9, 2022
    Copy the full SHA
    5801c72 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d27edd8 View commit details

Commits on Mar 22, 2022

  1. Fix saving issues

    ceze88 committed Mar 22, 2022
    Copy the full SHA
    ac397c1 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3c8bcb0 View commit details

Commits on Mar 23, 2022

  1. Fix typo

    ceze88 committed Mar 23, 2022
    Copy the full SHA
    ae2520c View commit details
  2. Small bugfixes

    ceze88 committed Mar 23, 2022
    Copy the full SHA
    617f116 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    823fe5a View commit details

Commits on May 24, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    be80fea View commit details
  2. 2.6.3-Beta

    Ontion to enable/disable modules
    ceze88 committed May 24, 2022
    Copy the full SHA
    8f962a4 View commit details

Commits on May 27, 2022

  1. Readd support for 1.16.x, HopperFilter fix

    ceze88 committed May 27, 2022
    Copy the full SHA
    abf802d View commit details
  2. Removed unloaded chunk support

    Better for server performance and HopperFilters aren't working in unloaded chunks
    ceze88 committed May 27, 2022
    Copy the full SHA
    1279ad3 View commit details
  3. Copy the full SHA
    c9a756c View commit details
  4. Disabled wildcard imports

    ceze88 committed May 27, 2022
    Copy the full SHA
    37d2a2a View commit details
  5. Revert "Disabled wildcard imports"

    This reverts commit 37d2a2a.
    ceze88 committed May 27, 2022
    Copy the full SHA
    601892d View commit details
  6. Revert "Optimize imports, move self created Tags to ChestsPlusPlusTag…

    … class"
    
    This reverts commit c9a756c.
    ceze88 committed May 27, 2022
    Copy the full SHA
    7e94608 View commit details
  7. Revert "Removed unloaded chunk support"

    This reverts commit 1279ad3.
    ceze88 committed May 27, 2022
    Copy the full SHA
    83edb09 View commit details
  8. Revert "Readd support for 1.16.x, HopperFilter fix"

    This reverts commit abf802d.
    ceze88 committed May 27, 2022
    Copy the full SHA
    32dc879 View commit details
  9. Reupload cleaner

    ceze88 committed May 27, 2022
    Copy the full SHA
    d9cdd90 View commit details
  10. 1.16 support removed, update api to 1.17

    ceze88 committed May 27, 2022
    Copy the full SHA
    ac6949d View commit details
  11. Update pom.xml

    ceze88 committed May 27, 2022
    Copy the full SHA
    66d39a8 View commit details

Commits on Jun 8, 2022

  1. Fix wildcard import

    ceze88 committed Jun 8, 2022
    Copy the full SHA
    1afc772 View commit details

Commits on Jun 13, 2022

  1. 1.19 support

    ceze88 committed Jun 13, 2022
    Copy the full SHA
    907d1b7 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fa4dae4 View commit details
  3. Revert "1.19 support"

    This reverts commit 907d1b7.
    ceze88 committed Jun 13, 2022
    Copy the full SHA
    e9ac177 View commit details
  4. 1.19 support

    ceze88 committed Jun 13, 2022
    Copy the full SHA
    de705a9 View commit details
  5. Copy the full SHA
    5124fa3 View commit details

Commits on Jun 27, 2022

  1. Merge branch 'master' of https://github.com/ChestsPlusPlus/ChestsPlus…

    …Plus into ChestsPlusPlus-master
    ceze88 committed Jun 27, 2022
    Copy the full SHA
    64b438a View commit details
  2. Merge branch 'ChestsPlusPlus-master'

    ceze88 committed Jun 27, 2022
    Copy the full SHA
    6d338d6 View commit details

Commits on Jan 9, 2023

  1. Copy the full SHA
    b0d167f View commit details
104 changes: 104 additions & 0 deletions ChestsPlusPlus_1_19_R2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<artifactId>ChestsPlusPlus-Parent</artifactId>
<groupId>com.jamesdpeters.minecraft.chests</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
<minecraft.version>1.19.3</minecraft.version>
</properties>

<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>ChestsPlusPlus_1_19_R2</artifactId>
<version>1.0-SNAPSHOT</version>

<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.jamesdpeters.minecraft.chests</groupId>
<artifactId>ChestsPlusPlus-API</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${minecraft.version}-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.jamesdpeters.minecraft.chests</groupId>
<artifactId>ChestsPlusPlus_1_17_R1</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>${minecraft.version}-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:${minecraft.version}-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:${minecraft.version}-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:${minecraft.version}-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:${minecraft.version}-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>16</source>
<target>16</target>
</configuration>
</plugin>
</plugins>
</build>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.jamesdpeters.minecraft.chests.v1_19_R2;

import com.jamesdpeters.minecraft.chests.CraftingProvider;
import com.jamesdpeters.minecraft.chests.CraftingResult;
import net.minecraft.core.NonNullList;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.CraftingContainer;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.Level;
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.craftbukkit.v1_19_R2.CraftServer;
import org.bukkit.craftbukkit.v1_19_R2.CraftWorld;
import org.bukkit.craftbukkit.v1_19_R2.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.Recipe;

import java.util.ArrayList;

public class Crafting implements CraftingProvider {

@Override
public CraftingResult craft(World world, ItemStack[] items) {
CraftWorld craftWorld = (CraftWorld) world;

// Setup crafting inventories.
CraftingContainer inventoryCrafting = new CraftingContainer(new AbstractContainerMenu(null, -1) {
@Override
public InventoryView getBukkitView() {
return null;
}

@Override
public net.minecraft.world.item.ItemStack quickMoveStack(net.minecraft.world.entity.player.Player player, int i) {
return null;
}

@Override
public boolean stillValid(net.minecraft.world.entity.player.Player player) {
return false;
}

}, 3, 3);

for (int i = 0; i < items.length; i++) {
inventoryCrafting.setItem(i, CraftItemStack.asNMSCopy(items[i]));
}

var recipe = ((CraftServer) Bukkit.getServer()).getServer().getRecipeManager().getRecipeFor(RecipeType.CRAFTING, inventoryCrafting, craftWorld.getHandle());

// Generate the resulting ItemStack from the Crafting Matrix
net.minecraft.world.item.ItemStack itemStack = net.minecraft.world.item.ItemStack.EMPTY;

if (recipe.isPresent()) {
itemStack = recipe.get().assemble(inventoryCrafting);
}

return createItemCraftResult(CraftItemStack.asBukkitCopy(itemStack), inventoryCrafting, craftWorld.getHandle());
}

@Override
public Recipe getRecipe(Player player, World world, ItemStack[] items) {
return Bukkit.getCraftingRecipe(items, world);
}

private CraftingResult createItemCraftResult(ItemStack itemStack, CraftingContainer inventoryCrafting, Level worldServer) {
CraftServer server = (CraftServer) Bukkit.getServer();
NonNullList<net.minecraft.world.item.ItemStack> remainingItems = server.getServer().getRecipeManager().getRemainingItemsFor(RecipeType.CRAFTING, inventoryCrafting, worldServer);

CraftingResult craftItemResult = new CraftingResult(itemStack, new ItemStack[9], new ArrayList<>());

// Create resulting matrix and overflow items
for (int i = 0; i < remainingItems.size(); ++i) {
net.minecraft.world.item.ItemStack itemstack1 = inventoryCrafting.getItem(i);
net.minecraft.world.item.ItemStack itemstack2 = (net.minecraft.world.item.ItemStack) remainingItems.get(i);

if (!itemstack1.isEmpty()) {
inventoryCrafting.removeItem(i, 1);
itemstack1 = inventoryCrafting.getItem(i);
}

if (!itemstack2.isEmpty()) {
if (itemstack1.isEmpty()) {
inventoryCrafting.setItem(i, itemstack2);
} else if (net.minecraft.world.item.ItemStack.tagMatches(itemstack1, itemstack2) && net.minecraft.world.item.ItemStack.matches(itemstack1, itemstack2)) {
itemstack2.grow(itemstack1.getCount());
inventoryCrafting.setItem(i, itemstack2);
} else {
craftItemResult.overflowItems().add(CraftItemStack.asBukkitCopy(itemstack2));
}
}
}

for (int i = 0; i < inventoryCrafting.getContents().size(); i++) {
craftItemResult.setResultMatrix(i, CraftItemStack.asBukkitCopy(inventoryCrafting.getItem(i)));
}

return craftItemResult;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.jamesdpeters.minecraft.chests.v1_19_R2;

import com.jamesdpeters.minecraft.chests.ChestOpener;
import com.jamesdpeters.minecraft.chests.CraftingProvider;
import com.jamesdpeters.minecraft.chests.EntityEventListener;
import com.jamesdpeters.minecraft.chests.MaterialChecker;
import com.jamesdpeters.minecraft.chests.NMSProvider;
import com.jamesdpeters.minecraft.chests.v1_17_R1.EntityEventListener_1_17;
import com.jamesdpeters.minecraft.chests.v1_17_R1.MaterialChecker_1_17_R1;
import org.bukkit.block.Lidded;
import org.bukkit.entity.ItemFrame;

public class NMSProviderImpl implements NMSProvider {

@Override
public ChestOpener getChestOpener() {
return (inventory, container, tileEntityOpener) -> {
if(container instanceof Lidded){
if(inventory.getViewers().size() > 0){
((Lidded) container).open();
} else {
((Lidded) container).close();
}
}
return null;
};
}

@Override
public MaterialChecker getMaterialChecker() {
return new MaterialChecker_1_17_R1();
}

@Override
public CraftingProvider getCraftingProvider() {
return new Crafting();
}

@Override
public EntityEventListener getEntityEventListener() {
return new EntityEventListener_1_17();
}

@Override
public void setItemFrameVisible(ItemFrame itemFrame, boolean visible) {
itemFrame.setVisible(visible);
}

}
12 changes: 10 additions & 2 deletions ChestsPlusPlus_Main/pom.xml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

<groupId>com.jamesdpeters.minecraft.chests</groupId>
<artifactId>ChestsPlusPlus-Master</artifactId>
<version>2.7-Release</version>
<version>2.7.1-Dev</version>

<properties>
<maven.compiler.target>16</maven.compiler.target>
@@ -90,7 +90,7 @@
<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.5.3-SNAPSHOT</version>
<version>1.6.3-SNAPSHOT</version>
</dependency>

<dependency>
@@ -99,6 +99,14 @@
<version>2.2.1</version>
</dependency>

<dependency>
<groupId>com.jamesdpeters.minecraft.chests</groupId>
<artifactId>ChestsPlusPlus_1_19_R2</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.jamesdpeters.minecraft.chests</groupId>
<artifactId>ChestsPlusPlus_1_19_R1</artifactId>
Original file line number Diff line number Diff line change
@@ -136,15 +136,15 @@ public void create(Player player) {
Messages.NO_PERMISSION(player);
return;
}
TextInputUI.getInput(player, Message.PARTY_ENTER_NAME.getString(), (p, partyName) -> {
boolean result = PartyUtils.createParty(player, partyName);
TextInputUI.getInput(player, Message.PARTY_ENTER_NAME.getString(), (completion) -> {
boolean result = PartyUtils.createParty(player, completion.getText());
if (result){
player.sendMessage(ChatColor.GREEN+ Message.PARTY_CREATED.getString(ChatColor.WHITE+partyName+ChatColor.GREEN));
player.sendMessage(ChatColor.GREEN+ Message.PARTY_CREATED.getString(ChatColor.WHITE+completion.getText()+ChatColor.GREEN));
getMenu().open(player);
return AnvilGUI.Response.close();
return List.of(AnvilGUI.ResponseAction.close());
} else {
player.sendMessage(ChatColor.RED+Message.PARTY_ALREADY_EXISTS.getString(ChatColor.WHITE+partyName+ChatColor.RED));
return AnvilGUI.Response.text(Message.ALREADY_EXISTS_ANVIL.getString());
player.sendMessage(ChatColor.RED+Message.PARTY_ALREADY_EXISTS.getString(ChatColor.WHITE+completion.getText()+ChatColor.RED));
return List.of(AnvilGUI.ResponseAction.replaceInputText(Message.ALREADY_EXISTS_ANVIL.getString()));
}
});
}
Original file line number Diff line number Diff line change
@@ -3,11 +3,14 @@
import com.jamesdpeters.minecraft.chests.ChestsPlusPlus;
import net.wesjd.anvilgui.AnvilGUI;
import org.bukkit.entity.Player;

import java.util.List;
import java.util.function.BiFunction;
import java.util.function.Function;

public class TextInputUI {

public static void getInput(Player player, String title, BiFunction<Player, String, AnvilGUI.Response> responseBiFunction) {
public static void getInput(Player player, String title, Function<AnvilGUI.Completion, List<AnvilGUI.ResponseAction>> responseBiFunction) {
new AnvilGUI.Builder()
.onComplete(responseBiFunction)
.text("Enter Name")
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Chests++ Language File (Version 2.6.4-Beta)
# Chests++ Language File (Version 2.7.1-Dev)
# NOTE: This file gets replaced when the plugin launches! If you want to make modifications create a copy first!
# To create a new language file simply create a copy of this file and rename it to your desired choice for example 'en_US.properties'
# It should be located in the 'lang' folder
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@

<modules>
<module>ChestsPlusPlusAPI</module>
<module>ChestsPlusPlus_1_19_R2</module>
<module>ChestsPlusPlus_1_19_R1</module>
<module>ChestsPlusPlus_1_18_R2</module>
<module>ChestsPlusPlus_1_18_R1</module>