mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-27 07:13:14 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d480cb2e9 | ||
|
|
0c361f2482 | ||
|
|
d299b0a1b0 | ||
|
|
927e531af8 | ||
|
|
395f258893 | ||
|
|
56a268bcda | ||
|
|
10a36f6413 | ||
|
|
951367919f | ||
|
|
7fee341e50 |
No files matched your search
@@ -3,9 +3,9 @@ name: Build and test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master, main ]
|
||||
branches: [ master, main, release/** ]
|
||||
push:
|
||||
branches: [ master, main ]
|
||||
branches: [ master, main, release/** ]
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
|
||||
@@ -27,4 +27,5 @@ whitelist.json
|
||||
*.iws
|
||||
src/main/resources/mixins.*.json
|
||||
*.bat
|
||||
*.sh
|
||||
layout.json
|
||||
+10
-10
@@ -23,22 +23,22 @@
|
||||
*/
|
||||
|
||||
dependencies {
|
||||
api("com.github.GTNewHorizons:waila:1.19.25:dev")
|
||||
api("com.github.GTNewHorizons:NotEnoughItems:2.8.93-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:waila:1.19.34:dev")
|
||||
api("com.github.GTNewHorizons:NotEnoughItems:2.8.152-GTNH:dev")
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.9.57:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.480:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.11.52:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.54.189:dev") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Botania:1.13.16-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.19:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.7.10:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Botania:1.13.36-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForestryMC:4.11.38:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.7.15:dev") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:Chisel:2.17.26-GTNH:api") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:Chisel:2.17.33-GTNH:api") {transitive = false }
|
||||
|
||||
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.7:dev") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.4.8:dev") {transitive = false }
|
||||
|
||||
compileOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev") {transitive = false }
|
||||
compileOnly("curse.maven:guide-api-228832:2287185") {transitive = false }
|
||||
compileOnly("curse.maven:endlessids-665730:7585931") {transitive = false }
|
||||
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.34:dev")
|
||||
compileOnly("com.github.GTNewHorizons:StructureLib:1.4.45:dev")
|
||||
}
|
||||
@@ -186,6 +186,11 @@ modrinthRelations =
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId =
|
||||
|
||||
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
|
||||
# Use client or server for mods that only support one environment. Defaults to client,server.
|
||||
# These tags describe where the mod can run, not whether installation is required on both sides.
|
||||
curseForgeEnvironments = client,server
|
||||
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1df82b76031285ef2e6a4f59ffe9299d/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/38256085a73e137cb4937ea9c4807fec/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+3
-1
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
# ksh gradlew
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
Vendored
+12
-23
@@ -19,12 +19,12 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem gradlew startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,29 +65,18 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 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!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.29'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.32'
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package WayofTime.alchemicalWizardry.api.alchemy;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class AlchemyRecipe {
|
||||
|
||||
private static final int MAX_INPUT_SLOTS = 5;
|
||||
|
||||
private final ItemStack output;
|
||||
private final ItemStack[] recipe;
|
||||
private final int bloodOrbLevel;
|
||||
@@ -23,35 +24,13 @@ public class AlchemyRecipe {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack[] recipe;
|
||||
|
||||
if (items.length < 5) {
|
||||
if (items.length < MAX_INPUT_SLOTS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.recipe.length != 5) {
|
||||
ItemStack[] newRecipe = new ItemStack[5];
|
||||
boolean[] checkList = new boolean[MAX_INPUT_SLOTS];
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if (i + 1 > this.recipe.length) {
|
||||
newRecipe[i] = null;
|
||||
} else {
|
||||
newRecipe[i] = this.recipe[i];
|
||||
}
|
||||
}
|
||||
|
||||
recipe = newRecipe;
|
||||
} else {
|
||||
recipe = this.recipe;
|
||||
}
|
||||
|
||||
boolean[] checkList = new boolean[5];
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
checkList[i] = false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
for (int i = 0; i < Math.min(recipe.length, MAX_INPUT_SLOTS); i++) {
|
||||
ItemStack recipeItemStack = recipe[i];
|
||||
|
||||
if (recipeItemStack == null) {
|
||||
@@ -60,7 +39,7 @@ public class AlchemyRecipe {
|
||||
|
||||
boolean test = false;
|
||||
|
||||
for (int j = 0; j < 5; j++) {
|
||||
for (int j = 0; j < MAX_INPUT_SLOTS; j++) {
|
||||
if (checkList[j]) {
|
||||
continue;
|
||||
}
|
||||
@@ -71,20 +50,6 @@ public class AlchemyRecipe {
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean quickTest = false;
|
||||
|
||||
if (recipeItemStack.getItem() instanceof ItemBlock) {
|
||||
if (checkedItemStack.getItem() instanceof ItemBlock) {
|
||||
quickTest = true;
|
||||
}
|
||||
} else if (!(checkedItemStack.getItem() instanceof ItemBlock)) {
|
||||
quickTest = true;
|
||||
}
|
||||
|
||||
if (!quickTest) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((checkedItemStack.getItemDamage() == recipeItemStack.getItemDamage()
|
||||
|| OreDictionary.WILDCARD_VALUE == recipeItemStack.getItemDamage())
|
||||
&& checkedItemStack.getItem() == recipeItemStack.getItem()) {
|
||||
|
||||
@@ -15,7 +15,7 @@ public class AlchemyRecipeRegistry {
|
||||
recipes.add(new AlchemyRecipe(output, amountNeeded, recipe, bloodOrbLevel));
|
||||
}
|
||||
|
||||
public static ItemStack getResult(ItemStack[] recipe, ItemStack bloodOrb) {
|
||||
public static AlchemyRecipe findRecipe(ItemStack[] recipe, ItemStack bloodOrb) {
|
||||
if (bloodOrb == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -28,31 +28,23 @@ public class AlchemyRecipeRegistry {
|
||||
|
||||
for (AlchemyRecipe ar : recipes) {
|
||||
if (ar.doesRecipeMatch(recipe, bloodOrbLevel)) {
|
||||
return (ar.getResult());
|
||||
return ar;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ItemStack getResult(ItemStack[] recipe, ItemStack bloodOrb) {
|
||||
AlchemyRecipe ar = findRecipe(recipe, bloodOrb);
|
||||
|
||||
return ar == null ? null : ar.getResult();
|
||||
}
|
||||
|
||||
public static int getAmountNeeded(ItemStack[] recipe, ItemStack bloodOrb) {
|
||||
if (bloodOrb == null) {
|
||||
return 0;
|
||||
}
|
||||
AlchemyRecipe ar = findRecipe(recipe, bloodOrb);
|
||||
|
||||
if (!(bloodOrb.getItem() instanceof IBloodOrb)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bloodOrbLevel = ((IBloodOrb) bloodOrb.getItem()).getOrbLevel();
|
||||
|
||||
for (AlchemyRecipe ar : recipes) {
|
||||
if (ar.doesRecipeMatch(recipe, bloodOrbLevel)) {
|
||||
return (ar.getAmountNeeded());
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ar == null ? 0 : ar.getAmountNeeded();
|
||||
}
|
||||
|
||||
public static ItemStack[] getRecipeForItemStack(ItemStack itemStack) {
|
||||
|
||||
@@ -122,7 +122,7 @@ public class NEIBindingRitualHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Binding Ritual";
|
||||
return StatCollector.translateToLocal("nei.recipe.bindingritual.category");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -216,6 +216,6 @@ public class NEICalcinatorHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Alchemic Calcinator";
|
||||
return StatCollector.translateToLocal("nei.recipe.calcinator.category");
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import java.util.stream.IntStream;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
@@ -34,6 +35,7 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TESocket;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.network.ByteBufUtils;
|
||||
import cpw.mods.fml.common.network.FMLEmbeddedChannel;
|
||||
import cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec;
|
||||
import cpw.mods.fml.common.network.FMLOutboundHandler;
|
||||
@@ -106,7 +108,7 @@ public enum NewPacketHandler {
|
||||
World world = AlchemicalWizardry.proxy.getClientWorld();
|
||||
TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z);
|
||||
if (te instanceof TEAltar altar) {
|
||||
altar.handlePacketData(msg.items, msg.fluids, msg.capacity);
|
||||
altar.handlePacketData(msg.itemStack, msg.fluids, msg.capacity);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,7 +319,7 @@ public enum NewPacketHandler {
|
||||
int y;
|
||||
int z;
|
||||
|
||||
int[] items;
|
||||
ItemStack itemStack;
|
||||
int[] fluids;
|
||||
int capacity;
|
||||
}
|
||||
@@ -482,11 +484,7 @@ public enum NewPacketHandler {
|
||||
target.writeInt(m.y);
|
||||
target.writeInt(m.z);
|
||||
|
||||
target.writeBoolean(m.items != null);
|
||||
if (m.items != null) {
|
||||
int[] items = m.items;
|
||||
Arrays.stream(items).forEach(target::writeInt);
|
||||
}
|
||||
ByteBufUtils.writeItemStack(target, m.itemStack);
|
||||
|
||||
target.writeBoolean(m.fluids != null);
|
||||
if (m.fluids != null) {
|
||||
@@ -658,13 +656,8 @@ public enum NewPacketHandler {
|
||||
m.x = dat.readInt();
|
||||
m.y = dat.readInt();
|
||||
m.z = dat.readInt();
|
||||
boolean hasStacks = dat.readBoolean();
|
||||
|
||||
m.items = new int[TEAltar.sizeInv * 3];
|
||||
if (hasStacks) {
|
||||
m.items = new int[TEAltar.sizeInv * 3];
|
||||
IntStream.range(0, m.items.length).forEach(i -> m.items[i] = dat.readInt());
|
||||
}
|
||||
m.itemStack = ByteBufUtils.readItemStack(dat);
|
||||
|
||||
boolean hasFluids = dat.readBoolean();
|
||||
m.fluids = new int[6];
|
||||
@@ -841,7 +834,7 @@ public enum NewPacketHandler {
|
||||
msg.x = tileAltar.xCoord;
|
||||
msg.y = tileAltar.yCoord;
|
||||
msg.z = tileAltar.zCoord;
|
||||
msg.items = tileAltar.buildIntDataList();
|
||||
msg.itemStack = tileAltar.getStackInSlot(0);
|
||||
msg.fluids = tileAltar.buildFluidList();
|
||||
msg.capacity = tileAltar.getCapacity();
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Facing;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -72,34 +69,7 @@ public class SpectralBlock extends BlockContainer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what,
|
||||
float these, float are) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemStack playerItem = player.getCurrentEquippedItem();
|
||||
|
||||
if (playerItem != null) {
|
||||
if (playerItem.getItem() instanceof ItemBlock) {
|
||||
world.setBlock(
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
((ItemBlock) (playerItem.getItem())).field_150939_a,
|
||||
playerItem.getItemDamage(),
|
||||
3);
|
||||
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
playerItem.stackSize--;
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isReplaceable(IBlockAccess world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setEnergyUsed(5);
|
||||
this.setHarvestLevel("axe", 7);
|
||||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i) {
|
||||
@@ -143,7 +144,6 @@ public class BoundAxe extends ItemAxe implements IBindable {
|
||||
}
|
||||
|
||||
checkPassiveDrain(item, world, player);
|
||||
item.setItemDamage(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,6 +49,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
this.setEnergyUsed(5);
|
||||
setHarvestLevel("pickaxe", 7);
|
||||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i) {
|
||||
@@ -183,7 +184,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable {
|
||||
}
|
||||
|
||||
checkPassiveDrain(item, world, player);
|
||||
item.setItemDamage(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,6 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
@@ -46,6 +45,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setEnergyUsed(5);
|
||||
setHarvestLevel("shovel", 7);
|
||||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i) {
|
||||
@@ -145,13 +145,7 @@ public class BoundShovel extends ItemSpade implements IBindable {
|
||||
return;
|
||||
}
|
||||
|
||||
if (item.getTagCompound() == null) {
|
||||
item.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
checkPassiveDrain(item, world, player);
|
||||
|
||||
item.setItemDamage(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ public class EnergySword extends ItemSword implements IBindable {
|
||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||
setEnergyUsed(50);
|
||||
setFull3D();
|
||||
setMaxDamage(100);
|
||||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
public void setEnergyUsed(int i) {
|
||||
@@ -106,7 +106,6 @@ public class EnergySword extends ItemSword implements IBindable {
|
||||
}
|
||||
|
||||
checkPassiveDrain(item, world, player);
|
||||
item.setItemDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-2
@@ -3,7 +3,6 @@ package WayofTime.alchemicalWizardry.common.spell.simple;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class HomSpellRegistry {
|
||||
@@ -22,7 +21,7 @@ public class HomSpellRegistry {
|
||||
for (HomSpellComponent hsc : spellList) {
|
||||
ItemStack item = hsc.item();
|
||||
|
||||
if (item != null && item.getItem() instanceof ItemBlock && testItem.getItem() == item.getItem()) {
|
||||
if (item != null && testItem.getItem() == item.getItem()) {
|
||||
return hsc.spell();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ public class SpellLightningBolt extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onOffensiveRangedRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class SpellLightningBolt extends HomSpell {
|
||||
@Override
|
||||
public ItemStack onOffensiveMeleeRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
// TODO Make it work better...?
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SpellTeleport extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onOffensiveRangedRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class SpellTeleport extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onOffensiveMeleeRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class SpellTeleport extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onDefensiveRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public class SpellTeleport extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onEnvironmentalRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -29,7 +29,7 @@ public class SpellWateryGrave extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onOffensiveRangedRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class SpellWateryGrave extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onOffensiveMeleeRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class SpellWateryGrave extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onDefensiveRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class SpellWateryGrave extends HomSpell {
|
||||
|
||||
@Override
|
||||
public ItemStack onEnvironmentalRightClick(ItemStack item, World world, EntityPlayer player) {
|
||||
if (IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
if (!IBindable.checkAndSetItemOwner(item, player) || player.isSneaking()) {
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.Packet;
|
||||
@@ -718,19 +717,8 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
|
||||
return NewPacketHandler.getPacket(this);
|
||||
}
|
||||
|
||||
public void handlePacketData(int[] intData, int[] fluidData, int capacity) {
|
||||
if (intData == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (intData.length == 3) {
|
||||
if (intData[2] != 0) {
|
||||
ItemStack is = new ItemStack(Item.getItemById(intData[0]), intData[2], intData[1]);
|
||||
inv[0] = is;
|
||||
} else {
|
||||
inv[0] = null;
|
||||
}
|
||||
}
|
||||
public void handlePacketData(ItemStack itemStack, int[] fluidData, int capacity) {
|
||||
inv[0] = itemStack == null ? null : itemStack.copy();
|
||||
|
||||
FluidStack flMain = new FluidStack(fluidData[0], fluidData[1]);
|
||||
FluidStack flIn = new FluidStack(fluidData[2], fluidData[3]);
|
||||
@@ -743,25 +731,6 @@ public class TEAltar extends TEInventory implements IFluidTank, IFluidHandler, I
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
public int[] buildIntDataList() {
|
||||
int[] sortList = new int[3]; // 1 * 3
|
||||
int pos = 0;
|
||||
|
||||
for (ItemStack is : inv) {
|
||||
if (is != null) {
|
||||
sortList[pos++] = Item.getIdFromItem(is.getItem());
|
||||
sortList[pos++] = is.getItemDamage();
|
||||
sortList[pos++] = is.stackSize;
|
||||
} else {
|
||||
sortList[pos++] = 0;
|
||||
sortList[pos++] = 0;
|
||||
sortList[pos++] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return sortList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startCycle() {
|
||||
if (worldObj != null) {
|
||||
|
||||
@@ -540,14 +540,22 @@ public class TEWritingTable extends TEInventory implements ISidedInventory, IBlo
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!isRecipeValid()) {
|
||||
ItemStack[] composedRecipe = new ItemStack[5];
|
||||
|
||||
System.arraycopy(inv, 1, composedRecipe, 0, 5);
|
||||
|
||||
AlchemyRecipe recipe = AlchemyRecipeRegistry.findRecipe(composedRecipe, inv[0]);
|
||||
|
||||
if (recipe == null) {
|
||||
progress = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack result = recipe.getResult();
|
||||
|
||||
if (progress <= 0) {
|
||||
progress = 0;
|
||||
amountUsed = this.getAmountNeeded(getStackInSlot(0));
|
||||
amountUsed = recipe.getAmountNeeded();
|
||||
|
||||
if (worldObj != null) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
@@ -580,60 +588,50 @@ public class TEWritingTable extends TEInventory implements ISidedInventory, IBlo
|
||||
|
||||
if (progress >= progressNeeded) {
|
||||
progress = 0;
|
||||
this.setInventorySlotContents(6, getResultingItemStack());
|
||||
this.setInventorySlotContents(6, result.copy());
|
||||
|
||||
ItemStack[] composedRecipe = new ItemStack[5];
|
||||
|
||||
System.arraycopy(inv, 1, composedRecipe, 0, 5);
|
||||
|
||||
this.decrementSlots(this.getRecipeForItems(composedRecipe, inv[0]));
|
||||
this.decrementSlots(recipe.getRecipe());
|
||||
|
||||
if (worldObj != null) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
} else if (getStackInSlot(6).getItem() == getResultingItemStack().getItem()
|
||||
&& getResultingItemStack().stackSize
|
||||
<= (getStackInSlot(6).getMaxStackSize() - getStackInSlot(6).stackSize)) {
|
||||
if (worldTime % 4 == 0) {
|
||||
SpellHelper.sendIndexedParticleToAllAround(
|
||||
worldObj,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
20,
|
||||
worldObj.provider.dimensionId,
|
||||
1,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord);
|
||||
}
|
||||
} else if (getStackInSlot(6).getItem() == result.getItem()
|
||||
&& result.stackSize <= (getStackInSlot(6).getMaxStackSize() - getStackInSlot(6).stackSize)) {
|
||||
if (worldTime % 4 == 0) {
|
||||
SpellHelper.sendIndexedParticleToAllAround(
|
||||
worldObj,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord,
|
||||
20,
|
||||
worldObj.provider.dimensionId,
|
||||
1,
|
||||
xCoord,
|
||||
yCoord,
|
||||
zCoord);
|
||||
}
|
||||
|
||||
if (!SoulNetworkHandler.syphonFromNetworkWhileInContainer(
|
||||
getStackInSlot(0),
|
||||
amountUsed * acceleration)) {
|
||||
return;
|
||||
}
|
||||
if (!SoulNetworkHandler
|
||||
.syphonFromNetworkWhileInContainer(getStackInSlot(0), amountUsed * acceleration)) {
|
||||
return;
|
||||
}
|
||||
|
||||
progress += acceleration;
|
||||
progress += acceleration;
|
||||
|
||||
if (progress >= progressNeeded) {
|
||||
progress = 0;
|
||||
ItemStack result = getResultingItemStack().copy();
|
||||
result.stackSize += getStackInSlot(6).stackSize;
|
||||
this.setInventorySlotContents(6, result);
|
||||
if (progress >= progressNeeded) {
|
||||
progress = 0;
|
||||
ItemStack mergedResult = result.copy();
|
||||
mergedResult.stackSize += getStackInSlot(6).stackSize;
|
||||
this.setInventorySlotContents(6, mergedResult);
|
||||
|
||||
ItemStack[] composedRecipe = new ItemStack[5];
|
||||
this.decrementSlots(recipe.getRecipe());
|
||||
|
||||
System.arraycopy(inv, 1, composedRecipe, 0, 5);
|
||||
|
||||
this.decrementSlots(this.getRecipeForItems(composedRecipe, inv[0]));
|
||||
|
||||
if (worldObj != null) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
if (worldObj != null) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -667,26 +665,6 @@ public class TEWritingTable extends TEInventory implements ISidedInventory, IBlo
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack[] getRecipeForItems(ItemStack[] recipe, ItemStack bloodOrb) {
|
||||
if (bloodOrb == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!(bloodOrb.getItem() instanceof IBloodOrb)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int bloodOrbLevel = ((IBloodOrb) bloodOrb.getItem()).getOrbLevel();
|
||||
|
||||
for (AlchemyRecipe ar : AlchemyRecipeRegistry.recipes) {
|
||||
if (ar.doesRecipeMatch(recipe, bloodOrbLevel)) {
|
||||
return ar.getRecipe();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getSpeedIncrease() {
|
||||
return accelerationTime > 0 ? 5 : 1;
|
||||
}
|
||||
|
||||
@@ -278,6 +278,8 @@ text.recipe.altar.tier=Tier: %s
|
||||
text.recipe.altar.bloodRequired=LP: %s
|
||||
text.recipe.shapedOrb=Shaped Orb Recipe
|
||||
text.recipe.alchemicCalcinator.reagent=%s AR
|
||||
nei.recipe.bindingritual.category=Binding Ritual
|
||||
nei.recipe.calcinator.category=Alchemic Calcinator
|
||||
nei.recipe.meteor.category=Meteor Ritual
|
||||
nei.recipe.meteor.cost=LP cost to summon this meteor
|
||||
nei.recipe.meteor.tooExpensive=Insufficient LP in Soul Network
|
||||
|
||||
Reference in new issue
Block a user