mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-11-28 16:06:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92b212d5e0 | ||
|
|
1972b9ab2b | ||
|
|
99e23607f5 | ||
|
|
63423b8913 | ||
|
|
0d3d390e22 | ||
|
|
96ffb23eae |
No files matched your search
+12
-12
@@ -1,27 +1,27 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.6-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.11-GTNH:dev')
|
||||
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive=false}
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-839-GTNH:api')
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-882-GTNH:api')
|
||||
api('com.github.GTNewHorizons:ThaumicBoots:1.5.8:dev') {transitive=false}
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.13.14-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.5.5:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.20:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderStorage:1.8.2:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.13.16-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.5.12:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.22:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderStorage:1.8.3:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.19.22:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.14.30-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.7.2:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:CodeChickenCore:1.4.10:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.16-GTNH:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.14.46-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.7.3:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:CodeChickenCore:1.4.12:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.22-GTNH:api') {transitive=false}
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:api') {transitive=false}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.308:dev") {exclude group: 'com.github.GTNewHorizons', module: 'ThaumicTinkerer'}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.52.399:dev") {exclude group: 'com.github.GTNewHorizons', module: 'ThaumicTinkerer'}
|
||||
compileOnly('curse.maven:computercraft-67504:2269339')
|
||||
compileOnly('curse.maven:cofh-core-69162:2388751')
|
||||
|
||||
// For testing purposes
|
||||
//runtimeOnlyNonPublishable("com.github.GTNewHorizons:Electro-Magic-Tools:1.7.17:dev")
|
||||
//runtimeOnlyNonPublishable("com.github.GTNewHorizons:Electro-Magic-Tools:1.7.20:dev")
|
||||
|
||||
runtimeOnly(rfg.deobf('curse.maven:thaumcraft-nei-plugin-225095:2241913'))
|
||||
runtimeOnly('com.github.GTNewHorizons:TCNEIAdditions:1.5.13:dev')
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/e1118b4c7c2858d28154d086dbff010e/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/832229f0f6f0be60ed817c5a5e5848eb/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/b96cb7670c095245220e7d01d5927b58/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/faa12903720d410b387cc69ccafb1a74/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a4c09dd2e2d7079373d30e524bbc2829/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
|
||||
toolchainVersion=25
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/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/.
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("com.gtnewhorizons.gtnhsettingsconvention") version "2.0.20"
|
||||
id("com.gtnewhorizons.gtnhsettingsconvention") version "2.0.24"
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumic.tinkerer.client.core.handler.ClientTickHandler;
|
||||
@@ -64,8 +66,11 @@ import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
import thaumic.tinkerer.common.item.ItemMobDisplay;
|
||||
import thaumic.tinkerer.common.item.kami.ItemPlacementMirror;
|
||||
import thaumic.tinkerer.common.item.kami.foci.ItemFocusShadowbeam;
|
||||
import thaumic.tinkerer.common.potion.PotionEffectHandlerClient;
|
||||
|
||||
public class TTClientProxy extends TTCommonProxy {
|
||||
public final class TTClientProxy extends TTCommonProxy {
|
||||
|
||||
private PotionEffectHandlerClient potionHandlerClient;
|
||||
|
||||
public static EntityPlayer getPlayer() {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
@@ -74,18 +79,21 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
super.preInit(event);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
if (Loader.isModLoaded("ComputerCraft")) {
|
||||
MinecraftForge.EVENT_BUS.register(new FumeTool());
|
||||
}
|
||||
|
||||
if (ConfigHandler.enableKami)
|
||||
if (ConfigHandler.enableKami) {
|
||||
// kamiRarity = EnumHelperClient.addRarity("KAMI", 0x6, "Kami");
|
||||
|
||||
kamiRarity = EnumHelperClient.addEnum(
|
||||
new Class[][] { { EnumRarity.class, EnumChatFormatting.class, String.class } },
|
||||
EnumRarity.class,
|
||||
"KAMI",
|
||||
EnumChatFormatting.LIGHT_PURPLE,
|
||||
"Kami");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,6 +116,22 @@ public class TTClientProxy extends TTCommonProxy {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) {
|
||||
this.potionHandlerClient = new PotionEffectHandlerClient();
|
||||
MinecraftForge.EVENT_BUS.register(potionHandlerClient);
|
||||
FMLCommonHandler.instance().bus().register(potionHandlerClient);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClientDisconnect(FMLNetworkEvent.ClientDisconnectionFromServerEvent event) {
|
||||
if (this.potionHandlerClient != null) {
|
||||
MinecraftForge.EVENT_BUS.unregister(potionHandlerClient);
|
||||
FMLCommonHandler.instance().bus().unregister(potionHandlerClient);
|
||||
this.potionHandlerClient = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void registerTiles() {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileAnimationTablet.class, new RenderTileAnimationTablet());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileMagnet.class, new RenderTileMagnet());
|
||||
|
||||
@@ -13,9 +13,6 @@ package thaumic.tinkerer.common;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraft.command.ICommandManager;
|
||||
import net.minecraft.command.ServerCommandManager;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -31,14 +28,12 @@ import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import thaumcraft.common.CommonProxy;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumic.tinkerer.api.InterModCommsOperations;
|
||||
import thaumic.tinkerer.common.core.commands.KamiUnlockedCommand;
|
||||
import thaumic.tinkerer.common.core.commands.MaxResearchCommand;
|
||||
import thaumic.tinkerer.common.core.commands.SetTendencyCommand;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.proxy.TTCommonProxy;
|
||||
import thaumic.tinkerer.common.dim.WorldProviderBedrock;
|
||||
@@ -85,13 +80,27 @@ public class ThaumicTinkerer {
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStart(FMLServerStartingEvent event) {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
ICommandManager command = server.getCommandManager();
|
||||
ServerCommandManager manager = (ServerCommandManager) command;
|
||||
manager.registerCommand(new SetTendencyCommand());
|
||||
manager.registerCommand(new MaxResearchCommand());
|
||||
manager.registerCommand(new KamiUnlockedCommand());
|
||||
public void init(FMLInitializationEvent event) {
|
||||
proxy.init(event);
|
||||
if (ConfigHandler.enableKami && ConfigHandler.bedrockDimensionID != 0) {
|
||||
DimensionManager.registerProviderType(ConfigHandler.bedrockDimensionID, WorldProviderBedrock.class, false);
|
||||
DimensionManager.registerDimension(ConfigHandler.bedrockDimensionID, ConfigHandler.bedrockDimensionID);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
proxy.postInit(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
proxy.serverStarting(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStopped(FMLServerStoppedEvent event) {
|
||||
proxy.serverStopped(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -111,18 +120,4 @@ public class ThaumicTinkerer {
|
||||
public void blackListCCDevices(String classname) {
|
||||
PeripheralHandler.Blacklist.add(classname);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
proxy.init(event);
|
||||
if (ConfigHandler.enableKami && ConfigHandler.bedrockDimensionID != 0) {
|
||||
DimensionManager.registerProviderType(ConfigHandler.bedrockDimensionID, WorldProviderBedrock.class, false);
|
||||
DimensionManager.registerDimension(ConfigHandler.bedrockDimensionID, ConfigHandler.bedrockDimensionID);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
proxy.postInit(event);
|
||||
}
|
||||
}
|
||||
@@ -65,11 +65,13 @@ public class TileEntityRelay extends TileEntity implements IMovableTile {
|
||||
if (partnerX - xCoord != 0) {
|
||||
xInc = ((float) Math.copySign(.05, partnerX - xCoord)) * (worldObj.getTotalWorldTime() % 20);
|
||||
}
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (0.5 + i + xInc),
|
||||
(float) (yCoord + 0.5),
|
||||
(float) (j + 0.5 + zInc),
|
||||
xCoord < partnerX || zCoord > partnerX ? 2 : 14);
|
||||
if (worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (0.5 + i + xInc),
|
||||
(float) (yCoord + 0.5),
|
||||
(float) (j + 0.5 + zInc),
|
||||
xCoord < partnerX || zCoord > partnerX ? 2 : 14);
|
||||
}
|
||||
j += Math.copySign(1, partnerZ - zCoord);
|
||||
} while (j < partnerZ);
|
||||
i += Math.copySign(1, partnerX - xCoord);
|
||||
|
||||
@@ -17,7 +17,8 @@ public class TileForcefield extends TileEntity {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
ticks--;
|
||||
|
||||
ThaumicTinkerer.tcProxy.blockSparkle(worldObj, xCoord, yCoord, zCoord, 255, 1);
|
||||
if (worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.blockSparkle(worldObj, xCoord, yCoord, zCoord, 255, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,9 @@ public class TileMagnet extends TileEntity implements IPeripheral, IMovableTile,
|
||||
|
||||
if (distanceSqrd > 1) {
|
||||
MiscHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), speedMod * 0.25F);
|
||||
ThaumicTinkerer.tcProxy.sparkle((float) x2, (float) y2, (float) z2, blue ? 2 : 4);
|
||||
if (worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.sparkle((float) x2, (float) y2, (float) z2, blue ? 2 : 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import thaumic.tinkerer.common.lib.LibBlockNames;
|
||||
public class TileRepairer extends TileEntity
|
||||
implements ISidedInventory, IAspectContainer, IEssentiaTransport, IMovableTile {
|
||||
|
||||
private static final String TAG_TOOK_LAST_TICK = "tookLastTick";
|
||||
private static final Map<Aspect, Integer> repairValues = new HashMap<>();
|
||||
|
||||
static {
|
||||
@@ -53,12 +54,25 @@ public class TileRepairer extends TileEntity
|
||||
|
||||
public int ticksExisted = 0;
|
||||
public boolean tookLastTick = true;
|
||||
int dmgLastTick = 0;
|
||||
ItemStack[] inventorySlots = new ItemStack[1];
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (++ticksExisted % 10 == 0) {
|
||||
if (worldObj.isRemote) {
|
||||
if (tookLastTick) {
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (xCoord + 0.25 + Math.random() / 2F),
|
||||
(float) (yCoord + 1 + Math.random() / 2F),
|
||||
(float) (zCoord + 0.25 + Math.random() / 2F),
|
||||
0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
boolean oldTookLastTick = tookLastTick;
|
||||
tookLastTick = false;
|
||||
|
||||
if (Loader.isModLoaded("TConstruct") && ConfigHandler.repairTConTools) {
|
||||
if (inventorySlots[0] != null) {
|
||||
if (TinkersConstructCompat.isTConstructTool(inventorySlots[0])) {
|
||||
@@ -66,18 +80,11 @@ public class TileRepairer extends TileEntity
|
||||
if (dmg > 0) {
|
||||
int essentia = drawEssentia();
|
||||
TinkersConstructCompat.fixDamage(inventorySlots[0], essentia);
|
||||
int newDmg = TinkersConstructCompat.getDamage(inventorySlots[0]);
|
||||
tookLastTick = newDmg != dmg;
|
||||
markDirty();
|
||||
if (dmgLastTick != 0 && dmgLastTick != dmg) {
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (xCoord + 0.25 + Math.random() / 2F),
|
||||
(float) (yCoord + 1 + Math.random() / 2F),
|
||||
(float) (zCoord + 0.25 + Math.random() / 2F),
|
||||
0);
|
||||
tookLastTick = true;
|
||||
} else tookLastTick = false;
|
||||
} else tookLastTick = false;
|
||||
dmgLastTick = inventorySlots[0] == null ? 0
|
||||
: TinkersConstructCompat.getDamage(inventorySlots[0]);
|
||||
}
|
||||
if (tookLastTick != oldTookLastTick) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -85,20 +92,12 @@ public class TileRepairer extends TileEntity
|
||||
if (inventorySlots[0] != null && inventorySlots[0].getItemDamage() > 0) {
|
||||
int essentia = drawEssentia();
|
||||
int dmg = inventorySlots[0].getItemDamage();
|
||||
inventorySlots[0].setItemDamage(Math.max(0, dmg - essentia));
|
||||
int newDmg = Math.max(0, dmg - essentia);
|
||||
inventorySlots[0].setItemDamage(newDmg);
|
||||
tookLastTick = newDmg != dmg;
|
||||
markDirty();
|
||||
|
||||
if (dmgLastTick != 0 && dmgLastTick != dmg) {
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (xCoord + 0.25 + Math.random() / 2F),
|
||||
(float) (yCoord + 1 + Math.random() / 2F),
|
||||
(float) (zCoord + 0.25 + Math.random() / 2F),
|
||||
0);
|
||||
tookLastTick = true;
|
||||
} else tookLastTick = false;
|
||||
} else tookLastTick = false;
|
||||
|
||||
dmgLastTick = inventorySlots[0] == null ? 0 : inventorySlots[0].getItemDamage();
|
||||
}
|
||||
if (tookLastTick != oldTookLastTick) worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +116,7 @@ public class TileRepairer extends TileEntity
|
||||
}
|
||||
|
||||
public void readCustomNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
tookLastTick = par1NBTTagCompound.getBoolean(TAG_TOOK_LAST_TICK);
|
||||
NBTTagList nbttaglist = par1NBTTagCompound.getTagList("Items", Constants.NBT.TAG_COMPOUND);
|
||||
inventorySlots = new ItemStack[1];
|
||||
|
||||
@@ -127,6 +127,7 @@ public class TileRepairer extends TileEntity
|
||||
}
|
||||
|
||||
public void writeCustomNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
par1NBTTagCompound.setBoolean(TAG_TOOK_LAST_TICK, tookLastTick);
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
if (inventorySlots[0] != null) {
|
||||
NBTTagCompound tagList = new NBTTagCompound();
|
||||
|
||||
@@ -51,22 +51,23 @@ public class TileWarpGate extends TileEntity implements IInventory {
|
||||
if (!destGate.locked) {
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:wand", 1F, 1F);
|
||||
|
||||
for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) player.posX + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) player.posY + player.worldObj.rand.nextFloat(),
|
||||
(float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
6);
|
||||
|
||||
if (player.worldObj.isRemote) {
|
||||
for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) player.posX + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) player.posY + player.worldObj.rand.nextFloat(),
|
||||
(float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
6);
|
||||
}
|
||||
player.mountEntity(null);
|
||||
if (player instanceof EntityPlayerMP) ((EntityPlayerMP) player).playerNetServerHandler
|
||||
.setPlayerLocation(x + 0.5, y + 1.6, z + 0.5, player.rotationYaw, player.rotationPitch);
|
||||
|
||||
for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) player.posX + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) player.posY + player.worldObj.rand.nextFloat(),
|
||||
(float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
6);
|
||||
|
||||
if (player.worldObj.isRemote) {
|
||||
for (int i = 0; i < 20; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) player.posX + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) player.posY + player.worldObj.rand.nextFloat(),
|
||||
(float) player.posZ + player.worldObj.rand.nextFloat() - 0.5F,
|
||||
6);
|
||||
}
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:wand", 1F, 0.1F);
|
||||
return true;
|
||||
} else
|
||||
|
||||
@@ -41,7 +41,7 @@ public class AspectCropLootManager {
|
||||
Random rand = new Random();
|
||||
int randInt = rand.nextInt(sum);
|
||||
for (Map.Entry<ItemStack, Integer> pair : aspectHashmap.entrySet()) {
|
||||
if (randInt <= 0) {
|
||||
if (randInt < pair.getValue()) {
|
||||
return pair.getKey().copy();
|
||||
}
|
||||
randInt -= pair.getValue();
|
||||
@@ -55,15 +55,7 @@ public class AspectCropLootManager {
|
||||
}
|
||||
|
||||
public static void addAspectLoot(Aspect aspect, String target) {
|
||||
|
||||
addAspectLoot(aspect, target, 1);
|
||||
for (String ore : OreDictionary.getOreNames()) {
|
||||
if (ore.contains(WordUtils.capitalizeFully(target)) || ore.contains(target)) {
|
||||
for (ItemStack stack : OreDictionary.getOres(ore)) {
|
||||
addAspectLoot(aspect, stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void addAspectLoot(Aspect aspect, String target, int count) {
|
||||
@@ -217,8 +209,7 @@ public class AspectCropLootManager {
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 6));
|
||||
|
||||
addAspectLoot(Aspect.HEAL, new ItemStack(Items.golden_apple));
|
||||
|
||||
addAspectLoot(Aspect.HEAL, new ItemStack(Blocks.cake));
|
||||
addAspectLoot(Aspect.HEAL, new ItemStack(Items.cake));
|
||||
|
||||
addAspectLoot(Aspect.SENSES, new ItemStack(Items.dye, 20, 4));
|
||||
|
||||
|
||||
@@ -1,20 +1,23 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as part of the ThaumicTinkerer Mod.
|
||||
*
|
||||
* <p>
|
||||
* ThaumicTinkerer is Open Source and distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0
|
||||
* License (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
|
||||
*
|
||||
* <p>
|
||||
* ThaumicTinkerer is a Derivative Work on Thaumcraft 4. Thaumcraft 4 (c) Azanor 2012
|
||||
* (http://www.minecraftforum.net/topic/1585216-)
|
||||
*
|
||||
* <p>
|
||||
* File Created @ [4 Sep 2013, 16:29:41 (GMT)]
|
||||
*/
|
||||
package thaumic.tinkerer.common.core.proxy;
|
||||
|
||||
import net.minecraft.command.ICommandManager;
|
||||
import net.minecraft.command.ServerCommandManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -27,6 +30,8 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import dan200.computercraft.api.ComputerCraftAPI;
|
||||
@@ -54,6 +59,9 @@ import thaumic.tinkerer.common.block.tile.transvector.TileTransvectorInterface;
|
||||
import thaumic.tinkerer.common.compat.EMTCompat;
|
||||
import thaumic.tinkerer.common.compat.EnderIO;
|
||||
import thaumic.tinkerer.common.compat.FumeTool;
|
||||
import thaumic.tinkerer.common.core.commands.KamiUnlockedCommand;
|
||||
import thaumic.tinkerer.common.core.commands.MaxResearchCommand;
|
||||
import thaumic.tinkerer.common.core.commands.SetTendencyCommand;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
import thaumic.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import thaumic.tinkerer.common.core.handler.kami.DimensionalShardDropHandler;
|
||||
@@ -89,6 +97,7 @@ import thaumic.tinkerer.common.peripheral.OpenComputers.DriverEssentiaTransport;
|
||||
import thaumic.tinkerer.common.peripheral.OpenComputers.DriverIAspectContainer;
|
||||
import thaumic.tinkerer.common.peripheral.PeripheralHandler;
|
||||
import thaumic.tinkerer.common.potion.ModPotions;
|
||||
import thaumic.tinkerer.common.potion.PotionEffectHandlerServer;
|
||||
import thaumic.tinkerer.common.research.ResearchHelper;
|
||||
|
||||
public class TTCommonProxy {
|
||||
@@ -97,6 +106,7 @@ public class TTCommonProxy {
|
||||
public WandCap capIchor;
|
||||
public WandRod rodIchor;
|
||||
public Item.ToolMaterial toolMaterialIchor;
|
||||
private PotionEffectHandlerServer potionHandlerServer;
|
||||
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
toolMaterialIchor = EnumHelper.addToolMaterial("ICHOR", 4, -1, 10F, 5F, 25);
|
||||
@@ -163,35 +173,48 @@ public class TTCommonProxy {
|
||||
EMTCompat.init();
|
||||
}
|
||||
|
||||
protected void registerPackets() {
|
||||
ThaumicTinkerer.netHandler
|
||||
.registerMessage(PacketSoulHearts.class, PacketSoulHearts.class, 142 + 0, Side.CLIENT);
|
||||
ThaumicTinkerer.netHandler
|
||||
.registerMessage(PacketToggleArmor.class, PacketToggleArmor.class, 142 + 1, Side.CLIENT);
|
||||
ThaumicTinkerer.netHandler
|
||||
.registerMessage(PacketToggleArmor.class, PacketToggleArmor.class, 142 + 2, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler
|
||||
.registerMessage(PacketWarpGateButton.class, PacketWarpGateButton.class, 142 + 3, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler
|
||||
.registerMessage(PacketWarpGateTeleport.class, PacketWarpGateTeleport.class, 142 + 4, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler.registerMessage(
|
||||
PacketEnchanterAddEnchant.class,
|
||||
PacketEnchanterAddEnchant.class,
|
||||
142 + 5,
|
||||
Side.SERVER);
|
||||
ThaumicTinkerer.netHandler.registerMessage(
|
||||
PacketEnchanterStartWorking.class,
|
||||
PacketEnchanterStartWorking.class,
|
||||
142 + 6,
|
||||
Side.SERVER);
|
||||
ThaumicTinkerer.netHandler
|
||||
.registerMessage(PacketMobMagnetButton.class, PacketMobMagnetButton.class, 142 + 7, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler
|
||||
.registerMessage(PacketTabletButton.class, PacketTabletButton.class, 142 + 8, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler
|
||||
.registerMessage(PacketPlacerButton.class, PacketPlacerButton.class, 142 + 9, Side.SERVER);
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
ResearchHelper.initResearch();
|
||||
ThaumicTinkerer.registry.postInit();
|
||||
AspectCropLootManager.populateLootMap();
|
||||
ItemFocusDeflect.setupBlackList();
|
||||
}
|
||||
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
ICommandManager command = server.getCommandManager();
|
||||
ServerCommandManager manager = (ServerCommandManager) command;
|
||||
manager.registerCommand(new SetTendencyCommand());
|
||||
manager.registerCommand(new MaxResearchCommand());
|
||||
manager.registerCommand(new KamiUnlockedCommand());
|
||||
this.potionHandlerServer = new PotionEffectHandlerServer();
|
||||
MinecraftForge.EVENT_BUS.register(potionHandlerServer);
|
||||
FMLCommonHandler.instance().bus().register(potionHandlerServer);
|
||||
}
|
||||
|
||||
public void serverStopped(FMLServerStoppedEvent event) {
|
||||
if (this.potionHandlerServer != null) {
|
||||
MinecraftForge.EVENT_BUS.unregister(potionHandlerServer);
|
||||
FMLCommonHandler.instance().bus().unregister(potionHandlerServer);
|
||||
this.potionHandlerServer = null;
|
||||
}
|
||||
}
|
||||
|
||||
// spotless:off
|
||||
protected void registerPackets() {
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketSoulHearts.class, PacketSoulHearts.class, 142 + 0, Side.CLIENT);
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketToggleArmor.class, PacketToggleArmor.class, 142 + 1, Side.CLIENT);
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketToggleArmor.class, PacketToggleArmor.class, 142 + 2, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketWarpGateButton.class, PacketWarpGateButton.class, 142 + 3, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketWarpGateTeleport.class, PacketWarpGateTeleport.class, 142 + 4, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketEnchanterAddEnchant.class, PacketEnchanterAddEnchant.class, 142 + 5, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketEnchanterStartWorking.class, PacketEnchanterStartWorking.class, 142 + 6, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketMobMagnetButton.class, PacketMobMagnetButton.class, 142 + 7, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketTabletButton.class, PacketTabletButton.class, 142 + 8, Side.SERVER);
|
||||
ThaumicTinkerer.netHandler.registerMessage(PacketPlacerButton.class, PacketPlacerButton.class, 142 + 9, Side.SERVER);
|
||||
}
|
||||
// spotless:on
|
||||
|
||||
public void registerVersionChecker() {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setString("curseProjectName", "75598-thaumic-tinkerer");
|
||||
@@ -200,13 +223,6 @@ public class TTCommonProxy {
|
||||
FMLInterModComms.sendRuntimeMessage(LibMisc.MOD_ID, "VersionChecker", "addCurseCheck", compound);
|
||||
}
|
||||
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
ResearchHelper.initResearch();
|
||||
ThaumicTinkerer.registry.postInit();
|
||||
AspectCropLootManager.populateLootMap();
|
||||
ItemFocusDeflect.setupBlackList();
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "EnderIO")
|
||||
protected void InitEnderIO() {
|
||||
EnderIO.registerPlanters();
|
||||
|
||||
@@ -85,11 +85,13 @@ public class ItemXPTalisman extends ItemBase implements IBauble {
|
||||
int xp = getXP(par1ItemStack);
|
||||
setXP(par1ItemStack, xp - LibFeatures.XP_TALISMAN_ENCHANTING_BOTTLE_COST);
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.1F, (float) (0.1F + Math.random() / 2F));
|
||||
for (int i = 0; par2World.isRemote && i < 6; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (par3EntityPlayer.posX + (Math.random() - 0.5)),
|
||||
(float) (par3EntityPlayer.posY + Math.random() - 0.5),
|
||||
(float) (par3EntityPlayer.posZ + (Math.random() - 0.5)),
|
||||
3);
|
||||
if (par2World.isRemote) {
|
||||
for (int i = 0; par2World.isRemote && i < 6; i++) ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) (par3EntityPlayer.posX + (Math.random() - 0.5)),
|
||||
(float) (par3EntityPlayer.posY + Math.random() - 0.5),
|
||||
(float) (par3EntityPlayer.posZ + (Math.random() - 0.5)),
|
||||
3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,10 +99,13 @@ public class ItemXPTalisman extends ItemBase implements IBauble {
|
||||
}
|
||||
|
||||
private void consumeXPOrb(EntityXPOrb orb) {
|
||||
orb.setDead();
|
||||
orb.worldObj.playSoundAtEntity(orb, "thaumcraft:zap", orb.getXpValue() / 10F, 1F);
|
||||
ThaumicTinkerer.tcProxy
|
||||
.wispFX(orb.worldObj, orb.posX, orb.posY, orb.posZ, orb.getXpValue() / 5F, 0.1F, 0.9F, 0.1F);
|
||||
if (!orb.worldObj.isRemote) {
|
||||
orb.setDead();
|
||||
orb.worldObj.playSoundAtEntity(orb, "thaumcraft:zap", orb.getXpValue() / 10F, 1F);
|
||||
} else {
|
||||
ThaumicTinkerer.tcProxy
|
||||
.wispFX(orb.worldObj, orb.posX, orb.posY, orb.posZ, orb.getXpValue() / 5F, 0.1F, 0.9F, 0.1F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -179,13 +184,15 @@ public class ItemXPTalisman extends ItemBase implements IBauble {
|
||||
@Override
|
||||
public void onWornTick(ItemStack par1ItemStack, EntityLivingBase player) {
|
||||
World par2World = player.worldObj;
|
||||
if (par1ItemStack.getItemDamage() == 1 && !par2World.isRemote) {
|
||||
if (par1ItemStack.getItemDamage() == 1) {
|
||||
int r = LibFeatures.XP_TALISMAN_RANGE;
|
||||
int currentXP = getXP(par1ItemStack);
|
||||
int xpToAdd = 0;
|
||||
int maxXP = LibFeatures.XP_TALISMAN_MAX_XP - currentXP; // Max, to prevent overflow.
|
||||
if (maxXP <= 0) {
|
||||
par1ItemStack.setItemDamage(0);
|
||||
if (!par2World.isRemote) {
|
||||
par1ItemStack.setItemDamage(0);
|
||||
}
|
||||
return; // Can't take any XP.
|
||||
}
|
||||
|
||||
@@ -211,8 +218,9 @@ public class ItemXPTalisman extends ItemBase implements IBauble {
|
||||
if (maxXP <= 0) break;
|
||||
}
|
||||
}
|
||||
|
||||
setXP(par1ItemStack, Math.min(LibFeatures.XP_TALISMAN_MAX_XP, currentXP + xpToAdd));
|
||||
if (!par2World.isRemote) {
|
||||
setXP(par1ItemStack, Math.min(LibFeatures.XP_TALISMAN_MAX_XP, currentXP + xpToAdd));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,10 +83,10 @@ public class ItemFocusDeflect extends ItemModFocus {
|
||||
(e.posX - p.posX) * (e.posX - p.posX) + (e.posY - p.posY) * (e.posY - p.posY)
|
||||
+ (e.posZ - p.posZ) * (e.posZ - p.posZ))
|
||||
* 2);
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
ThaumicTinkerer.tcProxy.sparkle((float) e.posX, (float) e.posY, (float) e.posZ, 6);
|
||||
|
||||
if (p.worldObj.isRemote) {
|
||||
for (int i = 0; i < 6; i++)
|
||||
ThaumicTinkerer.tcProxy.sparkle((float) e.posX, (float) e.posY, (float) e.posZ, 6);
|
||||
}
|
||||
e.posX += motionVec.x;
|
||||
e.posY += motionVec.y;
|
||||
e.posZ += motionVec.z;
|
||||
|
||||
@@ -126,15 +126,17 @@ public class ItemFocusDislocation extends ItemModFocus {
|
||||
tile1.zCoord = mop.blockZ;
|
||||
world.setTileEntity(mop.blockX, mop.blockY, mop.blockZ, tile1);
|
||||
}
|
||||
} else player.swingItem();
|
||||
} else {
|
||||
player.swingItem();
|
||||
for (int i = 0; i < 8; i++) {
|
||||
float x = (float) (mop.blockX + Math.random());
|
||||
float y = (float) (mop.blockY + Math.random()) + 0.65F;
|
||||
float z = (float) (mop.blockZ + Math.random());
|
||||
ThaumicTinkerer.tcProxy.burst(world, x, y, z, 0.2F);
|
||||
}
|
||||
}
|
||||
clearPickedBlock(itemstack);
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
float x = (float) (mop.blockX + Math.random());
|
||||
float y = (float) (mop.blockY + Math.random()) + 0.65F;
|
||||
float z = (float) (mop.blockZ + Math.random());
|
||||
ThaumicTinkerer.tcProxy.burst(world, x, y, z, 0.2F);
|
||||
}
|
||||
world.playSoundAtEntity(player, "thaumcraft:wand", 0.5F, 1F);
|
||||
}
|
||||
} else if (!blacklist.contains(block) && isBlockAllowed(block)
|
||||
@@ -146,13 +148,13 @@ public class ItemFocusDislocation extends ItemModFocus {
|
||||
world.removeTileEntity(mop.blockX, mop.blockY, mop.blockZ);
|
||||
world.setBlock(mop.blockX, mop.blockY, mop.blockZ, Blocks.air, 0, 1 | 2);
|
||||
storePickedBlock(itemstack, block, (short) meta, tile);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
float x = (float) (mop.blockX + Math.random());
|
||||
float y = (float) (mop.blockY + Math.random());
|
||||
float z = (float) (mop.blockZ + Math.random());
|
||||
ThaumicTinkerer.tcProxy.burst(world, x, y, z, 0.2F);
|
||||
} else {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
float x = (float) (mop.blockX + Math.random());
|
||||
float y = (float) (mop.blockY + Math.random());
|
||||
float z = (float) (mop.blockZ + Math.random());
|
||||
ThaumicTinkerer.tcProxy.burst(world, x, y, z, 0.2F);
|
||||
}
|
||||
}
|
||||
world.playSoundAtEntity(player, block.stepSound.getBreakSound(), 1F, 1F);
|
||||
world.playSoundAtEntity(player, "thaumcraft:wand", 0.5F, 1F);
|
||||
|
||||
@@ -56,15 +56,17 @@ public class ItemFocusFlight extends ItemModFocus {
|
||||
if (p instanceof EntityPlayerMP) {
|
||||
((EntityPlayerMP) p).playerNetServerHandler.floatingTickCount = 0;
|
||||
}
|
||||
for (int i = 0; i < 5; i++) ThaumicTinkerer.tcProxy.smokeSpiral(
|
||||
world,
|
||||
p.posX,
|
||||
p.posY - p.motionY,
|
||||
p.posZ,
|
||||
2F,
|
||||
(int) (Math.random() * 360),
|
||||
(int) p.posY,
|
||||
0x9E2FF);
|
||||
if (world.isRemote) {
|
||||
for (int i = 0; i < 5; i++) ThaumicTinkerer.tcProxy.smokeSpiral(
|
||||
world,
|
||||
p.posX,
|
||||
p.posY - p.motionY,
|
||||
p.posZ,
|
||||
2F,
|
||||
(int) (Math.random() * 360),
|
||||
(int) p.posY,
|
||||
0x9E2FF);
|
||||
}
|
||||
world.playSoundAtEntity(p, "thaumcraft:wind", 0.4F, 1F);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,11 +58,13 @@ public class ItemFocusHeal extends ItemModFocus {
|
||||
int progress = playerHealData.get(p.getGameProfile().getName()) + 1;
|
||||
playerHealData.put(p.getGameProfile().getName(), progress);
|
||||
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) p.posX + p.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) p.posY + p.worldObj.rand.nextFloat(),
|
||||
(float) p.posZ + p.worldObj.rand.nextFloat() - 0.5F,
|
||||
0);
|
||||
if (p.worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.sparkle(
|
||||
(float) p.posX + p.worldObj.rand.nextFloat() - 0.5F,
|
||||
(float) p.posY + p.worldObj.rand.nextFloat(),
|
||||
(float) p.posZ + p.worldObj.rand.nextFloat() - 0.5F,
|
||||
0);
|
||||
}
|
||||
|
||||
if (progress >= 30 - potency * 10 / 3) {
|
||||
playerHealData.put(p.getGameProfile().getName(), 0);
|
||||
|
||||
@@ -117,21 +117,23 @@ public class ItemFocusSmelt extends ItemModFocus {
|
||||
p.worldObj.playSoundAtEntity(p, "fire.fire", 1F, 1F);
|
||||
// Particle
|
||||
////////////////////
|
||||
for (int i = 0; i < 25; i++) {
|
||||
double x = pos.blockX + Math.random();
|
||||
double y = pos.blockY + Math.random();
|
||||
double z = pos.blockZ + Math.random();
|
||||
if (p.worldObj.isRemote) {
|
||||
for (int i = 0; i < 25; i++) {
|
||||
double x = pos.blockX + Math.random();
|
||||
double y = pos.blockY + Math.random();
|
||||
double z = pos.blockZ + Math.random();
|
||||
|
||||
ThaumicTinkerer.tcProxy.wispFX2(
|
||||
p.worldObj,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
(float) Math.random() / 2F,
|
||||
4,
|
||||
true,
|
||||
true,
|
||||
(float) -Math.random() / 10F);
|
||||
ThaumicTinkerer.tcProxy.wispFX2(
|
||||
p.worldObj,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
(float) Math.random() / 2F,
|
||||
4,
|
||||
true,
|
||||
true,
|
||||
(float) -Math.random() / 10F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,21 +148,23 @@ public class ItemFocusSmelt extends ItemModFocus {
|
||||
if (time % soundCooldown == 0) p.worldObj.playSoundAtEntity(p, "fire.fire", 0.2F, 1F);
|
||||
// Particle
|
||||
////////////////////
|
||||
for (int i = 0; i < 2; i++) {
|
||||
double x = pos.blockX + Math.random();
|
||||
double y = pos.blockY + Math.random();
|
||||
double z = pos.blockZ + Math.random();
|
||||
if (p.worldObj.isRemote) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
double x = pos.blockX + Math.random();
|
||||
double y = pos.blockY + Math.random();
|
||||
double z = pos.blockZ + Math.random();
|
||||
|
||||
ThaumicTinkerer.tcProxy.wispFX2(
|
||||
p.worldObj,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
(float) Math.random() / 2F,
|
||||
4,
|
||||
true,
|
||||
true,
|
||||
(float) -Math.random() / 10F);
|
||||
ThaumicTinkerer.tcProxy.wispFX2(
|
||||
p.worldObj,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
(float) Math.random() / 2F,
|
||||
4,
|
||||
true,
|
||||
true,
|
||||
(float) -Math.random() / 10F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,9 @@ public class ItemFocusTelekinesis extends ItemModFocus {
|
||||
if (!entities.isEmpty() && wand.consumeAllVis(stack, player, getVisCost(stack), true, false)) {
|
||||
for (EntityItem item : entities) {
|
||||
MiscHelper.setEntityMotionFromVector(item, target, 0.3333F);
|
||||
ThaumicTinkerer.tcProxy.sparkle((float) item.posX, (float) item.posY, (float) item.posZ, 0);
|
||||
if (player.worldObj.isRemote) {
|
||||
ThaumicTinkerer.tcProxy.sparkle((float) item.posX, (float) item.posY, (float) item.posZ, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,9 +218,9 @@ public class ItemKamiResource extends ItemKamiBase {
|
||||
new AspectList().add(Aspect.MAN, 32).add(Aspect.LIGHT, 32).add(Aspect.SOUL, 64),
|
||||
new ItemStack(Items.nether_star),
|
||||
new ItemStack(Items.diamond),
|
||||
new ItemStack(this, 8, 7),
|
||||
new ItemStack(this, 1, 7),
|
||||
new ItemStack(Items.ender_eye),
|
||||
new ItemStack(this, 8, 6)),
|
||||
new ItemStack(this, 1, 6)),
|
||||
new ThaumicTinkererInfusionRecipe(
|
||||
LibResearch.KEY_ICHORCLOTH_ROD,
|
||||
new ItemStack(this, 1, 5),
|
||||
|
||||
@@ -15,9 +15,7 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import thaumic.tinkerer.common.core.handler.ConfigHandler;
|
||||
|
||||
public final class ModPotions {
|
||||
@@ -28,8 +26,6 @@ public final class ModPotions {
|
||||
public static Potion potionAir;
|
||||
|
||||
public static void initPotions() {
|
||||
MinecraftForge.EVENT_BUS.register(new PotionEffectHandler());
|
||||
FMLCommonHandler.instance().bus().register(new PotionEffectHandler());
|
||||
|
||||
// Code based on potion code from WayOfTime
|
||||
Potion[] potionTypes = null;
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
package thaumic.tinkerer.common.potion;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
|
||||
public final class PotionEffectHandlerClient {
|
||||
|
||||
private final HashMap<Entity, Long> airPotionHitClient = new HashMap<>();
|
||||
private final HashMap<Entity, Long> firePotionHitClient = new HashMap<>();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingHurt(LivingAttackEvent e) {
|
||||
if (e.source.getSourceOfDamage() instanceof EntityPlayer p && p.worldObj.isRemote) {
|
||||
if (p.isPotionActive(ModPotions.potionAir)) {
|
||||
airPotionHitClient.put(e.entity, e.entity.worldObj.getTotalWorldTime());
|
||||
}
|
||||
if (p.isPotionActive(ModPotions.potionFire)) {
|
||||
firePotionHitClient.put(e.entity, e.entity.worldObj.getTotalWorldTime());
|
||||
}
|
||||
if (p.isPotionActive(ModPotions.potionEarth)) {
|
||||
boolean xAxis = Math.abs(e.entity.posZ - p.posZ) < Math.abs(e.entity.posX - p.posX);
|
||||
int centerX = (int) ((e.entity.posX + p.posX) / 2);
|
||||
|
||||
int centerY = (int) (p.posY + 2);
|
||||
int centerZ = (int) ((e.entity.posZ + p.posZ) / 2);
|
||||
|
||||
for (int i = -2; i < 3; i++) {
|
||||
for (int j = -2; j < 3; j++) {
|
||||
if (xAxis) {
|
||||
ThaumicTinkerer.tcProxy
|
||||
.blockSparkle(p.worldObj, centerX, centerY + i, centerZ + j, 100, 100);
|
||||
} else {
|
||||
ThaumicTinkerer.tcProxy
|
||||
.blockSparkle(p.worldObj, centerX + j, centerY + i, centerZ, 100, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent e) {
|
||||
if (e.side == Side.CLIENT && e.player.isPotionActive(ModPotions.potionWater)) {
|
||||
for (int x = (int) (e.player.posX - 2); x < e.player.posX + 2; x++) {
|
||||
for (int y = (int) (e.player.posY - 2); y < e.player.posY + 2; y++) {
|
||||
for (int z = (int) (e.player.posZ - 2); z < e.player.posZ + 2; z++) {
|
||||
if (e.player.worldObj.getBlock(x, y, z) == Blocks.lava
|
||||
|| e.player.worldObj.getBlock(x, y, z) == Blocks.flowing_lava) {
|
||||
ThaumicTinkerer.tcProxy.burst(e.player.worldObj, x + .5, y + .5, z + .5, 1.2F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTickClient(TickEvent.ClientTickEvent e) {
|
||||
|
||||
Iterator<Entity> iter = airPotionHitClient.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
Entity target = iter.next();
|
||||
if (target.isEntityAlive()) {
|
||||
if (target.worldObj.getTotalWorldTime() % 5 == 0) {
|
||||
ThaumicTinkerer.tcProxy.burst(target.worldObj, target.posX, target.posY, target.posZ, .5F);
|
||||
}
|
||||
}
|
||||
if (target.worldObj.getTotalWorldTime() > airPotionHitClient.get(target) + 20) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
|
||||
iter = firePotionHitClient.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
Entity target = iter.next();
|
||||
if (target.isEntityAlive()) {
|
||||
if (target.worldObj.getTotalWorldTime() % 5 == 0) {
|
||||
Random rand = new Random();
|
||||
|
||||
for (int i = 0; i < 30; i++) {
|
||||
double theta = rand.nextFloat() * 2 * Math.PI;
|
||||
|
||||
double phi = rand.nextFloat() * 2 * Math.PI;
|
||||
double r = 2.5;
|
||||
|
||||
double x = r * Math.sin(theta) * Math.cos(phi);
|
||||
|
||||
double y = r * Math.sin(theta) * Math.sin(phi);
|
||||
|
||||
double z = r * Math.cos(theta);
|
||||
|
||||
ThaumicTinkerer.tcProxy.wispFX2(
|
||||
target.worldObj,
|
||||
target.posX + x,
|
||||
target.posY + y + 1,
|
||||
target.posZ + z,
|
||||
.1F,
|
||||
4,
|
||||
true,
|
||||
true,
|
||||
1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (target.worldObj.getTotalWorldTime() > firePotionHitClient.get(target) + 6000) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
-50
@@ -11,28 +11,28 @@ import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.BlockForcefield;
|
||||
|
||||
/**
|
||||
* Created by pixlepix on 4/19/14.
|
||||
*/
|
||||
public class PotionEffectHandler {
|
||||
public final class PotionEffectHandlerServer {
|
||||
|
||||
public static HashMap<Entity, Long> airPotionHit = new HashMap<>();
|
||||
public static HashMap<Entity, Long> firePotionHit = new HashMap<>();
|
||||
private final HashMap<Entity, Long> airPotionHitServer = new HashMap<>();
|
||||
private final HashMap<Entity, Long> firePotionHitServer = new HashMap<>();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingHurt(LivingAttackEvent e) {
|
||||
if (e.source.getSourceOfDamage() instanceof EntityPlayer) {
|
||||
EntityPlayer p = (EntityPlayer) e.source.getSourceOfDamage();
|
||||
if (p.isPotionActive(ModPotions.potionAir) && !p.worldObj.isRemote) {
|
||||
airPotionHit.put(e.entity, e.entity.worldObj.getTotalWorldTime());
|
||||
if (e.source.getSourceOfDamage() instanceof EntityPlayer p && !p.worldObj.isRemote) {
|
||||
if (p.isPotionActive(ModPotions.potionAir)) {
|
||||
airPotionHitServer.put(e.entity, e.entity.worldObj.getTotalWorldTime());
|
||||
}
|
||||
if (p.isPotionActive(ModPotions.potionFire) && !p.worldObj.isRemote) {
|
||||
firePotionHit.put(e.entity, e.entity.worldObj.getTotalWorldTime());
|
||||
if (p.isPotionActive(ModPotions.potionFire)) {
|
||||
firePotionHitServer.put(e.entity, e.entity.worldObj.getTotalWorldTime());
|
||||
}
|
||||
if (p.isPotionActive(ModPotions.potionEarth) && !p.worldObj.isRemote) {
|
||||
if (p.isPotionActive(ModPotions.potionEarth)) {
|
||||
boolean xAxis = Math.abs(e.entity.posZ - p.posZ) < Math.abs(e.entity.posX - p.posX);
|
||||
int centerX = (int) ((e.entity.posX + p.posX) / 2);
|
||||
|
||||
@@ -48,8 +48,6 @@ public class PotionEffectHandler {
|
||||
centerY + i,
|
||||
centerZ + j,
|
||||
ThaumicTinkerer.registry.getFirstBlockFromClass(BlockForcefield.class));
|
||||
ThaumicTinkerer.tcProxy
|
||||
.blockSparkle(p.worldObj, centerX, centerY + i, centerZ + j, 100, 100);
|
||||
}
|
||||
} else {
|
||||
if (p.worldObj.isAirBlock(centerX + j, centerY + i, centerZ)) {
|
||||
@@ -58,9 +56,6 @@ public class PotionEffectHandler {
|
||||
centerY + i,
|
||||
centerZ,
|
||||
ThaumicTinkerer.registry.getFirstBlockFromClass(BlockForcefield.class));
|
||||
|
||||
ThaumicTinkerer.tcProxy
|
||||
.blockSparkle(p.worldObj, centerX + j, centerY + i, centerZ, 100, 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,14 +66,13 @@ public class PotionEffectHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent e) {
|
||||
if (e.player.isPotionActive(ModPotions.potionWater)) {
|
||||
if (e.side == Side.SERVER && e.player.isPotionActive(ModPotions.potionWater)) {
|
||||
for (int x = (int) (e.player.posX - 2); x < e.player.posX + 2; x++) {
|
||||
for (int y = (int) (e.player.posY - 2); y < e.player.posY + 2; y++) {
|
||||
for (int z = (int) (e.player.posZ - 2); z < e.player.posZ + 2; z++) {
|
||||
if (e.player.worldObj.getBlock(x, y, z) == Blocks.lava
|
||||
|| e.player.worldObj.getBlock(x, y, z) == Blocks.flowing_lava) {
|
||||
e.player.worldObj.setBlock(x, y, z, Blocks.obsidian);
|
||||
ThaumicTinkerer.tcProxy.burst(e.player.worldObj, x + .5, y + .5, z + .5, 1.2F);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,58 +81,32 @@ public class PotionEffectHandler {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(TickEvent.ServerTickEvent e) {
|
||||
public void onTickServer(TickEvent.ServerTickEvent e) {
|
||||
|
||||
Iterator<Entity> iter = airPotionHit.keySet().iterator();
|
||||
Iterator<Entity> iter = airPotionHitServer.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
Entity target = (Entity) iter.next();
|
||||
Entity target = iter.next();
|
||||
if (target.isEntityAlive()) {
|
||||
if (target.worldObj.getTotalWorldTime() % 5 == 0) {
|
||||
Random rand = new Random();
|
||||
target.setVelocity(rand.nextFloat() - .5, rand.nextFloat(), rand.nextFloat() - .5);
|
||||
ThaumicTinkerer.tcProxy.burst(target.worldObj, target.posX, target.posY, target.posZ, .5F);
|
||||
}
|
||||
}
|
||||
if (target.worldObj.getTotalWorldTime() > airPotionHit.get(target) + 20) {
|
||||
if (target.worldObj.getTotalWorldTime() > airPotionHitServer.get(target) + 20) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
|
||||
// Fire Potion
|
||||
iter = firePotionHit.keySet().iterator();
|
||||
iter = firePotionHitServer.keySet().iterator();
|
||||
while (iter.hasNext()) {
|
||||
Entity target = (Entity) iter.next();
|
||||
Entity target = iter.next();
|
||||
if (target.isEntityAlive()) {
|
||||
if (target.worldObj.getTotalWorldTime() % 5 == 0) {
|
||||
Random rand = new Random();
|
||||
target.setFire(6);
|
||||
|
||||
for (int i = 0; i < 30; i++) {
|
||||
double theta = rand.nextFloat() * 2 * Math.PI;
|
||||
|
||||
double phi = rand.nextFloat() * 2 * Math.PI;
|
||||
double r = 2.5;
|
||||
|
||||
double x = r * Math.sin(theta) * Math.cos(phi);
|
||||
|
||||
double y = r * Math.sin(theta) * Math.sin(phi);
|
||||
|
||||
double z = r * Math.cos(theta);
|
||||
|
||||
ThaumicTinkerer.tcProxy.wispFX2(
|
||||
target.worldObj,
|
||||
target.posX + x,
|
||||
target.posY + y + 1,
|
||||
target.posZ + z,
|
||||
.1F,
|
||||
4,
|
||||
true,
|
||||
true,
|
||||
1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (target.worldObj.getTotalWorldTime() > firePotionHit.get(target) + 6000) {
|
||||
if (target.worldObj.getTotalWorldTime() > firePotionHitServer.get(target) + 6000) {
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user