First test with items basic creation
This commit is contained in:
parent
fea69bdad9
commit
71e86f31ac
@ -2,8 +2,8 @@ package fr.jackcartersmith.ob.blocks;
|
|||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import fr.jackcartersmith.ob.items.OBItems;
|
|
||||||
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
import fr.jackcartersmith.ob.proxy.ClientProxy;
|
||||||
|
import fr.jackcartersmith.orbsat.common.OSItems;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
@ -81,17 +81,17 @@ public class LaserLowBlock extends BlockContainer
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getUnlocalizedName().equals(OBItems.laserGunHighItem.getUnlocalizedName()))
|
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getUnlocalizedName().equals(OSItems.laserGunHighItem.getUnlocalizedName()))
|
||||||
{
|
{
|
||||||
color = "red";
|
color = "red";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getUnlocalizedName().equals(OBItems.laserGunMedItem.getUnlocalizedName()))
|
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getUnlocalizedName().equals(OSItems.laserGunMedItem.getUnlocalizedName()))
|
||||||
{
|
{
|
||||||
color = "orange";
|
color = "orange";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getUnlocalizedName().equals(OBItems.laserGunLowItem.getUnlocalizedName()))
|
if (Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getUnlocalizedName().equals(OSItems.laserGunLowItem.getUnlocalizedName()))
|
||||||
{
|
{
|
||||||
color = "blue";
|
color = "blue";
|
||||||
}
|
}
|
@ -1,40 +0,0 @@
|
|||||||
package fr.jackcartersmith.ob.items;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
|
||||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
|
|
||||||
public class OBItems {
|
|
||||||
public static Item designatorLow;
|
|
||||||
public static Item designatorMed;
|
|
||||||
public static Item designatorHigh;
|
|
||||||
public static Item lenseItem;
|
|
||||||
public static Item laserGunLowItem;
|
|
||||||
public static Item laserGunMedItem;
|
|
||||||
public static Item laserGunHighItem;
|
|
||||||
public static Item thrusterFuelItem;
|
|
||||||
public static Item photonCondenserItem;
|
|
||||||
public static Item photonCapacitor;
|
|
||||||
|
|
||||||
public static void init()
|
|
||||||
{
|
|
||||||
designatorLow = new DesignatorLowItem().setUnlocalizedName("item_ob_designatorLow");
|
|
||||||
GameRegistry.registerItem(designatorLow, "ob_designatorLow");
|
|
||||||
designatorMed = new DesignatorMedItem().setUnlocalizedName("item_ob_designatorMed");
|
|
||||||
GameRegistry.registerItem(designatorMed, "ob_designatorMed");
|
|
||||||
designatorHigh = new DesignatorHighItem().setUnlocalizedName("item_ob_designatorHigh");
|
|
||||||
GameRegistry.registerItem(designatorHigh, "ob_designatorHigh");
|
|
||||||
lenseItem = new LenseItem().setUnlocalizedName("item_ob_lense");
|
|
||||||
GameRegistry.registerItem(lenseItem, "ob_lense_item");
|
|
||||||
laserGunLowItem = new LaserGunLowItem().setUnlocalizedName("item_ob_laserGunLow");
|
|
||||||
GameRegistry.registerItem(laserGunLowItem, "ob_laserGunLow");
|
|
||||||
laserGunMedItem = new LaserGunMedItem().setUnlocalizedName("item_ob_laserGunMed");
|
|
||||||
GameRegistry.registerItem(laserGunMedItem, "ob_laserGunMed");
|
|
||||||
laserGunHighItem = new LaserGunHighItem().setUnlocalizedName("item_ob_laserGunHigh");
|
|
||||||
GameRegistry.registerItem(laserGunHighItem, "ob_laserGunHigh");
|
|
||||||
photonCondenserItem = new PhotonCondenserItem().setUnlocalizedName("item_ob_condenser");
|
|
||||||
GameRegistry.registerItem(photonCondenserItem, "ob_condenser_item");
|
|
||||||
photonCapacitor = new PhotonCapacitorItem().setUnlocalizedName("item_ob_capacitor");
|
|
||||||
GameRegistry.registerItem(photonCapacitor, "ob_capacitor_item");
|
|
||||||
}
|
|
||||||
}
|
|
@ -25,7 +25,7 @@ public class OrbitalSatellite
|
|||||||
@SidedProxy(clientSide = OSRefs.CLIENTPROXYLOCATION, serverSide = OSRefs.SERVERPROXYLOCATION)
|
@SidedProxy(clientSide = OSRefs.CLIENTPROXYLOCATION, serverSide = OSRefs.SERVERPROXYLOCATION)
|
||||||
public static CommonProxy proxy;
|
public static CommonProxy proxy;
|
||||||
|
|
||||||
public static CreativeTabs OBCreativeTabs = new OSCreativeTabs(CreativeTabs.getNextID(),OSRefs.MODID);
|
public static CreativeTabs OSCreaTab = new OSCreativeTabs(CreativeTabs.getNextID(),OSRefs.MODID);
|
||||||
|
|
||||||
public static final String networkChannelName = OSRefs.MODID;
|
public static final String networkChannelName = OSRefs.MODID;
|
||||||
public static SimpleNetworkWrapper network;
|
public static SimpleNetworkWrapper network;
|
||||||
|
@ -1,34 +1,233 @@
|
|||||||
package fr.jackcartersmith.orbsat.client;
|
package fr.jackcartersmith.orbsat.client;
|
||||||
|
|
||||||
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
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.network.simpleimpl.MessageContext;
|
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||||
import fr.jackcartersmith.ob.blocks.DefenderLaserTileEntity;
|
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||||
import fr.jackcartersmith.ob.blocks.DefenderTileEntity;
|
import fr.jackcartersmith.orbsat.client.handler.ClientEventHandler;
|
||||||
import fr.jackcartersmith.ob.blocks.ExtenderTileEntity;
|
import fr.jackcartersmith.orbsat.client.handler.ParticleHandler;
|
||||||
import fr.jackcartersmith.ob.blocks.InverterAdvTileEntity;
|
import fr.jackcartersmith.orbsat.client.handler.ResourceHandler;
|
||||||
import fr.jackcartersmith.ob.blocks.LaserLowTileEntity;
|
|
||||||
import fr.jackcartersmith.ob.blocks.OverriderBlockTileEntity;
|
|
||||||
import fr.jackcartersmith.ob.blocks.PhotonAcceleratorTileEntity;
|
|
||||||
import fr.jackcartersmith.ob.blocks.PhotonDeceleratorTileEntity;
|
|
||||||
import fr.jackcartersmith.ob.blocks.SateliteTileEntity;
|
|
||||||
import fr.jackcartersmith.ob.libs.TESRInventoryRenderer;
|
|
||||||
import fr.jackcartersmith.ob.models.DefenderLaserRenderer;
|
|
||||||
import fr.jackcartersmith.ob.models.LaserLowRenderer;
|
|
||||||
import fr.jackcartersmith.ob.models.SateliteRenderer;
|
|
||||||
import fr.jackcartersmith.ob.models.TileEntityDefenderRenderer;
|
|
||||||
import fr.jackcartersmith.ob.models.TileEntityExtenderRenderer;
|
|
||||||
import fr.jackcartersmith.ob.models.TileEntityInverterAdvRenderer;
|
|
||||||
import fr.jackcartersmith.ob.models.TileEntityOverriderRenderer;
|
|
||||||
import fr.jackcartersmith.ob.models.TileEntityPhotonAcceleratorRenderer;
|
|
||||||
import fr.jackcartersmith.ob.models.TileEntityPhotonDeceleratorRenderer;
|
|
||||||
import fr.jackcartersmith.orbsat.common.CommonProxy;
|
import fr.jackcartersmith.orbsat.common.CommonProxy;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.audio.ISound;
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.client.MinecraftForgeClient;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
public class ClientProxy extends CommonProxy{
|
public class ClientProxy extends CommonProxy {
|
||||||
public static int tesrRenderId;
|
private final static boolean debug = OrbitalSatellite.debug;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
|
if (debug) System.out.println("on Client side");
|
||||||
|
super.preInit(event);
|
||||||
|
|
||||||
|
ResourceHandler.init(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(FMLInitializationEvent event) {
|
||||||
|
super.init(event);
|
||||||
|
//FMLCommonHandler.instance().bus().register(new KeyInputHandler());
|
||||||
|
FMLCommonHandler.instance().bus().register(new ClientEventHandler());
|
||||||
|
//if (ConfigHandler.enableVersionChecker) FMLCommonHandler.instance().bus().register(new UpdateChecker());
|
||||||
|
//MinecraftForge.EVENT_BUS.register(new HudHandler());
|
||||||
|
MinecraftForge.EVENT_BUS.register(new ClientEventHandler());
|
||||||
|
//KeyBindings.init();
|
||||||
|
registerRenderIDs();
|
||||||
|
registerRendering();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
|
super.postInit(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerRendering() {
|
||||||
|
/*
|
||||||
|
//Item Renderers
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBow());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBow());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.mobSoul, new RenderMobSoul());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.chaosShard, new RenderChaosShard());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.reactorStabilizerParts, new RenderStabilizerPart());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.chaosFragment, new RenderChaosFragment());
|
||||||
|
|
||||||
|
if (!ConfigHandler.useOldArmorModel) {
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernHelm, new RenderArmor(ModItems.wyvernHelm));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernChest, new RenderArmor(ModItems.wyvernChest));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernLeggs, new RenderArmor(ModItems.wyvernLeggs));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBoots, new RenderArmor(ModItems.wyvernBoots));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicHelm, new RenderArmor(ModItems.draconicHelm));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicChest, new RenderArmor(ModItems.draconicChest));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicLeggs, new RenderArmor(ModItems.draconicLeggs));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBoots, new RenderArmor(ModItems.draconicBoots));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ConfigHandler.useOldD2DToolTextures) {
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicSword, new RenderTool("models/tools/DraconicSword.obj", "textures/models/tools/DraconicSword.png", (IRenderTweak) ModItems.draconicSword));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernPickaxe, new RenderTool("models/tools/Pickaxe.obj", "textures/models/tools/Pickaxe.png", (IRenderTweak) ModItems.wyvernPickaxe));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicPickaxe, new RenderTool("models/tools/DraconicPickaxe.obj", "textures/models/tools/DraconicPickaxe.png", (IRenderTweak) ModItems.draconicPickaxe));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicAxe, new RenderTool("models/tools/DraconicLumberAxe.obj", "textures/models/tools/DraconicLumberAxe.png", (IRenderTweak) ModItems.draconicAxe));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernShovel, new RenderTool("models/tools/Shovel.obj", "textures/models/tools/Shovel.png", (IRenderTweak) ModItems.wyvernShovel));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicShovel, new RenderTool("models/tools/DraconicShovel.obj", "textures/models/tools/DraconicShovel.png", (IRenderTweak) ModItems.draconicShovel));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernSword, new RenderTool("models/tools/Sword.obj", "textures/models/tools/Sword.png", (IRenderTweak) ModItems.wyvernSword));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicDestructionStaff, new RenderTool("models/tools/DraconicStaffOfPower.obj", "textures/models/tools/DraconicStaffOfPower.png", (IRenderTweak) ModItems.draconicDestructionStaff));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicHoe, new RenderTool("models/tools/DraconicHoe.obj", "textures/models/tools/DraconicHoe.png", (IRenderTweak) ModItems.draconicHoe));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.draconicBow, new RenderBowModel(true));
|
||||||
|
MinecraftForgeClient.registerItemRenderer(ModItems.wyvernBow, new RenderBowModel(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.draconiumChest), new RenderDraconiumChest());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.particleGenerator), new RenderParticleGen());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyInfuser), new RenderEnergyInfuser());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.energyCrystal), new RenderCrystal());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorStabilizer), new RenderReactorStabilizer());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorEnergyInjector), new RenderReactorEnergyInjector());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.reactorCore), new RenderReactorCore());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.chaosCrystal), new RenderChaosShard());
|
||||||
|
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.upgradeModifier), new RenderUpgradeModifier());
|
||||||
|
|
||||||
|
//ISimpleBlockRendering
|
||||||
|
RenderingRegistry.registerBlockHandler(new RenderTeleporterStand());
|
||||||
|
RenderingRegistry.registerBlockHandler(new RenderPortal());
|
||||||
|
|
||||||
|
//TileEntitySpecialRenderers
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileParticleGenerator.class, new RenderTileParticleGen());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyInfuser.class, new RenderTileEnergyInfiser());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileCustomSpawner.class, new RenderTileCustomSpawner());
|
||||||
|
//ClientRegistry.bindTileEntitySpecialRenderer(TileTestBlock.class, new RenderTileCrystal());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyStorageCore.class, new RenderTileEnergyStorageCore());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyPylon.class, new RenderTileEnergyPylon());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TilePlacedItem.class, new RenderTilePlacedItem());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileDissEnchanter.class, new RenderTileDissEnchanter());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileTeleporterStand.class, new RenderTileTeleporterStand());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileDraconiumChest.class, new RenderTileDraconiumChest());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyRelay.class, new RenderTileCrystal());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileEnergyTransceiver.class, new RenderTileCrystal());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileWirelessEnergyTransceiver.class, new RenderTileCrystal());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorCore.class, new RenderTileReactorCore());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorStabilizer.class, new RenderTileReactorStabilizer());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileReactorEnergyInjector.class, new RenderTileReactorEnergyInjector());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileChaosShard.class, new RenderTileChaosShard());
|
||||||
|
ClientRegistry.bindTileEntitySpecialRenderer(TileUpgradeModifier.class, new RenderTileUpgradeModifier());
|
||||||
|
|
||||||
|
//Entitys
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityCustomDragon.class, new RenderDragon());
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityChaosGuardian.class, new RenderDragon());
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityDragonHeart.class, new RenderDragonHeart());
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityDragonProjectile.class, new RenderDragonProjectile());
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityChaosCrystal.class, new RenderChaosCrystal());
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityChaosVortex.class, new RenderEntityChaosVortex());
|
||||||
|
RenderingRegistry.registerEntityRenderingHandler(EntityCustomArrow.class, new RenderEntityCustomArrow());
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
public void registerRenderIDs() {
|
||||||
|
//References.idTeleporterStand = RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
//References.idPortal = RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ------------- Code inspiration pour le faisceau d'energie du satellite
|
||||||
|
*
|
||||||
|
@Override
|
||||||
|
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz, int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
|
||||||
|
if (!worldObj.isRemote) return null;
|
||||||
|
ParticleEnergyBeam beam = oldBeam;
|
||||||
|
boolean inRange = ParticleHandler.isInRange(x, y, z, 50) || ParticleHandler.isInRange(tx, ty, tz, 50);
|
||||||
|
|
||||||
|
if (beam == null || beam.isDead) {
|
||||||
|
if (inRange) {
|
||||||
|
beam = new ParticleEnergyBeam(worldObj, x, y, z, tx, ty, tz, 8, powerFlow, advanced, beamType);
|
||||||
|
|
||||||
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(beam);
|
||||||
|
}
|
||||||
|
} else if (!inRange) {
|
||||||
|
beam.setDead();
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
beam.update(powerFlow, render);
|
||||||
|
}
|
||||||
|
return beam;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced, ParticleEnergyField oldBeam, boolean render) {
|
||||||
|
if (!worldObj.isRemote) return null;
|
||||||
|
ParticleEnergyField beam = oldBeam;
|
||||||
|
boolean inRange = ParticleHandler.isInRange(x, y, z, 50);
|
||||||
|
|
||||||
|
if (beam == null || beam.isDead) {
|
||||||
|
if (inRange) {
|
||||||
|
beam = new ParticleEnergyField(worldObj, x, y, z, 8, type, advanced);
|
||||||
|
|
||||||
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(beam);
|
||||||
|
}
|
||||||
|
} else if (!inRange) {
|
||||||
|
beam.setDead();
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
beam.update(render);
|
||||||
|
}
|
||||||
|
return beam;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ParticleReactorBeam reactorBeam(TileEntity tile, ParticleReactorBeam oldBeam, boolean render) {
|
||||||
|
if (!tile.getWorldObj().isRemote || !(tile instanceof IReactorPart)) return null;
|
||||||
|
ParticleReactorBeam beam = oldBeam;
|
||||||
|
boolean inRange = ParticleHandler.isInRange(tile.xCoord, tile.yCoord, tile.zCoord, 50);
|
||||||
|
|
||||||
|
if (beam == null || beam.isDead) {
|
||||||
|
if (inRange) {
|
||||||
|
beam = new ParticleReactorBeam(tile);
|
||||||
|
|
||||||
|
FMLClientHandler.instance().getClient().effectRenderer.addEffect(beam);
|
||||||
|
}
|
||||||
|
} else if (!inRange) {
|
||||||
|
beam.setDead();
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
beam.update(render);
|
||||||
|
}
|
||||||
|
return beam;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
public boolean isOp(String paramString) {
|
||||||
|
return Minecraft.getMinecraft().theWorld.getWorldInfo().getGameType().isCreative();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void spawnParticle(Object particle, int range) {
|
||||||
|
if (particle instanceof EntityFX && ((EntityFX) particle).worldObj.isRemote)
|
||||||
|
ParticleHandler.spawnCustomParticle((EntityFX) particle, range);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ISound playISound(ISound sound) {
|
||||||
|
FMLClientHandler.instance().getClient().getSoundHandler().playSound(sound);
|
||||||
|
return sound;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public void registerRender()
|
public void registerRender()
|
||||||
{
|
{
|
||||||
@ -55,4 +254,5 @@ public class ClientProxy extends CommonProxy{
|
|||||||
// Solution is to double-check side before returning the player:
|
// Solution is to double-check side before returning the player:
|
||||||
return (ctx.side.isClient() ? Minecraft.getMinecraft().thePlayer : super.getPlayerEntity(ctx));
|
return (ctx.side.isClient() ? Minecraft.getMinecraft().thePlayer : super.getPlayerEntity(ctx));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package fr.jackcartersmith.orbsat.client.creativetabs;
|
package fr.jackcartersmith.orbsat.client.creativetabs;
|
||||||
|
|
||||||
import fr.jackcartersmith.ob.items.OBItems;
|
import fr.jackcartersmith.orbsat.common.OSItems;
|
||||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
|
||||||
import fr.jackcartersmith.orbsat.common.OSBlocks;
|
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
@ -15,7 +13,7 @@ public class OSCreativeTabs extends CreativeTabs {
|
|||||||
@Override
|
@Override
|
||||||
public Item getTabIconItem() {
|
public Item getTabIconItem() {
|
||||||
|
|
||||||
return OBItems.designatorLow;
|
return OSItems.basicExtrapolCircuit;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ public class OSGuiHandler implements IGuiHandler{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||||
|
/*
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case GUIID_OVERRIDER:
|
case GUIID_OVERRIDER:
|
||||||
TileEntity te = world.getTileEntity(x, y, z);
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
@ -49,11 +50,13 @@ public class OSGuiHandler implements IGuiHandler{
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||||
|
/*
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case GUIID_OVERRIDER:
|
case GUIID_OVERRIDER:
|
||||||
TileEntity te = world.getTileEntity(x, y, z);
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
@ -86,6 +89,7 @@ public class OSGuiHandler implements IGuiHandler{
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,95 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.client.handler;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
|
public class ClientEventHandler {
|
||||||
|
//public static Map<EntityPlayer, XZPair<Float, Integer>> playerShieldStatus = new HashMap<EntityPlayer, XZPair<Float, Integer>>();
|
||||||
|
|
||||||
|
public static int elapsedTicks;
|
||||||
|
public static float previousSensitivity = 0;
|
||||||
|
public static boolean bowZoom = false;
|
||||||
|
public static boolean lastTickBowZoom = false;
|
||||||
|
public static int tickSet = 0;
|
||||||
|
public static float energyCrystalAlphaValue = 0f;
|
||||||
|
public static float energyCrystalAlphaTarget = 0f;
|
||||||
|
public static boolean playerHoldingWrench = false;
|
||||||
|
public static Minecraft mc;
|
||||||
|
//private static Random rand = new Random();
|
||||||
|
//private static IModelCustom shieldSphere;
|
||||||
|
|
||||||
|
public ClientEventHandler() {
|
||||||
|
//shieldSphere = AdvancedModelLoader.loadModel(ResourceHandler.getResource("models/shieldSphere.obj"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
@SubscribeEvent
|
||||||
|
public void tickEnd(TickEvent.ClientTickEvent event) {
|
||||||
|
if (event.phase != TickEvent.Phase.START || event.type != TickEvent.Type.CLIENT || event.side != Side.CLIENT)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Iterator<Map.Entry<EntityPlayer, XZPair<Float, Integer>>> i = playerShieldStatus.entrySet().iterator(); i.hasNext(); ) {
|
||||||
|
Map.Entry<EntityPlayer, XZPair<Float, Integer>> entry = i.next();
|
||||||
|
if (elapsedTicks - entry.getValue().getValue() > 5) i.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (mc == null) mc = Minecraft.getMinecraft();
|
||||||
|
else if (mc.theWorld != null) {
|
||||||
|
elapsedTicks++;
|
||||||
|
HudHandler.clientTick();
|
||||||
|
|
||||||
|
if (bowZoom && !lastTickBowZoom) {
|
||||||
|
previousSensitivity = Minecraft.getMinecraft().gameSettings.mouseSensitivity;
|
||||||
|
Minecraft.getMinecraft().gameSettings.mouseSensitivity = previousSensitivity / 3;
|
||||||
|
} else if (!bowZoom && lastTickBowZoom) {
|
||||||
|
Minecraft.getMinecraft().gameSettings.mouseSensitivity = previousSensitivity;
|
||||||
|
}
|
||||||
|
|
||||||
|
lastTickBowZoom = bowZoom;
|
||||||
|
if (elapsedTicks - tickSet > 10) bowZoom = false;
|
||||||
|
|
||||||
|
if (energyCrystalAlphaValue < energyCrystalAlphaTarget) energyCrystalAlphaValue += 0.01f;
|
||||||
|
if (energyCrystalAlphaValue > energyCrystalAlphaTarget) energyCrystalAlphaValue -= 0.01f;
|
||||||
|
|
||||||
|
if (Math.abs(energyCrystalAlphaTarget - energyCrystalAlphaValue) <= 0.02f)
|
||||||
|
energyCrystalAlphaTarget = rand.nextFloat();
|
||||||
|
|
||||||
|
playerHoldingWrench = mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() == ModItems.wrench;
|
||||||
|
|
||||||
|
searchForPlayerMount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent(priority = EventPriority.LOW)
|
||||||
|
public void fovUpdate(FOVUpdateEvent event) {
|
||||||
|
|
||||||
|
//region Bow FOV Update
|
||||||
|
if (event.entity.getHeldItem() != null && (event.entity.getHeldItem().getItem() instanceof WyvernBow || event.entity.getHeldItem().getItem() instanceof DraconicBow) && Minecraft.getMinecraft().gameSettings.keyBindUseItem.getIsKeyPressed()) {
|
||||||
|
|
||||||
|
BowHandler.BowProperties properties = new BowHandler.BowProperties(event.entity.getHeldItem(), event.entity);
|
||||||
|
|
||||||
|
event.newfov = ((6 - properties.zoomModifier) / 6) * event.fov;
|
||||||
|
|
||||||
|
// if (ItemNBTHelper.getString(event.entity.getItemInUse(), "mode", "").equals("sharpshooter")){
|
||||||
|
// if (event.entity.getItemInUse().getItem() instanceof WyvernBow) zMax = 1.35f;
|
||||||
|
// else if (event.entity.getItemInUse().getItem() instanceof DraconicBow) zMax = 2.5f;
|
||||||
|
// bowZoom = true;
|
||||||
|
// tickSet = elapsedTicks;
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
//endregion
|
||||||
|
|
||||||
|
//region Armor move speed FOV effect cancellation
|
||||||
|
CustomArmorHandler.ArmorSummery summery = new CustomArmorHandler.ArmorSummery().getSummery(event.entity);
|
||||||
|
|
||||||
|
if (summery != null && summery.speedModifier > 0) {
|
||||||
|
IAttributeInstance iattributeinstance = event.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed);
|
||||||
|
float f = (float) ((iattributeinstance.getAttributeValue() / (double) event.entity.capabilities.getWalkSpeed() + 1.0D) / 2.0D);
|
||||||
|
event.newfov /= f;
|
||||||
|
}
|
||||||
|
|
||||||
|
//endregion
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.client.handler;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import fr.jackcartersmith.orbsat.client.render.ParticleDistortion;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class ParticleHandler {
|
||||||
|
private static Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
private static World theWorld = mc.theWorld;
|
||||||
|
|
||||||
|
public static EntityFX spawnParticle(String particleName, double x, double y, double z, double motionX, double motionY, double motionZ, float scale) {
|
||||||
|
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
|
||||||
|
int var14 = mc.gameSettings.particleSetting;
|
||||||
|
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
|
||||||
|
var14 = 2;
|
||||||
|
}
|
||||||
|
double var15 = mc.renderViewEntity.posX - x;
|
||||||
|
double var17 = mc.renderViewEntity.posY - y;
|
||||||
|
double var19 = mc.renderViewEntity.posZ - z;
|
||||||
|
EntityFX var21 = null;
|
||||||
|
double var22 = 16.0D;
|
||||||
|
if (var15 * var15 + var17 * var17 + var19 * var19 > var22 * var22) {
|
||||||
|
return null;
|
||||||
|
} else if (var14 > 1) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
if (particleName.equals("distortionParticle")) {
|
||||||
|
var21 = new ParticleDistortion(theWorld, x, y, z, (float) motionX, (float) motionY, (float) motionZ, scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
mc.effectRenderer.addEffect(var21);
|
||||||
|
return var21;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EntityFX spawnCustomParticle(EntityFX particle) {
|
||||||
|
return spawnCustomParticle(particle, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EntityFX spawnCustomParticle(EntityFX particle, double vewRange) {
|
||||||
|
if (mc != null && mc.renderViewEntity != null && mc.effectRenderer != null) {
|
||||||
|
int var14 = mc.gameSettings.particleSetting;
|
||||||
|
if (var14 == 1 && theWorld.rand.nextInt(3) == 0) {
|
||||||
|
var14 = 2;
|
||||||
|
}
|
||||||
|
if (!isInRange(particle.posX, particle.posY, particle.posZ, vewRange)) {
|
||||||
|
return null;
|
||||||
|
} else if (var14 > 1) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
mc.effectRenderer.addEffect(particle);
|
||||||
|
return particle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isInRange(double x, double y, double z, double vewRange) {
|
||||||
|
if (mc == null || mc.renderViewEntity == null || mc.effectRenderer == null) return false;
|
||||||
|
|
||||||
|
double var15 = mc.renderViewEntity.posX - x;
|
||||||
|
double var17 = mc.renderViewEntity.posY - y;
|
||||||
|
double var19 = mc.renderViewEntity.posZ - z;
|
||||||
|
if (var15 * var15 + var17 * var17 + var19 * var19 > vewRange * vewRange) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,80 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.client.handler;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||||
|
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.particle.EffectRenderer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public class ResourceHandler {
|
||||||
|
public static ResourceHandler instance = new ResourceHandler();
|
||||||
|
private static ResourceLocation defaultParticles;
|
||||||
|
private static ResourceLocation particles = new ResourceLocation(OSRefs.RESOURCESPREFIX + "textures/particle/particles.png");
|
||||||
|
private static Map<String, ResourceLocation> cachedResources = new HashMap<String, ResourceLocation>();
|
||||||
|
|
||||||
|
private static String savePath;
|
||||||
|
private static File saveFolder;
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------- File Handling -----------------------//
|
||||||
|
|
||||||
|
public static void init(FMLPreInitializationEvent event) {
|
||||||
|
FMLCommonHandler.instance().bus().register(instance);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static File getConfigFolder() {
|
||||||
|
if (saveFolder == null) {
|
||||||
|
saveFolder = new File(savePath);
|
||||||
|
}
|
||||||
|
if (!saveFolder.exists()) saveFolder.mkdir();
|
||||||
|
|
||||||
|
return saveFolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------//
|
||||||
|
|
||||||
|
|
||||||
|
public static void bindTexture(ResourceLocation texture) {
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Binds the vanilla particle sheet
|
||||||
|
*/
|
||||||
|
public static void bindDefaultParticles() {
|
||||||
|
if (defaultParticles == null) {
|
||||||
|
try {
|
||||||
|
defaultParticles = (ResourceLocation) ReflectionHelper.getPrivateValue(EffectRenderer.class, null, "particleTextures", "field_110737_b");
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (defaultParticles != null) bindTexture(defaultParticles);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void bindParticles() {
|
||||||
|
bindTexture(particles);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResourceLocation getResource(String rs) {
|
||||||
|
if (!cachedResources.containsKey(rs))
|
||||||
|
cachedResources.put(rs, new ResourceLocation(OSRefs.RESOURCESPREFIX + rs));
|
||||||
|
return cachedResources.get(rs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResourceLocation getResourceWOP(String rs) {
|
||||||
|
if (!cachedResources.containsKey(rs)) cachedResources.put(rs, new ResourceLocation(rs));
|
||||||
|
return cachedResources.get(rs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void bindResource(String rs) {
|
||||||
|
bindTexture(ResourceHandler.getResource(rs));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,101 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.client.render;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import fr.jackcartersmith.orbsat.client.handler.ResourceHandler;
|
||||||
|
import net.minecraft.client.particle.EntityFX;
|
||||||
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ParticleDistortion extends EntityFX{
|
||||||
|
double originalX;
|
||||||
|
double originalZ;
|
||||||
|
|
||||||
|
public ParticleDistortion(World par1World, double par2, double par4, double par6, float par8, float par9, float par10, float scale) {
|
||||||
|
this(par1World, par2, par4, par6, 1.0F, par8, par9, par10, scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ParticleDistortion(World world, double par2, double par4, double par6, float par8, float par9, float par10, float par11, float scale) {
|
||||||
|
super(world, par2, par4, par6, 0.0D, 0.0D, 0.0D);
|
||||||
|
this.motionX = par9;//initial motion value X
|
||||||
|
this.motionY = par10;//initial motion value Y
|
||||||
|
this.motionZ = par11;//initial motion value Z
|
||||||
|
this.originalX = par9;
|
||||||
|
this.originalZ = par11;
|
||||||
|
if (par9 == 0.0F) {
|
||||||
|
par9 = 1.0F;
|
||||||
|
}
|
||||||
|
//float var12 = (float) Math.random() * 0.4F + 0.6F;
|
||||||
|
this.particleTextureIndexX = 0; //
|
||||||
|
this.particleTextureIndexY = 0;
|
||||||
|
|
||||||
|
this.particleRed = 0.7F;//RGB of your particle
|
||||||
|
this.particleGreen = 0.8F;
|
||||||
|
this.particleBlue = 1.0F;
|
||||||
|
//this.particleScale *= 0.05f + world.rand.nextFloat()*0.005;
|
||||||
|
//this.particleScale *= par8;
|
||||||
|
this.particleScale = scale;
|
||||||
|
|
||||||
|
this.particleMaxAge = 40 + world.rand.nextInt(40);//how soon the particle dies. You can use randomizer for this
|
||||||
|
this.noClip = true;//does your particle collide with blocks?
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUpdate() {
|
||||||
|
this.prevPosX = this.posX;
|
||||||
|
this.prevPosY = this.posY;
|
||||||
|
this.prevPosZ = this.posZ;
|
||||||
|
|
||||||
|
if (this.particleAge++ >= this.particleMaxAge) {
|
||||||
|
this.setDead();//make sure to have this
|
||||||
|
}
|
||||||
|
this.moveEntity(this.motionX, this.motionY, this.motionZ);// also important if you want your particle to move
|
||||||
|
this.motionX = motionX * (1 - (worldObj.rand.nextFloat() / 10F));
|
||||||
|
this.motionY = motionY * (1 - (worldObj.rand.nextFloat() / 10F));
|
||||||
|
this.motionZ = motionZ * (1 - (worldObj.rand.nextFloat() / 10F));
|
||||||
|
this.particleAlpha = (1F - ((float) this.particleAge / (float) this.particleMaxAge)) * 0.5F;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {//Note U=X V=Y
|
||||||
|
|
||||||
|
tessellator.draw();
|
||||||
|
ResourceHandler.bindParticles();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setBrightness(200);//make sure you have this!!
|
||||||
|
|
||||||
|
|
||||||
|
float minU = 0.0F + 0F;//(float)this.particleTextureIndexX / 32.0F;
|
||||||
|
float maxU = 0.0F + 0.1245F;//minU + 0.124F;
|
||||||
|
float minV = 0F;//(float)this.particleTextureIndexY / 32.0F;
|
||||||
|
float maxV = 0.1245F;//minV + 0.124F;
|
||||||
|
float drawScale = 0.1F * this.particleScale;
|
||||||
|
|
||||||
|
if (this.particleIcon != null) {
|
||||||
|
minU = this.particleIcon.getMinU();
|
||||||
|
maxU = this.particleIcon.getMaxU();
|
||||||
|
minV = this.particleIcon.getMinV();
|
||||||
|
maxV = this.particleIcon.getMaxV();
|
||||||
|
}
|
||||||
|
|
||||||
|
float drawX = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
|
||||||
|
float drawY = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
|
||||||
|
float drawZ = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
|
||||||
|
|
||||||
|
tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);
|
||||||
|
tessellator.setColorRGBA(0, 255, 255, (int) (this.particleAlpha * 255F));
|
||||||
|
|
||||||
|
tessellator.addVertexWithUV((double) (drawX - par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ - par5 * drawScale - par7 * drawScale), (double) maxU, (double) maxV);
|
||||||
|
tessellator.addVertexWithUV((double) (drawX - par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ - par5 * drawScale + par7 * drawScale), (double) maxU, (double) minV);
|
||||||
|
tessellator.addVertexWithUV((double) (drawX + par3 * drawScale + par6 * drawScale), (double) (drawY + par4 * drawScale), (double) (drawZ + par5 * drawScale + par7 * drawScale), (double) minU, (double) minV);
|
||||||
|
tessellator.addVertexWithUV((double) (drawX + par3 * drawScale - par6 * drawScale), (double) (drawY - par4 * drawScale), (double) (drawZ + par5 * drawScale - par7 * drawScale), (double) minU, (double) maxV);
|
||||||
|
|
||||||
|
tessellator.draw();
|
||||||
|
ResourceHandler.bindDefaultParticles();
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -9,17 +9,16 @@ import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
|||||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import fr.jackcartersmith.ob.blocks.DefenderTileEntity;
|
|
||||||
import fr.jackcartersmith.ob.entities.LaserLightEntity;
|
|
||||||
import fr.jackcartersmith.ob.entities.MeteorEntity;
|
|
||||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||||
import fr.jackcartersmith.orbsat.client.gui.GuiHandlerForOb;
|
|
||||||
import fr.jackcartersmith.orbsat.client.gui.OSGuiHandler;
|
import fr.jackcartersmith.orbsat.client.gui.OSGuiHandler;
|
||||||
import fr.jackcartersmith.orbsat.common.handler.FMLEventHandler;
|
import fr.jackcartersmith.orbsat.common.handler.FMLEventHandler;
|
||||||
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
import fr.jackcartersmith.orbsat.common.lib.OSConstants;
|
||||||
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
|
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
|
||||||
import fr.jackcartersmith.orbsat.common.utils.OSLogHelper;
|
import fr.jackcartersmith.orbsat.common.utils.OSLogHelper;
|
||||||
|
import net.minecraft.client.audio.ISound;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
public class CommonProxy {
|
public class CommonProxy {
|
||||||
@ -82,7 +81,7 @@ public class CommonProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void registerTileEntities() {
|
public void registerTileEntities() {
|
||||||
GameRegistry.registerTileEntity(DefenderTileEntity.class, OSRefs.RESOURCESPREFIX + "TileDefender");
|
//GameRegistry.registerTileEntity(DefenderTileEntity.class, OSRefs.RESOURCESPREFIX + "TileDefender");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -134,8 +133,8 @@ public class CommonProxy {
|
|||||||
|
|
||||||
//@Callback
|
//@Callback
|
||||||
public void registerEntities() {
|
public void registerEntities() {
|
||||||
EntityRegistry.registerModEntity(MeteorEntity.class, "meteor", 0, OrbitalSatellite.instance, 256, 3, true);
|
//EntityRegistry.registerModEntity(MeteorEntity.class, "meteor", 0, OrbitalSatellite.instance, 256, 3, true);
|
||||||
EntityRegistry.registerModEntity(LaserLightEntity.class, "LaserLightEntity", 1, OrbitalSatellite.instance, 256, 3, true);
|
//EntityRegistry.registerModEntity(LaserLightEntity.class, "LaserLightEntity", 1, OrbitalSatellite.instance, 256, 3, true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -155,4 +154,26 @@ public class CommonProxy {
|
|||||||
EntityRegistry.registerModEntity(EntityCustomArrow.class, "CustomArrow", 11, DraconicEvolution.instance, 128, 1, true);
|
EntityRegistry.registerModEntity(EntityCustomArrow.class, "CustomArrow", 11, DraconicEvolution.instance, 128, 1, true);
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ------------- Code inspiration pour le faisceau d'energie du satellite
|
||||||
|
*
|
||||||
|
public ParticleEnergyBeam energyBeam(World worldObj, double x, double y, double z, double tx, double ty, double tz, int powerFlow, boolean advanced, ParticleEnergyBeam oldBeam, boolean render, int beamType) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ParticleEnergyField energyField(World worldObj, double x, double y, double z, int type, boolean advanced, ParticleEnergyField oldBeam, boolean render) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ParticleReactorBeam reactorBeam(TileEntity tile, ParticleReactorBeam oldBeam, boolean render) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
public void spawnParticle(Object particle, int range) {}
|
||||||
|
|
||||||
|
public ISound playISound(ISound sound) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package fr.jackcartersmith.orbsat.common;
|
|||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||||
import fr.jackcartersmith.orbsat.common.block.BlockOS;
|
import fr.jackcartersmith.orbsat.common.blocks.BlockOS;
|
||||||
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
|
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -22,6 +22,8 @@ public class OSBlocks {
|
|||||||
public static BlockOS laserDef;
|
public static BlockOS laserDef;
|
||||||
|
|
||||||
public static void init(){
|
public static void init(){
|
||||||
|
|
||||||
|
/*
|
||||||
laserLow = new LaserLowBlock(Material.fire).setBlockName("obLaserLow").setBlockTextureName(OSRefs.MODID + ":laserLow").setHardness(-1.0F).setResistance(-1.0F).setLightLevel(25.0F);;
|
laserLow = new LaserLowBlock(Material.fire).setBlockName("obLaserLow").setBlockTextureName(OSRefs.MODID + ":laserLow").setHardness(-1.0F).setResistance(-1.0F).setLightLevel(25.0F);;
|
||||||
GameRegistry.registerBlock(laserLow, "ob_laserLow");
|
GameRegistry.registerBlock(laserLow, "ob_laserLow");
|
||||||
GameRegistry.registerTileEntity(LaserLowTileEntity.class, "laserLowTileEntity");
|
GameRegistry.registerTileEntity(LaserLowTileEntity.class, "laserLowTileEntity");
|
||||||
@ -61,7 +63,7 @@ public class OSBlocks {
|
|||||||
defender = new DefenderBlock(Material.anvil).setBlockName("obDefender").setBlockTextureName(OSRefs.MODID + ":defender").setLightLevel(0.2F).setResistance(25.0F).setHardness(10.0F).setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
defender = new DefenderBlock(Material.anvil).setBlockName("obDefender").setBlockTextureName(OSRefs.MODID + ":defender").setLightLevel(0.2F).setResistance(25.0F).setHardness(10.0F).setCreativeTab(OrbitalSatellite.OBCreativeTabs);
|
||||||
GameRegistry.registerBlock(defender, "ob_defender");
|
GameRegistry.registerBlock(defender, "ob_defender");
|
||||||
GameRegistry.registerTileEntity(DefenderTileEntity.class, "DefenderTileEntity");
|
GameRegistry.registerTileEntity(DefenderTileEntity.class, "DefenderTileEntity");
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,9 +1,78 @@
|
|||||||
package fr.jackcartersmith.orbsat.common;
|
package fr.jackcartersmith.orbsat.common;
|
||||||
|
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
|
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||||
|
import fr.jackcartersmith.orbsat.common.items.AdvancedExtrapolCircuit;
|
||||||
@GameRegistry.ObjectHolder(OSRefs.MODID)
|
import fr.jackcartersmith.orbsat.common.items.AdvancedTargetDevice;
|
||||||
public class OSItems {
|
import fr.jackcartersmith.orbsat.common.items.BasicExtrapolCircuit;
|
||||||
|
import fr.jackcartersmith.orbsat.common.items.BasicTargetDevice;
|
||||||
}
|
import fr.jackcartersmith.orbsat.common.items.InvolvedExtrapolCircuit;
|
||||||
|
import fr.jackcartersmith.orbsat.common.items.InvolvedTargetDevice;
|
||||||
|
import fr.jackcartersmith.orbsat.common.items.ItemOS;
|
||||||
|
import fr.jackcartersmith.orbsat.common.items.PhotonCapacitor;
|
||||||
|
import fr.jackcartersmith.orbsat.common.items.PhotonLense;
|
||||||
|
import fr.jackcartersmith.orbsat.common.items.PhotonCondenser;
|
||||||
|
import fr.jackcartersmith.orbsat.common.lib.OSRefs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
@GameRegistry.ObjectHolder(OSRefs.MODID)
|
||||||
|
public class OSItems{
|
||||||
|
public static ItemOS basicExtrapolCircuit;
|
||||||
|
public static ItemOS advancedExtrapolCircuit;
|
||||||
|
public static ItemOS involvedExtrapolCircuit;
|
||||||
|
public static ItemOS photonLense;
|
||||||
|
public static ItemOS basicTargetDevice;
|
||||||
|
public static ItemOS advancedTargetDevice;
|
||||||
|
public static ItemOS involvedTargetDevice;
|
||||||
|
public static ItemOS photonCondenser;
|
||||||
|
public static ItemOS photonCapacitor;
|
||||||
|
|
||||||
|
public static void init()
|
||||||
|
{
|
||||||
|
photonLense = new PhotonLense();
|
||||||
|
photonCondenser = new PhotonCondenser();
|
||||||
|
photonCapacitor = new PhotonCapacitor();
|
||||||
|
basicExtrapolCircuit = new BasicExtrapolCircuit();
|
||||||
|
advancedExtrapolCircuit = new AdvancedExtrapolCircuit();
|
||||||
|
involvedExtrapolCircuit = new InvolvedExtrapolCircuit();
|
||||||
|
basicTargetDevice = new BasicTargetDevice();
|
||||||
|
advancedTargetDevice = new AdvancedTargetDevice();
|
||||||
|
involvedTargetDevice = new InvolvedTargetDevice();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
//Custom ItemStacks
|
||||||
|
wyvernEnergyCore = new ItemStack(ModItems.draconiumEnergyCore, 1, 0);
|
||||||
|
draconicEnergyCore = new ItemStack(ModItems.draconiumEnergyCore, 1, 1);
|
||||||
|
wyvernFluxCapacitor = new ItemStack(ModItems.draconiumFluxCapacitor, 1, 0);
|
||||||
|
draconicFluxCapacitor = new ItemStack(ModItems.draconiumFluxCapacitor, 1, 1);
|
||||||
|
|
||||||
|
partStabFrame = new ItemStack(reactorStabilizerParts, 1, 0);
|
||||||
|
partStabRotorInner = new ItemStack(reactorStabilizerParts, 1, 1);
|
||||||
|
partStabRotorOuter = new ItemStack(reactorStabilizerParts, 1, 2);
|
||||||
|
partStabRotorAssembly = new ItemStack(reactorStabilizerParts, 1, 3);
|
||||||
|
partStabRing = new ItemStack(reactorStabilizerParts, 1, 4);
|
||||||
|
|
||||||
|
nuggetDraconium = new ItemStack(nugget, 1, 0);
|
||||||
|
nuggetAwakened = new ItemStack(nugget, 1, 1);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void register(final ItemOS item) {
|
||||||
|
String name = item.getUnwrappedUnlocalizedName(item.getUnlocalizedName());
|
||||||
|
//if (isEnabled(item)) GameRegistry.registerItem(item, name.substring(name.indexOf(":") + 1));
|
||||||
|
GameRegistry.registerItem(item, name.substring(name.indexOf(":") + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public static boolean isEnabled(Item item) {
|
||||||
|
return !ConfigHandler.disabledNamesList.contains(item.getUnlocalizedName());
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package fr.jackcartersmith.orbsat.common.block;
|
package fr.jackcartersmith.orbsat.common.blocks;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
@ -14,7 +14,7 @@ public class FMLEventHandler {
|
|||||||
if (!giftGiven && event.player.getCommandSenderName().toLowerCase().equals("jackcartersmith")) {
|
if (!giftGiven && event.player.getCommandSenderName().toLowerCase().equals("jackcartersmith")) {
|
||||||
giftGiven = true;
|
giftGiven = true;
|
||||||
event.player.addChatComponentMessage(new ChatComponentText("Hello Jack! Take your personal satellite !"));
|
event.player.addChatComponentMessage(new ChatComponentText("Hello Jack! Take your personal satellite !"));
|
||||||
event.player.worldObj.spawnEntityInWorld(new EntityItem(event.player.worldObj, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(ModItems.dezilsMarshmallow)));
|
//event.player.worldObj.spawnEntityInWorld(new EntityItem(event.player.worldObj, event.player.posX, event.player.posY, event.player.posZ, new ItemStack(ModItems.dezilsMarshmallow)));
|
||||||
}
|
}
|
||||||
|
|
||||||
//ContributorHandler.onPlayerLogin(event);
|
//ContributorHandler.onPlayerLogin(event);
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.common.items;
|
||||||
|
|
||||||
|
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||||
|
import fr.jackcartersmith.orbsat.common.OSItems;
|
||||||
|
import fr.jackcartersmith.orbsat.common.lib.OSStrings;
|
||||||
|
|
||||||
|
public class AdvancedExtrapolCircuit extends ItemOS{
|
||||||
|
public AdvancedExtrapolCircuit() {
|
||||||
|
this.setUnlocalizedName(OSStrings.advancedExtrapolCircuitName);
|
||||||
|
this.setCreativeTab(OrbitalSatellite.OSCreaTab);
|
||||||
|
OSItems.register(this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.common.items;
|
||||||
|
|
||||||
|
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||||
|
import fr.jackcartersmith.orbsat.common.OSItems;
|
||||||
|
import fr.jackcartersmith.orbsat.common.lib.OSStrings;
|
||||||
|
|
||||||
|
public class AdvancedTargetDevice extends ItemOS{
|
||||||
|
public AdvancedTargetDevice() {
|
||||||
|
this.setUnlocalizedName(OSStrings.advancedTargetDeviceName);
|
||||||
|
this.setCreativeTab(OrbitalSatellite.OSCreaTab);
|
||||||
|
OSItems.register(this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.common.items;
|
||||||
|
|
||||||
|
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||||
|
import fr.jackcartersmith.orbsat.common.OSItems;
|
||||||
|
import fr.jackcartersmith.orbsat.common.lib.OSStrings;
|
||||||
|
|
||||||
|
public class BasicExtrapolCircuit extends ItemOS{
|
||||||
|
public BasicExtrapolCircuit() {
|
||||||
|
this.setUnlocalizedName(OSStrings.basicExtrapolCircuitName);
|
||||||
|
this.setCreativeTab(OrbitalSatellite.OSCreaTab);
|
||||||
|
OSItems.register(this);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package fr.jackcartersmith.orbsat.common.items;
|
||||||
|
|
||||||
|
import fr.jackcartersmith.orbsat.OrbitalSatellite;
|
||||||
|
import fr.jackcartersmith.orbsat.common.OSItems;
|
||||||
|
import fr.jackcartersmith.orbsat.common.lib.OSStrings;
|
||||||
|
|
||||||
|
public class BasicTargetDevice extends ItemOS{
|
||||||
|
public BasicTargetDevice() {
|
||||||
|
this.setUnlocalizedName(OSStrings.basicTargetDeviceName);
|
||||||
|
this.setCreativeTab(OrbitalSatellite.OSCreaTab);
|
||||||
|
OSItems.register(this);
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user