From ec03ac9cea02823394e4d5aea2ec243653da9f9c Mon Sep 17 00:00:00 2001 From: HellFirePvP <01ecs01m> Date: Sat, 19 Dec 2015 23:08:11 +0100 Subject: [PATCH 1/4] - Gammel bugfix arcane enervation emitter crafting recipe --- .../common/registration/RegisteredRecipes.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredRecipes.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredRecipes.java index b52ffe2..e68fab6 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredRecipes.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredRecipes.java @@ -71,7 +71,7 @@ public class RegisteredRecipes { public static IArcaneRecipe recipeArcaneDropper; public static IArcaneRecipe recipeRemoteJar; public static IArcaneRecipe recipeAncientPedestal; - public static IArcaneRecipe recipeBlockProtector; + public static IArcaneRecipe[] recipeBlockProtector; public static CrucibleRecipe recipeAncientStonePedestal = null; public static IArcaneRecipe recipeAncientStone = null; @@ -163,9 +163,20 @@ public class RegisteredRecipes { recipesFamilar = createFamilarRecipes(); recipesFamiliarAugmentation = createFamiliarAugmentationRecipes(); - recipeBlockProtector = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2), + recipeBlockProtector = new IArcaneRecipe[4]; + recipeBlockProtector[0] = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2), new AspectList().add(Aspect.ORDER, 120).add(Aspect.EARTH, 120), - "WNW", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8232), 'V', new ItemStack(Items.potionitem, 1, 8264), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone)); + "WNW", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8232), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone)); + recipeBlockProtector[1] = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2), + new AspectList().add(Aspect.ORDER, 120).add(Aspect.EARTH, 120), + "WNW", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8200), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone)); + + recipeBlockProtector[2] = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2), + new AspectList().add(Aspect.ORDER, 120).add(Aspect.EARTH, 120), + "WNV", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8232), 'V', new ItemStack(Items.potionitem, 1, 8200), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone)); + recipeBlockProtector[3] = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".BLOCK_PROTECTOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2), + new AspectList().add(Aspect.ORDER, 120).add(Aspect.EARTH, 120), + "WNV", "PJP", "GRG", 'W', new ItemStack(Items.potionitem, 1, 8200), 'V', new ItemStack(Items.potionitem, 1, 8232), 'N', new ItemStack(ConfigItems.itemResource, 1, 1), 'P', new ItemStack(ConfigBlocks.blockTube), 'J', new ItemStack(ConfigBlocks.blockJar), 'G', new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 6), 'R', new ItemStack(Items.redstone)); if(ModConfig.ancientStoneRecipes) { recipeAncientStone = ThaumcraftApi.addArcaneCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".ANCIENT_STONES", new ItemStack(ConfigBlocks.blockCosmeticSolid, 4, 11), new AspectList().add(Aspect.ENTROPY, 16).add(Aspect.EARTH, 8), From fca75ef4afdbfc1941aa3b1fa6a57cd847fa3eca Mon Sep 17 00:00:00 2001 From: HellFirePvP Date: Sat, 19 Dec 2015 23:21:22 +0100 Subject: [PATCH 2/4] - Removing unnecessary stuff --- .../common/blocks/tiles/TileAuraPylon.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java index 4e7c2b6..8396a79 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java @@ -37,22 +37,10 @@ import java.util.List; */ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectContainer, IEssentiaTransport { - //This TileEntity is designed to be used stacked with others of its kind - without limits. - //The aspects the tiles contain are all provided in the top tile of the structure - //The actual work is done in the top tile of the structure - - //The inner aspect type is defined by a piece of crystallized Essentia being checked by the master-tile - //The master tile informs all the other tiles what aspect currently is in use. - - //All tiles check each 8 ticks if the structure is still complete/contains an IO- and a master-tile - //Master tile updates its state and the state of all tiles every 4 ticks so Aspect information and item information are still valid. - //Master tile updates effects all 8 ticks if there is an internal aspect present. - //Input tile handles Essentia IO all 8 ticks and thus provides needed amount information. - private ItemStack crystalEssentiaStack = null; private boolean isPartOfMultiblock = false; - public int timeSinceLastItemInfo = 0; //0-5, update interval = 2 + public int timeSinceLastItemInfo = 0; private int ticksExisted = 0; private Aspect holdingAspect; From b681d6a8aea6f1ccf1f2e4f088b0fbf902074528 Mon Sep 17 00:00:00 2001 From: HellFirePvP Date: Sat, 19 Dec 2015 23:48:39 +0100 Subject: [PATCH 3/4] - Removing setVelocity --- .../makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java | 4 +++- .../gadomancy/common/entities/EntityPermNoClipItem.java | 4 +++- src/main/java/makeo/gadomancy/common/utils/ItemUtils.java | 7 +++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java index 8396a79..2d2e8e9 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java @@ -182,7 +182,9 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont EntityPermNoClipItem item = new EntityPermNoClipItem(entity.worldObj, xCoord + 0.5F, yC + 0.3F, zCoord + 0.5F, crystalEssentiaStack, xCoord, yCoord, zCoord); entity.worldObj.spawnEntityInWorld(item); - item.setVelocity(0, 0, 0); + item.motionX = 0; + item.motionY = 0; + item.motionZ = 0; item.hoverStart = entity.hoverStart; item.age = entity.age; item.noClip = true; diff --git a/src/main/java/makeo/gadomancy/common/entities/EntityPermNoClipItem.java b/src/main/java/makeo/gadomancy/common/entities/EntityPermNoClipItem.java index 2ce2370..faf934f 100644 --- a/src/main/java/makeo/gadomancy/common/entities/EntityPermNoClipItem.java +++ b/src/main/java/makeo/gadomancy/common/entities/EntityPermNoClipItem.java @@ -62,7 +62,9 @@ public class EntityPermNoClipItem extends EntityPermanentItem { public void onUpdate() { noClip = true; super.onUpdate(); - setVelocity(0, 0, 0); + motionX = 0; + motionY = 0; + motionZ = 0; if (getDataWatcher().getWatchedObject(ModConfig.entityNoClipItemDatawatcherFixedId).getObject() == null) return; diff --git a/src/main/java/makeo/gadomancy/common/utils/ItemUtils.java b/src/main/java/makeo/gadomancy/common/utils/ItemUtils.java index 216eb72..c56e94e 100644 --- a/src/main/java/makeo/gadomancy/common/utils/ItemUtils.java +++ b/src/main/java/makeo/gadomancy/common/utils/ItemUtils.java @@ -15,10 +15,9 @@ import java.util.Random; public class ItemUtils { public static void applyRandomDropOffset(EntityItem item, Random rand) { - double xs = rand.nextFloat() * 0.7F - 0.35D; - double ys = rand.nextFloat() * 0.7F - 0.35D; - double zs = rand.nextFloat() * 0.7F - 0.35D; - item.setVelocity(xs, ys, zs); + item.motionX = rand.nextFloat() * 0.7F - 0.35D; + item.motionY = rand.nextFloat() * 0.7F - 0.35D; + item.motionZ = rand.nextFloat() * 0.7F - 0.35D; } } From da15affb08cf4f524eff9024d24a40fe88e30ede Mon Sep 17 00:00:00 2001 From: HellFirePvP Date: Sun, 20 Dec 2015 00:36:02 +0100 Subject: [PATCH 4/4] - Server crash fixxes --- .../makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java | 5 ++++- .../java/makeo/gadomancy/common/entities/EntityAuraCore.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java index 2d2e8e9..c2219e1 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java @@ -1,5 +1,7 @@ package makeo.gadomancy.common.blocks.tiles; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import makeo.gadomancy.common.entities.EntityPermNoClipItem; import makeo.gadomancy.common.aura.AuraEffectHandler; import makeo.gadomancy.common.utils.NBTHelper; @@ -78,7 +80,7 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont } } else { - if( isInputTile() && holdingAspect != null) { + if(isInputTile() && holdingAspect != null) { doEssentiaTrail(); } } @@ -105,6 +107,7 @@ public class TileAuraPylon extends SynchronizedTileEntity implements IAspectCont } //Client-Side input tile only! + @SideOnly(Side.CLIENT) private void doEssentiaTrail() { if((ticksExisted & 1) == 0) return; TileAuraPylon tile = getMasterTile(); diff --git a/src/main/java/makeo/gadomancy/common/entities/EntityAuraCore.java b/src/main/java/makeo/gadomancy/common/entities/EntityAuraCore.java index f77ec77..5dcf86a 100644 --- a/src/main/java/makeo/gadomancy/common/entities/EntityAuraCore.java +++ b/src/main/java/makeo/gadomancy/common/entities/EntityAuraCore.java @@ -274,7 +274,10 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn ScanResult result = null; MovingObjectPosition pos = new MovingObjectPosition(x, y, z, ForgeDirection.UP.ordinal(), Vec3.createVectorHelper(0, 0, 0), true); - ItemStack is = block.getPickBlock(pos, worldObj, x, y, z); + ItemStack is = null; + try { + is = block.getPickBlock(pos, worldObj, x, y, z); + } catch (Throwable tr) {} try { if(is == null) { is = BlockUtils.createStackedBlock(block, meta);