mergetest
This commit is contained in:
parent
33bd22489c
commit
1bd5572148
17 changed files with 1982 additions and 45 deletions
20
README.md
20
README.md
|
@ -4,6 +4,22 @@ WarpDrive
|
|||
A warp drive mod for minecraft
|
||||
|
||||
Modified by DarkholmeTenk
|
||||
|
||||
Minecraft forum:
|
||||
http://www.minecraftforum.net/topic/1938578-164-warpdrive-mod-ships-space-lasers
|
||||
|
||||
Mod Showcase:
|
||||
https://www.youtube.com/watch?v=9pUSZPEMc1g
|
||||
|
||||
Wiki:
|
||||
http://wiki.kubach.tk/
|
||||
http://wiki.kubach.tk/
|
||||
|
||||
Installation
|
||||
============
|
||||
1. Download fresh build: http://kubach.tk/1.6.4/WarpDrive.zip
|
||||
2. Download fresh Core build: http://kubach.tk/1.6.4/WarpDriveCore.jar
|
||||
3. Install last version of IC2 and Computer Craft
|
||||
|
||||
Contact Us
|
||||
=============
|
||||
* Visit our IRC channel on EsperNet: irc://chaos.esper.net/WarpDrive
|
||||
* Or PM me: http://www.minecraftforum.net/user/1133830-anon1644/
|
||||
|
|
29
README.md.orig
Normal file
29
README.md.orig
Normal file
|
@ -0,0 +1,29 @@
|
|||
WarpDrive
|
||||
=========
|
||||
|
||||
A warp drive mod for minecraft
|
||||
|
||||
<<<<<<< HEAD
|
||||
Modified by DarkholmeTenk
|
||||
|
||||
=======
|
||||
Minecraft forum:
|
||||
http://www.minecraftforum.net/topic/1938578-164-warpdrive-mod-ships-space-lasers
|
||||
|
||||
Mod Showcase:
|
||||
https://www.youtube.com/watch?v=9pUSZPEMc1g
|
||||
|
||||
>>>>>>> 2285a5d75c56ad846175edf7a731b2738f06bb72
|
||||
Wiki:
|
||||
http://wiki.kubach.tk/
|
||||
|
||||
Installation
|
||||
============
|
||||
1. Download fresh build: http://kubach.tk/1.6.4/WarpDrive.zip
|
||||
2. Download fresh Core build: http://kubach.tk/1.6.4/WarpDriveCore.jar
|
||||
3. Install last version of IC2 and Computer Craft
|
||||
|
||||
Contact Us
|
||||
=============
|
||||
* Visit our IRC channel on EsperNet: irc://chaos.esper.net/WarpDrive
|
||||
* Or PM me: http://www.minecraftforum.net/user/1133830-anon1644/
|
22
client/ClientProxy.java
Normal file
22
client/ClientProxy.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
package cr0s.WarpDrive.client;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cr0s.WarpDrive.CommonProxy;
|
||||
import cr0s.WarpDrive.FXBeam;
|
||||
import cr0s.WarpDrive.Vector3;
|
||||
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
@Override
|
||||
public void registerRenderers()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderBeam(World world, Vector3 position, Vector3 target, float red, float green, float blue, int age, int energy)
|
||||
{
|
||||
System.out.println("Rendering beam...");
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, red, green, blue, age, energy));
|
||||
}
|
||||
}
|
|
@ -991,8 +991,6 @@ public class EntityJump extends Entity
|
|||
newTileEntity = TileEntity.createAndLoadEntity(oldnbt);
|
||||
newTileEntity.invalidate();
|
||||
}
|
||||
else if (blockID == WarpDriveConfig.i.GT_Machine)
|
||||
newTileEntity = TileEntity.createAndLoadEntity(oldnbt);
|
||||
else if (blockID == WarpDriveConfig.i.AS_Turbine)
|
||||
{
|
||||
if (oldnbt.hasKey("zhuYao"))
|
||||
|
@ -1005,19 +1003,13 @@ public class EntityJump extends Entity
|
|||
}
|
||||
newTileEntity = TileEntity.createAndLoadEntity(oldnbt);
|
||||
}
|
||||
else
|
||||
{
|
||||
newTileEntity = targetWorld.getBlockTileEntity(newX, newY, newZ);
|
||||
if (newTileEntity == null)
|
||||
{
|
||||
System.out.println("[EJ] Error moving tileEntity! TE is null");
|
||||
return false;
|
||||
}
|
||||
newTileEntity.invalidate();
|
||||
newTileEntity.readFromNBT(oldnbt);
|
||||
}
|
||||
|
||||
if (newTileEntity == null)
|
||||
newTileEntity = TileEntity.createAndLoadEntity(oldnbt);
|
||||
|
||||
newTileEntity.worldObj = targetWorld;
|
||||
newTileEntity.validate();
|
||||
|
||||
worldObj.removeBlockTileEntity(oldX, oldY, oldZ);
|
||||
targetWorld.setBlockTileEntity(newX, newY, newZ, newTileEntity);
|
||||
}
|
||||
|
|
|
@ -265,4 +265,10 @@ System.out.println("ZLO EntitySphereGen THE FUCK create");
|
|||
c.isModified = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderInPass(int pass)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
package cr0s.WarpDrive;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
@ -162,4 +164,10 @@ public final class EntityStarCore extends Entity
|
|||
nbttagcompound.setInteger("z", this.zCoord);
|
||||
nbttagcompound.setInteger("radius", this.radius);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderInPass(int pass)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ import java.util.logging.Level;
|
|||
import java.util.logging.Logger;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public final class JumpGatesRegistry
|
||||
{
|
||||
|
@ -20,8 +21,17 @@ public final class JumpGatesRegistry
|
|||
//@SideOnly(Side.CLIENT)
|
||||
public JumpGatesRegistry()
|
||||
{
|
||||
db = MinecraftServer.getServer().getFile("gates.txt");
|
||||
|
||||
db = new File("gates.txt");
|
||||
System.out.println("Gates.txt file: " + db);
|
||||
|
||||
if (db != null && !db.exists()) {
|
||||
try {
|
||||
db.createNewFile();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
loadGates();
|
||||
|
|
|
@ -67,13 +67,11 @@ public class PacketHandler implements IPacketHandler
|
|||
int h = Math.abs(maxY - minY);
|
||||
int l = Math.abs(maxZ - minZ);
|
||||
|
||||
//(-2099; 208; 423) -> (-2069; 243; 453)
|
||||
//
|
||||
int size = w * h * l;
|
||||
|
||||
//System.out.println("[Cloak Packet] Received " + ((decloak) ? "DEcloaked" : "cloaked") + "area: (" + minX + "; " + minY + "; " + minZ + ") -> (" + maxX + "; " + maxY + "; " + maxZ + ")");
|
||||
|
||||
if (minX <= player.chunkCoordX && maxX >= player.chunkCoordY && minY <= player.chunkCoordY && maxY >= player.chunkCoordY && minZ <= player.chunkCoordZ && maxZ >= player.chunkCoordZ)
|
||||
if (minX <= player.posX && maxX >= player.posY && minY <= player.posZ && maxY >= player.posX && minZ <= player.posY && maxZ >= player.posZ)
|
||||
return;
|
||||
|
||||
// Hide the area
|
||||
|
@ -97,7 +95,7 @@ public class PacketHandler implements IPacketHandler
|
|||
((WorldClient)worldObj).removeEntityFromWorld(e.entityId);
|
||||
}
|
||||
} else { // reveal the area
|
||||
player.worldObj.markBlockRangeForRenderUpdate(minX, minY, minZ, maxX, maxY, maxZ);
|
||||
player.worldObj.markBlockRangeForRenderUpdate(minX + 1, minY + 1, minZ + 1, maxX + 1, maxY + 1, maxZ + 1);
|
||||
|
||||
// Make some graphics
|
||||
int numLasers = 25 + player.worldObj.rand.nextInt(300);
|
||||
|
|
24
src/cr0s/WarpDrive/README.md
Normal file
24
src/cr0s/WarpDrive/README.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
WarpDrive
|
||||
=========
|
||||
|
||||
A warp drive mod for minecraft
|
||||
|
||||
Minecraft forum:
|
||||
http://www.minecraftforum.net/topic/1938578-164-warpdrive-mod-ships-space-lasers
|
||||
|
||||
Mod Showcase:
|
||||
https://www.youtube.com/watch?v=9pUSZPEMc1g
|
||||
|
||||
Wiki:
|
||||
http://wiki.kubach.tk/
|
||||
|
||||
Installation
|
||||
============
|
||||
1. Download fresh build: http://kubach.tk/1.6.4/WarpDrive.zip
|
||||
2. Download fresh Core build: http://kubach.tk/1.6.4/WarpDriveCore.jar
|
||||
3. Install last version of IC2 and Computer Craft
|
||||
|
||||
Contact Us
|
||||
=============
|
||||
* Visit our IRC channel on EsperNet: irc://chaos.esper.net/WarpDrive
|
||||
* Or PM me: http://www.minecraftforum.net/user/1133830-anon1644/
|
|
@ -18,6 +18,8 @@ public class SoundHandler
|
|||
event.manager.addSound("warpdrive:hilaser.ogg");
|
||||
event.manager.addSound("warpdrive:midlaser.ogg");
|
||||
event.manager.addSound("warpdrive:lowlaser.ogg");
|
||||
event.manager.addSound("warpdrive:cl.ogg");
|
||||
event.manager.addSound("warpdrive:dcl.ogg");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -450,14 +450,9 @@ public class WarpDrive implements LoadingCallback {
|
|||
|
||||
registry = new WarpCoresRegistry();
|
||||
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer())
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
cams = new CamRegistry();
|
||||
}
|
||||
|
||||
jumpGates = new JumpGatesRegistry();
|
||||
cams = new CamRegistry();
|
||||
}
|
||||
|
||||
private void registerSpaceDimension() {
|
||||
|
@ -483,8 +478,6 @@ public class WarpDrive implements LoadingCallback {
|
|||
@EventHandler
|
||||
public void serverLoad(FMLServerStartingEvent event) {
|
||||
cloaks = new CloakManager();
|
||||
debugPrint("Added jump registry");
|
||||
jumpGates = new JumpGatesRegistry();
|
||||
MinecraftForge.EVENT_BUS.register(new CloakChunkWatcher());
|
||||
|
||||
event.registerServerCommand(new GenerateCommand());
|
||||
|
|
587
src/cr0s/WarpDrive/WarpDrive.java.orig
Normal file
587
src/cr0s/WarpDrive/WarpDrive.java.orig
Normal file
|
@ -0,0 +1,587 @@
|
|||
package cr0s.WarpDrive;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Init;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.PostInit;
|
||||
import cpw.mods.fml.common.Mod.PreInit;
|
||||
import cpw.mods.fml.common.Mod.ServerStarting;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
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.network.NetworkMod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import cr0s.WarpDrive.machines.BlockAirGenerator;
|
||||
import cr0s.WarpDrive.machines.BlockCamera;
|
||||
import cr0s.WarpDrive.machines.BlockCloakingCoil;
|
||||
import cr0s.WarpDrive.machines.BlockCloakingDeviceCore;
|
||||
import cr0s.WarpDrive.machines.BlockLaser;
|
||||
import cr0s.WarpDrive.machines.BlockLaserCam;
|
||||
import cr0s.WarpDrive.machines.BlockLaserTreeFarm;
|
||||
import cr0s.WarpDrive.machines.BlockLift;
|
||||
import cr0s.WarpDrive.machines.BlockMiningLaser;
|
||||
import cr0s.WarpDrive.machines.BlockMonitor;
|
||||
import cr0s.WarpDrive.machines.BlockParticleBooster;
|
||||
import cr0s.WarpDrive.machines.BlockProtocol;
|
||||
import cr0s.WarpDrive.machines.BlockRadar;
|
||||
import cr0s.WarpDrive.machines.BlockReactor;
|
||||
import cr0s.WarpDrive.machines.BlockShipScanner;
|
||||
import cr0s.WarpDrive.machines.BlockWarpIsolation;
|
||||
import cr0s.WarpDrive.machines.TileEntityAirGenerator;
|
||||
import cr0s.WarpDrive.machines.TileEntityCamera;
|
||||
import cr0s.WarpDrive.machines.TileEntityCloakingDeviceCore;
|
||||
import cr0s.WarpDrive.machines.TileEntityLaser;
|
||||
import cr0s.WarpDrive.machines.TileEntityLaserTreeFarm;
|
||||
import cr0s.WarpDrive.machines.TileEntityLift;
|
||||
import cr0s.WarpDrive.machines.TileEntityMiningLaser;
|
||||
import cr0s.WarpDrive.machines.TileEntityMonitor;
|
||||
import cr0s.WarpDrive.machines.TileEntityParticleBooster;
|
||||
import cr0s.WarpDrive.machines.TileEntityProtocol;
|
||||
import cr0s.WarpDrive.machines.TileEntityRadar;
|
||||
import cr0s.WarpDrive.machines.TileEntityReactor;
|
||||
import cr0s.WarpDrive.machines.TileEntityShipScanner;
|
||||
import cr0s.WarpDrive.machines.WarpChunkTE;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.LoadingCallback;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
@Mod(modid = "WarpDrive", name = "WarpDrive", version = "1.2.1.1", dependencies = "required-after:IC2; required-after:ComputerCraft; after:CCTurtle; after:gregtech_addon; required-after:AppliedEnergistics; after:AdvancedSolarPanel; after:AtomicScience; after:ICBM|Explosion; after:MFFS; after:GraviSuite")
|
||||
@NetworkMod(clientSideRequired = true, serverSideRequired = true, channels = {
|
||||
"WarpDriveBeam",
|
||||
"WarpDriveFreq",
|
||||
"WarpDriveLaserT",
|
||||
"WarpDriveCloaks" }, packetHandler = PacketHandler.class)
|
||||
/**
|
||||
* @author Cr0s
|
||||
*/
|
||||
public class WarpDrive implements LoadingCallback {
|
||||
// World limits
|
||||
public final static int WORLD_LIMIT_BLOCKS = 100000;
|
||||
|
||||
public static Block warpCore;
|
||||
public static Block protocolBlock;
|
||||
public static Block radarBlock;
|
||||
public static Block isolationBlock;
|
||||
public static Block airgenBlock;
|
||||
public static Block laserBlock;
|
||||
public static Block laserCamBlock;
|
||||
public static Block cameraBlock;
|
||||
public static Block monitorBlock;
|
||||
public static Block boosterBlock;
|
||||
public static Block miningLaserBlock;
|
||||
public static Block laserTreeFarmBlock;
|
||||
public static Block liftBlock;
|
||||
public static Block scannerBlock;
|
||||
public static Block cloakBlock;
|
||||
public static Block cloakCoilBlock;
|
||||
|
||||
public static Block airBlock;
|
||||
public static Block gasBlock;
|
||||
|
||||
public static Block iridiumBlock;
|
||||
|
||||
public static BiomeGenBase spaceBiome;
|
||||
public World space;
|
||||
private int spaceProviderID;
|
||||
public int spaceDimID;
|
||||
public SpaceWorldGenerator spaceWorldGenerator;
|
||||
public HyperSpaceWorldGenerator hyperSpaceWorldGenerator;
|
||||
|
||||
public World hyperSpace;
|
||||
private int hyperSpaceProviderID;
|
||||
public int hyperSpaceDimID;
|
||||
|
||||
@Instance("WarpDrive")
|
||||
public static WarpDrive instance;
|
||||
@SidedProxy(clientSide = "cr0s.WarpDrive.ClientProxy", serverSide = "cr0s.WarpDrive.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
public WarpCoresRegistry registry;
|
||||
public JumpGatesRegistry jumpGates;
|
||||
|
||||
public CloakManager cloaks;
|
||||
|
||||
public CamRegistry cams;
|
||||
public boolean isOverlayEnabled = false;
|
||||
public int overlayType = 0;
|
||||
|
||||
private ArrayList<Ticket> warpTickets = new ArrayList<Ticket>();
|
||||
|
||||
@EventHandler
|
||||
// @PreInit
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
WarpDriveConfig.Init(new Configuration(event
|
||||
.getSuggestedConfigurationFile()));
|
||||
|
||||
if (FMLCommonHandler.instance().getSide().isClient()) {
|
||||
debugPrint("[WarpDrive] Registering sounds event handler...");
|
||||
MinecraftForge.EVENT_BUS.register(new SoundHandler());
|
||||
}
|
||||
}
|
||||
|
||||
public static void debugPrint(String out)
|
||||
{
|
||||
System.out.println(out);
|
||||
}
|
||||
|
||||
@Init
|
||||
public void load(FMLInitializationEvent event) {
|
||||
WarpDriveConfig.i.Init2();
|
||||
|
||||
// CORE CONTROLLER
|
||||
this.protocolBlock = new BlockProtocol(WarpDriveConfig.i.controllerID,
|
||||
0, Material.rock).setHardness(0.5F)
|
||||
.setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Warp Controller");
|
||||
|
||||
LanguageRegistry.addName(protocolBlock, "Warp Controller");
|
||||
GameRegistry.registerBlock(protocolBlock, "protocolBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityProtocol.class,
|
||||
"protocolBlock");
|
||||
|
||||
// WARP CORE
|
||||
this.warpCore = new BlockReactor(WarpDriveConfig.i.coreID, 0, Material.rock).setHardness(0.5F).setStepSound(Block.soundMetalFootstep).setCreativeTab(CreativeTabs.tabRedstone).setUnlocalizedName("Warp Core");
|
||||
|
||||
LanguageRegistry.addName(warpCore, "Warp Core");
|
||||
GameRegistry.registerBlock(warpCore, "warpCore");
|
||||
GameRegistry.registerTileEntity(TileEntityReactor.class, "warpCore");
|
||||
|
||||
// WARP RADAR
|
||||
this.radarBlock = new BlockRadar(WarpDriveConfig.i.radarID, 0,
|
||||
Material.rock).setHardness(0.5F)
|
||||
.setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("W-Radar");
|
||||
|
||||
LanguageRegistry.addName(radarBlock, "W-Radar");
|
||||
GameRegistry.registerBlock(radarBlock, "radarBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityRadar.class, "radarBlock");
|
||||
|
||||
// WARP ISOLATION
|
||||
this.isolationBlock = new BlockWarpIsolation(
|
||||
WarpDriveConfig.i.isolationID, 0, Material.rock)
|
||||
.setHardness(0.5F).setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Warp-Field Isolation Block");
|
||||
|
||||
LanguageRegistry.addName(isolationBlock, "Warp-Field Isolation Block");
|
||||
GameRegistry.registerBlock(isolationBlock, "isolationBlock");
|
||||
|
||||
// AIR GENERATOR
|
||||
this.airgenBlock = new BlockAirGenerator(WarpDriveConfig.i.airgenID, 0,
|
||||
Material.rock).setHardness(0.5F)
|
||||
.setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Air Generator");
|
||||
LanguageRegistry.addName(airgenBlock, "Air Generator");
|
||||
GameRegistry.registerBlock(airgenBlock, "airgenBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityAirGenerator.class,
|
||||
"airgenBlock");
|
||||
|
||||
// AIR BLOCK
|
||||
this.airBlock = (new BlockAir(WarpDriveConfig.i.airID)).setHardness(
|
||||
0.0F).setUnlocalizedName("Air block");
|
||||
LanguageRegistry.addName(airBlock, "Air block");
|
||||
GameRegistry.registerBlock(airBlock, "airBlock");
|
||||
|
||||
// GAS BLOCK
|
||||
this.gasBlock = (new BlockGas(WarpDriveConfig.i.gasID)).setHardness(
|
||||
0.0F).setUnlocalizedName("Gas block");
|
||||
LanguageRegistry.addName(gasBlock, "Gas block");
|
||||
GameRegistry.registerBlock(gasBlock, "gasBlock");
|
||||
|
||||
// LASER EMITTER
|
||||
this.laserBlock = new BlockLaser(WarpDriveConfig.i.laserID, 0,
|
||||
Material.rock).setHardness(0.5F)
|
||||
.setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Laser Emitter");
|
||||
LanguageRegistry.addName(laserBlock, "Laser Emitter");
|
||||
GameRegistry.registerBlock(laserBlock, "laserBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityLaser.class, "laserBlock");
|
||||
|
||||
// LASER EMITTER WITH CAMERA
|
||||
this.laserCamBlock = new BlockLaserCam(WarpDriveConfig.i.laserCamID, 0,
|
||||
Material.rock).setHardness(0.5F)
|
||||
.setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Laser Emitter + Camera");
|
||||
LanguageRegistry.addName(laserCamBlock, "Laser Emitter + Camera");
|
||||
GameRegistry.registerBlock(laserCamBlock, "laserCamBlock");
|
||||
|
||||
// CAMERA
|
||||
this.cameraBlock = new BlockCamera(WarpDriveConfig.i.camID, 0,
|
||||
Material.rock).setHardness(0.5F)
|
||||
.setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Camera block");
|
||||
LanguageRegistry.addName(cameraBlock, "Camera");
|
||||
GameRegistry.registerBlock(cameraBlock, "cameraBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityCamera.class, "cameraBlock");
|
||||
|
||||
// MONITOR
|
||||
this.monitorBlock = new BlockMonitor(WarpDriveConfig.i.monitorID)
|
||||
.setHardness(0.5F).setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Monitor");
|
||||
LanguageRegistry.addName(monitorBlock, "Monitor");
|
||||
GameRegistry.registerBlock(monitorBlock, "monitorBlock");
|
||||
GameRegistry
|
||||
.registerTileEntity(TileEntityMonitor.class, "monitorBlock");
|
||||
|
||||
// MINING LASER
|
||||
this.miningLaserBlock = new BlockMiningLaser(
|
||||
WarpDriveConfig.i.miningLaserID, 0, Material.rock)
|
||||
.setHardness(0.5F).setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Mining Laser");
|
||||
LanguageRegistry.addName(miningLaserBlock, "Mining Laser");
|
||||
GameRegistry.registerBlock(miningLaserBlock, "miningLaserBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityMiningLaser.class,
|
||||
"miningLaserBlock");
|
||||
|
||||
// LASER TREE FARM
|
||||
this.laserTreeFarmBlock = new BlockLaserTreeFarm(WarpDriveConfig.i.laserTreeFarmID,0,Material.rock)
|
||||
.setHardness(0.5F).setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Laser Tree Farm");
|
||||
LanguageRegistry.addName(laserTreeFarmBlock, "Laser Tree Farm");
|
||||
GameRegistry.registerBlock(laserTreeFarmBlock, "laserTreeFarmBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityLaserTreeFarm.class,"laserTreeFarmBlock");
|
||||
|
||||
// PARTICLE BOOSTER
|
||||
this.boosterBlock = new BlockParticleBooster(
|
||||
WarpDriveConfig.i.particleBoosterID, 0, Material.rock)
|
||||
.setHardness(0.5F).setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Particle Booster");
|
||||
LanguageRegistry.addName(boosterBlock, "Particle Booster");
|
||||
GameRegistry.registerBlock(boosterBlock, "boosterBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityParticleBooster.class,
|
||||
"boosterBlock");
|
||||
|
||||
// LASER LIFT
|
||||
this.liftBlock = new BlockLift(WarpDriveConfig.i.liftID, 0,
|
||||
Material.rock).setHardness(0.5F)
|
||||
.setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Laser lift");
|
||||
LanguageRegistry.addName(liftBlock, "Laser lift");
|
||||
GameRegistry.registerBlock(liftBlock, "liftBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityLift.class, "liftBlock");
|
||||
|
||||
// IRIDIUM BLOCK
|
||||
this.iridiumBlock = new BlockIridium(WarpDriveConfig.i.iridiumID)
|
||||
.setHardness(0.8F).setResistance(150 * 4)
|
||||
.setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Block of Iridium");
|
||||
|
||||
LanguageRegistry.addName(iridiumBlock, "Block of Iridium");
|
||||
GameRegistry.registerBlock(iridiumBlock, "iridiumBlock");
|
||||
|
||||
// SHIP SCANNER
|
||||
this.scannerBlock = new BlockShipScanner(WarpDriveConfig.i.shipScannerID, 0, Material.rock)
|
||||
.setHardness(0.5F).setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone).setUnlocalizedName("Ship Scanner");
|
||||
|
||||
LanguageRegistry.addName(scannerBlock, "Ship Scanner");
|
||||
GameRegistry.registerBlock(scannerBlock, "scannerBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityShipScanner.class, "scannerBlock");
|
||||
|
||||
// CLOAKING DEVICE CORE
|
||||
this.cloakBlock = new BlockCloakingDeviceCore(WarpDriveConfig.i.cloakCoreID, 0, Material.rock)
|
||||
.setHardness(0.5F).setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone).setUnlocalizedName("Cloaking Device Core");
|
||||
|
||||
LanguageRegistry.addName(cloakBlock, "Cloaking Device Core");
|
||||
GameRegistry.registerBlock(cloakBlock, "cloakBlock");
|
||||
GameRegistry.registerTileEntity(TileEntityCloakingDeviceCore.class, "cloakBlock");
|
||||
|
||||
// CLOAKING DEVICE COIL
|
||||
this.cloakCoilBlock = new BlockCloakingCoil(WarpDriveConfig.i.cloakCoilID, 0, Material.rock)
|
||||
.setHardness(0.5F)
|
||||
.setStepSound(Block.soundMetalFootstep)
|
||||
.setCreativeTab(CreativeTabs.tabRedstone)
|
||||
.setUnlocalizedName("Cloaking Device Coil");
|
||||
|
||||
LanguageRegistry.addName(cloakCoilBlock, "Cloaking Device Coil");
|
||||
GameRegistry.registerBlock(cloakCoilBlock, "cloakCoilBlock");
|
||||
|
||||
proxy.registerEntities();
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(instance, instance);
|
||||
spaceWorldGenerator = new SpaceWorldGenerator();
|
||||
GameRegistry.registerWorldGenerator(spaceWorldGenerator);
|
||||
hyperSpaceWorldGenerator = new HyperSpaceWorldGenerator();
|
||||
GameRegistry.registerWorldGenerator(hyperSpaceWorldGenerator);
|
||||
registerSpaceDimension();
|
||||
registerHyperSpaceDimension();
|
||||
MinecraftForge.EVENT_BUS.register(new SpaceEventHandler());
|
||||
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
|
||||
MinecraftForge.EVENT_BUS.register(new CameraOverlay(Minecraft
|
||||
.getMinecraft()));
|
||||
}
|
||||
}
|
||||
|
||||
@PostInit
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
space = DimensionManager.getWorld(spaceDimID);
|
||||
hyperSpace = DimensionManager.getWorld(hyperSpaceDimID);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(warpCore), "ici", "cmc", "ici",
|
||||
'i', WarpDriveConfig.i.getIC2Item("iridiumPlate"), 'm',
|
||||
WarpDriveConfig.i.getIC2Item("advancedMachine"), 'c',
|
||||
WarpDriveConfig.i.getIC2Item("advancedCircuit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(protocolBlock), "iic", "imi",
|
||||
"cii", 'i', WarpDriveConfig.i.getIC2Item("iridiumPlate"), 'm',
|
||||
WarpDriveConfig.i.getIC2Item("advancedMachine"), 'c',
|
||||
WarpDriveConfig.i.getIC2Item("advancedCircuit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(radarBlock), "ifi", "imi", "imi",
|
||||
'i', WarpDriveConfig.i.getIC2Item("iridiumPlate"), 'm',
|
||||
WarpDriveConfig.i.getIC2Item("advancedMachine"), 'f',
|
||||
WarpDriveConfig.i.getIC2Item("frequencyTransmitter"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(isolationBlock), "iii", "idi",
|
||||
"iii", 'i', WarpDriveConfig.i.getIC2Item("iridiumPlate"), 'm',
|
||||
WarpDriveConfig.i.getIC2Item("advancedMachine"), 'd',
|
||||
Block.blockDiamond);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(airgenBlock), "lcl", "lml", "lll",
|
||||
'l', Block.leaves, 'm',
|
||||
WarpDriveConfig.i.getIC2Item("advancedMachine"), 'c',
|
||||
WarpDriveConfig.i.getIC2Item("advancedCircuit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(laserBlock), "sss", "ama", "aaa",
|
||||
'm', WarpDriveConfig.i.getIC2Item("advancedMachine"), 'a',
|
||||
WarpDriveConfig.i.getIC2Item("advancedAlloy"), 's',
|
||||
WarpDriveConfig.i.getIC2Item("advancedCircuit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(miningLaserBlock), "aaa", "ama",
|
||||
"ccc", 'c', WarpDriveConfig.i.getIC2Item("advancedCircuit"),
|
||||
'a', WarpDriveConfig.i.getIC2Item("advancedAlloy"), 'm',
|
||||
WarpDriveConfig.i.getIC2Item("miner"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(boosterBlock), "afc", "ama",
|
||||
"cfa", 'c', WarpDriveConfig.i.getIC2Item("advancedCircuit"),
|
||||
'a', WarpDriveConfig.i.getIC2Item("advancedAlloy"), 'f',
|
||||
WarpDriveConfig.i.getIC2Item("glassFiberCableItem"), 'm',
|
||||
WarpDriveConfig.i.getIC2Item("mfeUnit"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(liftBlock), "aca", "ama", "a#a",
|
||||
'c', WarpDriveConfig.i.getIC2Item("advancedCircuit"), 'a',
|
||||
WarpDriveConfig.i.getIC2Item("advancedAlloy"), 'm',
|
||||
WarpDriveConfig.i.getIC2Item("magnetizer"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(iridiumBlock), "iii", "iii",
|
||||
"iii", 'i', WarpDriveConfig.i.getIC2Item("iridiumPlate"));
|
||||
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(WarpDriveConfig.i
|
||||
.getIC2Item("iridiumPlate").getItem(), 9), new ItemStack(
|
||||
iridiumBlock));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(laserCamBlock), "imi", "cec",
|
||||
"#k#", 'i', WarpDriveConfig.i.getIC2Item("iridiumPlate"), 'm',
|
||||
WarpDriveConfig.i.getIC2Item("advancedMachine"), 'c',
|
||||
WarpDriveConfig.i.getIC2Item("advancedCircuit"), 'e',
|
||||
laserBlock, 'k', cameraBlock);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(cameraBlock), "cgc", "gmg", "cgc",
|
||||
'm', WarpDriveConfig.i.getIC2Item("advancedMachine"), 'c',
|
||||
WarpDriveConfig.i.getIC2Item("advancedCircuit"), 'g',
|
||||
Block.glass);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(monitorBlock), "gcg", "gmg",
|
||||
"ggg", 'm', WarpDriveConfig.i.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.i.getIC2Item("advancedCircuit"), 'g',
|
||||
Block.glass);
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(scannerBlock), "sgs", "mma", "amm",
|
||||
'm', WarpDriveConfig.i.getIC2Item("advancedMachine"), 'a',
|
||||
WarpDriveConfig.i.getIC2Item("advancedAlloy"), 's',
|
||||
WarpDriveConfig.i.getIC2Item("advancedCircuit"), 'g', Block.glass);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(laserTreeFarmBlock),false,new Object[] {
|
||||
"cwc", "wmw", "cwc",
|
||||
'c', WarpDriveConfig.i.getIC2Item("electronicCircuit"),
|
||||
'w', "logWood",
|
||||
'm', miningLaserBlock }));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(cloakBlock),
|
||||
"imi",
|
||||
"mcm",
|
||||
"imi",
|
||||
'i', iridiumBlock, 'c', cloakCoilBlock, 'm', WarpDriveConfig.i.getIC2Item("advancedMachine"));
|
||||
|
||||
GameRegistry.addRecipe(new ItemStack(cloakCoilBlock),
|
||||
"iai",
|
||||
"aca",
|
||||
"iai",
|
||||
'i', WarpDriveConfig.i.getIC2Item("iridiumPlate"), 'c', WarpDriveConfig.i.getIC2Item("advancedCircuit"), 'a', WarpDriveConfig.i.getIC2Item("advancedAlloy"));
|
||||
|
||||
registry = new WarpCoresRegistry();
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isServer())
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
cams = new CamRegistry();
|
||||
}
|
||||
=======
|
||||
|
||||
jumpGates = new JumpGatesRegistry();
|
||||
cams = new CamRegistry();
|
||||
>>>>>>> 2285a5d75c56ad846175edf7a731b2738f06bb72
|
||||
}
|
||||
|
||||
private void registerSpaceDimension() {
|
||||
spaceBiome = (new BiomeSpace(23)).setColor(0).setDisableRain()
|
||||
.setBiomeName("Space");
|
||||
this.spaceProviderID = 14;
|
||||
DimensionManager.registerProviderType(this.spaceProviderID,
|
||||
SpaceProvider.class, true);
|
||||
this.spaceDimID = DimensionManager.getNextFreeDimId();
|
||||
DimensionManager.registerDimension(this.spaceDimID,
|
||||
this.spaceProviderID);
|
||||
}
|
||||
|
||||
private void registerHyperSpaceDimension() {
|
||||
this.hyperSpaceProviderID = 15;
|
||||
DimensionManager.registerProviderType(this.hyperSpaceProviderID,
|
||||
HyperSpaceProvider.class, true);
|
||||
this.hyperSpaceDimID = DimensionManager.getNextFreeDimId();
|
||||
DimensionManager.registerDimension(this.hyperSpaceDimID,
|
||||
this.hyperSpaceProviderID);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverLoad(FMLServerStartingEvent event) {
|
||||
cloaks = new CloakManager();
|
||||
debugPrint("Added jump registry");
|
||||
jumpGates = new JumpGatesRegistry();
|
||||
MinecraftForge.EVENT_BUS.register(new CloakChunkWatcher());
|
||||
|
||||
event.registerServerCommand(new GenerateCommand());
|
||||
event.registerServerCommand(new SpaceTpCommand());
|
||||
event.registerServerCommand(new InvisibleCommand());
|
||||
event.registerServerCommand(new JumpgateCommand());
|
||||
}
|
||||
|
||||
private ArrayList<Ticket> worldTickets(World worldObj)
|
||||
{
|
||||
ArrayList<Ticket> ticks = new ArrayList<Ticket>();
|
||||
for(Ticket t: warpTickets)
|
||||
if(t.world.equals(worldObj))
|
||||
ticks.add(t);
|
||||
return ticks;
|
||||
}
|
||||
|
||||
public Ticket registerChunkLoadTE(WarpChunkTE te,boolean refreshLoading)
|
||||
{
|
||||
World worldObj = te.worldObj;
|
||||
ArrayList<Ticket> worldTicks = worldTickets(worldObj);
|
||||
boolean isWorldTicketed = worldTicks.size() != 0;
|
||||
if(isWorldTicketed)
|
||||
{
|
||||
if(ForgeChunkManager.ticketCountAvailableFor(this, worldObj) > 0)
|
||||
{
|
||||
Ticket t = ForgeChunkManager.requestTicket(this, worldObj, Type.NORMAL);
|
||||
if(t != null)
|
||||
{
|
||||
te.giveTicket(t);
|
||||
if(refreshLoading)
|
||||
te.refreshLoading();
|
||||
return t;
|
||||
}
|
||||
else
|
||||
{
|
||||
WarpDrive.debugPrint("Ticket not granted");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WarpDrive.debugPrint("No tickets left!");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Ticket t = ForgeChunkManager.requestTicket(this, worldObj, Type.NORMAL);
|
||||
if(t != null)
|
||||
{
|
||||
te.giveTicket(t);
|
||||
if(refreshLoading)
|
||||
te.refreshLoading();
|
||||
return t;
|
||||
}
|
||||
else
|
||||
{
|
||||
WarpDrive.debugPrint("Ticket not granted");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Ticket registerChunkLoadTE(WarpChunkTE te)
|
||||
{
|
||||
return registerChunkLoadTE(te,true);
|
||||
}
|
||||
|
||||
public Ticket getTicket(WarpChunkTE te)
|
||||
{
|
||||
return registerChunkLoadTE(te,false);
|
||||
}
|
||||
|
||||
public void removeTicket(Ticket t)
|
||||
{
|
||||
for(Ticket ticket:warpTickets)
|
||||
if(t.equals(ticket))
|
||||
warpTickets.remove(ticket);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world)
|
||||
{
|
||||
for (Ticket ticket : tickets)
|
||||
{
|
||||
warpTickets.add(ticket);
|
||||
ImmutableSet chunks = ticket.getChunkList();
|
||||
for(Object chunk : chunks)
|
||||
if(chunk instanceof ChunkCoordIntPair)
|
||||
ForgeChunkManager.unforceChunk(ticket,(ChunkCoordIntPair)chunk);
|
||||
ForgeChunkManager.releaseTicket(ticket);
|
||||
//ForgeChunkManager.releaseTicket(ticket);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -163,10 +163,10 @@ public class WarpDriveConfig
|
|||
WC_ENERGY_PER_DISTANCE_MODE1 = config.get("WarpCore", "energy_per_distance_mode1", 100).getInt();
|
||||
WC_ENERGY_PER_DISTANCE_MODE2 = config.get("WarpCore", "energy_per_distance_mode2", 1000).getInt();
|
||||
WC_ENERGY_PER_BLOCK_MODE2 = config.get("WarpCore", "energy_per_block_mode2", 1000).getInt();
|
||||
WC_ENERGY_PER_ENTITY_TO_SPACE = config.get("WarpCore", "energy_ped_entity_to_space", 1000000).getInt();
|
||||
WC_ENERGY_PER_ENTITY_TO_SPACE = config.get("WarpCore", "energy_per_entity_to_space", 1000000).getInt();
|
||||
WC_MAX_JUMP_DISTANCE = config.get("WarpCore", "max_jump_distance", 128).getInt();
|
||||
WC_MAX_SHIP_VOLUME_ON_SURFACE = config.get("WarpCore", "max_ship_volume_on_surface", 15000).getInt(); // Maximum ship mass to jump on earth (15k blocks)
|
||||
WC_MIN_SHIP_VOLUME_FOR_HYPERSPACE = config.get("WarpCore", "min_ship_volume_for_hyperspace", 500).getInt(); ; // Minimum ship volume value for hyper space
|
||||
WC_MIN_SHIP_VOLUME_FOR_HYPERSPACE = config.get("WarpCore", "min_ship_volume_for_hyperspace", 500).getInt(); // Minimum ship volume value for hyper space
|
||||
WC_MAX_SHIP_SIDE = config.get("WarpCore", "max_ship_side", 100).getInt();
|
||||
|
||||
WC_COOLDOWN_INTERVAL_SECONDS = config.get("WarpCore", "cooldown_interval_seconds", 4).getInt();
|
||||
|
@ -363,8 +363,8 @@ public class WarpDriveConfig
|
|||
IC2_Air = new int[] {Items.getItem("airCell").itemID, Items.getItem("airCell").getItemDamage()};
|
||||
IC2_Empty = new int[] {Items.getItem("cell").itemID, Items.getItem("cell").getItemDamage()};
|
||||
CommonWorldGenOres.add(new int[] {Items.getItem("uraniumOre").itemID, Items.getItem("uraniumOre").getItemDamage()});
|
||||
CommonWorldGenOres.add(new int[] {Items.getItem("copperOre").itemID, Items.getItem("uraniumOre").getItemDamage()});
|
||||
CommonWorldGenOres.add(new int[] {Items.getItem("tinOre").itemID, Items.getItem("uraniumOre").getItemDamage()});
|
||||
CommonWorldGenOres.add(new int[] {Items.getItem("copperOre").itemID, Items.getItem("copperOre").getItemDamage()});
|
||||
CommonWorldGenOres.add(new int[] {Items.getItem("tinOre").itemID, Items.getItem("tinOre").getItemDamage()});
|
||||
MinerOres.add(Items.getItem("rubberWood").itemID);
|
||||
AEExtraFDI = Items.getItem("FluidCell").getItem();
|
||||
}
|
||||
|
|
|
@ -72,6 +72,9 @@ public class TileEntityCloakingDeviceCore extends TileEntity implements IEnergyS
|
|||
private int updateTicks = 0;
|
||||
private int laserDrawingTicks = 0;
|
||||
|
||||
private boolean soundPlayed = false;
|
||||
private int soundTicks = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if (FMLCommonHandler.instance().getEffectiveSide().isClient()) {
|
||||
|
@ -83,6 +86,12 @@ public class TileEntityCloakingDeviceCore extends TileEntity implements IEnergyS
|
|||
addedToEnergyNet = true;
|
||||
}
|
||||
|
||||
// Reset sound timer
|
||||
if (soundTicks++ >= 40) {
|
||||
this.soundTicks = 0;
|
||||
this.soundPlayed = false;
|
||||
}
|
||||
|
||||
if (--this.updateTicks <= 0) {
|
||||
//System.out.println("[CloakDev] Updating cloaking state...");
|
||||
this.updateTicks = ((this.tier == 1) ? 20 : (tier == 2) ? 10 : 20) * WarpDriveConfig.i.CD_FIELD_REFRESH_INTERVAL_SECONDS; // resetting timer
|
||||
|
@ -95,7 +104,10 @@ public class TileEntityCloakingDeviceCore extends TileEntity implements IEnergyS
|
|||
if (!WarpDrive.instance.cloaks.isAreaExists(this.frequency)) {
|
||||
WarpDrive.instance.cloaks.addCloakedAreaWorld(worldObj, minX, minY, minZ, maxX, maxY, maxZ, frequency, tier);
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 2);
|
||||
worldObj.playSoundEffect(xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, "warpdrive:cloak", 4F, 1F);
|
||||
if (!soundPlayed) {
|
||||
soundPlayed = true;
|
||||
worldObj.playSoundEffect(xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, "warpdrive:cl", 4F, 1F);
|
||||
}
|
||||
|
||||
// Enable coils
|
||||
setCoilsState(true);
|
||||
|
@ -218,7 +230,11 @@ public class TileEntityCloakingDeviceCore extends TileEntity implements IEnergyS
|
|||
if (WarpDrive.instance.cloaks.isAreaExists(this.frequency))
|
||||
WarpDrive.instance.cloaks.removeCloakedArea(this.frequency);
|
||||
|
||||
worldObj.playSoundEffect(xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, "warpdrive:decloak", 4F, 1F);
|
||||
if (!soundPlayed) {
|
||||
soundPlayed = true;
|
||||
worldObj.playSoundEffect(xCoord + 0.5f, yCoord + 0.5f, zCoord + 0.5f, "warpdrive:dcl", 4F, 1F);
|
||||
}
|
||||
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 2);
|
||||
}
|
||||
public void countBlocksAndConsumeEnergy() {
|
||||
|
@ -377,7 +393,10 @@ public class TileEntityCloakingDeviceCore extends TileEntity implements IEnergyS
|
|||
switch (method) {
|
||||
case 0: // setFieldTier(1 or 2)
|
||||
if (arguments.length == 1) {
|
||||
this.tier = ((Double)arguments[0]).byteValue();
|
||||
if (((Double)arguments[0]).byteValue() != 1 && ((Double)arguments[0]).byteValue() != 2) {
|
||||
this.tier = 1;
|
||||
} else
|
||||
this.tier = ((Double)arguments[0]).byteValue();
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -207,20 +207,20 @@ public class TileEntityProtocol extends TileEntity implements IPeripheral
|
|||
|
||||
public String getAttachedPlayersList()
|
||||
{
|
||||
String list = "";
|
||||
StringBuilder list = new StringBuilder("");
|
||||
|
||||
for (int i = 0; i < this.players.size(); i++)
|
||||
{
|
||||
String nick = this.players.get(i);
|
||||
list += nick + ((i == this.players.size() - 1) ? "" : ", ");
|
||||
list.append(nick + ((i == this.players.size() - 1) ? "" : ", "));
|
||||
}
|
||||
|
||||
if (players.isEmpty())
|
||||
{
|
||||
list = "<nobody>";
|
||||
list = new StringBuilder("<nobody>");
|
||||
}
|
||||
|
||||
return list;
|
||||
return list.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -204,6 +204,7 @@ public class TileEntityReactor extends TileEntity implements IEnergySink
|
|||
// Awaiting cooldown time
|
||||
if (/*currentMode != MODE_BASIC_JUMP && */cooldownTime++ < ((WarpDriveConfig.i.WC_COOLDOWN_INTERVAL_SECONDS) * 20) + randomCooldownAddition)
|
||||
{
|
||||
//System.out.println("[WC] Awaiting cooldown: " + cooldownTime + " < " + ( ((WarpDriveConfig.i.WC_COOLDOWN_INTERVAL_SECONDS) * 20) + randomCooldownAddition));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -212,11 +213,13 @@ public class TileEntityReactor extends TileEntity implements IEnergySink
|
|||
|
||||
if (!prepareToJump())
|
||||
{
|
||||
System.out.println("[WC] Prepare to jump returns false");
|
||||
return;
|
||||
}
|
||||
|
||||
if (WarpDrive.instance.registry.isWarpCoreIntersectsWithOthers(this))
|
||||
{
|
||||
System.out.println("[WD] Intersect");
|
||||
this.controller.setJumpFlag(false);
|
||||
messageToAllPlayersOnShip("Warp field intersects with other ship's field. Cannot jump.");
|
||||
return;
|
||||
|
@ -224,6 +227,7 @@ public class TileEntityReactor extends TileEntity implements IEnergySink
|
|||
|
||||
if (WarpDrive.instance.cloaks.isInCloak(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, false))
|
||||
{
|
||||
System.out.println("[WD] Core inside cloaking field");
|
||||
this.controller.setJumpFlag(false);
|
||||
messageToAllPlayersOnShip("Wap-Core is inside cloaking field. Can't jump. Disable cloaking field to jump!");
|
||||
return;
|
||||
|
@ -485,7 +489,7 @@ public class TileEntityReactor extends TileEntity implements IEnergySink
|
|||
|
||||
default:
|
||||
this.controller.setJumpFlag(false);
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ship side is too big
|
||||
|
@ -497,7 +501,7 @@ public class TileEntityReactor extends TileEntity implements IEnergySink
|
|||
|
||||
this.shipVolume = getRealShipVolume();
|
||||
|
||||
if (shipVolume > WarpDriveConfig.i.WC_MAX_JUMP_DISTANCE && worldObj.provider.dimensionId == 0)
|
||||
if (shipVolume > WarpDriveConfig.i.WC_MAX_SHIP_VOLUME_ON_SURFACE && worldObj.provider.dimensionId == 0)
|
||||
{
|
||||
this.controller.setJumpFlag(false);
|
||||
return false;
|
||||
|
@ -794,7 +798,11 @@ public class TileEntityReactor extends TileEntity implements IEnergySink
|
|||
|
||||
JumpGate t = WarpDrive.instance.jumpGates.findNearestGate(xCoord, yCoord, zCoord);
|
||||
|
||||
if (t != null && !isShipInJumpgate(t))
|
||||
|
||||
if (WarpDrive.instance.jumpGates == null)
|
||||
System.out.println("[JumpGates] WarpDrive.instance.jumpGates is NULL!");
|
||||
|
||||
if (WarpDrive.instance.jumpGates != null && t != null && !isShipInJumpgate(t))
|
||||
{
|
||||
if (shipVolume < WarpDriveConfig.i.WC_MIN_SHIP_VOLUME_FOR_HYPERSPACE)
|
||||
{
|
||||
|
|
1223
src/cr0s/WarpDrive/machines/TileEntityReactor.java.orig
Normal file
1223
src/cr0s/WarpDrive/machines/TileEntityReactor.java.orig
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue