v4.0.9 Release
Bugfixes! *Added range packets for machines. *Fixed machines changing facing after you go more than 40 blocks away. *Updated IC2 hooks to run on startup. *Fixed gold dust turning into iron ingots in Platinum Compressor when IC2 is installed. *Fixed iron dust turning into gold ingots in Platinum Compressor when IC2 is installed. *Fixed machine blockNames. *Added smelting for Platinum Dust to turn into Platinum Ingots. *Added macerator recipe for Platinum ore to turn into 2 Platinum Dust. *Fixed block creative tab. *Bumped version to 4.0.9.
This commit is contained in:
parent
435fd3e24a
commit
a398fb9631
6 changed files with 63 additions and 12 deletions
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 15 KiB |
|
@ -17,6 +17,7 @@ public class BlockMachine extends BlockContainer
|
|||
super(id, Material.iron);
|
||||
setHardness(3.5F);
|
||||
setResistance(8F);
|
||||
setCreativeTab(CreativeTabs.tabDeco);
|
||||
}
|
||||
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityliving)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package net.uberkat.obsidian.common;
|
||||
|
||||
import ic2.api.Ic2Recipes;
|
||||
import net.minecraft.src.*;
|
||||
|
||||
/**
|
||||
|
@ -22,8 +23,10 @@ public class ObsidianHooks
|
|||
|
||||
if(IC2Loaded)
|
||||
{
|
||||
IC2IronDust = getIC2Item("goldDust", false);
|
||||
IC2GoldDust = getIC2Item("ironDust", false);
|
||||
IC2IronDust = getIC2Item("ironDust", false);
|
||||
IC2GoldDust = getIC2Item("goldDust", false);
|
||||
|
||||
Ic2Recipes.addMaceratorRecipe(new ItemStack(ObsidianIngots.MultiBlock, 1, 0), new ItemStack(ObsidianIngots.PlatinumDust, 2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import cpw.mods.fml.common.registry.TickRegistry;
|
|||
* @author AidanBrady
|
||||
*
|
||||
*/
|
||||
@Mod(modid = "ObsidianIngots", name = "Obsidian Ingots", version = "4.0.8")
|
||||
@Mod(modid = "ObsidianIngots", name = "Obsidian Ingots", version = "4.0.9")
|
||||
@NetworkMod(channels = { "ObsidianIngots" }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
|
||||
public class ObsidianIngots
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ public class ObsidianIngots
|
|||
public static Configuration configuration;
|
||||
|
||||
/** Obsidian Ingots version number */
|
||||
public static Version versionNumber = new Version(4, 0, 8);
|
||||
public static Version versionNumber = new Version(4, 0, 9);
|
||||
|
||||
/** The latest version number which is received from the Obsidian Ingots server */
|
||||
public static String latestVersionNumber;
|
||||
|
@ -486,6 +486,7 @@ public class ObsidianIngots
|
|||
|
||||
//Smelting
|
||||
GameRegistry.addSmelting(new ItemStack(MultiBlock, 1, 0).itemID, new ItemStack(PlatinumIngot), 1.0F);
|
||||
GameRegistry.addSmelting(PlatinumDust.shiftedIndex, new ItemStack(PlatinumIngot, 1), 1.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -800,12 +801,12 @@ public class ObsidianIngots
|
|||
ObsidianTNT = new BlockObsidianTNT(obsidianTNTID).setBlockName("ObsidianTNT").setCreativeTab(CreativeTabs.tabBlock);
|
||||
if(extrasEnabled == true)
|
||||
{
|
||||
TheoreticalElementizer = new BlockTheoreticalElementizer(elementizerID).setBlockName("TheoreticalElementizer").setCreativeTab(CreativeTabs.tabBlock);
|
||||
TheoreticalElementizer = new BlockTheoreticalElementizer(elementizerID).setBlockName("TheoreticalElementizer");
|
||||
}
|
||||
EnrichmentChamber = new BlockEnrichmentChamber(enrichmentChamberID).setBlockName("EnrichmentChamberIdle").setCreativeTab(CreativeTabs.tabBlock);
|
||||
PlatinumCompressor = new BlockPlatinumCompressor(platinumCompressorID).setBlockName("PlatinumCompressorIdle").setCreativeTab(CreativeTabs.tabBlock);
|
||||
Combiner = new BlockCombiner(combinerID).setBlockName("CombinerIdle").setCreativeTab(CreativeTabs.tabBlock);
|
||||
Crusher = new BlockCrusher(crusherID).setBlockName("CrusherIdle").setCreativeTab(CreativeTabs.tabBlock);
|
||||
EnrichmentChamber = new BlockEnrichmentChamber(enrichmentChamberID).setBlockName("EnrichmentChamber");
|
||||
PlatinumCompressor = new BlockPlatinumCompressor(platinumCompressorID).setBlockName("PlatinumCompressor");
|
||||
Combiner = new BlockCombiner(combinerID).setBlockName("Combiner");
|
||||
Crusher = new BlockCrusher(crusherID).setBlockName("Crusher");
|
||||
|
||||
//Registrations
|
||||
GameRegistry.registerBlock(ObsidianTNT);
|
||||
|
@ -872,7 +873,10 @@ public class ObsidianIngots
|
|||
@PostInit
|
||||
public void postInit(FMLPostInitializationEvent event)
|
||||
{
|
||||
hooks = new ObsidianHooks();
|
||||
hooks.hook();
|
||||
addIntegratedItems();
|
||||
System.out.println("[ObsidianIngots] Hooking complete.");
|
||||
}
|
||||
|
||||
@PreInit
|
||||
|
@ -893,9 +897,6 @@ public class ObsidianIngots
|
|||
proxy.loadTickHandler();
|
||||
|
||||
//Hook with mods Obsidian Ingots has implemented
|
||||
hooks = new ObsidianHooks();
|
||||
hooks.hook();
|
||||
System.out.println("[ObsidianIngots] Hooking complete.");
|
||||
|
||||
//Add all items
|
||||
addItems();
|
||||
|
|
|
@ -133,6 +133,35 @@ public class PacketHandler implements IPacketHandler
|
|||
}
|
||||
}
|
||||
|
||||
public static void sendMachinePacketWithRange(TileEntityMachine sender, double distance)
|
||||
{
|
||||
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
|
||||
DataOutputStream output = new DataOutputStream(bytes);
|
||||
|
||||
try {
|
||||
output.writeInt(2);
|
||||
output.writeInt(sender.xCoord);
|
||||
output.writeInt(sender.yCoord);
|
||||
output.writeInt(sender.zCoord);
|
||||
output.writeInt(sender.facing);
|
||||
output.writeByte(sender.isActive ? 1 : 0);
|
||||
output.writeInt(sender.machineBurnTime);
|
||||
output.writeInt(sender.machineCookTime);
|
||||
output.writeInt(sender.currentItemBurnTime);
|
||||
} catch (IOException e)
|
||||
{
|
||||
System.err.println("[ObsidianIngots] Error while writing tile entity packet.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Packet250CustomPayload packet = new Packet250CustomPayload();
|
||||
packet.channel = "ObsidianIngots";
|
||||
packet.data = bytes.toByteArray();
|
||||
packet.length = packet.data.length;
|
||||
|
||||
PacketDispatcher.sendPacketToAllAround(sender.xCoord, sender.yCoord, sender.zCoord, distance, sender.worldObj.provider.worldType, packet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends the server the defined packet data int.
|
||||
* @param type - packet type
|
||||
|
|
|
@ -51,6 +51,9 @@ public abstract class TileEntityMachine extends TileEntity implements IInventory
|
|||
/** An integer that constantly cycles from 0 to 15. Used for animated textures. */
|
||||
public int textureIndex = 0;
|
||||
|
||||
/** Amount of ticks passed since Tile Entity init. Used for update packets. */
|
||||
public int packetTick = 0;
|
||||
|
||||
/**
|
||||
* Instance of TileEntityMachine. Extend this for a head start on machine making.
|
||||
* @param time - time it takes to smelt an item
|
||||
|
@ -94,6 +97,8 @@ public abstract class TileEntityMachine extends TileEntity implements IInventory
|
|||
}
|
||||
updateTick();
|
||||
|
||||
updatePacketTick();
|
||||
|
||||
if(machineCookTime == 0 || machineCookTime == maxBurnTime && currentItemBurnTime != 0)
|
||||
{
|
||||
currentItemBurnTime = 0;
|
||||
|
@ -118,6 +123,18 @@ public abstract class TileEntityMachine extends TileEntity implements IInventory
|
|||
}
|
||||
}
|
||||
|
||||
public void updatePacketTick()
|
||||
{
|
||||
if(packetTick % 100 == 0)
|
||||
{
|
||||
packetTick++;
|
||||
PacketHandler.sendMachinePacketWithRange(this, 50);
|
||||
}
|
||||
else {
|
||||
packetTick++;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see when to run updateTexture(). Called every tick, but functions every 3.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue