Skip to content

Commit 446fb11

Browse files
committed
Merge pull request #1 from micdoodle8/master
Sync fork with trunk
2 parents c5d40b8 + df633e3 commit 446fb11

File tree

608 files changed

+5503
-7303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

608 files changed

+5503
-7303
lines changed

build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ ext.coreFiles = ['micdoodle8/mods/galacticraft/api/**',
7878

7979
// Keep a list of planets addon files/directories for easy jar packing
8080
ext.planetsFiles = ['micdoodle8/mods/galacticraft/planets/**',
81-
'assets/galacticraftmars/**']
81+
'assets/galacticraftmars/**',
82+
'assets/galacticraftasteroids/**']
8283

8384
// Keep a list of coremod files/directories for easy jar packing
8485
ext.micdoodleCoreFiles = ['**/micdoodlecore_at.cfg',

src/main/java/micdoodle8/mods/galacticraft/api/entity/IRocketType.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
package micdoodle8.mods.galacticraft.api.entity;
22

3+
import net.minecraft.util.StatCollector;
4+
5+
36
public interface IRocketType
47
{
58
public static enum EnumRocketType
69
{
710
DEFAULT(0, "", false, 2),
8-
INVENTORY27(1, "Storage Space: 18", false, 20),
9-
INVENTORY36(2, "Storage Space: 36", false, 38),
10-
INVENTORY54(3, "Storage Space: 54", false, 56),
11-
PREFUELED(4, "Pre-fueled", true, 2);
11+
INVENTORY27(1, StatCollector.translateToLocal("gui.rocketType.0"), false, 20),
12+
INVENTORY36(2, StatCollector.translateToLocal("gui.rocketType.1"), false, 38),
13+
INVENTORY54(3, StatCollector.translateToLocal("gui.rocketType.2"), false, 56),
14+
PREFUELED(4, StatCollector.translateToLocal("gui.rocketType.3"), true, 2);
1215

1316
private int index;
1417
private String tooltip;
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
/**
2-
* package-info.java
3-
*
4-
* This file is part of the Galacticraft project
5-
*
6-
* @author micdoodle8
7-
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
8-
*
9-
*/
1+
2+
103
@API(apiVersion = "1.0", owner = "GalacticraftCore", provides = "Galacticraft API")
114
package micdoodle8.mods.galacticraft.api;
125

13-
import cpw.mods.fml.common.API;
6+
import cpw.mods.fml.common.API;
7+

src/main/java/micdoodle8/mods/galacticraft/api/power/IEnergyHandlerGC.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public interface IEnergyHandlerGC
1212
* @param simulate If true, the transfer will only be simulated.
1313
* @return The amount of energy that was successfully received (or would have been, if simulated).
1414
*/
15-
public int receiveEnergyGC(EnergySource from, int amount, boolean simulate);
15+
public float receiveEnergyGC(EnergySource from, float amount, boolean simulate);
1616

1717
/**
1818
* Remove energy, transferring it to an external source
@@ -22,7 +22,7 @@ public interface IEnergyHandlerGC
2222
* @param simulate If true, the transfer will only be simulated.
2323
* @return The amount of energy that was successfully extracted (or would have been, if simulated).
2424
*/
25-
public int extractEnergyGC(EnergySource from, int amount, boolean simulate);
25+
public float extractEnergyGC(EnergySource from, float amount, boolean simulate);
2626

2727
/**
2828
* Returns true if the handler can interface with the provided energy source
@@ -32,10 +32,10 @@ public interface IEnergyHandlerGC
3232
/**
3333
* Returns the amount of energy stored in this handler available to the provided source
3434
*/
35-
public int getEnergyStoredGC(EnergySource from);
35+
public float getEnergyStoredGC(EnergySource from);
3636

3737
/**
3838
* Returns the maximum amount of energy stored in this handler available to the provided source
3939
*/
40-
public int getMaxEnergyStoredGC(EnergySource from);
40+
public float getMaxEnergyStoredGC(EnergySource from);
4141
}

src/main/java/micdoodle8/mods/galacticraft/api/power/IEnergyStorageGC.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public interface IEnergyStorageGC
99
* @param simulate If true, the transfer will only be simulated.
1010
* @return The amount of energy that was successfully received (or would have been, if simulated).
1111
*/
12-
public int receiveEnergyGC(int amount, boolean simulate);
12+
public float receiveEnergyGC(float amount, boolean simulate);
1313

1414
/**
1515
* Remove energy from the storage.
@@ -18,15 +18,15 @@ public interface IEnergyStorageGC
1818
* @param simulate If true, the transfer will only be simulated.
1919
* @return The amount of energy that was successfully extracted (or would have been, if simulated).
2020
*/
21-
public int extractEnergyGC(int amount, boolean simulate);
21+
public float extractEnergyGC(float amount, boolean simulate);
2222

2323
/**
2424
* Returns the amount of energy stored
2525
*/
26-
public int getEnergyStoredGC();
26+
public float getEnergyStoredGC();
2727

2828
/**
2929
* Returns the maximum amount of energy stored
3030
*/
31-
public int getCapacityGC();
31+
public float getCapacityGC();
3232
}

src/main/java/micdoodle8/mods/galacticraft/api/prefab/entity/EntityAutoRocket.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.util.List;
88

99
import micdoodle8.mods.galacticraft.api.entity.IDockable;
10-
import micdoodle8.mods.galacticraft.api.entity.ICargoEntity.EnumCargoLoadingState;
1110
import micdoodle8.mods.galacticraft.api.tile.IFuelDock;
1211
import micdoodle8.mods.galacticraft.api.tile.ILandingPadAttachable;
1312
import micdoodle8.mods.galacticraft.api.vector.Vector3;
@@ -20,6 +19,7 @@
2019
import micdoodle8.mods.galacticraft.core.network.IPacketReceiver;
2120
import micdoodle8.mods.galacticraft.core.tile.TileEntityFuelLoader;
2221
import micdoodle8.mods.galacticraft.core.tile.TileEntityLandingPad;
22+
import micdoodle8.mods.galacticraft.core.util.GCCoreUtil;
2323
import net.minecraft.block.Block;
2424
import net.minecraft.entity.player.EntityPlayer;
2525
import net.minecraft.inventory.IInventory;
@@ -28,7 +28,6 @@
2828
import net.minecraft.nbt.NBTTagList;
2929
import net.minecraft.tileentity.TileEntity;
3030
import net.minecraft.util.MathHelper;
31-
import net.minecraft.util.StatCollector;
3231
import net.minecraft.world.World;
3332
import net.minecraft.world.WorldServer;
3433
import net.minecraftforge.common.MinecraftForge;
@@ -686,8 +685,8 @@ public void onLaunch()
686685
{
687686
if (!(this.worldObj.provider instanceof IOrbitDimension) && this.riddenByEntity != null && this.riddenByEntity instanceof GCEntityPlayerMP)
688687
{
689-
((GCEntityPlayerMP) this.riddenByEntity).setCoordsTeleportedFromX(this.riddenByEntity.posX);
690-
((GCEntityPlayerMP) this.riddenByEntity).setCoordsTeleportedFromZ(this.riddenByEntity.posZ);
688+
((GCEntityPlayerMP) this.riddenByEntity).getPlayerStats().coordsTeleportedFromX = this.riddenByEntity.posX;
689+
((GCEntityPlayerMP) this.riddenByEntity).getPlayerStats().coordsTeleportedFromZ = this.riddenByEntity.posZ;
691690
}
692691

693692
int amountRemoved = 0;
@@ -722,7 +721,7 @@ public void onLaunch()
722721

723722
//Set the player's launchpad item for return on landing - or null if launchpads not removed
724723
if (this.riddenByEntity != null && this.riddenByEntity instanceof GCEntityPlayerMP)
725-
((GCEntityPlayerMP) this.riddenByEntity).setLaunchpadStack((amountRemoved == 9) ? new ItemStack(GCBlocks.landingPad, 9, 0) : null);
724+
((GCEntityPlayerMP) this.riddenByEntity).getPlayerStats().launchpadStack = (amountRemoved == 9) ? new ItemStack(GCBlocks.landingPad, 9, 0) : null;
726725

727726
this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
728727
}
@@ -1042,7 +1041,7 @@ public void setInventorySlotContents(int par1, ItemStack par2ItemStack)
10421041
@Override
10431042
public String getInventoryName()
10441043
{
1045-
return StatCollector.translateToLocal("container.spaceship.name");
1044+
return GCCoreUtil.translate("container.spaceship.name");
10461045
}
10471046

10481047
@Override

src/main/java/micdoodle8/mods/galacticraft/api/prefab/entity/EntitySpaceshipBase.java

-4
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@
88
import micdoodle8.mods.galacticraft.api.GalacticraftRegistry;
99
import micdoodle8.mods.galacticraft.api.world.IExitHeight;
1010
import micdoodle8.mods.galacticraft.core.GalacticraftCore;
11-
import micdoodle8.mods.galacticraft.core.entities.player.GCEntityPlayerMP;
1211
import micdoodle8.mods.galacticraft.core.network.IPacketReceiver;
1312
import micdoodle8.mods.galacticraft.core.network.PacketDynamic;
14-
import micdoodle8.mods.galacticraft.core.network.PacketSimple;
15-
import micdoodle8.mods.galacticraft.core.network.PacketSimple.EnumSimplePacket;
1613
import micdoodle8.mods.galacticraft.core.util.ConfigManagerCore;
1714
import micdoodle8.mods.galacticraft.core.util.DamageSourceGC;
1815
import net.minecraft.entity.Entity;
1916
import net.minecraft.entity.player.EntityPlayer;
20-
import net.minecraft.entity.player.EntityPlayerMP;
2117
import net.minecraft.item.ItemStack;
2218
import net.minecraft.nbt.NBTTagCompound;
2319
import net.minecraft.util.AxisAlignedBB;

src/main/java/micdoodle8/mods/galacticraft/api/prefab/entity/EntityTieredRocket.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import java.util.HashMap;
77
import java.util.Map.Entry;
88

9-
import org.lwjgl.input.Keyboard;
10-
119
import micdoodle8.mods.galacticraft.api.entity.ICameraZoomEntity;
1210
import micdoodle8.mods.galacticraft.api.entity.IDockable;
1311
import micdoodle8.mods.galacticraft.api.entity.IRocketType;
@@ -30,6 +28,8 @@
3028
import net.minecraft.world.World;
3129
import net.minecraft.world.WorldServer;
3230

31+
import org.lwjgl.input.Keyboard;
32+
3333
import cpw.mods.fml.common.FMLCommonHandler;
3434
import cpw.mods.fml.common.Loader;
3535

@@ -280,8 +280,8 @@ public void onReachAtmoshpere()
280280
}
281281

