Skip to content

Commit

Permalink
packetadder wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Dec 31, 2018
1 parent 2eeb9a7 commit 70d6b7b
Show file tree
Hide file tree
Showing 69 changed files with 948 additions and 696 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -17,6 +17,10 @@ A project to make (AEI) [https://minecraft.curseforge.com/projects/almost-enough
- Fixed Scrolling (by a bit)
- One page now shows 2 recipe

### 1.14 Port
- Not Called Listeners
- PacketAdder

### Features that I will work on in the future
- Hide Gui with Control / Command + O

Expand Down
57 changes: 18 additions & 39 deletions build.gradle 100644 → 100755
@@ -1,50 +1,29 @@
buildscript {
repositories {
jcenter()
maven { url 'https://www.jitpack.io' }
maven { url 'http://repo.spongepowered.org/maven' }
maven { url 'http://files.minecraftforge.net/maven' }
}
dependencies {
classpath 'com.github.Chocohead:ForgeGradle:moderniser-SNAPSHOT'
classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}
plugins {
id 'fabric-loom' version '0.2.0-SNAPSHOT'
}

apply plugin: 'net.minecraftforge.gradle.tweaker-client'
apply plugin: 'org.spongepowered.mixin'
apply plugin: 'java'

group 'me.shedaniel'
version '1.0b-1'
archivesBaseName = 'RoughlyEnoughItems'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
maven { url 'https://www.dimdev.org/maven/' }
maven { url 'https://repo.spongepowered.org/maven/' }
maven { url 'https://www.jitpack.io' }
maven { url "http://repo.strezz.org/artifactory/list/Strezz-Central" }
}
archivesBaseName = "RoughlyEnoughItems"
version = "1.0-1"

minecraft {
}

dependencies {
minecraft "com.mojang:minecraft:18w50a"
mappings "net.fabricmc:yarn:18w50a.83"
modCompile "net.fabricmc:fabric-loader:0.3.1.82"

mixin {
defaultObfuscationEnv notch
add sourceSets.main, 'mixins.roughlyenoughitems.refmap.json'
// Fabric API. This is technically optional, but you probably want it anyway.
modCompile "net.fabricmc:fabric:0.1.2.63"
}

minecraft {
version = '1.13.2'
mappings = 'snapshot_20181130'
runDir = 'run'
tweakClass = 'org.dimdev.riftloader.launch.RiftLoaderClientTweaker'
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

dependencies {
implementation 'com.github.Chocohead:Rift:f76cf44d887d290782590c99770876393c924333:dev'
implementation 'com.google.code.gson:gson:2.8.5'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar 100644 → 100755
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties 100644 → 100755
@@ -1,6 +1,6 @@
#Fri Dec 21 19:34:34 HKT 2018
#Sun Dec 30 21:50:18 HKT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
23 changes: 10 additions & 13 deletions gradlew
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

##############################################################################
##
Expand Down Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn () {
warn ( ) {
echo "$*"
}

die () {
die ( ) {
echo
echo "$*"
echo
Expand Down Expand Up @@ -154,19 +154,16 @@ if $cygwin ; then
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
168 changes: 84 additions & 84 deletions gradlew.bat 100644 → 100755
@@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
12 changes: 10 additions & 2 deletions settings.gradle 100644 → 100755
@@ -1,2 +1,10 @@
rootProject.name = 'RoughlyEnoughItems'

pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
}
}
26 changes: 13 additions & 13 deletions src/main/java/me/shedaniel/ClientListener.java
Expand Up @@ -9,12 +9,12 @@
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.registry.IRegistry;
import net.minecraft.item.Items;
import net.minecraft.recipe.RecipeManager;
import net.minecraft.util.DefaultedList;
import net.minecraft.util.registry.Registry;

import java.awt.event.KeyEvent;
import java.util.ArrayList;
Expand Down Expand Up @@ -43,24 +43,24 @@ public void onDoneLoading() {
}

private void buildItemList() {
if (!IRegistry.ITEM.isEmpty())
IRegistry.ITEM.forEach(this::processItem);
if (!IRegistry.ENCHANTMENT.isEmpty())
IRegistry.ENCHANTMENT.forEach(enchantment -> {
for(int i = enchantment.getMinLevel(); i < enchantment.getMaxLevel(); i++) {
if (!Registry.ITEM.isEmpty())
Registry.ITEM.forEach(this::processItem);
if (Registry.ENCHANTMENT.stream().count() > 0)
Registry.ENCHANTMENT.forEach(enchantment -> {
for(int i = enchantment.getMinimumLevel(); i < enchantment.getMaximumLevel(); i++) {
ItemStack stack = new ItemStack(Items.ENCHANTED_BOOK);
Map<Enchantment, Integer> map = new HashMap<>();
map.put(enchantment, i);
EnchantmentHelper.setEnchantments(map, stack);
EnchantmentHelper.set(map, stack);
processItemStack(stack);
}
});
}

private void processItem(Item item) {
NonNullList<ItemStack> items = NonNullList.create();
DefaultedList<ItemStack> items = DefaultedList.create();
try {
item.fillItemGroup(item.getGroup(), items);
item.addStacksForDisplay(item.getItemGroup(), items);
items.forEach(stackList::add);
} catch (NullPointerException e) {
// if (item == Items.ENCHANTED_BOOK) {
Expand All @@ -75,7 +75,7 @@ private void processItemStack(ItemStack item) {
}

@Override
public void recipesLoaded(net.minecraft.item.crafting.RecipeManager recipeManager) {
public void recipesLoaded(RecipeManager recipeManager) {
REIRecipeManager.instance().RecipesLoaded(recipeManager);
}
}

0 comments on commit 70d6b7b

Please sign in to comment.