Removed Errors from Atomic Module Block section
This commit is contained in:
parent
28db0ec6d3
commit
23f4cb743c
9 changed files with 239 additions and 231 deletions
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,4 +1,4 @@
|
|||
#Mon Dec 23 19:14:25 EST 2013
|
||||
#Fri Jul 25 09:02:44 EDT 2014
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
package resonantinduction.atomic;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import resonant.content.loader.ModManager;
|
||||
import resonant.engine.content.debug.TileCreativeBuilder;
|
||||
import resonant.lib.network.discriminator.PacketAnnotation;
|
||||
import resonant.lib.network.discriminator.PacketAnnotationManager;
|
||||
import resonantinduction.atomic.blocks.TileElectromagnet;
|
||||
import resonantinduction.atomic.items.ItemDarkMatter;
|
||||
import resonantinduction.atomic.items.ItemHazmat;
|
||||
|
@ -9,7 +18,7 @@ import resonantinduction.atomic.machine.plasma.BlockPlasmaHeater;
|
|||
import resonantinduction.atomic.machine.plasma.TilePlasma;
|
||||
import resonantinduction.atomic.machine.quantum.TileQuantumAssembler;
|
||||
import resonantinduction.atomic.schematic.SchematicBreedingReactor;
|
||||
import ic2.api.item.Items;
|
||||
import universalelectricity.core.transform.vector.VectorWorld;
|
||||
import ic2.api.recipe.IRecipeInput;
|
||||
import ic2.api.recipe.RecipeOutput;
|
||||
import ic2.api.recipe.Recipes;
|
||||
|
@ -25,7 +34,6 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumMovingObjectType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
|
@ -35,8 +43,6 @@ 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.event.Event.Result;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
|
@ -49,11 +55,6 @@ import resonant.api.IElectromagnet;
|
|||
import resonant.api.event.PlasmaEvent.SpawnPlasmaEvent;
|
||||
import resonant.api.recipe.QuantumAssemblerRecipes;
|
||||
import resonant.core.content.debug.BlockCreativeBuilder;
|
||||
import resonant.lib.content.ContentRegistry;
|
||||
import resonant.lib.flag.FlagRegistry;
|
||||
import resonant.lib.modproxy.ProxyHandler;
|
||||
import resonant.lib.network.PacketAnnotation;
|
||||
import resonant.lib.network.PacketHandler;
|
||||
import resonant.lib.prefab.block.BlockRadioactive;
|
||||
import resonant.lib.prefab.ore.OreGenBase;
|
||||
import resonant.lib.prefab.ore.OreGenReplaceStone;
|
||||
|
@ -121,8 +122,8 @@ public class Atomic
|
|||
public static final EnumArmorMaterial hazmatArmorMaterial = EnumHelper.addArmorMaterial("HAZMAT", 0, new int[]
|
||||
{ 0, 0, 0, 0 }, 0);
|
||||
public static final String BAN_ANTIMATTER_POWER = FlagRegistry.registerFlag("ban_antimatter_power");
|
||||
public static final String NAME = Reference.NAME + " Atomic";
|
||||
public static final ContentRegistry contentRegistry = new ContentRegistry(Settings.config, Settings.idManager, ID).setPrefix(Reference.PREFIX).setTab(ResonantTab.DEFAULT);
|
||||
public static final String NAME = Reference.name() + " Atomic";
|
||||
public static final ModManager contentRegistry = new ModManager().setPrefix(Reference.prefix()).setTab(ResonantTab.tab());
|
||||
private static final String[] SUPPORTED_LANGUAGES = new String[]
|
||||
{ "en_US", "pl_PL", "de_DE", "ru_RU" };
|
||||
|
||||
|
@ -132,8 +133,6 @@ public class Atomic
|
|||
@SidedProxy(clientSide = "ClientProxy", serverSide = "CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
public ProxyHandler modproxies;
|
||||
|
||||
@Mod.Metadata(ID)
|
||||
public static ModMetadata metadata;
|
||||
|
||||
|
@ -155,12 +154,11 @@ public class Atomic
|
|||
public static Block blockQuantumAssembler;
|
||||
public static Block blockReactorCell;
|
||||
|
||||
/** Cells */
|
||||
public static Block blockUraniumOre;
|
||||
|
||||
//items
|
||||
public static Item itemCell, itemFissileFuel, itemBreedingRod, itemDarkMatter, itemAntimatter, itemDeuteriumCell, itemTritiumCell, itemWaterCell;
|
||||
public static Item itemBucketToxic;
|
||||
|
||||
/** Uranium Related Items */
|
||||
public static Block blockUraniumOre;
|
||||
public static Item itemYellowCake;
|
||||
public static Item itemUranium;
|
||||
public static Item itemHazmatTop;
|
||||
|
@ -239,28 +237,19 @@ public class Atomic
|
|||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
modproxies = new ProxyHandler();
|
||||
INSTANCE = this;
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
NetworkRegistry.instance().registerGuiHandler(this, proxy);
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
||||
|
||||
PacketAnnotation.register(TileElectricTurbine.class);
|
||||
PacketAnnotation.register(TileReactorCell.class);
|
||||
PacketAnnotation.register(TileThermometer.class);
|
||||
|
||||
BlockCreativeBuilder.register(new SchematicAccelerator());
|
||||
BlockCreativeBuilder.register(new SchematicBreedingReactor());
|
||||
BlockCreativeBuilder.register(new SchematicFissionReactor());
|
||||
BlockCreativeBuilder.register(new SchematicFusionReactor());
|
||||
|
||||
TileCreativeBuilder.register(new SchematicAccelerator());
|
||||
TileCreativeBuilder.register(new SchematicBreedingReactor());
|
||||
TileCreativeBuilder.register(new SchematicFissionReactor());
|
||||
TileCreativeBuilder.register(new SchematicFusionReactor());
|
||||
|
||||
Settings.config.load();
|
||||
|
||||
/** Register Packets */
|
||||
PacketAnnotation.register(TileAccelerator.class);
|
||||
PacketAnnotation.register(TileChemicalExtractor.class);
|
||||
PacketAnnotation.register(TileNuclearBoiler.class);
|
||||
PacketAnnotation.register(TileElectricTurbine.class);
|
||||
|
||||
/** Registers Gases & Fluids */
|
||||
FLUID_URANIUM_HEXAFLOURIDE = new Fluid("uraniumhexafluoride").setGaseous(true);
|
||||
FLUID_STEAM = new Fluid("steam").setGaseous(true);
|
||||
|
@ -285,15 +274,15 @@ public class Atomic
|
|||
FLUIDSTACK_TOXIC_WASTE = new FluidStack(FluidRegistry.getFluidID("toxicwaste"), 0);
|
||||
|
||||
/** Block Initiation */
|
||||
blockRadioactive = contentRegistry.createBlock(BlockRadioactive.class).setUnlocalizedName(Reference.PREFIX + "radioactive").setTextureName(Reference.PREFIX + "radioactive").setCreativeTab(ResonantTab.DEFAULT);
|
||||
blockUraniumOre = contentRegistry.createBlock(BlockUraniumOre.class);
|
||||
blockRadioactive = new BlockRadioactive().setUnlocalizedName(Reference.prefix() + "radioactive").setTextureName(Reference.prefix() + "radioactive").setCreativeTab(CreativeTabs.tabBlock);
|
||||
blockUraniumOre = new BlockUraniumOre();
|
||||
|
||||
blockElectricTurbine = contentRegistry.createTile(BlockElectricTurbine.class, TileElectricTurbine.class);
|
||||
blockCentrifuge = contentRegistry.createTile(BlockCentrifuge.class, TileCentrifuge.class);
|
||||
blockElectricTurbine = contentRegistry.newBlock(TileElectricTurbine.class);
|
||||
blockCentrifuge = contentRegistry.newBlock(TileCentrifuge.class);
|
||||
blockReactorCell = contentRegistry.newBlock(TileReactorCell.class);
|
||||
blockNuclearBoiler = contentRegistry.createTile(BlockNuclearBoiler.class, TileNuclearBoiler.class);
|
||||
blockChemicalExtractor = contentRegistry.createTile(BlockChemicalExtractor.class, TileChemicalExtractor.class);
|
||||
blockFusionCore = contentRegistry.createTile(BlockPlasmaHeater.class, TilePlasmaHeater.class);
|
||||
blockNuclearBoiler = contentRegistry.newBlock(TileNuclearBoiler.class);
|
||||
blockChemicalExtractor = contentRegistry.newBlock(TileChemicalExtractor.class);
|
||||
blockFusionCore = contentRegistry.newBlock(BlockPlasmaHeater.class, TilePlasmaHeater.class);
|
||||
blockControlRod = contentRegistry.newBlock(TileControlRod.class);
|
||||
blockThermometer = contentRegistry.newBlock(TileThermometer.class);
|
||||
blockPlasma = contentRegistry.newBlock(TilePlasma.class);
|
||||
|
@ -371,19 +360,13 @@ public class Atomic
|
|||
OreDictionary.registerOre("antimatterMilligram", new ItemStack(itemAntimatter, 1, 0));
|
||||
OreDictionary.registerOre("antimatterGram", new ItemStack(itemAntimatter, 1, 1));
|
||||
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(this, new LoadingCallback()
|
||||
{
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(this, new LoadingCallback() {
|
||||
@Override
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world)
|
||||
{
|
||||
for (Ticket ticket : tickets)
|
||||
{
|
||||
if (ticket.getType() == Type.ENTITY)
|
||||
{
|
||||
if (ticket.getEntity() != null)
|
||||
{
|
||||
if (ticket.getEntity() instanceof EntityParticle)
|
||||
{
|
||||
public void ticketsLoaded(List<Ticket> tickets, World world) {
|
||||
for (Ticket ticket : tickets) {
|
||||
if (ticket.getType() == Type.ENTITY) {
|
||||
if (ticket.getEntity() != null) {
|
||||
if (ticket.getEntity() instanceof EntityParticle) {
|
||||
((EntityParticle) ticket.getEntity()).updateTicket = ticket;
|
||||
}
|
||||
}
|
||||
|
@ -391,8 +374,6 @@ public class Atomic
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
proxy.preInit();
|
||||
Settings.config.save();
|
||||
ResonantTab.ITEMSTACK = new ItemStack(blockReactorCell);
|
||||
}
|
||||
|
@ -402,7 +383,6 @@ public class Atomic
|
|||
{
|
||||
Settings.setModMetadata(metadata, ID, NAME, ResonantInduction.ID);
|
||||
proxy.init();
|
||||
modproxies.init();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -517,13 +497,13 @@ public class Atomic
|
|||
|
||||
// Hazmat Suit
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(itemHazmatTop, new Object[]
|
||||
{ "SSS", "BAB", "SCS", 'A', Item.helmetLeather, 'C', UniversalRecipe.CIRCUIT_T1.get(Settings.allowAlternateRecipes), 'S', Block.cloth }));
|
||||
{ "SSS", "BAB", "SCS", 'A', Items.leather_helmet, 'C', UniversalRecipe.CIRCUIT_T1.get(), 'S', Blocks.wool }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(itemHazmatBody, new Object[]
|
||||
{ "SSS", "BAB", "SCS", 'A', Item.plateLeather, 'C', UniversalRecipe.CIRCUIT_T1.get(Settings.allowAlternateRecipes), 'S', Block.cloth }));
|
||||
{ "SSS", "BAB", "SCS", 'A', Items.leather_chestplate, 'C', UniversalRecipe.CIRCUIT_T1.get(), 'S', Blocks.wool }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(itemHazmatLeggings, new Object[]
|
||||
{ "SSS", "BAB", "SCS", 'A', Item.legsLeather, 'C', UniversalRecipe.CIRCUIT_T1.get(Settings.allowAlternateRecipes), 'S', Block.cloth }));
|
||||
{ "SSS", "BAB", "SCS", 'A', Items.leather_leggings, 'C', UniversalRecipe.CIRCUIT_T1.get(), 'S', Blocks.wool }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(itemHazmatBoots, new Object[]
|
||||
{ "SSS", "BAB", "SCS", 'A', Item.bootsLeather, 'C', UniversalRecipe.CIRCUIT_T1.get(Settings.allowAlternateRecipes), 'S', Block.cloth }));
|
||||
{ "SSS", "BAB", "SCS", 'A', Items.leather_boots, 'C', UniversalRecipe.CIRCUIT_T1.get(), 'S', Blocks.wool }));
|
||||
|
||||
EntityRegistry.registerGlobalEntityID(EntityParticle.class, "ASParticle", EntityRegistry.findGlobalUniqueEntityId());
|
||||
EntityRegistry.registerModEntity(EntityParticle.class, "ASParticle", ENTITY_ID_PREFIX, this, 80, 3, true);
|
||||
|
@ -532,76 +512,6 @@ public class Atomic
|
|||
|
||||
Settings.config.load();
|
||||
|
||||
if (Loader.isModLoaded("IC2") && Settings.allowAlternateRecipes)
|
||||
{
|
||||
if (Settings.allowIC2UraniumCompression)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Recipes.compressor != null)
|
||||
{
|
||||
Map<IRecipeInput, RecipeOutput> compressorRecipes = Recipes.compressor.getRecipes();
|
||||
Iterator<Entry<IRecipeInput, RecipeOutput>> it = compressorRecipes.entrySet().iterator();
|
||||
int i = 0;
|
||||
|
||||
while (it.hasNext())
|
||||
{
|
||||
Map.Entry<IRecipeInput, RecipeOutput> entry = it.next();
|
||||
|
||||
for (ItemStack checkStack : entry.getKey().getInputs())
|
||||
{
|
||||
if (isItemStackUraniumOre(checkStack))
|
||||
{
|
||||
i++;
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ResonantInduction.LOGGER.fine("Removed " + i + " IC2 uranium compression recipe, use centrifuge instead.");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ResonantInduction.LOGGER.fine("Failed to remove IC2 compressor recipes.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Atomic Assembler Recipes */
|
||||
if (Settings.quantumAssemblerGenerateMode > 0)
|
||||
{
|
||||
for (Item item : Item.itemsList)
|
||||
{
|
||||
if (item != null)
|
||||
{
|
||||
if (item.itemID > 256 || Settings.quantumAssemblerGenerateMode == 2)
|
||||
{
|
||||
ItemStack itemStack = new ItemStack(item);
|
||||
|
||||
if (itemStack != null)
|
||||
{
|
||||
QuantumAssemblerRecipes.addRecipe(itemStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.quantumAssemblerGenerateMode == 2)
|
||||
{
|
||||
for (Block block : Block.blocksList)
|
||||
{
|
||||
if (block != null)
|
||||
{
|
||||
ItemStack itemStack = new ItemStack(block);
|
||||
if (itemStack != null)
|
||||
{
|
||||
QuantumAssemblerRecipes.addRecipe(itemStack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String oreName : OreDictionary.getOreNames())
|
||||
{
|
||||
|
@ -616,12 +526,11 @@ public class Atomic
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Settings.config.save();
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@EventHandler
|
||||
public void thermalEventHandler(EventThermalUpdate evt)
|
||||
{
|
||||
VectorWorld pos = evt.position;
|
||||
|
@ -633,87 +542,71 @@ public class Atomic
|
|||
}
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@EventHandler
|
||||
public void plasmaEvent(SpawnPlasmaEvent evt)
|
||||
{
|
||||
World world = evt.world;
|
||||
Vector3 position = new Vector3(evt.x, evt.y, evt.z);
|
||||
int blockID = position.getBlock(world);
|
||||
Block block = evt.world.getBlock(evt.x, evt.y, evt.z);
|
||||
|
||||
Block block = Block.blocksList[blockID];
|
||||
|
||||
if (block != null)
|
||||
if (block != null && block.getBlockHardness(evt.world, evt.x, evt.y, evt.z) >= 0)
|
||||
{
|
||||
if (block.blockID == Block.bedrock.blockID || block.blockID == Block.blockIron.blockID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TileEntity tile = position.getTileEntity(world);
|
||||
TileEntity tile = evt.world.getTileEntity(evt.x, evt.y, evt.z);
|
||||
|
||||
if (tile instanceof TilePlasma)
|
||||
{
|
||||
((TilePlasma) tile).setTemperature(evt.temperature);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tile instanceof IElectromagnet)
|
||||
}else if (tile instanceof IElectromagnet)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
position.setBlock(world, blockPlasma.blockID);
|
||||
|
||||
TileEntity tile = position.getTileEntity(world);
|
||||
|
||||
if (tile instanceof TilePlasma)
|
||||
else
|
||||
{
|
||||
((TilePlasma) tile).setTemperature(evt.temperature);
|
||||
evt.world.setBlockToAir(evt.x, evt.y, evt.z);
|
||||
evt.world.setBlock(evt.x, evt.y, evt.z, blockPlasma);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@EventHandler
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void preTextureHook(TextureStitchEvent.Pre event)
|
||||
{
|
||||
if (event.map.textureType == 0)
|
||||
if (event.map.getTextureType() == 0)
|
||||
{
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "uraniumHexafluoride", event.map);
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "steam", event.map);
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "deuterium", event.map);
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "tritium", event.map);
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "atomic_edge", event.map);
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "funnel_edge", event.map);
|
||||
RenderUtility.registerIcon(Reference.PREFIX + "glass", event.map);
|
||||
RenderUtility.registerIcon(Reference.prefix() + "uraniumHexafluoride", event.map);
|
||||
RenderUtility.registerIcon(Reference.prefix() + "steam", event.map);
|
||||
RenderUtility.registerIcon(Reference.prefix() + "deuterium", event.map);
|
||||
RenderUtility.registerIcon(Reference.prefix() + "tritium", event.map);
|
||||
RenderUtility.registerIcon(Reference.prefix() + "atomic_edge", event.map);
|
||||
RenderUtility.registerIcon(Reference.prefix() + "funnel_edge", event.map);
|
||||
RenderUtility.registerIcon(Reference.prefix() + "glass", event.map);
|
||||
}
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@EventHandler
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void postTextureHook(TextureStitchEvent.Post event)
|
||||
{
|
||||
FLUID_URANIUM_HEXAFLOURIDE.setIcons(RenderUtility.loadedIconMap.get(Reference.PREFIX + "uraniumHexafluoride"));
|
||||
FLUID_STEAM.setIcons(RenderUtility.loadedIconMap.get(Reference.PREFIX + "steam"));
|
||||
FLUID_DEUTERIUM.setIcons(RenderUtility.loadedIconMap.get(Reference.PREFIX + "deuterium"));
|
||||
FLUID_TRITIUM.setIcons(RenderUtility.loadedIconMap.get(Reference.PREFIX + "tritium"));
|
||||
FLUID_URANIUM_HEXAFLOURIDE.setIcons(RenderUtility.loadedIconMap.get(Reference.prefix() + "uraniumHexafluoride"));
|
||||
FLUID_STEAM.setIcons(RenderUtility.loadedIconMap.get(Reference.prefix() + "steam"));
|
||||
FLUID_DEUTERIUM.setIcons(RenderUtility.loadedIconMap.get(Reference.prefix() + "deuterium"));
|
||||
FLUID_TRITIUM.setIcons(RenderUtility.loadedIconMap.get(Reference.prefix() + "tritium"));
|
||||
FLUID_TOXIC_WASTE.setIcons(blockToxicWaste.getIcon(0, 0));
|
||||
FLUID_PLASMA.setIcons(blockPlasma.getIcon(0, 0));
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@EventHandler
|
||||
public void fillBucketEvent(FillBucketEvent evt)
|
||||
{
|
||||
if (!evt.world.isRemote && evt.target != null && evt.target.typeOfHit == EnumMovingObjectType.TILE)
|
||||
if (!evt.world.isRemote && evt.target != null && evt.target.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
|
||||
{
|
||||
Vector3 blockPos = new Vector3(evt.target);
|
||||
int blockID = blockPos.getBlock(evt.world);
|
||||
VectorWorld pos = new VectorWorld(evt.world, evt.target);
|
||||
|
||||
if (blockID == blockToxicWaste.blockID)
|
||||
if (pos.getBlock() == blockToxicWaste)
|
||||
{
|
||||
blockPos.setBlock(evt.world, 0);
|
||||
pos.setBlockToAir();
|
||||
evt.result = new ItemStack(itemBucketToxic);
|
||||
evt.setResult(Result.ALLOW);
|
||||
evt.setResult(Event.Result.ALLOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
package resonantinduction.atomic.blocks;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntitySmokeFX;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import resonant.lib.prefab.poison.PoisonRadiation;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import universalelectricity.core.transform.vector.Vector3;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
public class BlockRadioactive extends Block
|
||||
{
|
||||
public boolean canSpread = true;
|
||||
public float radius = 5;
|
||||
public int amplifier = 2;
|
||||
public boolean canWalkPoison = true;
|
||||
public boolean isRandomlyRadioactive = true;
|
||||
public boolean spawnParticle = true;
|
||||
|
||||
private IIcon iconTop;
|
||||
private IIcon iconBottom;
|
||||
|
||||
public BlockRadioactive(Material material) {
|
||||
super(material);
|
||||
this.setTickRandomly(true);
|
||||
this.setHardness(0.2F);
|
||||
}
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister iconRegister)
|
||||
{
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon(this.getUnlocalizedName().replace("tile.", "") + "_top");
|
||||
this.iconBottom = iconRegister.registerIcon(this.getUnlocalizedName().replace("tile.", "") + "_bottom");
|
||||
}
|
||||
|
||||
/** Ticks the block if it's been scheduled */
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand)
|
||||
{
|
||||
if (!world.isRemote)
|
||||
{
|
||||
if (this.isRandomlyRadioactive)
|
||||
{
|
||||
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(x - this.radius, y - this.radius, z - this.radius, x + this.radius, y + this.radius, z + this.radius);
|
||||
List<EntityLivingBase> entitiesNearby = world.getEntitiesWithinAABB(EntityLivingBase.class, bounds);
|
||||
|
||||
for (EntityLivingBase entity : entitiesNearby)
|
||||
{
|
||||
PoisonRadiation.INSTANCE.poisonEntity(new Vector3(x, y, z), entity, amplifier);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.canSpread)
|
||||
{
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
int newX = x + rand.nextInt(3) - 1;
|
||||
int newY = y + rand.nextInt(5) - 3;
|
||||
int newZ = z + rand.nextInt(3) - 1;
|
||||
Block block = world.getBlock(newX, newY, newZ);
|
||||
|
||||
if (rand.nextFloat() > 0.4 && (block == Blocks.farmland || block == Blocks.grass))
|
||||
{
|
||||
world.setBlock(newX, newY, newZ, this);
|
||||
}
|
||||
}
|
||||
|
||||
if (rand.nextFloat() > 0.85)
|
||||
{
|
||||
world.setBlock(x, y, z, Blocks.dirt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity */
|
||||
@Override
|
||||
public void onEntityWalking(World par1World, int x, int y, int z, Entity par5Entity)
|
||||
{
|
||||
if (par5Entity instanceof EntityLiving && this.canWalkPoison)
|
||||
{
|
||||
PoisonRadiation.INSTANCE.poisonEntity(new Vector3(x, y, z), (EntityLiving) par5Entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random par5Random)
|
||||
{
|
||||
if (this.spawnParticle)
|
||||
{
|
||||
if (Minecraft.getMinecraft().gameSettings.particleSetting == 0)
|
||||
{
|
||||
int radius = 3;
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Vector3 pos = new Vector3(x, y, z);
|
||||
pos.add(Math.random() * radius - radius / 2, Math.random() * radius - radius / 2, Math.random() * radius - radius / 2);
|
||||
EntitySmokeFX fx = new EntitySmokeFX(world, pos.x(), pos.y(), pos.z(), (Math.random() - 0.5) / 2, (Math.random() - 0.5) / 2, (Math.random() - 0.5) / 2);
|
||||
fx.setRBGColorF(0.2f, 0.8f, 0);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ public class BlockToxicWaste extends BlockFluidClassic
|
|||
{
|
||||
public BlockToxicWaste(int id)
|
||||
{
|
||||
super(id, FluidRegistry.getFluid("toxicwaste"), Material.water);
|
||||
super(FluidRegistry.getFluid("toxicwaste"), Material.water);
|
||||
setTickRate(20);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.Random;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import resonant.lib.prefab.block.BlockRadioactive;
|
||||
import resonantinduction.core.Reference;
|
||||
import resonantinduction.core.ResonantTab;
|
||||
import resonantinduction.core.Settings;
|
||||
|
@ -15,17 +14,17 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
/** Uranium ore block */
|
||||
public class BlockUraniumOre extends BlockRadioactive
|
||||
{
|
||||
public BlockUraniumOre(int id)
|
||||
public BlockUraniumOre()
|
||||
{
|
||||
super(id, Material.rock);
|
||||
this.setUnlocalizedName(Reference.PREFIX + "oreUranium");
|
||||
this.setStepSound(soundStoneFootstep);
|
||||
this.setCreativeTab(ResonantTab.DEFAULT);
|
||||
super(Material.rock);
|
||||
this.setBlockName(Reference.prefix() + "oreUranium");
|
||||
this.setStepSound(soundTypeStone);
|
||||
this.setCreativeTab(ResonantTab.tab());
|
||||
this.setHardness(2f);
|
||||
this.setTextureName(Reference.PREFIX + "oreUranium");
|
||||
this.setBlockTextureName(Reference.prefix() + "oreUranium");
|
||||
|
||||
this.isRandomlyRadioactive = Settings.allowRadioactiveOres;
|
||||
this.canWalkPoison = Settings.allowRadioactiveOres;
|
||||
this.isRandomlyRadioactive = Settings.allowRadioactiveOres();
|
||||
this.canWalkPoison = Settings.allowRadioactiveOres();
|
||||
this.canSpread = false;
|
||||
this.radius = 1f;
|
||||
this.amplifier = 0;
|
||||
|
@ -36,7 +35,7 @@ public class BlockUraniumOre extends BlockRadioactive
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random par5Random)
|
||||
{
|
||||
if (Settings.allowRadioactiveOres)
|
||||
if (Settings.allowRadioactiveOres())
|
||||
{
|
||||
super.randomDisplayTick(world, x, y, z, par5Random);
|
||||
}
|
||||
|
|
|
@ -2,32 +2,32 @@ package resonantinduction.atomic.blocks;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import resonant.api.IElectromagnet;
|
||||
import resonant.lib.content.module.TileBase;
|
||||
import resonant.lib.content.module.TileRender;
|
||||
import resonant.lib.utility.ConnectedTextureRenderer;
|
||||
import resonant.lib.prefab.item.ItemBlockMetadata;
|
||||
import resonant.content.prefab.itemblock.ItemBlockMetadata;
|
||||
import resonant.content.spatial.block.SpatialBlock;
|
||||
import resonantinduction.core.Reference;
|
||||
import universalelectricity.api.UniversalElectricity;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
|
||||
/** Electromagnet block */
|
||||
public class TileElectromagnet extends TileBase implements IElectromagnet
|
||||
public class TileElectromagnet extends SpatialBlock implements IElectromagnet
|
||||
{
|
||||
private static IIcon iconTop, iconGlass;
|
||||
|
||||
public TileElectromagnet()
|
||||
{
|
||||
super(UniversalElectricity.machine);
|
||||
blockResistance = 20;
|
||||
isOpaqueCube = false;
|
||||
itemBlock = ItemBlockMetadata.class;
|
||||
super(Material.iron);
|
||||
blockResistance(20);
|
||||
isOpaqueCube(false);
|
||||
this.itemBlock(ItemBlockMetadata.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,8 +51,8 @@ public class TileElectromagnet extends TileBase implements IElectromagnet
|
|||
public void registerIcons(IIconRegister iconRegister)
|
||||
{
|
||||
super.registerIcons(iconRegister);
|
||||
iconTop = iconRegister.registerIcon(domain + textureName + "_top");
|
||||
iconGlass = iconRegister.registerIcon(domain + "electromagnetGlass");
|
||||
iconTop = iconRegister.registerIcon(domain() + textureName() + "_top");
|
||||
iconGlass = iconRegister.registerIcon(domain() + "electromagnetGlass");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -80,10 +80,10 @@ public class TileElectromagnet extends TileBase implements IElectromagnet
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
par3List.add(new ItemStack(par1, 1, 0));
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
super.getSubBlocks(item, par2CreativeTabs, par3List);
|
||||
par3List.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -91,11 +91,4 @@ public class TileElectromagnet extends TileBase implements IElectromagnet
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
protected TileRender newRenderer()
|
||||
{
|
||||
return new ConnectedTextureRenderer(this, Reference.PREFIX + "atomic_edge");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package resonantinduction.atomic.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import resonant.content.spatial.block.SpatialBlock;
|
||||
import resonantinduction.core.Reference;
|
||||
import universalelectricity.api.UniversalElectricity;
|
||||
import universalelectricity.core.transform.vector.Vector3;
|
||||
|
||||
/** Siren block */
|
||||
|
@ -13,23 +13,11 @@ public class TileSiren extends SpatialBlock
|
|||
{
|
||||
public TileSiren()
|
||||
{
|
||||
super(UniversalElectricity.machine);
|
||||
super(Material.wood);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWorldJoin()
|
||||
{
|
||||
scheduelTick(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
scheduelTick(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity()
|
||||
public void update()
|
||||
{
|
||||
World world = worldObj;
|
||||
if (world != null)
|
||||
|
@ -42,20 +30,19 @@ public class TileSiren extends SpatialBlock
|
|||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
Vector3 check = position().add(ForgeDirection.getOrientation(i));
|
||||
if (check.getBlock(world) == blockID())
|
||||
if (check.getBlock(world) == getBlockType())
|
||||
{
|
||||
volume *= 1.5f;
|
||||
}
|
||||
}
|
||||
|
||||
world.playSoundEffect(x(), y(), z(), Reference.PREFIX + "alarm", volume, 1f - 0.18f * (metadata / 15f));
|
||||
scheduelTick(30);
|
||||
world.playSoundEffect(x(), y(), z(), Reference.prefix() + "alarm", volume, 1f - 0.18f * (metadata / 15f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean configure(EntityPlayer player, int side, Vector3 hit)
|
||||
public boolean configure(EntityPlayer player, int side, Vector3 hit)
|
||||
{
|
||||
int metadata = world().getBlockMetadata(x(), y(), z());
|
||||
|
||||
|
|
|
@ -15,4 +15,6 @@ object ResonantTab extends CreativeTabs(CreativeTabs.getNextID, "ResonantInducti
|
|||
var itemStack: ItemStack = null
|
||||
|
||||
override def getTabIconItem: Item = itemStack.getItem
|
||||
|
||||
def tab = this
|
||||
}
|
Loading…
Reference in a new issue