282282
GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_UPDATE_DIMENSION_LIST, new Object[] { player.getGameProfile().getName(), temp }), player);
283-
player.setSpaceshipTier(this.getRocketTier());
284-
player.setUsingPlanetGui();
283+
player.getPlayerStats().spaceshipTier = this.getRocketTier();
284+
player.getPlayerStats().usingPlanetSelectionGui = true;
285285

286286
this.onTeleport(player);
287287
player.mountEntity(this);
@@ -339,7 +339,7 @@ public boolean interactFirst(EntityPlayer par1EntityPlayer)
339339
if (!this.worldObj.isRemote)
340340
{
341341
GalacticraftCore.packetPipeline.sendTo(new PacketSimple(EnumSimplePacket.C_RESET_THIRD_PERSON, new Object[] { ((EntityPlayerMP) this.riddenByEntity).getGameProfile().getName() }), (EntityPlayerMP) par1EntityPlayer);
342-
((GCEntityPlayerMP) par1EntityPlayer).setChatCooldown(0);
342+
((GCEntityPlayerMP) par1EntityPlayer).getPlayerStats().chatCooldown = 0;
343343
par1EntityPlayer.mountEntity(null);
344344
}
345345

@@ -353,7 +353,7 @@ else if (par1EntityPlayer instanceof GCEntityPlayerMP)
353353
par1EntityPlayer.addChatMessage(new ChatComponentText("A / D - Turn left-right"));
354354
par1EntityPlayer.addChatMessage(new ChatComponentText("W / S - Turn up-down"));
355355
par1EntityPlayer.addChatMessage(new ChatComponentText(Keyboard.getKeyName(KeyHandlerClient.openFuelGui.getKeyCode()) + " - Inventory / Fuel"));
356-
((GCEntityPlayerMP) par1EntityPlayer).setChatCooldown(0);
356+
((GCEntityPlayerMP) par1EntityPlayer).getPlayerStats().chatCooldown = 0;
357357
par1EntityPlayer.mountEntity(this);
358358
}
359359

