Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/gnembon/carpetmod
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Apr 20, 2019
2 parents d805401 + 8dd9b1e commit ead8189
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 7 deletions.
36 changes: 36 additions & 0 deletions installer/create_installer_unix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# For debug: Print commands and their arguments as they are executed.
#set -x

# Some colors for bash
RED='\033[0;31m'
NOCOLOR='\033[0m'

if [[ ! -f ../build/distributions/carpetmod_1.13.2_Client.zip ]]; then
printf "${RED}Patches missing, create them with /gradlew createRelease"
exit 1
fi
if [[ ! -f ../build/distributions/carpetmod_1.13.2_Server.zip ]]; then
printf "${RED}Patches missing, create them with /gradlew createRelease"
exit 1
fi

[[ -d output-ux ]] && rm -rf output-ux
mkdir output-ux

printf "${NOCOLOR}Copying files ...\n"
cp ../build/distributions/carpetmod_1.13.2_Client.zip output-ux
cp ../build/distributions/carpetmod_1.13.2_Server.zip output-ux
cp unix_install_server.sh output-ux
cp unix_install_singleplayer.sh output-ux
cp README.txt output-ux

echo "Zipping ..."
[[ -f carpet_package_ux.zip ]] && rm -f carpet_package_ux.zip
pushd output-ux > /dev/null
tar czf ../carpet_package_ux.tar.gz *
popd > /dev/null

echo "Cleaning ..."
rm -rf output-ux
37 changes: 37 additions & 0 deletions installer/create_installer_win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

# For debug: Print commands and their arguments as they are executed.
#set -x

# Some colors for bash
RED='\033[0;31m'
NOCOLOR='\033[0m'

if [[ ! -f ../build/distributions/carpetmod_1.13.2_Client.zip ]]; then
echo "${RED}Patches missing, create them with /gradlew createRelease"
exit 1
fi
if [[ ! -f ../build/distributions/carpetmod_1.13.2_Server.zip ]]; then
echo "${RED}Patches missing, create them with /gradlew createRelease"
exit 1
fi

[[ -d output-win ]] && rm -rf output-win
mkdir output-win

echo "${NOCOLOR}Copying files ..."
cp ../build/distributions/carpetmod_1.13.2_Client.zip output-win
cp ../build/distributions/carpetmod_1.13.2_Server.zip output-win
cp 7za.exe output-win
cp win_install_server.cmd output-win
cp win_install_singleplayer.cmd output-win
cp README.txt output-win

echo "Zipping ..."
[[ -f carpet_package_win.zip ]] && rm -f carpet_package_win.zip
pushd output-win > /dev/null
zip -r ../carpet_package_win.zip * > /dev/null
popd > /dev/null

echo "Cleaning ..."
rm -rf output-win
27 changes: 27 additions & 0 deletions installer/unix_install_server.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# For debug: Print commands and their arguments as they are executed.
# set -x

# Some colors for bash
RED='\033[0;31m'
NOCOLOR='\033[0m'

echo "Location server..."
if [[ ! -f server.jar ]]; then
printf "${RED}... cannot locate server jar, make sure its placed in current directory\n"
echo " and its named like: server.jar"
exit 1
fi

cp server.jar ____server.jar
printf "${NOCOLOR}Extracting patches ..."
unzip carpetmod_1.13.2_Server.zip -d ____patches
echo "Patching server ..."
pushd ____patches > /dev/null
zip -ur ../____server.jar *
popd > /dev/null
echo "Cleanup ..."
rm -rf ____patches
mv ____server.jar minecraft_server.1.13.2_carpet.jar
echo "Done"
2 changes: 1 addition & 1 deletion src/main/java/carpet/script/CarpetExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import carpet.utils.Messenger;
import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import javafx.util.Pair;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.command.CommandSource;
Expand All @@ -34,6 +33,7 @@
import net.minecraft.world.WorldServer;
import net.minecraft.world.gen.Heightmap;
import net.minecraft.world.storage.SessionLockException;
import org.apache.commons.lang3.tuple.Pair;

import java.math.BigInteger;
import java.util.ArrayList;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/carpet/script/EntityValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import javafx.util.Pair;
import net.minecraft.command.CommandSource;
import net.minecraft.command.arguments.EntitySelector;
import net.minecraft.command.arguments.EntitySelectorParser;
Expand All @@ -28,6 +27,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.util.text.TextComponentString;
import org.apache.commons.lang3.tuple.Pair;

import java.util.ArrayList;
import java.util.Collection;
Expand Down Expand Up @@ -112,11 +112,11 @@ public static Pair<Class<? extends Entity>, Predicate<? super Entity>> getPredic
private static Map<String, Pair<Class<? extends Entity>, Predicate<? super Entity>>> entityPredicates =
new HashMap<String, Pair<Class<? extends Entity>, Predicate<? super Entity>>>()
{{
put("*", new Pair<>(Entity.class, EntitySelectors.IS_ALIVE));
put("living", new Pair<>(EntityLivingBase.class, EntitySelectors.IS_ALIVE));
put("items", new Pair<>(EntityItem.class, EntitySelectors.IS_ALIVE));
put("players", new Pair<>(EntityPlayer.class, EntitySelectors.IS_ALIVE));
put("!players", new Pair<>(Entity.class, (e) -> !(e instanceof EntityPlayer) ));
put("*", Pair.of(Entity.class, EntitySelectors.IS_ALIVE));
put("living", Pair.of(EntityLivingBase.class, EntitySelectors.IS_ALIVE));
put("items", Pair.of(EntityItem.class, EntitySelectors.IS_ALIVE));
put("players", Pair.of(EntityPlayer.class, EntitySelectors.IS_ALIVE));
put("!players", Pair.of(Entity.class, (e) -> !(e instanceof EntityPlayer) ));
}};
public Value get(String what, Value arg)
{
Expand Down

0 comments on commit ead8189

Please sign in to comment.