src/main/java/micdoodle8/mods/galacticraft/api/recipe/CompressorRecipes.java

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import java.util.List;
77

88
import net.minecraft.block.Block;
9-
import net.minecraft.init.Items;
109
import net.minecraft.inventory.IInventory;
1110
import net.minecraft.item.Item;
1211
import net.minecraft.item.ItemStack;

src/main/java/micdoodle8/mods/galacticraft/api/transmission/ElectricalEvent.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ public ElectricityProduceEvent(IElectrical tileEntity)
3131
public static class NetworkEvent extends ElectricalEvent
3232
{
3333
public final IElectricityNetwork network;
34-
public ElectricityPack electricityPack;
34+
public float energy;
3535
public TileEntity[] ignoreTiles;
3636

37-
public NetworkEvent(IElectricityNetwork network, ElectricityPack electricityPack, TileEntity... ignoreTiles)
37+
public NetworkEvent(IElectricityNetwork network, float energy, TileEntity... ignoreTiles)
3838
{
3939
this.network = network;
40-
this.electricityPack = electricityPack;
40+
this.energy = energy;
4141
this.ignoreTiles = ignoreTiles;
4242
}
4343
}
@@ -52,17 +52,17 @@ public NetworkEvent(IElectricityNetwork network, ElectricityPack electricityPack
5252
@Cancelable
5353
public static class ElectricityProductionEvent extends NetworkEvent
5454
{
55-
public ElectricityProductionEvent(IElectricityNetwork network, ElectricityPack electricityPack, TileEntity... ignoreTiles)
55+
public ElectricityProductionEvent(IElectricityNetwork network, float energy, TileEntity... ignoreTiles)
5656
{
57-
super(network, electricityPack, ignoreTiles);
57+
super(network, energy, ignoreTiles);
5858
}
5959
}
6060

6161
public static class ElectricityRequestEvent extends NetworkEvent
6262
{
63-
public ElectricityRequestEvent(IElectricityNetwork network, ElectricityPack electricityPack, TileEntity... ignoreTiles)
63+
public ElectricityRequestEvent(IElectricityNetwork network, float energy, TileEntity... ignoreTiles)
6464
{
65-
super(network, electricityPack, ignoreTiles);
65+
super(network, energy, ignoreTiles);
6666
}
6767
}
6868

0 commit comments

Comments
 (0)