generated from tilera/1710mod
feat: start port
This commit is contained in:
parent
ca3087e9d4
commit
1a4d250a47
|
@ -1,3 +1,7 @@
|
|||
bin
|
||||
.classpath
|
||||
.project
|
||||
.settings
|
||||
.gradle
|
||||
.idea
|
||||
build
|
||||
|
|
|
@ -17,6 +17,9 @@ buildscript {
|
|||
|
||||
apply plugin: 'forge'
|
||||
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
version = "1.0"
|
||||
group= "modgroup"
|
||||
archivesBaseName = "modid"
|
||||
|
|
|
@ -0,0 +1,675 @@
|
|||
package atomicscience;
|
||||
|
||||
import atomicscience.api.BlockRadioactive;
|
||||
import atomicscience.api.ISteamReceptor;
|
||||
import atomicscience.api.Plasma;
|
||||
import atomicscience.api.poison.PoisonRadiation;
|
||||
import atomicscience.api.poison.PotionRadiation;
|
||||
import atomicscience.fanwusu.BAccelerator;
|
||||
import atomicscience.fanwusu.BFulminationGenerator;
|
||||
import atomicscience.fanwusu.EMatter;
|
||||
import atomicscience.fanwusu.FulminationEventHandler;
|
||||
import atomicscience.fanwusu.ItAntimatterCell;
|
||||
import atomicscience.fanwusu.TAccelerator;
|
||||
import atomicscience.fanwusu.TFulminationGenerator;
|
||||
import atomicscience.fenlie.BCentrifuge;
|
||||
import atomicscience.fenlie.BControlRod;
|
||||
import atomicscience.fenlie.BFissionReactor;
|
||||
import atomicscience.fenlie.BNuclearBoiler;
|
||||
import atomicscience.fenlie.BReactorTap;
|
||||
import atomicscience.fenlie.BSiren;
|
||||
import atomicscience.fenlie.BUraniumOre;
|
||||
import atomicscience.fenlie.ItRadioactive;
|
||||
import atomicscience.fenlie.ItStrangeMatter;
|
||||
import atomicscience.fenlie.ItUranium;
|
||||
import atomicscience.fenlie.TCentrifuge;
|
||||
import atomicscience.fenlie.TFissionReactor;
|
||||
import atomicscience.fenlie.TNuclearBoiler;
|
||||
import atomicscience.fenlie.TReactorTap;
|
||||
import atomicscience.hecheng.BElectromagnet;
|
||||
import atomicscience.hecheng.BElectromagnetGlass;
|
||||
import atomicscience.hecheng.BFusionReactor;
|
||||
import atomicscience.hecheng.BPlasma;
|
||||
import atomicscience.hecheng.IBAccelerator;
|
||||
import atomicscience.hecheng.IBPlasma;
|
||||
import atomicscience.hecheng.IBSiren;
|
||||
import atomicscience.hecheng.TElectromagnet;
|
||||
import atomicscience.hecheng.TFusionReactor;
|
||||
import atomicscience.jiqi.BChemicalExtractor;
|
||||
import atomicscience.jiqi.BFunnel;
|
||||
import atomicscience.jiqi.BThermometer;
|
||||
import atomicscience.jiqi.BTurbine;
|
||||
import atomicscience.jiqi.ItHazmatSuite;
|
||||
import atomicscience.jiqi.ItThermometer;
|
||||
import atomicscience.jiqi.TChemicalExtractor;
|
||||
import atomicscience.jiqi.TFunnel;
|
||||
import atomicscience.jiqi.TThermometer;
|
||||
import atomicscience.jiqi.TTurbine;
|
||||
import atomicscience.wujian.ItBreederFuel;
|
||||
import atomicscience.wujian.ItCell;
|
||||
import atomicscience.wujian.ItFissileFuel;
|
||||
import calclavia.lib.UniversalRecipes;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.Mod.Metadata;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Arrays;
|
||||
import java.util.logging.Logger;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemBucket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent.Post;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import universalelectricity.core.item.ElectricItemHelper;
|
||||
import universalelectricity.core.item.ItemElectric;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.TranslationHelper;
|
||||
import universalelectricity.prefab.ore.OreGenBase;
|
||||
import universalelectricity.prefab.ore.OreGenReplaceStone;
|
||||
import universalelectricity.prefab.ore.OreGenerator;
|
||||
|
||||
@Mod(modid = "AtomicScience", name = "Atomic Science", version = "0.6.2",
|
||||
dependencies = "required-after:basiccomponents")
|
||||
public class AtomicScience {
|
||||
public static Configuration CONFIGURATION =
|
||||
new Configuration(Loader.instance().getConfigDir(), "AtomicScience.cfg");
|
||||
public static final String ID = "AtomicScience";
|
||||
public static final String CHANNEL = "AtomicScience";
|
||||
public static final String PREFIX = "atomicscience:";
|
||||
@Instance("AtomicScience") public static AtomicScience instance;
|
||||
@SidedProxy(clientSide = "atomicscience.ClientProxy",
|
||||
serverSide = "atomicscience.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
@Metadata("AtomicScience") public static ModMetadata metadata;
|
||||
public static final String WEN_JIAN_NO_SLASH = "atomicscience/";
|
||||
public static final String WEN_JIAN = "/atomicscience/";
|
||||
public static final String DIR = "/mods/atomicscience/";
|
||||
public static final String TEXTURE_WEN_JIAN = "/mods/atomicscience/textures/";
|
||||
public static final String SHI_MIAN_WEN_JIAN =
|
||||
"/mods/atomicscience/textures/gui/";
|
||||
public static final String BLOCK_WEN_JIAN =
|
||||
"/mods/atomicscience/textures/blocks/";
|
||||
public static final String ITEM_WEN_JIAN =
|
||||
"/mods/atomicscience/textures/items/";
|
||||
public static final String MODEL_WEN_JIAN =
|
||||
"/mods/atomicscience/textures/models/";
|
||||
// private static final String YU_YAN_WEN_JIAN = "/mods/atomicscience/yuyan/";
|
||||
private static final String[] YU_YAN = new String[] {"en_US"};
|
||||
public static float WOLUN_MULTIPLIER_OUTPUT = 30.0F;
|
||||
public static boolean ALLOW_LAYERED_TURBINES = true;
|
||||
public static boolean ALLOW_TOXIC_WASTE = true;
|
||||
public static boolean ALLOW_RADIOACTIVE_ORES = true;
|
||||
public static final int BLOCK_ID_PREFIX = 3768;
|
||||
public static final int ENTITY_ID_PREFIX = 49;
|
||||
public static Block blockRadioactive;
|
||||
public static Block bCentrifuge;
|
||||
public static Block bTurbine;
|
||||
public static Block bNuclearBoiler;
|
||||
public static Block bControlRod;
|
||||
public static Block bThermometer;
|
||||
public static Block bFusionReactor;
|
||||
public static BPlasma bPlasma;
|
||||
public static Block bElectromagnet;
|
||||
public static Block bChemicalExtractor;
|
||||
public static Block bSiren;
|
||||
public static Block bElectromagnetGlass;
|
||||
public static Block bFunnel;
|
||||
public static Block bAccelerator;
|
||||
public static Block bAutoBuilder;
|
||||
public static Block bFulminationGenerator;
|
||||
public static Block bAtomicAssembler;
|
||||
public static Block bFissionReactor;
|
||||
public static Block bReactorTap;
|
||||
public static final int ITEM_ID_PREFIX = 13768;
|
||||
public static Item itCell;
|
||||
public static Item itCellUranium;
|
||||
public static Item itCellBreederFuel;
|
||||
public static Item itCellStrangeMatter;
|
||||
public static Item itCellAntimatter;
|
||||
public static Item itCellDeuterium;
|
||||
public static Item itCellWater;
|
||||
public static Item itBucketToxic;
|
||||
public static Block bUraniumOre;
|
||||
public static Item itYellowcake;
|
||||
public static Item itUranium;
|
||||
public static ItemElectric itWenDuBiao;
|
||||
public static Item itHazmatHelmet;
|
||||
public static Item itHazmatChestplate;
|
||||
public static Item itHazmanLeggings;
|
||||
public static Item itHazmatBoots;
|
||||
public static Block bToxicWaste;
|
||||
public static Fluid FLUID_URANIUM_HEXAFLOURIDE;
|
||||
public static Fluid FLUID_STEAM;
|
||||
public static Fluid FLUID_TOXIC_WASTE;
|
||||
public static final ArmorMaterial hazmatArmorMaterial =
|
||||
EnumHelper.addArmorMaterial("HAZMAT", 0, new int[] {0, 0, 0, 0}, 0);
|
||||
public static OreGenBase uraniumOreGeneration;
|
||||
public static int URANIUM_HEXAFLOURIDE_RATIO = 200;
|
||||
public static int STEAM_RATIO = 40;
|
||||
// public static final String QIZI_FAN_WU_SU_BAO_ZHA =
|
||||
// FlagRegistry.registerFlag("ban_antimatter_power");
|
||||
public static final Logger LOGGER = Logger.getLogger("AtomicScience");
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
instance = this;
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
AtomicScience.CONFIGURATION.load();
|
||||
WOLUN_MULTIPLIER_OUTPUT = (float)AtomicScience.CONFIGURATION
|
||||
.get("general", "Turbine Output Multiplier",
|
||||
(double)WOLUN_MULTIPLIER_OUTPUT)
|
||||
.getDouble((double)WOLUN_MULTIPLIER_OUTPUT);
|
||||
ALLOW_LAYERED_TURBINES =
|
||||
AtomicScience.CONFIGURATION
|
||||
.get("general", "Allow Layered Turbines", ALLOW_LAYERED_TURBINES)
|
||||
.getBoolean(ALLOW_LAYERED_TURBINES);
|
||||
ALLOW_TOXIC_WASTE =
|
||||
AtomicScience.CONFIGURATION
|
||||
.get("general", "Allow Toxic Waste", ALLOW_TOXIC_WASTE)
|
||||
.getBoolean(ALLOW_TOXIC_WASTE);
|
||||
ALLOW_RADIOACTIVE_ORES =
|
||||
AtomicScience.CONFIGURATION
|
||||
.get("general", "Allow Radioactive Ores", ALLOW_RADIOACTIVE_ORES)
|
||||
.getBoolean(ALLOW_RADIOACTIVE_ORES);
|
||||
PoisonRadiation.disabled =
|
||||
AtomicScience.CONFIGURATION
|
||||
.get("general", "Disable Radiation", PoisonRadiation.disabled)
|
||||
.getBoolean(PoisonRadiation.disabled);
|
||||
URANIUM_HEXAFLOURIDE_RATIO =
|
||||
AtomicScience.CONFIGURATION
|
||||
.get("general", "Uranium Hexafluoride Ratio",
|
||||
URANIUM_HEXAFLOURIDE_RATIO)
|
||||
.getInt(URANIUM_HEXAFLOURIDE_RATIO);
|
||||
STEAM_RATIO =
|
||||
AtomicScience.CONFIGURATION.get("general", "Steam Ratio", STEAM_RATIO)
|
||||
.getInt(STEAM_RATIO);
|
||||
PotionRadiation.INSTANCE.getId();
|
||||
blockRadioactive = (new BlockRadioactive()
|
||||
.setBlockName("atomicscience:radioactive")
|
||||
.setCreativeTab(TabAS.INSTANCE));
|
||||
bUraniumOre = new BUraniumOre();
|
||||
bCentrifuge = new BCentrifuge();
|
||||
bFissionReactor = new BFissionReactor();
|
||||
bTurbine = new BTurbine();
|
||||
bNuclearBoiler = new BNuclearBoiler();
|
||||
bControlRod = new BControlRod();
|
||||
bThermometer = new BThermometer();
|
||||
bFusionReactor = new BFusionReactor();
|
||||
bPlasma = new BPlasma();
|
||||
bElectromagnet = new BElectromagnet();
|
||||
bChemicalExtractor = new BChemicalExtractor();
|
||||
bSiren = new BSiren();
|
||||
bElectromagnetGlass = new BElectromagnetGlass();
|
||||
bFunnel = new BFunnel();
|
||||
bAccelerator = new BAccelerator();
|
||||
bAutoBuilder = new BAutoBuilder();
|
||||
bFulminationGenerator = new BFulminationGenerator();
|
||||
bAtomicAssembler = new BAtomicAssembler();
|
||||
bReactorTap = new BReactorTap();
|
||||
itHazmatHelmet =
|
||||
(new ItHazmatSuite(
|
||||
|
||||
hazmatArmorMaterial, proxy.getArmorIndex("hazmat"), 0))
|
||||
.setUnlocalizedName("atomicscience:hazmatMask");
|
||||
itHazmatChestplate = (new ItHazmatSuite(hazmatArmorMaterial,
|
||||
proxy.getArmorIndex("hazmat"), 1))
|
||||
.setUnlocalizedName("atomicscience:hazmatBody");
|
||||
itHazmanLeggings = (new ItHazmatSuite(hazmatArmorMaterial,
|
||||
proxy.getArmorIndex("hazmat"), 2))
|
||||
.setUnlocalizedName("atomicscience:hazmatLeggings");
|
||||
itHazmatBoots = (new ItHazmatSuite(hazmatArmorMaterial,
|
||||
proxy.getArmorIndex("hazmat"), 3))
|
||||
.setUnlocalizedName("atomicscience:hazmatBoots");
|
||||
itWenDuBiao = new ItThermometer(1);
|
||||
itCell = new ItCell("cellEmpty");
|
||||
itCellUranium = new ItFissileFuel();
|
||||
itCellDeuterium = new ItCell("cellDeuterium");
|
||||
itCellStrangeMatter = new ItStrangeMatter();
|
||||
itCellAntimatter = new ItAntimatterCell();
|
||||
itCellWater = new ItCell("cellWater");
|
||||
itCellBreederFuel = new ItBreederFuel();
|
||||
itYellowcake = new ItRadioactive("yellowcake");
|
||||
itUranium = new ItUranium(0);
|
||||
FLUID_URANIUM_HEXAFLOURIDE = getOrRegisterFluid("uranium_hexafluoride");
|
||||
FLUID_STEAM = getOrRegisterFluid("steam");
|
||||
FLUID_TOXIC_WASTE = getOrRegisterFluid("toxic_waste");
|
||||
bToxicWaste =
|
||||
(new BToxicWaste("toxicWaste")).setCreativeTab((CreativeTabs)null);
|
||||
itBucketToxic = (new ItemBucket(bToxicWaste))
|
||||
.setCreativeTab(TabAS.INSTANCE)
|
||||
.setUnlocalizedName("atomicscience:bucketToxicWaste")
|
||||
.setContainerItem(Items.bucket);
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(
|
||||
new FluidStack(FLUID_TOXIC_WASTE, 1000), new ItemStack(itBucketToxic),
|
||||
new ItemStack(Items.bucket)));
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
||||
GameRegistry.registerBlock(blockRadioactive, "blockRadioactive");
|
||||
GameRegistry.registerBlock(bUraniumOre, "bUraniumOre");
|
||||
GameRegistry.registerBlock(bCentrifuge, "bCentrifuge");
|
||||
GameRegistry.registerBlock(bFissionReactor, "bFissionReactor");
|
||||
GameRegistry.registerBlock(bTurbine, "bTurbine");
|
||||
GameRegistry.registerBlock(bNuclearBoiler, "bNuclearBoiler");
|
||||
GameRegistry.registerBlock(bControlRod, "bControlRod");
|
||||
GameRegistry.registerBlock(bThermometer, "bThermometer");
|
||||
GameRegistry.registerBlock(bFusionReactor, "bFusionReactor");
|
||||
GameRegistry.registerBlock(bPlasma, IBPlasma.class, "bPlasma");
|
||||
GameRegistry.registerBlock(bElectromagnet, "bElectromagnet");
|
||||
GameRegistry.registerBlock(bChemicalExtractor, "bChemicalExtractor");
|
||||
GameRegistry.registerBlock(bSiren, IBSiren.class, "bSiren");
|
||||
GameRegistry.registerBlock(bElectromagnetGlass, "bElectromagnetGlass");
|
||||
GameRegistry.registerBlock(bFunnel, "bFunnel");
|
||||
GameRegistry.registerBlock(bAccelerator, IBAccelerator.class,
|
||||
"bAccelerator");
|
||||
GameRegistry.registerBlock(bAutoBuilder, "bAutoBuilder");
|
||||
GameRegistry.registerBlock(bFulminationGenerator, "bFulminationGenerator");
|
||||
GameRegistry.registerBlock(bAtomicAssembler, "bAtomicAssembler");
|
||||
GameRegistry.registerBlock(bToxicWaste, "bToxicWaste");
|
||||
GameRegistry.registerBlock(bReactorTap, "bReactorTap");
|
||||
uraniumOreGeneration = new OreGenReplaceStone("Uranium Ore", "oreUranium",
|
||||
new ItemStack(bUraniumOre), 0,
|
||||
25, 9, 3, "pickaxe", 2);
|
||||
if (OreDictionary.getOres("oreUranium").size() > 1 &&
|
||||
AtomicScience.CONFIGURATION
|
||||
.get("general", "Auto Disable Uranium If Exist", false)
|
||||
.getBoolean(false)) {
|
||||
LOGGER.fine(
|
||||
"Disabled Uranium Generation. Detected another uranium being generated: " +
|
||||
OreDictionary.getOres("oreUranium").size());
|
||||
} else {
|
||||
uraniumOreGeneration.enable(AtomicScience.CONFIGURATION);
|
||||
OreGenerator.addOre(uraniumOreGeneration);
|
||||
LOGGER.fine("Added Atomic Science uranium to ore generator.");
|
||||
}
|
||||
|
||||
AtomicScience.CONFIGURATION.save();
|
||||
MinecraftForge.EVENT_BUS.register(itCellAntimatter);
|
||||
MinecraftForge.EVENT_BUS.register(FulminationEventHandler.INSTANCE);
|
||||
OreDictionary.registerOre("ingotUranium", itUranium);
|
||||
OreDictionary.registerOre("breederUranium", new ItemStack(itUranium, 1, 1));
|
||||
OreDictionary.registerOre("blockRadioactive", blockRadioactive);
|
||||
OreDictionary.registerOre("cellEmpty", itCell);
|
||||
OreDictionary.registerOre("cellUranium", itCellUranium);
|
||||
OreDictionary.registerOre("cellDeuterium", itCellDeuterium);
|
||||
OreDictionary.registerOre("cellWater", itCellWater);
|
||||
OreDictionary.registerOre("strangeMatter", itCellStrangeMatter);
|
||||
OreDictionary.registerOre("antimatterMilligram",
|
||||
new ItemStack(itCellAntimatter, 1, 0));
|
||||
OreDictionary.registerOre("antimatterGram",
|
||||
new ItemStack(itCellAntimatter, 1, 1));
|
||||
FluidContainerRegistry.registerFluidContainer(new FluidContainerData(
|
||||
new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(itCellWater),
|
||||
new ItemStack(itCell)));
|
||||
ForgeChunkManager.setForcedChunkLoadingCallback(this, (tickets, world) -> {
|
||||
for (Ticket ticket : tickets) {
|
||||
if (ticket.getType() == Type.ENTITY && ticket.getEntity() != null &&
|
||||
ticket.getEntity() instanceof EMatter) {
|
||||
((EMatter)ticket.getEntity()).youPiao = ticket;
|
||||
}
|
||||
}
|
||||
});
|
||||
Plasma.blockPlasma = bPlasma;
|
||||
GameRegistry.registerTileEntity(TCentrifuge.class, "ASCentrifuge");
|
||||
GameRegistry.registerTileEntity(TFusionReactor.class, "ASFusionReactor");
|
||||
GameRegistry.registerTileEntity(TTurbine.class, "ASTurbine");
|
||||
GameRegistry.registerTileEntity(TNuclearBoiler.class, "ASNuclearBoiler");
|
||||
GameRegistry.registerTileEntity(TThermometer.class, "ASThermometer");
|
||||
GameRegistry.registerTileEntity(TElectromagnet.class, "ASElectromagnet");
|
||||
GameRegistry.registerTileEntity(TChemicalExtractor.class,
|
||||
"ASChemicalExtractor");
|
||||
GameRegistry.registerTileEntity(TFunnel.class, "ASFunnel");
|
||||
GameRegistry.registerTileEntity(TAccelerator.class, "ASAccelerator");
|
||||
GameRegistry.registerTileEntity(TFulminationGenerator.class,
|
||||
"ASFulminationGenerator");
|
||||
GameRegistry.registerTileEntity(TAtomicAssembler.class,
|
||||
"ASAtomicAssembler");
|
||||
GameRegistry.registerTileEntity(TAutoBuilder.class, "ASAutoBuilder");
|
||||
GameRegistry.registerTileEntity(TFissionReactor.class, "ASFissionReactor");
|
||||
GameRegistry.registerTileEntity(TReactorTap.class, "ASReactorTap");
|
||||
proxy.preInit();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void load(FMLInitializationEvent evt) {
|
||||
metadata.modId = "AtomicScience";
|
||||
metadata.name = "Atomic Science";
|
||||
metadata.description =
|
||||
"Electricity generation is always a burden. That\'s why we are here to bring in high tech nuclear power to solve all your electricity-lack problems. With our fission reactors, fusion reactors, and antimatter generators, you won\'t be lacking electricity ever again!";
|
||||
metadata.url = "http://www.universalelectricity.com/atomicscience";
|
||||
metadata.logoFile = "/as_logo.png";
|
||||
metadata.version = "0.6.2.117";
|
||||
metadata.authorList = Arrays.asList(new String[] {"Calclavia"});
|
||||
metadata.credits = "Please visit the website.";
|
||||
metadata.autogenerated = false;
|
||||
LOGGER.fine(
|
||||
"Loaded Languages: " +
|
||||
TranslationHelper.loadLanguages("/mods/atomicscience/yuyan/", YU_YAN));
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
UniversalRecipes.init();
|
||||
if (Loader.isModLoaded("IC2")) {
|
||||
OreDictionary.registerOre("cellEmpty", itCell);
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
itYellowcake, GameRegistry.findItem("IC2", "reactorUraniumSimple")));
|
||||
Item ic2FluidCell = GameRegistry.findItem("IC2", "itemFluidCell");
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(ic2FluidCell, itCell));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(itCell, "cellEmpty"));
|
||||
}
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
new ItemStack(itCellAntimatter, 1, 1), itCellAntimatter,
|
||||
itCellAntimatter, itCellAntimatter, itCellAntimatter, itCellAntimatter,
|
||||
itCellAntimatter, itCellAntimatter, itCellAntimatter));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
new ItemStack(itCellAntimatter, 8, 0),
|
||||
new Object[] {new ItemStack(itCellAntimatter, 1, 1)}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(bFunnel, 2), " B ", "B B", "B B", 'B', "ingotBronze"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(bFunnel, 2), " B ",
|
||||
"B B", "B B", 'B', "ingotIron"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bAtomicAssembler, "CCC", "SXS", "SSS", 'X', bCentrifuge, 'C',
|
||||
"calclavia:CIRCUIT_T3", 'S', "plateSteel"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bFulminationGenerator, "OSO", "SCS", "OSO", 'O', Blocks.obsidian, 'C',
|
||||
"calclavia:CIRCUIT_T2", 'S', "plateSteel"));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bAccelerator, "SCS", "CMC", "SCS", 'M', "calclavia:MOTOR", 'C',
|
||||
"calclavia:CIRCUIT_T3", 'S', "plateSteel"));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
bElectromagnetGlass, new Object[] {bElectromagnet, Blocks.glass}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bCentrifuge,
|
||||
new Object[] {"BSB", "MCM", "BSB", Character.valueOf('C'),
|
||||
"calclavia:CIRCUIT_T2", Character.valueOf('S'),
|
||||
"plateSteel", Character.valueOf('B'), "ingotBronze",
|
||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bNuclearBoiler,
|
||||
new Object[] {"S S", "FBF", "SMS", Character.valueOf('F'),
|
||||
Blocks.furnace, Character.valueOf('S'), "plateSteel",
|
||||
Character.valueOf('B'), Items.bucket,
|
||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bChemicalExtractor,
|
||||
new Object[] {"BSB", "MCM", "BSB", Character.valueOf('C'),
|
||||
"calclavia:CIRCUIT_T3", Character.valueOf('S'),
|
||||
"plateSteel", Character.valueOf('B'), "ingotBronze",
|
||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(bSiren, 2),
|
||||
new Object[] {"NPN", Character.valueOf('N'), Blocks.noteblock,
|
||||
Character.valueOf('P'), "plateBronze"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bFissionReactor,
|
||||
new Object[] {"SCS", "MEM", "SCS", Character.valueOf('E'), "cellEmpty",
|
||||
Character.valueOf('C'), "calclavia:CIRCUIT_T2",
|
||||
Character.valueOf('S'), "plateSteel",
|
||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bFusionReactor,
|
||||
new Object[] {"CPC", "PFP", "CPC", Character.valueOf('P'), "plateSteel",
|
||||
Character.valueOf('F'), bFissionReactor,
|
||||
Character.valueOf('C'), "calclavia:CIRCUIT_T3"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bTurbine, new Object[] {" B ", "BMB", " B ", Character.valueOf('B'),
|
||||
"plateBronze", Character.valueOf('M'),
|
||||
"calclavia:MOTOR"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bReactorTap,
|
||||
new Object[] {"SBS", "TMT", "SBS", Character.valueOf('S'),
|
||||
"plateBronze", Character.valueOf('T'), "ingotBronze",
|
||||
Character.valueOf('M'), "calclavia:MOTOR",
|
||||
Character.valueOf('B'), Items.bucket}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(itCell, 16),
|
||||
new Object[] {" T ", "TGT", " T ", Character.valueOf('T'), "ingotTin",
|
||||
Character.valueOf('G'), Blocks.glass}));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(itCellWater),
|
||||
itCell, Items.water_bucket));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
ElectricItemHelper.getUncharged(new ItemStack(itWenDuBiao)),
|
||||
new Object[] {"SSS", "GCG", "GSG", Character.valueOf('S'), "ingotSteel",
|
||||
Character.valueOf('G'), Blocks.glass,
|
||||
Character.valueOf('C'), "calclavia:CIRCUIT_T1"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bThermometer, new Object[] {"SSS", "SWS", "SSS", Character.valueOf('S'),
|
||||
"ingotSteel", Character.valueOf('W'),
|
||||
ElectricItemHelper.getUncharged(
|
||||
new ItemStack(itWenDuBiao))}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
bControlRod, new Object[] {"I", "I", "I", Character.valueOf('I'),
|
||||
Items.iron_ingot}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
itCellUranium,
|
||||
new Object[] {"CUC", "CUC", "CUC", Character.valueOf('U'),
|
||||
"ingotUranium", Character.valueOf('C'), "cellEmpty"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
itCellBreederFuel,
|
||||
new Object[] {"CUC", "CUC", "CUC", Character.valueOf('U'),
|
||||
"breederUranium", Character.valueOf('C'), "cellEmpty"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(bElectromagnet, 2),
|
||||
new Object[] {"BBB", "BMB", "BBB", Character.valueOf('B'),
|
||||
"ingotBronze", Character.valueOf('M'),
|
||||
"calclavia:MOTOR"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(bElectromagnet, 2),
|
||||
new Object[] {"BBB", "BMB", "BBB", Character.valueOf('B'), "ingotIron",
|
||||
Character.valueOf('M'), "calclavia:MOTOR"}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
itHazmatHelmet,
|
||||
new Object[] {"SSS", "BAB", "SCS", Character.valueOf('A'),
|
||||
Items.leather_helmet, Character.valueOf('C'),
|
||||
"calclavia:CIRCUIT_T1", Character.valueOf('S'),
|
||||
Blocks.wool}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
itHazmatChestplate,
|
||||
new Object[] {"SSS", "BAB", "SCS", Character.valueOf('A'),
|
||||
Items.leather, Character.valueOf('C'),
|
||||
"calclavia:CIRCUIT_T1", Character.valueOf('S'),
|
||||
Blocks.wool}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
itHazmanLeggings,
|
||||
new Object[] {"SSS", "BAB", "SCS", Character.valueOf('A'),
|
||||
Items.leather_leggings, Character.valueOf('C'),
|
||||
"calclavia:CIRCUIT_T1", Character.valueOf('S'),
|
||||
Blocks.wool}));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
itHazmatBoots,
|
||||
new Object[] {"SSS", "BAB", "SCS", Character.valueOf('A'),
|
||||
Items.leather_boots, Character.valueOf('C'),
|
||||
"calclavia:CIRCUIT_T1", Character.valueOf('S'),
|
||||
Blocks.wool}));
|
||||
EntityRegistry.registerGlobalEntityID(
|
||||
EMatter.class, "ASParticle", EntityRegistry.findGlobalUniqueEntityId());
|
||||
EntityRegistry.registerModEntity(EMatter.class, "ASParticle", 49, this, 80,
|
||||
3, true);
|
||||
proxy.init();
|
||||
AtomicScience.CONFIGURATION.load();
|
||||
if (Loader.isModLoaded("IC2") &&
|
||||
AtomicScience.CONFIGURATION
|
||||
.get("general", "Disable IC2 Uranium Compression (Recommended)",
|
||||
true)
|
||||
.getBoolean(true)) {
|
||||
try {
|
||||
// TODO: WTF
|
||||
// if (Recipes.compressor != null) {
|
||||
// Map e = Recipes.compressor.getRecipes();
|
||||
// Iterator it = e.entrySet().iterator();
|
||||
// int i = 0;
|
||||
|
||||
// while (it.hasNext()) {
|
||||
// Entry entry = (Entry)it.next();
|
||||
// if (isUraniumOre((ItemStack)entry.getKey())) {
|
||||
// ++i;
|
||||
// it.remove();
|
||||
// }
|
||||
// }
|
||||
|
||||
// LOGGER.fine(
|
||||
// "Removed " + i +
|
||||
// " IC2 uranium compression recipe, use centrifuge instead.");
|
||||
// }
|
||||
} catch (Exception var6) {
|
||||
LOGGER.fine("Failed to remove IC2 compressor recipes.");
|
||||
var6.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
AtomicScience.CONFIGURATION.save();
|
||||
}
|
||||
|
||||
public static boolean isCell(ItemStack itemStack) {
|
||||
return is(itemStack, "cellEmpty");
|
||||
}
|
||||
|
||||
public static boolean isCellWater(ItemStack itemStack) {
|
||||
return is(itemStack, "cellWater");
|
||||
}
|
||||
|
||||
public static boolean isUraniumOre(ItemStack itemStack) {
|
||||
return is(itemStack, "dropUranium", "oreUranium");
|
||||
}
|
||||
|
||||
public static boolean isFusionFuel(ItemStack itemStack) {
|
||||
return is(itemStack, "molecule_1d", "molecule_1h2", "cellDeuterium");
|
||||
}
|
||||
|
||||
public static boolean is(ItemStack itemStack, String... names) {
|
||||
if (itemStack != null && names != null && names.length > 0) {
|
||||
String name = OreDictionary.getOreName(OreDictionary.getOreID(itemStack));
|
||||
String[] arr$ = names;
|
||||
int len$ = names.length;
|
||||
|
||||
for (int i$ = 0; i$ < len$; ++i$) {
|
||||
String compareName = arr$[i$];
|
||||
if (name.equals(compareName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void boilWater(World worldObj, Vector3 pos, int height,
|
||||
int rpm) {
|
||||
Block blockID = pos.getBlock(worldObj);
|
||||
if (blockID == Blocks.flowing_water || blockID == Blocks.water) {
|
||||
if (!ALLOW_LAYERED_TURBINES) {
|
||||
height = 1;
|
||||
}
|
||||
|
||||
if (worldObj.rand.nextInt(80) == 0) {
|
||||
worldObj.playSoundEffect(
|
||||
pos.x + 0.5D, pos.y + 0.5D, pos.z + 0.5D, "liquid.lava", 0.5F,
|
||||
2.1F + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) *
|
||||
0.85F);
|
||||
}
|
||||
|
||||
if (worldObj.rand.nextInt(40) == 0) {
|
||||
worldObj.playSoundEffect(
|
||||
pos.x + 0.5D, pos.y + 0.5D, pos.z + 0.5D, "liquid.lavapop", 0.5F,
|
||||
2.6F +
|
||||
(worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.8F);
|
||||
}
|
||||
|
||||
worldObj.spawnParticle("bubble", pos.x + 0.5D,
|
||||
pos.y + 0.20000000298023224D, pos.z + 0.5D, 0.0D,
|
||||
0.0D, 0.0D);
|
||||
if (worldObj.rand.nextInt(5) == 0) {
|
||||
worldObj.spawnParticle("smoke", pos.x + 0.5D, pos.y + 0.5D,
|
||||
pos.z + 0.5D, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
for (int i = 1; i <= height; ++i) {
|
||||
TileEntity tileEntity =
|
||||
worldObj.getTileEntity(pos.intX(), pos.intY() + i, pos.intZ());
|
||||
if (tileEntity != null && tileEntity instanceof ISteamReceptor) {
|
||||
((ISteamReceptor)tileEntity).onReceiveSteam(rpm);
|
||||
rpm /= 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void textureHook(Post event) {
|
||||
// TODO: WTF
|
||||
// if (event.map == Minecraft.getMinecraft().renderEngine.field_94155_m) {
|
||||
|
||||
FLUID_URANIUM_HEXAFLOURIDE.setIcons(
|
||||
event.map.registerIcon("atomicscience:uraniumHexafluoride"));
|
||||
// TODO: might override railcraft icon?
|
||||
FLUID_STEAM.setIcons(event.map.registerIcon("atomicscience:steam"));
|
||||
FLUID_TOXIC_WASTE.setIcons(
|
||||
event.map.registerIcon("atomicscience:toxicWaste"));
|
||||
}
|
||||
|
||||
// TODO: WTF
|
||||
// @EventHandler public void serverStarting(FMLServerStartingEvent event) {
|
||||
// FlagRegistry.registerModFlag(
|
||||
// "ModFlags", new ModFlag(NBTFileLoader.loadData("ModFlags")));
|
||||
// ICommandManager commandManager = FMLCommonHandler.instance()
|
||||
// .getMinecraftServerInstance()
|
||||
// .getCommandManager();
|
||||
// ServerCommandManager serverCommandManager =
|
||||
// (ServerCommandManager)commandManager;
|
||||
// serverCommandManager.registerCommand(
|
||||
// new CommandFlag(FlagRegistry.getModFlag("ModFlags")));
|
||||
// }
|
||||
|
||||
// TODO: WTF
|
||||
// @ForgeSubscribe
|
||||
// public void worldSave(Save evt) {
|
||||
// if (!evt.world.isRemote) {
|
||||
// NBTFileLoader.saveData("ModFlags",
|
||||
// FlagRegistry.getModFlag("ModFlags").getNBT());
|
||||
// }
|
||||
// }
|
||||
|
||||
public static int getLiquidAmount(FluidStack liquid) {
|
||||
return liquid != null ? liquid.amount : 0;
|
||||
}
|
||||
|
||||
static Fluid getOrRegisterFluid(String id) {
|
||||
FluidRegistry.registerFluid(new Fluid(id));
|
||||
|
||||
return FluidRegistry.getFluid(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package atomicscience;
|
||||
|
||||
import atomicscience.jiqi.BBase;
|
||||
import atomicscience.render.RH;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BAtomicAssembler extends BBase {
|
||||
|
||||
public BAtomicAssembler() {
|
||||
super("atomicAssembler");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMachineActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) {
|
||||
par1World.getBlockMetadata(x, y, z);
|
||||
if(!par1World.isRemote) {
|
||||
par5EntityPlayer.openGui(AtomicScience.instance, CommonProxy.GuiType.GOU_CHENG.ordinal(), par1World, x, y, z);
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int meta) {
|
||||
return new TAtomicAssembler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderType() {
|
||||
return RH.BLOCK_RENDER_ID;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package atomicscience;
|
||||
|
||||
import atomicscience.jiqi.BBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BAutoBuilder extends BBase {
|
||||
public static final int BAN_JING = 30;
|
||||
|
||||
public BAutoBuilder() {
|
||||
super("instantBuilder");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMachineActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) {
|
||||
par5EntityPlayer.openGui(AtomicScience.instance, -1, par1World, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int meta) {
|
||||
return new TAutoBuilder();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package atomicscience;
|
||||
|
||||
import atomicscience.api.poison.PoisonRadiation;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class BToxicWaste extends BlockFluidClassic {
|
||||
public BToxicWaste(String name) {
|
||||
super(AtomicScience.FLUID_TOXIC_WASTE, Material.water);
|
||||
this.setBlockName("atomicscience:" + name);
|
||||
this.setCreativeTab(TabAS.INSTANCE);
|
||||
this.setHardness(100.0F);
|
||||
this.setLightOpacity(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World par1World) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World par1World, int x, int y, int z,
|
||||
Random par5Random) {
|
||||
super.randomDisplayTick(par1World, x, y, z, par5Random);
|
||||
if (par5Random.nextInt(100) == 0) {
|
||||
double d5 = (double)((float)x + par5Random.nextFloat());
|
||||
double d7 = (double)y + this.maxY;
|
||||
double d6 = (double)((float)z + par5Random.nextFloat());
|
||||
par1World.spawnParticle("suspended", d5, d7, d6, 0.0D, 0.0D, 0.0D);
|
||||
par1World.playSound(d5, d7, d6, "liquid.lavapop",
|
||||
0.2F + par5Random.nextFloat() * 0.2F,
|
||||
0.9F + par5Random.nextFloat() * 0.15F, false);
|
||||
}
|
||||
|
||||
if (par5Random.nextInt(200) == 0) {
|
||||
par1World.playSound((double)x, (double)y, (double)z, "liquid.lava",
|
||||
0.2F + par5Random.nextFloat() * 0.2F,
|
||||
0.9F + par5Random.nextFloat() * 0.15F, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, int x, int y, int z,
|
||||
Entity entity) {
|
||||
if (entity instanceof EntityLiving) {
|
||||
entity.attackEntityFrom(DamageSource.wither, 3);
|
||||
PoisonRadiation.INSTANCE.poisonEntity(
|
||||
new Vector3((double)x, (double)y, (double)z), (EntityLiving)entity,
|
||||
4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon("atomicscience:toxicWaste");
|
||||
AtomicScience.FLUID_TOXIC_WASTE.setIcons(this.blockIcon);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
package atomicscience;
|
||||
|
||||
import atomicscience.fanwusu.EMatter;
|
||||
import atomicscience.fanwusu.TAccelerator;
|
||||
import atomicscience.fenlie.TCentrifuge;
|
||||
import atomicscience.fenlie.TFissionReactor;
|
||||
import atomicscience.fenlie.TNuclearBoiler;
|
||||
import atomicscience.hecheng.TFusionReactor;
|
||||
import atomicscience.jiqi.TChemicalExtractor;
|
||||
import atomicscience.jiqi.TThermometer;
|
||||
import atomicscience.jiqi.TTurbine;
|
||||
import atomicscience.render.RAtomicAssembler;
|
||||
import atomicscience.render.RCentrifuge;
|
||||
import atomicscience.render.RExtractor;
|
||||
import atomicscience.render.RFusionReactor;
|
||||
import atomicscience.render.RH;
|
||||
import atomicscience.render.RMatter;
|
||||
import atomicscience.render.RNuclearBoiler;
|
||||
import atomicscience.render.RReactorCell;
|
||||
import atomicscience.render.RThermometer;
|
||||
import atomicscience.render.RTurbine;
|
||||
import atomicscience.shimian.GAccelerator;
|
||||
import atomicscience.shimian.GAtomicAssembler;
|
||||
import atomicscience.shimian.GAutoBuilder;
|
||||
import atomicscience.shimian.GCentrifuge;
|
||||
import atomicscience.shimian.GChemicalReactor;
|
||||
import atomicscience.shimian.GFissionReactor;
|
||||
import atomicscience.shimian.GNuclearBoiler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
public void preInit() {
|
||||
RenderingRegistry.registerBlockHandler(new RH());
|
||||
}
|
||||
|
||||
public int getArmorIndex(String armor) {
|
||||
return RenderingRegistry.addNewArmourRendererPrefix(armor);
|
||||
}
|
||||
|
||||
public void init() {
|
||||
super.init();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TCentrifuge.class,
|
||||
new RCentrifuge());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TFusionReactor.class,
|
||||
new RFusionReactor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TNuclearBoiler.class,
|
||||
new RNuclearBoiler());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TTurbine.class,
|
||||
new RTurbine());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TThermometer.class,
|
||||
new RThermometer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TChemicalExtractor.class,
|
||||
new RExtractor());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TAtomicAssembler.class,
|
||||
new RAtomicAssembler());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TFissionReactor.class,
|
||||
new RReactorCell());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EMatter.class,
|
||||
new RMatter());
|
||||
}
|
||||
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world,
|
||||
int x, int y, int z) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (tileEntity != null && ID < CommonProxy.GuiType.values().length) {
|
||||
if (tileEntity instanceof TAutoBuilder) {
|
||||
return new GAutoBuilder(tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TCentrifuge) {
|
||||
return new GCentrifuge(player.inventory, (TCentrifuge)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TChemicalExtractor) {
|
||||
return new GChemicalReactor(player.inventory,
|
||||
(TChemicalExtractor)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TAccelerator) {
|
||||
return new GAccelerator(player.inventory, (TAccelerator)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TAtomicAssembler) {
|
||||
return new GAtomicAssembler(player.inventory,
|
||||
(TAtomicAssembler)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TNuclearBoiler) {
|
||||
return new GNuclearBoiler(player.inventory, (TNuclearBoiler)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TFissionReactor) {
|
||||
return new GFissionReactor(player.inventory,
|
||||
(TFissionReactor)tileEntity);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package atomicscience;
|
||||
|
||||
import atomicscience.fanwusu.CAccelerator;
|
||||
import atomicscience.fanwusu.TAccelerator;
|
||||
import atomicscience.fenlie.CCentrifuge;
|
||||
import atomicscience.fenlie.TCentrifuge;
|
||||
import atomicscience.fenlie.TFissionReactor;
|
||||
import atomicscience.fenlie.TNuclearBoiler;
|
||||
import atomicscience.hecheng.CChemicalExtractor;
|
||||
import atomicscience.hecheng.CNuclearBoiler;
|
||||
import atomicscience.jiqi.CAssembler;
|
||||
import atomicscience.jiqi.TChemicalExtractor;
|
||||
import atomicscience.shimian.CFissionReactor;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CommonProxy implements IGuiHandler {
|
||||
|
||||
public void preInit() {}
|
||||
|
||||
public void init() {}
|
||||
|
||||
public int getArmorIndex(String armor) { return 0; }
|
||||
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world,
|
||||
int x, int y, int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world,
|
||||
int x, int y, int z) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (tileEntity != null && ID < CommonProxy.GuiType.values().length &&
|
||||
ID >= 0) {
|
||||
if (tileEntity instanceof TCentrifuge) {
|
||||
return new CCentrifuge(player.inventory, (TCentrifuge)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TChemicalExtractor) {
|
||||
return new CChemicalExtractor(player.inventory,
|
||||
(TChemicalExtractor)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TAccelerator) {
|
||||
return new CAccelerator(player.inventory, (TAccelerator)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TAtomicAssembler) {
|
||||
return new CAssembler(player.inventory, (TAtomicAssembler)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TNuclearBoiler) {
|
||||
return new CNuclearBoiler(player.inventory, (TNuclearBoiler)tileEntity);
|
||||
}
|
||||
|
||||
if (tileEntity instanceof TFissionReactor) {
|
||||
return new CFissionReactor(player, (TFissionReactor)tileEntity);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static enum GuiType {
|
||||
|
||||
CENTRIFUGE,
|
||||
DAO_CHOU_QI,
|
||||
JIA_SU_QI,
|
||||
GOU_CHENG,
|
||||
HE_QI;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package atomicscience;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MegaTNTExplusion extends Explosion {
|
||||
|
||||
private Random explosionRAND = new Random();
|
||||
private World worldObj;
|
||||
|
||||
public MegaTNTExplusion(World world, Entity par2Entity, double par3,
|
||||
double par5, double par7, float par9) {
|
||||
super(world, par2Entity, par3, par5, par7, par9);
|
||||
this.worldObj = world;
|
||||
super.isFlaming = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doExplosionB(boolean par1) {
|
||||
super.doExplosionB(par1);
|
||||
for (Object chunkposition_obj : super.affectedBlockPositions) {
|
||||
ChunkPosition chunkposition = (ChunkPosition) chunkposition_obj;
|
||||
Block id = this.worldObj.getBlock(chunkposition.chunkPosX,
|
||||
chunkposition.chunkPosY,
|
||||
chunkposition.chunkPosZ);
|
||||
if (id == Blocks.air && id.isOpaqueCube() &&
|
||||
this.explosionRAND.nextInt(3) == 0) {
|
||||
this.worldObj.setBlock(chunkposition.chunkPosX, chunkposition.chunkPosY,
|
||||
chunkposition.chunkPosZ,
|
||||
AtomicScience.blockRadioactive);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package atomicscience;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufInputStream;
|
||||
import io.netty.buffer.ByteBufOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class PAutoBuilder implements IMessage {
|
||||
public Vector3 pos;
|
||||
public TAutoBuilder.AutoBuilderType type;
|
||||
public int radius;
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
try {
|
||||
NBTTagCompound nbt = CompressedStreamTools.read(
|
||||
new DataInputStream(new ByteBufInputStream(buf)));
|
||||
|
||||
this.pos = Vector3.readFromNBT(nbt.getCompoundTag("pos"));
|
||||
this.type = TAutoBuilder.AutoBuilderType.get(nbt.getInteger("type"));
|
||||
this.radius = nbt.getInteger("radius");
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
nbt.setTag("pos", this.pos.writeToNBT(new NBTTagCompound()));
|
||||
nbt.setInteger("type", this.type.ordinal());
|
||||
nbt.setInteger("radius", this.radius);
|
||||
|
||||
try {
|
||||
CompressedStreamTools.write(
|
||||
nbt, new DataOutputStream(new ByteBufOutputStream(buf)));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package atomicscience;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class PHAutoBuilder implements IMessageHandler<PAutoBuilder, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PAutoBuilder packet, MessageContext ctx) {
|
||||
World world = ctx.getServerHandler().playerEntity.worldObj;
|
||||
|
||||
TileEntity te = packet.pos.getTileEntity(world);
|
||||
if (!(te instanceof TAutoBuilder))
|
||||
return null;
|
||||
|
||||
TAutoBuilder ab = (TAutoBuilder)te;
|
||||
|
||||
ab.onActivatePacket(packet.type, packet.radius);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package atomicscience;
|
||||
|
||||
public class SoundManager {
|
||||
public static final String ANTIMATTER = "atomicscience:antimatter";
|
||||
public static final String STRANGE_MATTER = "atomicscience:strangematter";
|
||||
public static final String ALARM = "atomicscience:alarm";
|
||||
public static final String ACCELERATOR = "atomicscience:accelerator";
|
||||
public static final String TURBINE = "atomicscience:turbine";
|
||||
public static final String ASSEMBLER = "atomicscience:assembler";
|
||||
}
|
|
@ -0,0 +1,178 @@
|
|||
package atomicscience;
|
||||
|
||||
import atomicscience.jiqi.TInventory;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
|
||||
public class TAtomicAssembler extends TInventory {
|
||||
|
||||
public final int SMELTING_TICKS = 1200;
|
||||
public final float DIAN = 10000.0F;
|
||||
public int smeltingTicks = 0;
|
||||
public float rotationYaw1;
|
||||
public float rotationYaw2;
|
||||
public float rotationYaw3;
|
||||
public EntityItem entityItem;
|
||||
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.isDisabled()) {
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (this.canWork()) {
|
||||
double var10000 = super.wattsReceived;
|
||||
this.getClass();
|
||||
if (var10000 >= 10000.0D) {
|
||||
if (this.smeltingTicks == 0) {
|
||||
this.getClass();
|
||||
this.smeltingTicks = 1200;
|
||||
}
|
||||
|
||||
if (this.smeltingTicks > 0) {
|
||||
--this.smeltingTicks;
|
||||
if (this.smeltingTicks < 1) {
|
||||
this.work();
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
} else {
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
|
||||
super.wattsReceived = 0.0D;
|
||||
}
|
||||
} else {
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
|
||||
if (super.ticks % 10L == 0L) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord,
|
||||
this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.worldObj.isRemote && this.smeltingTicks > 0) {
|
||||
if (super.ticks % 600L == 0L) {
|
||||
this.worldObj.playSoundEffect(
|
||||
(double)this.xCoord, (double)this.yCoord, (double)this.zCoord,
|
||||
SoundManager.ASSEMBLER, 0.7F, 1.0F);
|
||||
}
|
||||
|
||||
this.rotationYaw1 += 3.0F;
|
||||
this.rotationYaw2 += 2.0F;
|
||||
++this.rotationYaw3;
|
||||
ItemStack var3 = this.getStackInSlot(6);
|
||||
if (var3 != null) {
|
||||
var3 = var3.copy();
|
||||
var3.stackSize = 1;
|
||||
if (this.entityItem == null) {
|
||||
this.entityItem =
|
||||
new EntityItem(this.worldObj, 0.0D, 0.0D, 0.0D, var3);
|
||||
} else if (!var3.isItemEqual(this.entityItem.getEntityItem())) {
|
||||
this.entityItem =
|
||||
new EntityItem(this.worldObj, 0.0D, 0.0D, 0.0D, var3);
|
||||
}
|
||||
|
||||
++this.entityItem.age;
|
||||
} else {
|
||||
this.entityItem = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ElectricityPack getRequest() {
|
||||
return this.canWork()
|
||||
? new ElectricityPack(10000.0D / this.getVoltage(), this.getVoltage())
|
||||
: new ElectricityPack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager arg0,
|
||||
S35PacketUpdateTileEntity arg1) {
|
||||
NBTTagCompound nbt = arg1.func_148857_g();
|
||||
|
||||
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
||||
super.disabledTicks = nbt.getInteger("disabledTicks");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
||||
nbt.setInteger("disabledTicks", super.disabledTicks);
|
||||
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||
this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
public void openInventory() {
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canWork() {
|
||||
if (super.containingItems[6] != null) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
if (super.containingItems[i] == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (super.containingItems[i].getItem() !=
|
||||
AtomicScience.itCellStrangeMatter) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return super.containingItems[6].stackSize < 64;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void work() {
|
||||
if (this.canWork()) {
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
if (super.containingItems[i] != null) {
|
||||
super.containingItems[i].setItemDamage(
|
||||
super.containingItems[i].getItemDamage() + 1);
|
||||
if (super.containingItems[i].getItemDamage() >= 64) {
|
||||
super.containingItems[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (super.containingItems[6] != null) {
|
||||
++super.containingItems[6].stackSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
||||
}
|
||||
|
||||
public double getVoltage() {
|
||||
return UniversalElectricity.isVoltageSensitive ? 480.0D : 120.0D;
|
||||
}
|
||||
|
||||
public int getSizeInventory() { return 7; }
|
||||
|
||||
public boolean isItemValidForSlot(int slotID, ItemStack itemStack) {
|
||||
return slotID == 6
|
||||
? true
|
||||
: itemStack.getItem() == AtomicScience.itCellStrangeMatter;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,350 @@
|
|||
package atomicscience;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
||||
|
||||
public class TAutoBuilder
|
||||
extends TileEntityAdvanced {
|
||||
public boolean canUpdate() { return false; }
|
||||
|
||||
public void onActivatePacket(TAutoBuilder.AutoBuilderType type, int radius) {
|
||||
if (!this.worldObj.isRemote) {
|
||||
try {
|
||||
Vector3 diDian = new Vector3(this);
|
||||
if (radius > 0) {
|
||||
int r;
|
||||
int x;
|
||||
int z;
|
||||
Vector3 targetPosition;
|
||||
Vector3 targetPosition1;
|
||||
byte var16;
|
||||
int var17;
|
||||
switch (TAutoBuilder.NamelessClass2141744605
|
||||
.$SwitchMap$atomicscience$TJianLi$JianLiType
|
||||
[type.ordinal()]) {
|
||||
case 1:
|
||||
r = radius;
|
||||
|
||||
for (x = -radius; x < r; ++x) {
|
||||
for (z = -r; z < r; ++z) {
|
||||
for (var17 = -1; var17 <= 1; ++var17) {
|
||||
targetPosition1 = diDian.clone();
|
||||
targetPosition1.add(
|
||||
new Vector3((double)x, (double)var17, (double)z));
|
||||
if (x == -r || x == r - 1 || z == -r || z == r - 1) {
|
||||
targetPosition1.setBlock(
|
||||
this.worldObj, AtomicScience.bElectromagnet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
r = radius - 2;
|
||||
|
||||
for (x = -r; x < r; ++x) {
|
||||
for (z = -r; z < r; ++z) {
|
||||
for (var17 = -1; var17 <= 1; ++var17) {
|
||||
if (x == -r || x == r - 1 || z == -r || z == r - 1) {
|
||||
targetPosition1 = diDian.clone();
|
||||
targetPosition1.add(
|
||||
new Vector3((double)x, (double)var17, (double)z));
|
||||
targetPosition1.setBlock(
|
||||
this.worldObj, AtomicScience.bElectromagnet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
r = radius - 1;
|
||||
|
||||
for (x = -r; x < r; ++x) {
|
||||
for (z = -r; z < r; ++z) {
|
||||
for (var17 = -1; var17 <= 1; ++var17) {
|
||||
if (x == -r || x == r - 1 || z == -r || z == r - 1) {
|
||||
targetPosition1 = diDian.clone();
|
||||
targetPosition1.add(
|
||||
new Vector3((double)x, (double)var17, (double)z));
|
||||
if (var17 != -1 && var17 != 1) {
|
||||
if (var17 == 0) {
|
||||
targetPosition1.setBlock(this.worldObj, Blocks.air);
|
||||
}
|
||||
} else {
|
||||
targetPosition1.setBlock(
|
||||
this.worldObj,
|
||||
AtomicScience.bElectromagnetGlass);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
case 2:
|
||||
if (radius <= 1) {
|
||||
var16 = 2;
|
||||
|
||||
for (x = -var16; x <= var16; ++x) {
|
||||
for (z = -var16; z <= var16; ++z) {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 0.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(this.worldObj,
|
||||
Blocks.water);
|
||||
}
|
||||
}
|
||||
|
||||
r = var16 - 1;
|
||||
|
||||
for (x = -r; x <= r; ++x) {
|
||||
for (z = -r; z <= r; ++z) {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 1.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(this.worldObj,
|
||||
AtomicScience.bTurbine);
|
||||
if ((x != -r && x != r || z != -r && z != r) &&
|
||||
(new Vector3((double)x, 0.0D, (double)z))
|
||||
.getMagnitude() <= 1.0D) {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, -1.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj,
|
||||
AtomicScience.bControlRod);
|
||||
targetPosition.add(new Vector3(0.0D, -1.0D, 0.0D));
|
||||
targetPosition.setBlock(
|
||||
this.worldObj, Blocks.sticky_piston, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vector3.add(diDian, new Vector3(0.0D, -1.0D, 0.0D))
|
||||
.setBlock(this.worldObj,
|
||||
AtomicScience.bThermometer);
|
||||
Vector3.add(diDian, new Vector3(0.0D, -3.0D, 0.0D))
|
||||
.setBlock(this.worldObj, AtomicScience.bSiren);
|
||||
Vector3.add(diDian, new Vector3(0.0D, -2.0D, 0.0D))
|
||||
.setBlock(this.worldObj, Blocks.redstone_wire);
|
||||
diDian.setBlock(this.worldObj,
|
||||
AtomicScience.bFissionReactor);
|
||||
break;
|
||||
} else {
|
||||
var16 = 2;
|
||||
|
||||
for (x = 0; x < radius; ++x) {
|
||||
for (z = -var16; z <= var16; ++z) {
|
||||
for (var17 = -var16; var17 <= var16; ++var17) {
|
||||
targetPosition1 =
|
||||
(new Vector3((double)z, (double)x, (double)var17))
|
||||
.add(diDian);
|
||||
Vector3 leveledDiDian =
|
||||
Vector3.add(diDian, new Vector3(0.0D, (double)x, 0.0D));
|
||||
if (x < radius - 1) {
|
||||
if (targetPosition1.distanceTo(leveledDiDian) == 2.0D) {
|
||||
targetPosition1.setBlock(
|
||||
this.worldObj,
|
||||
AtomicScience.bControlRod);
|
||||
} else if (z != -var16 && z != var16 && var17 != -var16 &&
|
||||
var17 != var16) {
|
||||
if (z == 0 && var17 == 0) {
|
||||
targetPosition1.setBlock(
|
||||
this.worldObj,
|
||||
AtomicScience.bFissionReactor);
|
||||
} else {
|
||||
targetPosition1.setBlock(
|
||||
this.worldObj,
|
||||
Blocks.water);
|
||||
}
|
||||
} else {
|
||||
targetPosition1.setBlock(
|
||||
this.worldObj, Blocks.glass);
|
||||
}
|
||||
} else if (targetPosition1.distanceTo(leveledDiDian) <
|
||||
2.0D) {
|
||||
targetPosition1.setBlock(
|
||||
this.worldObj, AtomicScience.bTurbine);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
case 3:
|
||||
r = Math.max(radius, 2);
|
||||
|
||||
for (x = -r; x <= r; ++x) {
|
||||
for (z = -r; z <= r; ++z) {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 0.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(this.worldObj,
|
||||
Blocks.water);
|
||||
}
|
||||
}
|
||||
|
||||
--r;
|
||||
|
||||
for (x = -r; x <= r; ++x) {
|
||||
for (z = -r; z <= r; ++z) {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 1.0D, (double)z)).add(diDian);
|
||||
if ((new Vector3((double)x, 0.0D, (double)z)).getMagnitude() <=
|
||||
2.0D) {
|
||||
if ((x == -r || x == r) && (z == -r || z == r)) {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, -1.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj,
|
||||
AtomicScience.bControlRod);
|
||||
targetPosition.add(new Vector3(0.0D, -1.0D, 0.0D));
|
||||
targetPosition.setBlock(
|
||||
this.worldObj, Blocks.sticky_piston, 1);
|
||||
} else {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 0.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(this.worldObj,
|
||||
AtomicScience.bFissionReactor);
|
||||
targetPosition =
|
||||
(new Vector3((double)x, -1.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj,
|
||||
AtomicScience.bThermometer);
|
||||
targetPosition =
|
||||
(new Vector3((double)x, -3.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj, AtomicScience.bSiren);
|
||||
targetPosition =
|
||||
(new Vector3((double)x, -2.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj, Blocks.redstone_wire);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vector3.add(diDian, new Vector3(0.0D, -3.0D, 0.0D))
|
||||
.setBlock(this.worldObj, Blocks.stone);
|
||||
Vector3.add(diDian, new Vector3(0.0D, -2.0D, 0.0D))
|
||||
.setBlock(this.worldObj, Blocks.stone);
|
||||
diDian.setBlock(this.worldObj, AtomicScience.bFissionReactor);
|
||||
break;
|
||||
case 4:
|
||||
r = Math.max(radius, 1);
|
||||
|
||||
for (x = -r; x <= r; ++x) {
|
||||
for (z = -r; z <= r; ++z) {
|
||||
targetPosition = new Vector3((double)x, 0.0D, (double)z);
|
||||
if (targetPosition.getMagnitude() > 1.0D) {
|
||||
if (targetPosition.getMagnitude() < (double)r) {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 1.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj, AtomicScience.bElectromagnet);
|
||||
targetPosition =
|
||||
(new Vector3((double)x, -1.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj, AtomicScience.bElectromagnet);
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 2.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(this.worldObj,
|
||||
Blocks.water);
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 3.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj, AtomicScience.bTurbine);
|
||||
} else if (targetPosition.getMagnitude() - 0.7D < (double)r) {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 0.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj,
|
||||
AtomicScience.bElectromagnetGlass);
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 2.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(
|
||||
this.worldObj,
|
||||
AtomicScience.bElectromagnetGlass);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var16 = 1;
|
||||
|
||||
for (x = -var16; x <= var16; ++x) {
|
||||
for (z = -var16; z <= var16; ++z) {
|
||||
targetPosition =
|
||||
(new Vector3((double)x, 0.0D, (double)z)).add(diDian);
|
||||
targetPosition.setBlock(this.worldObj,
|
||||
AtomicScience.bElectromagnet);
|
||||
}
|
||||
}
|
||||
|
||||
diDian.setBlock(this.worldObj,
|
||||
AtomicScience.bFusionReactor);
|
||||
}
|
||||
}
|
||||
} catch (Exception var15) {
|
||||
var15.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// $FF: synthetic class
|
||||
static class NamelessClass2141744605 {
|
||||
|
||||
// $FF: synthetic field
|
||||
static final int[] $SwitchMap$atomicscience$TJianLi$JianLiType =
|
||||
new int[TAutoBuilder.AutoBuilderType.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
$SwitchMap$atomicscience$TJianLi$JianLiType[TAutoBuilder.AutoBuilderType
|
||||
.JIA_SU_QI.ordinal()] =
|
||||
1;
|
||||
} catch (NoSuchFieldError var4) {
|
||||
;
|
||||
}
|
||||
|
||||
try {
|
||||
$SwitchMap$atomicscience$TJianLi$JianLiType[TAutoBuilder.AutoBuilderType
|
||||
.FEN_LIE.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError var3) {
|
||||
;
|
||||
}
|
||||
|
||||
try {
|
||||
$SwitchMap$atomicscience$TJianLi$JianLiType[TAutoBuilder.AutoBuilderType
|
||||
.HUAN_YUAN.ordinal()] =
|
||||
3;
|
||||
} catch (NoSuchFieldError var2) {
|
||||
;
|
||||
}
|
||||
|
||||
try {
|
||||
$SwitchMap$atomicscience$TJianLi$JianLiType[TAutoBuilder.AutoBuilderType
|
||||
.HE_CHENG.ordinal()] =
|
||||
4;
|
||||
} catch (NoSuchFieldError var1) {
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static enum AutoBuilderType {
|
||||
|
||||
JIA_SU_QI("Particle Accelerator"),
|
||||
FEN_LIE("Fission Reactor"),
|
||||
HE_CHENG("Fusion Reactor"),
|
||||
HUAN_YUAN("Breeder Reactor");
|
||||
|
||||
public final String name;
|
||||
|
||||
private AutoBuilderType(String name) { this.name = name; }
|
||||
|
||||
public static TAutoBuilder.AutoBuilderType get(int id) {
|
||||
return id >= 0 && id < values().length ? values()[id] : null;
|
||||
}
|
||||
|
||||
public TAutoBuilder.AutoBuilderType next() {
|
||||
return values()[(this.ordinal() + 1) % values().length];
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package atomicscience;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class TabAS extends CreativeTabs {
|
||||
|
||||
public static final TabAS INSTANCE = new TabAS("atomicscience");
|
||||
|
||||
|
||||
public TabAS(String par2Str) {
|
||||
super(CreativeTabs.getNextID(), par2Str);
|
||||
}
|
||||
|
||||
public Item getTabIconItem() {
|
||||
return Item.getItemFromBlock(AtomicScience.bFusionReactor);
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,17 @@
|
|||
package atomicscience.api;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class AtomicScience {
|
||||
|
||||
public static final String MAJOR_VERSION = "0";
|
||||
public static final String MINOR_VERSION = "6";
|
||||
public static final String REVISION_VERSION = "2";
|
||||
public static final String BUILD_VERSION = "117";
|
||||
public static final String VERSION = "0.6.2";
|
||||
public static final String NAME = "Atomic Science";
|
||||
public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), "AtomicScience.cfg"));
|
||||
}
|
|
@ -0,0 +1,141 @@
|
|||
package atomicscience.api;
|
||||
|
||||
import atomicscience.api.poison.PoisonRadiation;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
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.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class BlockRadioactive extends Block {
|
||||
|
||||
public static int RECOMMENDED_ID = 3768;
|
||||
public boolean canSpread;
|
||||
public float radius;
|
||||
public int amplifier;
|
||||
public boolean canWalkPoison;
|
||||
public boolean isRandomlyRadioactive;
|
||||
private IIcon iconTop;
|
||||
private IIcon iconBottom;
|
||||
|
||||
public BlockRadioactive(Material material) {
|
||||
super(material);
|
||||
this.canSpread = true;
|
||||
this.radius = 5.0F;
|
||||
this.amplifier = 2;
|
||||
this.canWalkPoison = true;
|
||||
this.isRandomlyRadioactive = true;
|
||||
this.setTickRandomly(true);
|
||||
this.setHardness(0.2F);
|
||||
this.setLightLevel(0.1F);
|
||||
}
|
||||
|
||||
public BlockRadioactive() {
|
||||
this(Material.rock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side == 1 ? this.iconTop
|
||||
: (side == 0 ? this.iconBottom : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockClicked(World world, int x, int y, int z,
|
||||
EntityPlayer par5EntityPlayer) {
|
||||
if ((double) world.rand.nextFloat() > 0.8D) {
|
||||
this.updateTick(world, x, y, z, world.rand);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
if (!world.isRemote) {
|
||||
if (this.isRandomlyRadioactive) {
|
||||
AxisAlignedBB i = AxisAlignedBB.getBoundingBox(
|
||||
(double) ((float) x - this.radius), (double) ((float) y - this.radius),
|
||||
(double) ((float) z - this.radius), (double) ((float) x + this.radius),
|
||||
(double) ((float) y + this.radius), (double) ((float) z + this.radius));
|
||||
List<EntityLiving> newX = world.getEntitiesWithinAABB(EntityLiving.class, i);
|
||||
|
||||
for (EntityLiving newZ : newX) {
|
||||
PoisonRadiation.INSTANCE.poisonEntity(
|
||||
new Vector3((double) x, (double) y, (double) z), newZ,
|
||||
this.amplifier);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.canSpread) {
|
||||
for (int var11 = 0; var11 < 4; ++var11) {
|
||||
int xOffset = x + rand.nextInt(3) - 1;
|
||||
int yOffset = y + rand.nextInt(5) - 3;
|
||||
int zOffset = z + rand.nextInt(3) - 1;
|
||||
Block block = world.getBlock(xOffset, yOffset, zOffset);
|
||||
if ((double) rand.nextFloat() > 0.4D &&
|
||||
(block == Blocks.farmland || block == Blocks.grass)) {
|
||||
world.setBlock(xOffset, yOffset, zOffset, this);
|
||||
}
|
||||
}
|
||||
|
||||
if ((double) rand.nextFloat() > 0.85D) {
|
||||
world.setBlock(x, y, z, Blocks.mycelium);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void func_71891_b(World par1World, int x, int y, int z,
|
||||
Entity par5Entity) {
|
||||
if (par5Entity instanceof EntityLiving && this.canWalkPoison) {
|
||||
PoisonRadiation.INSTANCE.poisonEntity(
|
||||
new Vector3((double) x, (double) y, (double) z),
|
||||
(EntityLiving) par5Entity);
|
||||
}
|
||||
}
|
||||
|
||||
public int func_71925_a(Random par1Random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void func_71862_a(World world, int x, int y, int z,
|
||||
Random par5Random) {
|
||||
if (Minecraft.getMinecraft().gameSettings.particleSetting == 0) {
|
||||
byte radius = 3;
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
Vector3 diDian = new Vector3((double) x, (double) y, (double) z);
|
||||
diDian.x += Math.random() * (double) radius - (double) (radius / 2);
|
||||
diDian.y += Math.random() * (double) radius - (double) (radius / 2);
|
||||
diDian.z += Math.random() * (double) radius - (double) (radius / 2);
|
||||
EntitySmokeFX fx = new EntitySmokeFX(
|
||||
world, diDian.x, diDian.y, diDian.z, (Math.random() - 0.5D) / 2.0D,
|
||||
(Math.random() - 0.5D) / 2.0D, (Math.random() - 0.5D) / 2.0D);
|
||||
fx.setRBGColorF(0.2F, 0.8F, 0.0F);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package atomicscience.api;
|
||||
|
||||
import atomicscience.api.poison.Poison;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IAntiPoisonArmor {
|
||||
|
||||
boolean isProtectedFromPoison(ItemStack var1, EntityLivingBase var2, Poison var3);
|
||||
|
||||
void onProtectFromPoison(ItemStack var1, EntityLivingBase var2, Poison var3);
|
||||
|
||||
Poison.ArmorType getArmorType();
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package atomicscience.api;
|
||||
|
||||
import atomicscience.api.poison.Poison;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IAntiPoisonBlock {
|
||||
|
||||
boolean isPoisonPrevention(World var1, int var2, int var3, int var4, Poison var5);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package atomicscience.api;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public interface IElectromagnet {
|
||||
|
||||
boolean isRunning(World var1, int var2, int var3, int var4);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package atomicscience.api;
|
||||
|
||||
import atomicscience.api.ITemperature;
|
||||
|
||||
public interface IFissileMaterial {
|
||||
|
||||
int onFissile(ITemperature var1);
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package atomicscience.api;
|
||||
|
||||
import atomicscience.api.ITemperature;
|
||||
|
||||
public interface IHeatSource extends ITemperature {
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package atomicscience.api;
|
||||
|
||||
|
||||
public interface IReactor {
|
||||
|
||||
boolean isOverToxic();
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package atomicscience.api;
|
||||
|
||||
|
||||
public interface ISteamReceptor {
|
||||
|
||||
void onReceiveSteam(int var1);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
package atomicscience.api;
|
||||
|
||||
|
||||
public interface ITemperature {
|
||||
|
||||
float getTemperature();
|
||||
|
||||
void setTemperature(float var1);
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package atomicscience.api;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class Plasma {
|
||||
|
||||
public static Plasma.IPlasma blockPlasma;
|
||||
|
||||
|
||||
|
||||
public interface IPlasma {
|
||||
|
||||
void spawn(World var1, int var2, int var3, int var4, byte var5);
|
||||
|
||||
boolean canPlace(World var1, int var2, int var3, int var4);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package atomicscience.api.poison;
|
||||
|
||||
import atomicscience.api.IAntiPoisonArmor;
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public abstract class Poison {
|
||||
|
||||
public static Poison[] list = new Poison[32];
|
||||
protected String name;
|
||||
protected EnumSet<Poison.ArmorType> armorRequired;
|
||||
|
||||
public Poison(String name, int id) {
|
||||
this.armorRequired = EnumSet.range(Poison.ArmorType.HELM, Poison.ArmorType.BOOTS);
|
||||
this.name = name;
|
||||
if (list == null) {
|
||||
list = new Poison[32];
|
||||
}
|
||||
|
||||
list[0] = this;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public EnumSet<Poison.ArmorType> getArmorRequired() {
|
||||
return this.armorRequired;
|
||||
}
|
||||
|
||||
public void poisonEntity(Vector3 emitPosition, EntityLivingBase entity,
|
||||
int amplifier) {
|
||||
EnumSet<Poison.ArmorType> armorWorn = EnumSet.of(Poison.ArmorType.UNKNOWN);
|
||||
if (entity instanceof EntityPlayer) {
|
||||
EntityPlayer entityPlayer = (EntityPlayer) entity;
|
||||
|
||||
for (int i = 0; i < entityPlayer.inventory.armorInventory.length; ++i) {
|
||||
if (entityPlayer.inventory.armorInventory[i] != null &&
|
||||
entityPlayer.inventory.armorInventory[i].getItem() instanceof IAntiPoisonArmor &&
|
||||
((IAntiPoisonArmor) entityPlayer.inventory.armorInventory[i]
|
||||
.getItem())
|
||||
.isProtectedFromPoison(entityPlayer.inventory.armorInventory[i],
|
||||
entity, this)) {
|
||||
((IAntiPoisonArmor) entityPlayer.inventory.armorInventory[i].getItem())
|
||||
.onProtectFromPoison(entityPlayer.inventory.armorInventory[i],
|
||||
entity, this);
|
||||
armorWorn.add(
|
||||
((IAntiPoisonArmor) entityPlayer.inventory.armorInventory[i]
|
||||
.getItem())
|
||||
.getArmorType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!armorWorn.containsAll(this.armorRequired)) {
|
||||
this.doPoisonEntity(emitPosition, entity, armorWorn, amplifier);
|
||||
}
|
||||
}
|
||||
|
||||
public void poisonEntity(Vector3 emitPosition, EntityLivingBase entity) {
|
||||
this.poisonEntity(emitPosition, entity, 0);
|
||||
}
|
||||
|
||||
protected abstract void doPoisonEntity(Vector3 var1, EntityLivingBase var2,
|
||||
EnumSet<Poison.ArmorType> var3, int var4);
|
||||
|
||||
public static enum ArmorType {
|
||||
HELM,
|
||||
BODY,
|
||||
LEGGINGS,
|
||||
BOOTS,
|
||||
UNKNOWN;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package atomicscience.api.poison;
|
||||
|
||||
import atomicscience.api.IAntiPoisonBlock;
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.CustomDamageSource;
|
||||
import universalelectricity.prefab.potion.CustomPotionEffect;
|
||||
|
||||
public class PoisonRadiation extends Poison {
|
||||
|
||||
public static final Poison INSTANCE = new PoisonRadiation("radiation", 0);
|
||||
public static final CustomDamageSource damageSource = (CustomDamageSource) (new CustomDamageSource("radiation"))
|
||||
.setDamageBypassesArmor();
|
||||
public static boolean disabled = false;
|
||||
|
||||
public PoisonRadiation(String name, int id) {
|
||||
super(name, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doPoisonEntity(Vector3 emitPosition, EntityLivingBase entity,
|
||||
EnumSet<Poison.ArmorType> armorWorn,
|
||||
int amplifier) {
|
||||
if (!disabled) {
|
||||
if (emitPosition == null) {
|
||||
entity.addPotionEffect(
|
||||
new CustomPotionEffect(PotionRadiation.INSTANCE.getId(),
|
||||
300 * (amplifier + 1), amplifier, null));
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.getAntiRadioactiveCount(entity.worldObj, emitPosition,
|
||||
new Vector3(entity)) <= amplifier) {
|
||||
entity.addPotionEffect(
|
||||
new CustomPotionEffect(PotionRadiation.INSTANCE.getId(),
|
||||
400 * (amplifier + 1), amplifier, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getAntiRadioactiveCount(World world, Vector3 startingPosition,
|
||||
Vector3 endingPosition) {
|
||||
Vector3 delta = Vector3.subtract(endingPosition, startingPosition).normalize();
|
||||
Vector3 targetPosition = startingPosition.clone();
|
||||
double totalDistance = startingPosition.distanceTo(endingPosition);
|
||||
int count = 0;
|
||||
if (totalDistance > 1.0D) {
|
||||
for (; targetPosition.distanceTo(endingPosition) <= totalDistance; targetPosition.add(delta)) {
|
||||
Block block = targetPosition.getBlock(world);
|
||||
if (block != Blocks.air && block instanceof IAntiPoisonBlock &&
|
||||
((IAntiPoisonBlock) block)
|
||||
.isPoisonPrevention(world, targetPosition.intX(),
|
||||
targetPosition.intY(),
|
||||
targetPosition.intZ(), this)) {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package atomicscience.api.poison;
|
||||
|
||||
import atomicscience.api.AtomicScience;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import universalelectricity.prefab.potion.CustomPotion;
|
||||
|
||||
public class PotionRadiation extends CustomPotion {
|
||||
public static final PotionRadiation INSTANCE;
|
||||
|
||||
public PotionRadiation(int id, boolean isBadEffect, int color, String name) {
|
||||
super(AtomicScience.CONFIGURATION.get("Potion", name + " potion ID", id)
|
||||
.getInt(id),
|
||||
isBadEffect, color, name);
|
||||
this.setIconIndex(6, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase entity, int amplifier) {
|
||||
if ((double) entity.worldObj.rand.nextFloat() > 0.9D - (double) amplifier * 0.08D) {
|
||||
entity.attackEntityFrom(PoisonRadiation.damageSource, 1);
|
||||
if (entity instanceof EntityPlayer) {
|
||||
((EntityPlayer) entity)
|
||||
.addExhaustion(0.01F * (float) (amplifier + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isReady(int duration, int amplifier) {
|
||||
return duration % 10 == 0;
|
||||
}
|
||||
|
||||
static {
|
||||
AtomicScience.CONFIGURATION.load();
|
||||
INSTANCE = new PotionRadiation(21, true, 5149489, "radiation");
|
||||
AtomicScience.CONFIGURATION.save();
|
||||
}
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,34 @@
|
|||
package atomicscience.fanwusu;
|
||||
|
||||
import atomicscience.CommonProxy;
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.api.IElectromagnet;
|
||||
import atomicscience.jiqi.BBaseRotatable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
|
||||
public class BAccelerator extends BBaseRotatable implements IElectromagnet {
|
||||
|
||||
public BAccelerator() {
|
||||
super("accelerator", UniversalElectricity.machine);
|
||||
}
|
||||
|
||||
public boolean onMachineActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) {
|
||||
par1World.getBlockMetadata(x, y, z);
|
||||
if(!par1World.isRemote) {
|
||||
par5EntityPlayer.openGui(AtomicScience.instance, CommonProxy.GuiType.JIA_SU_QI.ordinal(), par1World, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TAccelerator();
|
||||
}
|
||||
|
||||
public boolean isRunning(World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package atomicscience.fanwusu;
|
||||
|
||||
import atomicscience.fanwusu.TFulminationGenerator;
|
||||
import atomicscience.jiqi.BBase;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BFulminationGenerator extends BBase {
|
||||
|
||||
public BFulminationGenerator() {
|
||||
super("fulmination");
|
||||
this.setHardness(50.0F);
|
||||
}
|
||||
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TFulminationGenerator();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package atomicscience.fanwusu;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.SlotFurnace;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CAccelerator extends Container {
|
||||
private TAccelerator tileEntity;
|
||||
|
||||
public CAccelerator(InventoryPlayer par1InventoryPlayer, TAccelerator tileEntity) {
|
||||
this.tileEntity = tileEntity;
|
||||
this.addSlotToContainer(new Slot(tileEntity, 0, 132, 24));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 1, 132, 51));
|
||||
this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, tileEntity, 2, 152, 51));
|
||||
|
||||
int var3;
|
||||
for(var3 = 0; var3 < 3; ++var3) {
|
||||
for(int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(var3 = 0; var3 < 9; ++var3) {
|
||||
this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
|
||||
}
|
||||
|
||||
this.tileEntity.players.add(par1InventoryPlayer.player);
|
||||
tileEntity.openInventory();
|
||||
}
|
||||
|
||||
public void onContainerClosed(EntityPlayer entityplayer) {
|
||||
super.onContainerClosed(entityplayer);
|
||||
this.tileEntity.players.remove(entityplayer);
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||
return this.tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
}
|
||||
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1) {
|
||||
ItemStack var2 = null;
|
||||
Slot var3 = (Slot)super.inventorySlots.get(par1);
|
||||
if(var3 != null && var3.getHasStack()) {
|
||||
ItemStack itemStack = var3.getStack();
|
||||
var2 = itemStack.copy();
|
||||
if(par1 > 2) {
|
||||
if(itemStack.getItem() == AtomicScience.itCell) {
|
||||
if(!this.mergeItemStack(itemStack, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(itemStack, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(itemStack, 3, 39, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(itemStack.stackSize == 0) {
|
||||
var3.putStack((ItemStack)null);
|
||||
} else {
|
||||
var3.onSlotChanged();
|
||||
}
|
||||
|
||||
if(itemStack.stackSize == var2.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var3.onPickupFromSlot(par1EntityPlayer, itemStack);
|
||||
}
|
||||
|
||||
return var2;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,316 @@
|
|||
package atomicscience.fanwusu;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.api.IElectromagnet;
|
||||
import atomicscience.api.poison.PoisonRadiation;
|
||||
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
|
||||
public class EMatter extends Entity implements IEntityAdditionalSpawnData {
|
||||
|
||||
// private static final int FANG_XIANG_DATA = 20;
|
||||
private int lastTurn;
|
||||
private Vector3 jiQi;
|
||||
private ForgeDirection fangXiang;
|
||||
public Ticket youPiao;
|
||||
|
||||
public EMatter(World par1World) {
|
||||
super(par1World);
|
||||
this.lastTurn = 60;
|
||||
this.jiQi = new Vector3();
|
||||
this.fangXiang = ForgeDirection.NORTH;
|
||||
this.setSize(0.2F, 0.2F);
|
||||
super.renderDistanceWeight = 3.0D;
|
||||
super.noClip = true;
|
||||
super.ignoreFrustumCheck = true;
|
||||
}
|
||||
|
||||
public EMatter(World par1World, Vector3 diDian, Vector3 jiQi,
|
||||
ForgeDirection direction) {
|
||||
this(par1World);
|
||||
this.setPosition(diDian.x, diDian.y, diDian.z);
|
||||
this.jiQi = jiQi;
|
||||
this.fangXiang = direction;
|
||||
}
|
||||
|
||||
public void writeSpawnData(ByteBuf data) {
|
||||
data.writeInt(this.jiQi.intX());
|
||||
data.writeInt(this.jiQi.intY());
|
||||
data.writeInt(this.jiQi.intZ());
|
||||
data.writeInt(this.fangXiang.ordinal());
|
||||
}
|
||||
|
||||
public void readSpawnData(ByteBuf data) {
|
||||
this.jiQi.x = (double)data.readInt();
|
||||
this.jiQi.y = (double)data.readInt();
|
||||
this.jiQi.z = (double)data.readInt();
|
||||
this.fangXiang = ForgeDirection.getOrientation(data.readInt());
|
||||
}
|
||||
|
||||
protected void entityInit() {
|
||||
super.dataWatcher.addObject(20, Byte.valueOf((byte)3));
|
||||
if (this.youPiao == null) {
|
||||
this.youPiao = ForgeChunkManager.requestTicket(
|
||||
AtomicScience.instance, super.worldObj, Type.ENTITY);
|
||||
this.youPiao.getModData();
|
||||
this.youPiao.bindEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void onUpdate() {
|
||||
if (super.ticksExisted % 10 == 0) {
|
||||
super.worldObj.playSoundAtEntity(
|
||||
this, "atomicscience.accelerator", 1.5F,
|
||||
(float)(0.6000000238418579D + 0.4D * (this.getSuDu() / 1.0D)));
|
||||
}
|
||||
|
||||
TileEntity t = super.worldObj.getTileEntity(
|
||||
this.jiQi.intX(), this.jiQi.intY(), this.jiQi.intZ());
|
||||
if (!(t instanceof TAccelerator)) {
|
||||
this.setDead();
|
||||
} else {
|
||||
TAccelerator tileEntity = (TAccelerator)t;
|
||||
if (tileEntity.wuSu == null) {
|
||||
tileEntity.wuSu = this;
|
||||
}
|
||||
|
||||
for (int jianKuai = -1; jianKuai < 1; ++jianKuai) {
|
||||
for (int z = -1; z < 1; ++z) {
|
||||
ForgeChunkManager.forceChunk(
|
||||
this.youPiao,
|
||||
new ChunkCoordIntPair(((int)super.posX >> 4) + jianKuai,
|
||||
((int)super.posZ >> 4) + z));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (!super.worldObj.isRemote) {
|
||||
super.dataWatcher.updateObject(
|
||||
20, Byte.valueOf((byte)this.fangXiang.ordinal()));
|
||||
} else {
|
||||
this.fangXiang = ForgeDirection.getOrientation(
|
||||
super.dataWatcher.getWatchableObjectByte(20));
|
||||
}
|
||||
} catch (Exception var13) {
|
||||
var13.printStackTrace();
|
||||
}
|
||||
|
||||
double var14 = 6.99999975040555E-4D;
|
||||
ForgeDirection zuoFangXiang = VectorHelper.getOrientationFromSide(
|
||||
this.fangXiang, ForgeDirection.EAST);
|
||||
Block zuoBlockID = super.worldObj.getBlock(
|
||||
MathHelper.floor_double(super.posX + (double)zuoFangXiang.offsetX),
|
||||
MathHelper.floor_double(super.posY),
|
||||
MathHelper.floor_double(super.posZ + (double)zuoFangXiang.offsetZ));
|
||||
ForgeDirection youFangXiang = VectorHelper.getOrientationFromSide(
|
||||
this.fangXiang, ForgeDirection.WEST);
|
||||
Block youBlockID = super.worldObj.getBlock(
|
||||
MathHelper.floor_double(super.posX + (double)youFangXiang.offsetX),
|
||||
MathHelper.floor_double(super.posY),
|
||||
MathHelper.floor_double(super.posZ + (double)youFangXiang.offsetZ));
|
||||
if ((zuoBlockID == Blocks.air || youBlockID == Blocks.air) &&
|
||||
this.lastTurn <= 0) {
|
||||
var14 = this.turn();
|
||||
super.motionX = 0.0D;
|
||||
super.motionY = 0.0D;
|
||||
super.motionZ = 0.0D;
|
||||
this.lastTurn = 40;
|
||||
}
|
||||
|
||||
--this.lastTurn;
|
||||
if (canCunZai(super.worldObj, new Vector3(this), this.fangXiang) &&
|
||||
!super.isCollided) {
|
||||
Vector3 dongLi = new Vector3();
|
||||
dongLi.modifyPositionFromSide(this.fangXiang);
|
||||
dongLi.multiply(var14);
|
||||
super.motionX = Math.min(dongLi.x + super.motionX, 1.0D);
|
||||
super.motionY = Math.min(dongLi.y + super.motionY, 1.0D);
|
||||
super.motionZ = Math.min(dongLi.z + super.motionZ, 1.0D);
|
||||
super.isAirBorne = true;
|
||||
super.lastTickPosX = super.posX;
|
||||
super.lastTickPosY = super.posY;
|
||||
super.lastTickPosZ = super.posZ;
|
||||
super.posX += super.motionX;
|
||||
super.posY += super.motionY;
|
||||
super.posZ += super.motionZ;
|
||||
this.setPosition(super.posX, super.posY, super.posZ);
|
||||
if (super.lastTickPosX == super.posX &&
|
||||
super.lastTickPosY == super.posY &&
|
||||
super.lastTickPosZ == super.posZ && this.getSuDu() <= 0.0D &&
|
||||
this.lastTurn <= 0) {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
super.worldObj.spawnParticle("portal", super.posX, super.posY,
|
||||
super.posZ, 0.0D, 0.0D, 0.0D);
|
||||
super.worldObj.spawnParticle("largesmoke", super.posX, super.posY,
|
||||
super.posZ, 0.0D, 0.0D, 0.0D);
|
||||
if (super.ticksExisted % 10 == 0) {
|
||||
float radius = 0.6F;
|
||||
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(
|
||||
super.posX - (double)radius, super.posY - (double)radius,
|
||||
super.posZ - (double)radius, super.posX + (double)radius,
|
||||
super.posY + (double)radius, super.posZ + (double)radius);
|
||||
List<Entity> entitiesNearby =
|
||||
super.worldObj.getEntitiesWithinAABB(Entity.class, bounds);
|
||||
if (entitiesNearby.size() > 1) {
|
||||
this.explode();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
this.explode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private double turn() {
|
||||
ForgeDirection zuoFangXiang = VectorHelper.getOrientationFromSide(
|
||||
this.fangXiang, ForgeDirection.EAST);
|
||||
Vector3 zuoBian = new Vector3(this);
|
||||
zuoBian.modifyPositionFromSide(zuoFangXiang);
|
||||
ForgeDirection youFangXiang = VectorHelper.getOrientationFromSide(
|
||||
this.fangXiang, ForgeDirection.WEST);
|
||||
Vector3 youBian = new Vector3(this);
|
||||
youBian.modifyPositionFromSide(youFangXiang);
|
||||
if (zuoBian.getBlock(super.worldObj) == Blocks.air) {
|
||||
this.fangXiang = zuoFangXiang;
|
||||
} else {
|
||||
if (youBian.getBlock(super.worldObj) != Blocks.air) {
|
||||
this.setDead();
|
||||
return 0.0D;
|
||||
}
|
||||
|
||||
this.fangXiang = youFangXiang;
|
||||
}
|
||||
|
||||
this.setPosition(Math.floor(super.posX) + 0.5D,
|
||||
Math.floor(super.posY) + 0.5D,
|
||||
Math.floor(super.posZ) + 0.5D);
|
||||
return this.getSuDu() -
|
||||
this.getSuDu() /
|
||||
Math.min(Math.max(70.0D * this.getSuDu(), 4.0D), 30.0D);
|
||||
}
|
||||
|
||||
public void explode() {
|
||||
if (!super.worldObj.isRemote) {
|
||||
boolean radius = false;
|
||||
if (this.getSuDu() > 0.5D) {
|
||||
float bounds = 1.0F;
|
||||
AxisAlignedBB livingNearby = AxisAlignedBB.getBoundingBox(
|
||||
super.posX - (double)bounds, super.posY - (double)bounds,
|
||||
super.posZ - (double)bounds, super.posX + (double)bounds,
|
||||
super.posY + (double)bounds, super.posZ + (double)bounds);
|
||||
List<Entity> entities =
|
||||
super.worldObj.getEntitiesWithinAABB(Entity.class, livingNearby);
|
||||
|
||||
for (Entity entity : entities) {
|
||||
if (entity instanceof EMatter) {
|
||||
if ((double)super.worldObj.rand.nextFloat() > 0.85D) {
|
||||
super.worldObj.spawnEntityInWorld(new EntityItem(
|
||||
super.worldObj, super.posX, super.posY, super.posZ,
|
||||
new ItemStack(AtomicScience.itCellStrangeMatter)));
|
||||
}
|
||||
|
||||
radius = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ((double)super.worldObj.rand.nextFloat() > 0.95D) {
|
||||
super.worldObj.spawnEntityInWorld(
|
||||
new EntityItem(super.worldObj, super.posX, super.posY, super.posZ,
|
||||
new ItemStack(AtomicScience.itCellStrangeMatter)));
|
||||
}
|
||||
}
|
||||
|
||||
if (!radius) {
|
||||
super.worldObj.createExplosion(this, super.posX, super.posY, super.posZ,
|
||||
(float)this.getSuDu() * 2.5F, true);
|
||||
}
|
||||
}
|
||||
|
||||
float radius1 = 6.0F;
|
||||
AxisAlignedBB bounds1 = AxisAlignedBB.getBoundingBox(
|
||||
super.posX - (double)radius1, super.posY - (double)radius1,
|
||||
super.posZ - (double)radius1, super.posX + (double)radius1,
|
||||
super.posY + (double)radius1, super.posZ + (double)radius1);
|
||||
List<EntityLivingBase> livingNearby1 =
|
||||
super.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, bounds1);
|
||||
|
||||
for (EntityLivingBase entity2 : livingNearby1) {
|
||||
PoisonRadiation.INSTANCE.poisonEntity(new Vector3(entity2), entity2);
|
||||
}
|
||||
|
||||
super.worldObj.playSoundEffect(
|
||||
super.posX, super.posY, super.posZ, "atomicscience.antimatter", 1.5F,
|
||||
1.0F - super.worldObj.rand.nextFloat() * 0.3F);
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
public double getSuDu() {
|
||||
return Math.abs(super.motionX) + Math.abs(super.motionY) +
|
||||
Math.abs(super.motionZ);
|
||||
}
|
||||
|
||||
public static boolean canCunZai(World worldObj, Vector3 position,
|
||||
ForgeDirection facing) {
|
||||
if (position.getBlock(worldObj) != Blocks.air) {
|
||||
return false;
|
||||
} else {
|
||||
for (int i = 0; i <= 1; ++i) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(i);
|
||||
if (!isElectromagnet(worldObj, position, dir)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isElectromagnet(World worldObj, Vector3 position,
|
||||
ForgeDirection dir) {
|
||||
Vector3 checkPos = position.clone();
|
||||
checkPos.modifyPositionFromSide(dir);
|
||||
Block block = checkPos.getBlock(worldObj);
|
||||
return block != Blocks.air ? block instanceof IElectromagnet : false;
|
||||
}
|
||||
|
||||
public void applyEntityCollision(Entity par1Entity) { this.explode(); }
|
||||
|
||||
public void setDead() {
|
||||
ForgeChunkManager.releaseTicket(this.youPiao);
|
||||
super.setDead();
|
||||
}
|
||||
|
||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
this.jiQi = Vector3.readFromNBT(nbt.getCompoundTag("jiqi"));
|
||||
ForgeDirection.getOrientation(nbt.getByte("fangXiang"));
|
||||
}
|
||||
|
||||
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
nbt.setTag("jiqi", this.jiQi.writeToNBT(new NBTTagCompound()));
|
||||
nbt.setByte("fangXiang", (byte)this.fangXiang.ordinal());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package atomicscience.fanwusu;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import icbm.api.explosion.ExplosionEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import net.minecraft.util.Vec3;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class FulminationEventHandler {
|
||||
public static final FulminationEventHandler INSTANCE =
|
||||
new FulminationEventHandler();
|
||||
public static final List<TFulminationGenerator> list = new ArrayList<>();
|
||||
|
||||
public void register(TFulminationGenerator tileEntity) {
|
||||
if (!list.contains(tileEntity)) {
|
||||
list.add(tileEntity);
|
||||
}
|
||||
}
|
||||
|
||||
public void unregister(TFulminationGenerator tileEntity) {
|
||||
list.remove(tileEntity);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPreExplosionEvent(ExplosionEvent.PreExplosionEvent event) {
|
||||
if (event.explosive != null && event.explosive.getRadius() > 0.0F &&
|
||||
event.explosive.getEnergy() > 0.0D) {
|
||||
for (TFulminationGenerator tileEntity : list) {
|
||||
if (tileEntity != null && !tileEntity.isInvalid()) {
|
||||
Vector3 tilePos = new Vector3(tileEntity);
|
||||
tilePos.add(0.5D);
|
||||
double explosionDistance =
|
||||
tilePos.distanceTo(new Vector3(event.x, event.y, event.z));
|
||||
if (explosionDistance <= (double)event.explosive.getRadius() &&
|
||||
explosionDistance > 0.0D) {
|
||||
float density = event.world.getBlockDensity(
|
||||
Vec3.createVectorHelper(event.x, event.y, event.z),
|
||||
AtomicScience.bFulminationGenerator
|
||||
.getCollisionBoundingBoxFromPool(
|
||||
event.world, tileEntity.xCoord, tileEntity.yCoord,
|
||||
tileEntity.zCoord));
|
||||
if (density < 1.0F) {
|
||||
double nengLiang =
|
||||
Math.min(event.explosive.getEnergy(),
|
||||
event.explosive.getEnergy() /
|
||||
(explosionDistance /
|
||||
(double)event.explosive.getRadius()));
|
||||
nengLiang =
|
||||
Math.max(nengLiang - (double)density * nengLiang, 0.0D);
|
||||
tileEntity.dian += nengLiang;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,192 @@
|
|||
package atomicscience.fanwusu;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.api.poison.PoisonRadiation;
|
||||
import atomicscience.wujian.ItCell;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import icbm.api.explosion.ExplosionEvent;
|
||||
import icbm.api.explosion.IExplosive;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.item.ItemExpireEvent;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class ItAntimatterCell extends ItCell {
|
||||
|
||||
private IIcon iconGram;
|
||||
|
||||
public ItAntimatterCell() {
|
||||
super("antimatter");
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack,
|
||||
EntityPlayer par2EntityPlayer, List list,
|
||||
boolean par4) {
|
||||
if (par1ItemStack.getItemDamage() >= 1) {
|
||||
list.add("1 Gram");
|
||||
} else {
|
||||
list.add("125 Milligrams");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
this.itemIcon = iconRegister.registerIcon(
|
||||
this.getUnlocalizedName().replace("item.", "") + "_milligram");
|
||||
this.iconGram = iconRegister.registerIcon(
|
||||
this.getUnlocalizedName().replace("item.", "") + "_gram");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int metadata) {
|
||||
return metadata >= 1 ? this.iconGram : this.itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs,
|
||||
List par3List) {
|
||||
par3List.add(new ItemStack(item, 1, 0));
|
||||
par3List.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEntityLifespan(ItemStack itemStack, World world) {
|
||||
return 160;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemExpireEvent(ItemExpireEvent event) {
|
||||
if (event.entityItem != null) {
|
||||
ItemStack itemStack = event.entityItem.getEntityItem();
|
||||
if (itemStack != null && itemStack.getItem() == this) {
|
||||
event.entityItem.worldObj.playSoundEffect(
|
||||
event.entityItem.posX, event.entityItem.posY, event.entityItem.posZ,
|
||||
"atomicscience.antimatter", 3.0F,
|
||||
1.0F - event.entityItem.worldObj.rand.nextFloat() * 0.3F);
|
||||
if (!event.entityItem.worldObj.isRemote
|
||||
// &&
|
||||
// ! FlagRegistry.getModFlag("ModFlags")
|
||||
// .containsValue(event.entityItem.worldObj,
|
||||
// ZhuYao.QIZI_FAN_WU_SU_BAO_ZHA, "true",
|
||||
// new Vector3(event.entityItem))
|
||||
) {
|
||||
IExplosive explosive = new IExplosive() {
|
||||
public int getID() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public String getUnlocalizedName() {
|
||||
return "Antimatter";
|
||||
}
|
||||
|
||||
public String getExplosiveName() {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public String getGrenadeName() {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public String getMissileName() {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public String getMinecartName() {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public float getRadius() {
|
||||
return 4.0F;
|
||||
}
|
||||
|
||||
public int getTier() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
public double getEnergy() {
|
||||
return 400000.0D;
|
||||
}
|
||||
};
|
||||
if (itemStack.getItemDamage() == 1) {
|
||||
explosive = new IExplosive() {
|
||||
public int getID() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public String getUnlocalizedName() {
|
||||
return "antimatter";
|
||||
}
|
||||
|
||||
public String getExplosiveName() {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public String getGrenadeName() {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public String getMissileName() {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public String getMinecartName() {
|
||||
return this.getUnlocalizedName();
|
||||
}
|
||||
|
||||
public float getRadius() {
|
||||
return 6.0F;
|
||||
}
|
||||
|
||||
public int getTier() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
public double getEnergy() {
|
||||
return 2000000.0D;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new ExplosionEvent.PreExplosionEvent(
|
||||
event.entity.worldObj, event.entityItem.posX,
|
||||
event.entityItem.posY, event.entityItem.posZ, explosive));
|
||||
event.entityItem.worldObj.createExplosion(
|
||||
event.entityItem, event.entityItem.posX, event.entityItem.posY,
|
||||
event.entityItem.posZ, explosive.getRadius(), true);
|
||||
AtomicScience.LOGGER.fine(
|
||||
"Antimatter cell detonated at: " + event.entityItem.posX + ", " +
|
||||
event.entityItem.posY + ", " + event.entityItem.posZ);
|
||||
boolean radius = true;
|
||||
AxisAlignedBB bounds = AxisAlignedBB.getBoundingBox(
|
||||
event.entityItem.posX - 20.0D, event.entityItem.posY - 20.0D,
|
||||
event.entityItem.posZ - 20.0D, event.entityItem.posX + 20.0D,
|
||||
event.entityItem.posY + 20.0D, event.entityItem.posZ + 20.0D);
|
||||
List entitiesNearby = event.entityItem.worldObj.getEntitiesWithinAABB(
|
||||
EntityLiving.class, bounds);
|
||||
Iterator i$ = entitiesNearby.iterator();
|
||||
|
||||
while (i$.hasNext()) {
|
||||
EntityLiving entity = (EntityLiving) i$.next();
|
||||
PoisonRadiation.INSTANCE.poisonEntity(new Vector3(entity), entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,242 @@
|
|||
package atomicscience.fanwusu;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.jiqi.TInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.implement.IRotatable;
|
||||
|
||||
public class TAccelerator
|
||||
extends TInventory implements IRotatable, ISidedInventory {
|
||||
|
||||
public final int DIAN = 10000;
|
||||
public double yongDianLiang = 0.0D;
|
||||
public int antimatter;
|
||||
public EMatter wuSu;
|
||||
public static final float SU_DU = 1.0F;
|
||||
public float suDu;
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElectricityPack getRequest() {
|
||||
return this.getStackInSlot(0) != null &&
|
||||
(this.worldObj.isBlockIndirectlyGettingPowered(
|
||||
this.xCoord, this.yCoord, this.zCoord) ||
|
||||
this.worldObj.getBlockPowerInput(this.xCoord, this.yCoord,
|
||||
this.zCoord) > 0)
|
||||
? new ElectricityPack(10000.0D / this.getVoltage(), this.getVoltage())
|
||||
: new ElectricityPack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceive(ElectricityPack electricityPack) {
|
||||
super.onReceive(electricityPack);
|
||||
this.yongDianLiang += electricityPack.getWatts();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.suDu = 0.0F;
|
||||
if (this.wuSu != null) {
|
||||
this.suDu = (float)this.wuSu.getSuDu();
|
||||
}
|
||||
|
||||
if (AtomicScience.isCell(this.getStackInSlot(1)) &&
|
||||
this.getStackInSlot(1).stackSize > 0 && this.antimatter >= 125) {
|
||||
if (this.getStackInSlot(2) != null) {
|
||||
if (this.getStackInSlot(2).getItem() == AtomicScience.itCellAntimatter) {
|
||||
ItemStack i$ = this.getStackInSlot(2).copy();
|
||||
if (i$.stackSize < i$.getMaxStackSize()) {
|
||||
this.decrStackSize(1, 1);
|
||||
this.antimatter -= 125;
|
||||
++i$.stackSize;
|
||||
this.setInventorySlotContents(2, i$);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.antimatter -= 125;
|
||||
this.decrStackSize(1, 1);
|
||||
this.setInventorySlotContents(2, new ItemStack(AtomicScience.itCellAntimatter));
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.isDisabled()) {
|
||||
if (this.worldObj.isBlockIndirectlyGettingPowered(
|
||||
this.xCoord, this.yCoord, this.zCoord)) {
|
||||
double var10000 = super.wattsReceived;
|
||||
this.getClass();
|
||||
if (var10000 >= 10000.0D) {
|
||||
if (this.wuSu == null) {
|
||||
if (this.getStackInSlot(0) != null && super.ticks % 20L == 0L) {
|
||||
Vector3 i$1 = new Vector3(this);
|
||||
i$1.modifyPositionFromSide(
|
||||
this.getDirection(this.worldObj, this.xCoord, this.yCoord,
|
||||
this.zCoord)
|
||||
.getOpposite());
|
||||
i$1.add(0.5D);
|
||||
if (EMatter.canCunZai(
|
||||
this.worldObj, i$1,
|
||||
this.getDirection(this.worldObj, this.xCoord,
|
||||
this.yCoord, this.zCoord)
|
||||
.getOpposite())) {
|
||||
this.yongDianLiang = 0.0D;
|
||||
this.wuSu =
|
||||
new EMatter(this.worldObj, i$1, new Vector3(this),
|
||||
this.getDirection(this.worldObj, this.xCoord,
|
||||
this.yCoord, this.zCoord)
|
||||
.getOpposite());
|
||||
this.worldObj.spawnEntityInWorld(this.wuSu);
|
||||
this.decrStackSize(0, 1);
|
||||
}
|
||||
}
|
||||
} else if (this.wuSu.isDead) {
|
||||
this.wuSu = null;
|
||||
} else if (this.suDu > 1.0F) {
|
||||
this.worldObj.playSoundEffect(
|
||||
(double)this.xCoord, (double)this.yCoord, (double)this.zCoord,
|
||||
"atomicscience.antimatter", 2.0F,
|
||||
1.0F - this.worldObj.rand.nextFloat() * 0.3F);
|
||||
this.antimatter += 5 + this.worldObj.rand.nextInt(5);
|
||||
this.yongDianLiang = 0.0D;
|
||||
this.wuSu.setDead();
|
||||
this.wuSu = null;
|
||||
}
|
||||
|
||||
double var10001 = super.wattsReceived;
|
||||
this.getClass();
|
||||
super.wattsReceived = Math.max(var10001 - 10000.0D / 10.0D, 0.0D);
|
||||
} else {
|
||||
if (this.wuSu != null) {
|
||||
this.wuSu.setDead();
|
||||
}
|
||||
|
||||
this.wuSu = null;
|
||||
}
|
||||
} else {
|
||||
if (this.wuSu != null) {
|
||||
this.wuSu.setDead();
|
||||
}
|
||||
|
||||
this.wuSu = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (super.ticks % 5L == 0L) {
|
||||
worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager nm,
|
||||
S35PacketUpdateTileEntity packet) {
|
||||
if (!this.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
NBTTagCompound nbt = packet.func_148857_g();
|
||||
super.disabledTicks = nbt.getInteger("disabledTicks");
|
||||
this.suDu = nbt.getFloat("suDu");
|
||||
this.yongDianLiang = nbt.getDouble("yongDianLiang");
|
||||
this.antimatter = nbt.getInteger("antimatter");
|
||||
}
|
||||
|
||||
// public void handlePacketData(INetworkManager network, int packetType,
|
||||
// Packet250CustomPayload packet,
|
||||
// EntityPlayer player,
|
||||
// ByteArrayDataInput dataStream) {
|
||||
// try {
|
||||
// super.disabledTicks = dataStream.readInt();
|
||||
// this.suDu = dataStream.readFloat();
|
||||
// this.yongDianLiang = dataStream.readDouble();
|
||||
// this.fanWuSu = dataStream.readInt();
|
||||
// } catch (Exception var7) {
|
||||
// var7.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("disabledTicks", super.disabledTicks);
|
||||
nbt.setFloat("suDu", this.suDu);
|
||||
nbt.setDouble("yongDianLiang", this.yongDianLiang);
|
||||
nbt.setInteger("antimatter", this.antimatter);
|
||||
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||
this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
super.wattsReceived = nbt.getDouble("wattsReceived");
|
||||
this.yongDianLiang = nbt.getDouble("yongDianLiang");
|
||||
this.antimatter = nbt.getInteger("antimatter");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setDouble("wattsReceived", super.wattsReceived);
|
||||
nbt.setDouble("yongDianLiang", this.yongDianLiang);
|
||||
nbt.setInteger("antimatter", this.antimatter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() { return 3; }
|
||||
|
||||
@Override
|
||||
public double getVoltage() {
|
||||
return UniversalElectricity.isVoltageSensitive ? 480.0D : 120.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return new int[] {0, 1, 2};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slotID, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(slotID, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int j) {
|
||||
return slotID == 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
return true;
|
||||
case 1:
|
||||
return AtomicScience.isCell(itemStack);
|
||||
case 2:
|
||||
return itemStack.getItem() instanceof ItAntimatterCell;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package atomicscience.fanwusu;
|
||||
|
||||
import atomicscience.fanwusu.FulminationEventHandler;
|
||||
import calclavia.lib.TileEntityUniversalProducer;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
|
||||
public class TFulminationGenerator extends TileEntityUniversalProducer {
|
||||
|
||||
public final int DIAN = 5000;
|
||||
public double dian;
|
||||
|
||||
|
||||
public TFulminationGenerator() {
|
||||
FulminationEventHandler.INSTANCE.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if(!this.isDisabled()) {
|
||||
this.produce(Math.min(this.dian, 5000.0D));
|
||||
}
|
||||
|
||||
this.dian = Math.max(this.dian - 5000.0D, 0.0D);
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
FulminationEventHandler.INSTANCE.unregister(this);
|
||||
super.initiate();
|
||||
}
|
||||
|
||||
public double getVoltage() {
|
||||
return UniversalElectricity.isVoltageSensitive?480.0D:120.0D;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.CommonProxy;
|
||||
import atomicscience.jiqi.BBaseRotatable;
|
||||
import atomicscience.render.RH;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
|
||||
public class BCentrifuge extends BBaseRotatable {
|
||||
public BCentrifuge() { super("centrifuge", UniversalElectricity.machine); }
|
||||
|
||||
@Override
|
||||
public boolean onMachineActivated(World par1World, int x, int y, int z,
|
||||
EntityPlayer par5EntityPlayer, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
par1World.getBlockMetadata(x, y, z);
|
||||
if (!par1World.isRemote) {
|
||||
par5EntityPlayer.openGui(AtomicScience.instance,
|
||||
CommonProxy.GuiType.CENTRIFUGE.ordinal(),
|
||||
par1World, x, y, z);
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TCentrifuge();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderType() {
|
||||
return RH.BLOCK_RENDER_ID;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.jiqi.BBase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
public class BControlRod extends BBase {
|
||||
public BControlRod() {
|
||||
super("controlRod", Material.iron);
|
||||
this.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, 1.0F, 0.7F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.blockIcon = iconRegister.registerIcon(
|
||||
Blocks.iron_block.getUnlocalizedName().replace("tile.", ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() { return false; }
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata) { return false; }
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.api.IFissileMaterial;
|
||||
import atomicscience.fenlie.TFissionReactor;
|
||||
import atomicscience.jiqi.BBase;
|
||||
import atomicscience.render.RH;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BFissionReactor extends BBase {
|
||||
|
||||
public BFissionReactor() { super("fissionReactor"); }
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World par1World, int x, int y, int z) {
|
||||
super.onBlockAdded(par1World, x, y, z);
|
||||
TFissionReactor tileEntity =
|
||||
(TFissionReactor)par1World.getTileEntity(x, y, z);
|
||||
tileEntity.updatePositionStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int x, int y, int z,
|
||||
Block block) {
|
||||
TFissionReactor tileEntity =
|
||||
(TFissionReactor)par1World.getTileEntity(x, y, z);
|
||||
tileEntity.updatePositionStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMachineActivated(World world, int x, int y, int z,
|
||||
EntityPlayer entityPlayer, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
if (!world.isRemote) {
|
||||
TFissionReactor tileEntity =
|
||||
(TFissionReactor)world.getTileEntity(x, y, z);
|
||||
tileEntity = tileEntity.zhaoZuiDi();
|
||||
if (!entityPlayer.isSneaking()) {
|
||||
if (entityPlayer.inventory.getCurrentItem() != null &&
|
||||
entityPlayer.inventory.getCurrentItem().getItem() ==
|
||||
AtomicScience.itWenDuBiao) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tileEntity.getStackInSlot(0) != null) {
|
||||
EntityItem itemStack1 =
|
||||
new EntityItem(world, entityPlayer.posX, entityPlayer.posY,
|
||||
entityPlayer.posZ, tileEntity.getStackInSlot(0));
|
||||
Random random = new Random();
|
||||
float var13 = 0.05F;
|
||||
itemStack1.motionX = (double)((float)random.nextGaussian() * var13);
|
||||
itemStack1.motionY =
|
||||
(double)((float)random.nextGaussian() * var13 + 0.2F);
|
||||
itemStack1.motionZ = (double)((float)random.nextGaussian() * var13);
|
||||
itemStack1.delayBeforeCanPickup = 0;
|
||||
world.spawnEntityInWorld(itemStack1);
|
||||
tileEntity.setInventorySlotContents(0, (ItemStack)null);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (entityPlayer.inventory.getCurrentItem() != null &&
|
||||
entityPlayer.inventory.getCurrentItem().getItem() instanceof
|
||||
IFissileMaterial) {
|
||||
ItemStack itemStack = entityPlayer.inventory.getCurrentItem().copy();
|
||||
itemStack.stackSize = 1;
|
||||
tileEntity.setInventorySlotContents(0, itemStack);
|
||||
entityPlayer.inventory.decrStackSize(
|
||||
entityPlayer.inventory.currentItem, 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
entityPlayer.openGui(AtomicScience.instance, 0, world, tileEntity.xCoord,
|
||||
tileEntity.yCoord, tileEntity.zCoord);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderType() {
|
||||
return RH.BLOCK_RENDER_ID;
|
||||
}
|
||||
|
||||
public TileEntity createNewTileEntity(World var1) { return new TFissionReactor(); }
|
||||
|
||||
public boolean renderAsNormalBlock() { return false; }
|
||||
|
||||
public boolean isOpaqueCube() { return false; }
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.CommonProxy;
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.jiqi.BBaseRotatable;
|
||||
import atomicscience.render.RH;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
|
||||
public class BNuclearBoiler extends BBaseRotatable {
|
||||
|
||||
public BNuclearBoiler() {
|
||||
super("nuclearBoiler", UniversalElectricity.machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMachineActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) {
|
||||
par1World.getBlockMetadata(x, y, z);
|
||||
if(!par1World.isRemote) {
|
||||
par5EntityPlayer.openGui(AtomicScience.instance, CommonProxy.GuiType.HE_QI.ordinal(), par1World, x, y, z);
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderType() {
|
||||
return RH.BLOCK_RENDER_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TNuclearBoiler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.fenlie.TReactorTap;
|
||||
import atomicscience.jiqi.BBaseRotatable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BReactorTap extends BBaseRotatable {
|
||||
private IIcon frontIcon;
|
||||
|
||||
public BReactorTap() { super("reactorTap"); }
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z,
|
||||
EntityLivingBase entityLiving,
|
||||
ItemStack itemStack) {
|
||||
if (MathHelper.abs((float)entityLiving.posX - (float)x) < 2.0F &&
|
||||
MathHelper.abs((float)entityLiving.posZ - (float)z) < 2.0F) {
|
||||
double d0 = entityLiving.posY + 1.82D - (double)entityLiving.yOffset;
|
||||
if (d0 - (double)y > 2.0D) {
|
||||
this.setDirection(world, x, y, z, ForgeDirection.getOrientation(1));
|
||||
return;
|
||||
}
|
||||
|
||||
if ((double)y - d0 > 0.0D) {
|
||||
this.setDirection(world, x, y, z, ForgeDirection.getOrientation(0));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
super.onBlockPlacedBy(world, x, y, z, entityLiving, itemStack);
|
||||
}
|
||||
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side == metadata ? this.frontIcon : this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.frontIcon = iconRegister.registerIcon(
|
||||
this.getUnlocalizedName().replace("tile.", "") + "_front");
|
||||
}
|
||||
|
||||
public TileEntity createNewTileEntity(World world, int meta) { return new TReactorTap(); }
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.jiqi.BBase;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class BSiren extends BBase {
|
||||
|
||||
public BSiren() {
|
||||
super("siren");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World par1World, int x, int y, int z) {
|
||||
par1World.scheduleBlockUpdate(x, y, z, this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int x, int y, int z, Block block) {
|
||||
par1World.scheduleBlockUpdate(x, y, z, this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World worldObj, int x, int y, int z, Random par5Random) {
|
||||
int metadata = worldObj.getBlockMetadata(x, y, z);
|
||||
if(worldObj.getBlockPowerInput(x, y, z) > 0) {
|
||||
float volume = 0.5F;
|
||||
|
||||
for(int i = 0; i < 6; ++i) {
|
||||
Vector3 pos = new Vector3((double)x, (double)y, (double)z);
|
||||
pos.modifyPositionFromSide(ForgeDirection.getOrientation(i));
|
||||
Block block = pos.getBlock(worldObj);
|
||||
if(block == this) {
|
||||
volume *= 1.5F;
|
||||
}
|
||||
}
|
||||
|
||||
worldObj.playSoundEffect((double)x, (double)y, (double)z, "atomicscience.alarm", volume, 1.0F - 0.18F * ((float)metadata / 15.0F));
|
||||
worldObj.scheduleBlockUpdate(x, y, z, this, 30);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) {
|
||||
int metadata = par1World.getBlockMetadata(x, y, z) + 1;
|
||||
if(metadata < 0) {
|
||||
metadata = 15;
|
||||
}
|
||||
|
||||
par1World.setBlockMetadataWithNotify(x, y, z, metadata, 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSneakUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) {
|
||||
int metadata = par1World.getBlockMetadata(x, y, z) - 1;
|
||||
if(metadata > 15) {
|
||||
metadata = 0;
|
||||
}
|
||||
|
||||
par1World.setBlockMetadataWithNotify(x, y, z, metadata, 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
return 20;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.TabAS;
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.api.BlockRadioactive;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BUraniumOre extends BlockRadioactive {
|
||||
|
||||
public BUraniumOre() {
|
||||
super(Material.rock);
|
||||
this.setBlockName("atomicscience:oreUranium");
|
||||
this.setStepSound(Block.soundTypeStone);
|
||||
this.setCreativeTab(TabAS.INSTANCE);
|
||||
this.setHardness(2.0F);
|
||||
super.isRandomlyRadioactive = AtomicScience.ALLOW_RADIOACTIVE_ORES;
|
||||
super.canWalkPoison = AtomicScience.ALLOW_RADIOACTIVE_ORES;
|
||||
super.canSpread = false;
|
||||
super.radius = 1.0F;
|
||||
super.amplifier = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random par5Random) {
|
||||
if(AtomicScience.ALLOW_RADIOACTIVE_ORES) {
|
||||
super.randomDisplayTick(world, x, y, z, par5Random);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand) {
|
||||
return 1;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.SlotFurnace;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import universalelectricity.core.item.IItemElectric;
|
||||
import universalelectricity.prefab.SlotSpecific;
|
||||
|
||||
public class CCentrifuge extends Container {
|
||||
|
||||
//private static final int slotCount = 4;
|
||||
private TCentrifuge tileEntity;
|
||||
|
||||
|
||||
public CCentrifuge(InventoryPlayer par1InventoryPlayer, TCentrifuge tileEntity) {
|
||||
this.tileEntity = tileEntity;
|
||||
this.addSlotToContainer(new SlotSpecific(tileEntity, 0, 131, 26, IItemElectric.class));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 1, 25, 50));
|
||||
this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, tileEntity, 2, 81, 26));
|
||||
this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, tileEntity, 3, 101, 26));
|
||||
|
||||
int var3;
|
||||
for(var3 = 0; var3 < 3; ++var3) {
|
||||
for(int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(var3 = 0; var3 < 9; ++var3) {
|
||||
this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
|
||||
}
|
||||
|
||||
this.tileEntity.players.add(par1InventoryPlayer.player);
|
||||
tileEntity.openInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer entityplayer) {
|
||||
super.onContainerClosed(entityplayer);
|
||||
this.tileEntity.players.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||
return this.tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par1) {
|
||||
ItemStack var2 = null;
|
||||
Slot var3 = (Slot)super.inventorySlots.get(par1);
|
||||
if(var3 != null && var3.getHasStack()) {
|
||||
ItemStack itemStack = var3.getStack();
|
||||
var2 = itemStack.copy();
|
||||
if(par1 >= 4) {
|
||||
if(this.getSlot(0).isItemValid(itemStack)) {
|
||||
if(!this.mergeItemStack(itemStack, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(AtomicScience.isUraniumOre(itemStack)) {
|
||||
if(!this.mergeItemStack(itemStack, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(AtomicScience.isCell(itemStack)) {
|
||||
if(!this.mergeItemStack(itemStack, 3, 4, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(par1 < 31) {
|
||||
if(!this.mergeItemStack(itemStack, 31, 40, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(par1 >= 31 && par1 < 40 && !this.mergeItemStack(itemStack, 4, 30, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(itemStack, 4, 40, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(itemStack.stackSize == 0) {
|
||||
var3.putStack((ItemStack)null);
|
||||
} else {
|
||||
var3.onSlotChanged();
|
||||
}
|
||||
|
||||
if(itemStack.stackSize == var2.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var3.onPickupFromSlot(par1EntityPlayer, itemStack);
|
||||
}
|
||||
|
||||
return var2;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.api.poison.PoisonRadiation;
|
||||
import atomicscience.wujian.ItAS;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class ItRadioactive extends ItAS {
|
||||
public ItRadioactive(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity entity, int par4, boolean par5) {
|
||||
if(entity instanceof EntityLiving) {
|
||||
PoisonRadiation.INSTANCE.poisonEntity(new Vector3(entity), (EntityLiving)entity, 1);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.TabAS;
|
||||
import atomicscience.wujian.ItCell;
|
||||
|
||||
public class ItStrangeMatter extends ItCell {
|
||||
public static final int YONG_LIANG = 64;
|
||||
|
||||
public ItStrangeMatter() {
|
||||
super("strangeMatter");
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(64);
|
||||
this.setCreativeTab(TabAS.INSTANCE);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItUranium extends ItRadioactive {
|
||||
|
||||
public ItUranium(int icon) {
|
||||
super("uranium");
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
if(itemStack.getItemDamage() > 0) {
|
||||
list.add("Breeding Uranium");
|
||||
} else {
|
||||
list.add("Enriched Uranium");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack) {
|
||||
return this.getUnlocalizedName() + "." + itemStack.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List list) {
|
||||
list.add(new ItemStack(this, 1, 0));
|
||||
list.add(new ItemStack(this, 1, 1));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,236 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.jiqi.TInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
import universalelectricity.core.item.ElectricItemHelper;
|
||||
import universalelectricity.core.item.IItemElectric;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import universalelectricity.prefab.implement.IRotatable;
|
||||
|
||||
public class TCentrifuge
|
||||
extends TInventory implements ISidedInventory, IFluidHandler, IRotatable {
|
||||
|
||||
public static final int SHI_JIAN = 2400;
|
||||
public static final float DIAN = 500.0F;
|
||||
public int smeltingTicks = 0;
|
||||
public float xuanZhuan = 0.0F;
|
||||
public final FluidTank gasTank;
|
||||
|
||||
public TCentrifuge() {
|
||||
this.gasTank =
|
||||
new FluidTank(AtomicScience.FLUID_URANIUM_HEXAFLOURIDE, 0, 5000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElectricityPack getRequest() {
|
||||
return this.canWork()
|
||||
? new ElectricityPack(500.0D / this.getVoltage(), this.getVoltage())
|
||||
: new ElectricityPack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.worldObj.isRemote && !this.isDisabled()) {
|
||||
if (super.ticks % 20L == 0L) {
|
||||
for (int i$ = 0; i$ < 6; ++i$) {
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(i$);
|
||||
TileEntity tileEntity = VectorHelper.getTileEntityFromSide(
|
||||
this.worldObj, new Vector3(this), direction);
|
||||
if (tileEntity instanceof IFluidHandler &&
|
||||
tileEntity.getClass() != this.getClass()) {
|
||||
int requiredLiquid =
|
||||
this.gasTank.getCapacity() - this.gasTank.getFluidAmount();
|
||||
FluidStack drained =
|
||||
((IFluidHandler)tileEntity)
|
||||
.drain(
|
||||
direction.getOpposite(),
|
||||
new FluidStack(AtomicScience.FLUID_URANIUM_HEXAFLOURIDE,
|
||||
requiredLiquid),
|
||||
true);
|
||||
this.gasTank.fill(drained, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.canWork()) {
|
||||
super.wattsReceived += ElectricItemHelper.dechargeItem(
|
||||
super.containingItems[0], 500.0D, this.getVoltage());
|
||||
if (super.wattsReceived >= 500.0D) {
|
||||
if (this.smeltingTicks == 0) {
|
||||
this.smeltingTicks = 2400;
|
||||
}
|
||||
|
||||
if (this.smeltingTicks > 0) {
|
||||
--this.smeltingTicks;
|
||||
if (this.smeltingTicks < 1) {
|
||||
this.work();
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
} else {
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
|
||||
super.wattsReceived = 0.0D;
|
||||
}
|
||||
} else {
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
|
||||
if (super.ticks % 10L == 0L) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager nm,
|
||||
S35PacketUpdateTileEntity packet) {
|
||||
NBTTagCompound nbt = packet.func_148857_g();
|
||||
this.smeltingTicks = nbt.getInteger("shiJian");
|
||||
this.gasTank.setFluid(
|
||||
new FluidStack(AtomicScience.FLUID_URANIUM_HEXAFLOURIDE,
|
||||
nbt.getInteger("fluidAmount")));
|
||||
super.disabledTicks = nbt.getInteger("disabledTicks");
|
||||
}
|
||||
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
nbt.setInteger("shiJian", this.smeltingTicks);
|
||||
nbt.setInteger("fluidAmount", this.gasTank.getFluidAmount());
|
||||
nbt.setInteger("disabledTicks", super.disabledTicks);
|
||||
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||
this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
public boolean canWork() {
|
||||
return !this.isDisabled() && this.gasTank.getFluidAmount() != 0 &&
|
||||
this.gasTank.getFluidAmount() >=
|
||||
AtomicScience.URANIUM_HEXAFLOURIDE_RATIO &&
|
||||
this.isItemValidForSlot(2, new ItemStack(AtomicScience.itUranium)) &&
|
||||
this.isItemValidForSlot(3,
|
||||
new ItemStack(AtomicScience.itUranium, 1, 1));
|
||||
}
|
||||
|
||||
public void work() {
|
||||
if (this.canWork()) {
|
||||
this.gasTank.drain(AtomicScience.URANIUM_HEXAFLOURIDE_RATIO, true);
|
||||
if ((double)this.worldObj.rand.nextFloat() > 0.7D) {
|
||||
this.incrStackSize(2, new ItemStack(AtomicScience.itUranium));
|
||||
} else {
|
||||
this.incrStackSize(3, new ItemStack(AtomicScience.itUranium, 1, 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
||||
NBTTagCompound gasNbt = nbt.getCompoundTag("gas");
|
||||
this.gasTank.setFluid(FluidStack.loadFluidStackFromNBT(gasNbt));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
||||
NBTTagCompound gasNbt = new NBTTagCompound();
|
||||
if (this.gasTank.getFluid() != null)
|
||||
this.gasTank.getFluid().writeToNBT(gasNbt);
|
||||
nbt.setTag("gas", gasNbt);
|
||||
}
|
||||
|
||||
public int getSizeInventory() { return 4; }
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection arg0, Fluid fluid) {
|
||||
return AtomicScience.FLUID_URANIUM_HEXAFLOURIDE == fluid &&
|
||||
this.gasTank.getCapacity() != this.gasTank.getFluidAmount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return AtomicScience.FLUID_URANIUM_HEXAFLOURIDE == resource.getFluid()
|
||||
? this.gasTank.fill(resource, doFill)
|
||||
: 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
||||
return new FluidTankInfo[] {new FluidTankInfo(this.gasTank)};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return side == 0 ? new int[] {2, 3} : new int[] {0, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slotID, ItemStack itemStack, int side) {
|
||||
return slotID == 1 && this.isItemValidForSlot(slotID, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int j) {
|
||||
return slotID == 2 || slotID == 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
return itemStack.getItem() instanceof IItemElectric;
|
||||
case 1:
|
||||
return true;
|
||||
case 2:
|
||||
return itemStack.getItem() == AtomicScience.itUranium;
|
||||
case 3:
|
||||
return itemStack.getItem() == AtomicScience.itUranium;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,430 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.MegaTNTExplusion;
|
||||
import atomicscience.api.IFissileMaterial;
|
||||
import atomicscience.api.IReactor;
|
||||
import atomicscience.api.ITemperature;
|
||||
import atomicscience.api.poison.PoisonRadiation;
|
||||
import atomicscience.wujian.ItBreederFuel;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.tile.TileEntityDisableable;
|
||||
|
||||
public class TFissionReactor extends TileEntityDisableable
|
||||
implements IInventory, ITemperature, IReactor, IFluidHandler {
|
||||
|
||||
public static final int BAN_JING = 2;
|
||||
public static final int WEN_DU = 2000;
|
||||
public float wenDu = 0.0F;
|
||||
private ItemStack[] containingItems = new ItemStack[1];
|
||||
public float rotation = 0.0F;
|
||||
private TFissionReactor cachedZhuYao = null;
|
||||
public FluidTank wasteTank;
|
||||
|
||||
public TFissionReactor() {
|
||||
this.wasteTank = new FluidTank(AtomicScience.FLUID_TOXIC_WASTE, 0, 800000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (this.cachedZhuYao == null || super.ticks % 20L == 0L) {
|
||||
this.zhaoZuiDi();
|
||||
}
|
||||
|
||||
if (!this.isDisabled()) {
|
||||
if (this.cachedZhuYao != this && this.getStackInSlot(0) != null &&
|
||||
this.cachedZhuYao.getStackInSlot(0) == null) {
|
||||
this.cachedZhuYao.setInventorySlotContents(0, this.getStackInSlot(0));
|
||||
this.setInventorySlotContents(0, (ItemStack) null);
|
||||
}
|
||||
|
||||
ItemStack fissileFuel = this.cachedZhuYao.getStackInSlot(0);
|
||||
int i;
|
||||
if (fissileFuel != null && fissileFuel.getItem() instanceof IFissileMaterial) {
|
||||
i = ((IFissileMaterial) fissileFuel.getItem()).onFissile(this);
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (i == 0) {
|
||||
fissileFuel.setItemDamage(Math.min(fissileFuel.getItemDamage() + 1,
|
||||
fissileFuel.getMaxDamage()));
|
||||
if (fissileFuel.getItemDamage() >= fissileFuel.getMaxDamage()) {
|
||||
this.cachedZhuYao.setInventorySlotContents(0, (ItemStack) null);
|
||||
}
|
||||
} else if (i == 2) {
|
||||
fissileFuel.setItemDamage(
|
||||
Math.max(fissileFuel.getItemDamage() - 1, 0));
|
||||
}
|
||||
}
|
||||
|
||||
if (super.ticks % 20L == 0L &&
|
||||
(double) this.worldObj.rand.nextFloat() > 0.65D) {
|
||||
List<EntityLivingBase> entitiesInRange = this.worldObj.getEntitiesWithinAABB(
|
||||
EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
(double) (this.xCoord - 4), (double) (this.yCoord - 4),
|
||||
(double) (this.xCoord - 4), (double) (this.xCoord + 4),
|
||||
(double) (this.yCoord + 4), (double) (this.xCoord + 4)));
|
||||
|
||||
for (EntityLivingBase entity : entitiesInRange) {
|
||||
PoisonRadiation.INSTANCE.poisonEntity(new Vector3(this), entity);
|
||||
}
|
||||
}
|
||||
|
||||
if ((double) this.worldObj.rand.nextFloat() > 0.5D) {
|
||||
this.wasteTank.fill(
|
||||
new FluidStack(AtomicScience.FLUID_TOXIC_WASTE, 1), true);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.wenDu > 2000.0F) {
|
||||
this.meltDown();
|
||||
} else if (this.wenDu > 100.0F &&
|
||||
(fissileFuel == null ||
|
||||
!(fissileFuel.getItem() instanceof ItBreederFuel))) {
|
||||
for (int x = -2; x <= 2; ++x) {
|
||||
for (int z = -2; z <= 2; ++z) {
|
||||
Vector3 offsetPos = new Vector3(this);
|
||||
offsetPos.add(new Vector3((double) x, 0.0D, (double) z));
|
||||
Block offsetBlock = this.worldObj.getBlock(
|
||||
offsetPos.intX(), offsetPos.intY(), offsetPos.intZ());
|
||||
if (offsetBlock != Blocks.water) {
|
||||
if (this.isOverToxic() && !this.worldObj.isRemote &&
|
||||
(double) this.worldObj.rand.nextFloat() > 0.999D) {
|
||||
if (offsetBlock == Blocks.grass) {
|
||||
offsetPos.setBlock(this.worldObj,
|
||||
AtomicScience.blockRadioactive);
|
||||
} else if (offsetBlock != Blocks.air) {
|
||||
offsetPos.setBlock(
|
||||
this.worldObj,
|
||||
this.wasteTank.getFluid().getFluid().getBlock());
|
||||
}
|
||||
|
||||
this.wasteTank.drain(1000, true);
|
||||
}
|
||||
} else if (super.ticks %
|
||||
(long) ((int) Math.max(
|
||||
40.0F - this.wenDu / 2000.0F * 40.0F, 2.0F)) == 0L) {
|
||||
AtomicScience.boilWater(this.worldObj, offsetPos, 3, 8);
|
||||
this.wenDu = (float) ((double) this.wenDu - 0.2D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int direction = 2; direction < 6; ++direction) {
|
||||
Vector3 neighborPos = new Vector3(this);
|
||||
neighborPos.modifyPositionFromSide(
|
||||
ForgeDirection.getOrientation(direction));
|
||||
if (neighborPos.getBlock(this.worldObj) == AtomicScience.bControlRod) {
|
||||
this.setTemperature(this.getTemperature() - 0.5F);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.setTemperature(this.getTemperature() - 1.1F);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote && super.ticks % 60L == 0L) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isOverToxic() {
|
||||
return AtomicScience.ALLOW_TOXIC_WASTE &&
|
||||
// TODO >=?
|
||||
this.wasteTank.getFluidAmount() > this.wasteTank.getCapacity();
|
||||
}
|
||||
|
||||
public void updatePositionStatus() {
|
||||
boolean top = (new Vector3(this))
|
||||
.add(new Vector3(0.0D, 1.0D, 0.0D))
|
||||
.getTileEntity(this.worldObj) instanceof TFissionReactor;
|
||||
boolean bottom = (new Vector3(this))
|
||||
.add(new Vector3(0.0D, -1.0D, 0.0D))
|
||||
.getTileEntity(this.worldObj) instanceof TFissionReactor;
|
||||
if (top && bottom) {
|
||||
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord,
|
||||
this.zCoord, 1, 3);
|
||||
} else if (top) {
|
||||
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord,
|
||||
this.zCoord, 0, 3);
|
||||
} else {
|
||||
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord,
|
||||
this.zCoord, 2, 3);
|
||||
}
|
||||
}
|
||||
|
||||
public TFissionReactor zhaoZuiDi() {
|
||||
Vector3 checkPosition = new Vector3(this);
|
||||
TFissionReactor tile = null;
|
||||
|
||||
do {
|
||||
TileEntity newTile = checkPosition.getTileEntity(this.worldObj);
|
||||
if (!(newTile instanceof TFissionReactor)) {
|
||||
this.cachedZhuYao = tile;
|
||||
return tile;
|
||||
}
|
||||
|
||||
tile = (TFissionReactor) newTile;
|
||||
--checkPosition.y;
|
||||
} while (tile != null);
|
||||
|
||||
this.cachedZhuYao = this;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
int height = 0;
|
||||
Vector3 checkPosition = new Vector3(this);
|
||||
|
||||
for (Object tile = this; tile instanceof TFissionReactor; tile = checkPosition.getTileEntity(this.worldObj)) {
|
||||
++checkPosition.y;
|
||||
++height;
|
||||
}
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeToNBT(nbt);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||
this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
private void meltDown() {
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.setInventorySlotContents(0, (ItemStack) null);
|
||||
MegaTNTExplusion baoZha = new MegaTNTExplusion(this.worldObj, (Entity) null, (double) this.xCoord,
|
||||
(double) this.yCoord, (double) this.zCoord, 9.0F);
|
||||
baoZha.doExplosionA();
|
||||
baoZha.doExplosionB(true);
|
||||
this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord,
|
||||
Blocks.lava);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager arg0,
|
||||
S35PacketUpdateTileEntity packet) {
|
||||
this.readFromNBT(packet.func_148857_g());
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.wenDu = nbt.getFloat("temperature");
|
||||
this.wasteTank.readFromNBT(nbt.getCompoundTag("tank"));
|
||||
NBTTagList items = nbt.getTagList("Items", 10); // 10 = magic number for compound
|
||||
this.containingItems = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
for (int i = 0; i < items.tagCount(); ++i) {
|
||||
NBTTagCompound item = items.getCompoundTagAt(i);
|
||||
byte var5 = item.getByte("Slot");
|
||||
if (var5 >= 0 && var5 < this.containingItems.length) {
|
||||
this.containingItems[var5] = ItemStack.loadItemStackFromNBT(item);
|
||||
this.containingItems[var5].setItemDamage(item.getInteger("damage"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
super.writeToNBT(par1NBTTagCompound);
|
||||
par1NBTTagCompound.setFloat("temperature", this.wenDu);
|
||||
NBTTagCompound tankNBT = new NBTTagCompound();
|
||||
this.wasteTank.writeToNBT(tankNBT);
|
||||
par1NBTTagCompound.setTag("tank", tankNBT);
|
||||
NBTTagList var2 = new NBTTagList();
|
||||
|
||||
for (int var3 = 0; var3 < this.containingItems.length; ++var3) {
|
||||
if (this.containingItems[var3] != null) {
|
||||
NBTTagCompound var4 = new NBTTagCompound();
|
||||
var4.setByte("Slot", (byte) var3);
|
||||
this.containingItems[var3].writeToNBT(var4);
|
||||
var4.setInteger("damage", this.containingItems[var3].getItemDamage());
|
||||
var2.appendTag(var4);
|
||||
}
|
||||
}
|
||||
|
||||
par1NBTTagCompound.setTag("Items", var2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return this.containingItems.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
return this.containingItems[par1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int par1, int par2) {
|
||||
if (this.containingItems[par1] != null) {
|
||||
ItemStack var3;
|
||||
if (this.containingItems[par1].stackSize <= par2) {
|
||||
var3 = this.containingItems[par1];
|
||||
this.containingItems[par1] = null;
|
||||
return var3;
|
||||
} else {
|
||||
var3 = this.containingItems[par1].splitStack(par2);
|
||||
if (this.containingItems[par1].stackSize == 0) {
|
||||
this.containingItems[par1] = null;
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int par1) {
|
||||
if (this.containingItems[par1] != null) {
|
||||
ItemStack var2 = this.containingItems[par1];
|
||||
this.containingItems[par1] = null;
|
||||
return var2;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
this.containingItems[par1] = par2ItemStack;
|
||||
if (par2ItemStack != null &&
|
||||
par2ItemStack.stackSize > this.getInventoryStackLimit()) {
|
||||
par2ItemStack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
|
||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this
|
||||
? false
|
||||
: par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D,
|
||||
(double) this.yCoord + 0.5D,
|
||||
(double) this.zCoord + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable(int duration) {
|
||||
super.disabledTicks = duration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return super.disabledTicks > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTemperature() {
|
||||
return this.wenDu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTemperature(float celsius) {
|
||||
this.wenDu = Math.max(celsius, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotID, ItemStack itemStack) {
|
||||
return this.cachedZhuYao != null &&
|
||||
this.cachedZhuYao.getStackInSlot(0) == null
|
||||
? itemStack.getItem() instanceof IFissileMaterial
|
||||
: false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
||||
return arg1 == AtomicScience.FLUID_TOXIC_WASTE &&
|
||||
this.wasteTank.getFluidAmount() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return this.wasteTank.drain(maxDrain, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack fluid,
|
||||
boolean doDrain) {
|
||||
return fluid.getFluid() == AtomicScience.FLUID_TOXIC_WASTE
|
||||
? this.drain(from, fluid.amount, doDrain)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
||||
return new FluidTankInfo[] { new FluidTankInfo(this.wasteTank) };
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return this.cachedZhuYao == this ? TileEntity.INFINITE_EXTENT_AABB
|
||||
: super.getRenderBoundingBox();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.getBlockType().getLocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,260 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.jiqi.TInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
import universalelectricity.core.item.ElectricItemHelper;
|
||||
import universalelectricity.prefab.implement.IRotatable;
|
||||
|
||||
public class TNuclearBoiler
|
||||
extends TInventory implements ISidedInventory, IFluidHandler, IRotatable {
|
||||
|
||||
public final int SHI_JIAN = 300;
|
||||
public final float DIAN = 800.0F;
|
||||
public int smeltingTicks = 0;
|
||||
public float rotation = 0.0F;
|
||||
public final FluidTank waterTank;
|
||||
public final FluidTank gasTank;
|
||||
|
||||
public TNuclearBoiler() {
|
||||
this.waterTank = new FluidTank(FluidRegistry.WATER, 0, 5000);
|
||||
this.gasTank = new FluidTank(AtomicScience.FLUID_URANIUM_HEXAFLOURIDE, 0, 5000);
|
||||
// TODO: WTF
|
||||
// this.waterTank.setTankPressure(-10);
|
||||
// this.gasTank.setTankPressure(10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElectricityPack getRequest() {
|
||||
return this.canWork()
|
||||
? new ElectricityPack(800.0D / this.getVoltage(), this.getVoltage())
|
||||
: new ElectricityPack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.worldObj.isRemote && !this.isDisabled()) {
|
||||
if (super.containingItems[1] != null &&
|
||||
FluidContainerRegistry.isFilledContainer(super.containingItems[1])) {
|
||||
if (FluidContainerRegistry
|
||||
.getFluidForFilledItem(super.containingItems[1])
|
||||
.getFluid() == FluidRegistry.WATER &&
|
||||
this.fill(ForgeDirection.UNKNOWN,
|
||||
FluidContainerRegistry.getFluidForFilledItem(
|
||||
super.containingItems[1]),
|
||||
false) > 0) {
|
||||
ItemStack player = super.containingItems[1].getItem().getContainerItem(
|
||||
super.containingItems[1]);
|
||||
if (player == null && super.containingItems[1].stackSize > 1) {
|
||||
--super.containingItems[1].stackSize;
|
||||
} else {
|
||||
super.containingItems[1] = player;
|
||||
}
|
||||
|
||||
this.waterTank.fill(FluidContainerRegistry.getFluidForFilledItem(
|
||||
super.containingItems[1]),
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.canWork()) {
|
||||
super.wattsReceived += ElectricItemHelper.dechargeItem(
|
||||
super.containingItems[0], 800.0D, this.getVoltage());
|
||||
double var10000 = super.wattsReceived;
|
||||
this.getClass();
|
||||
if (var10000 >= (double) (800.0F / 2.0F)) {
|
||||
if (this.smeltingTicks == 0) {
|
||||
this.smeltingTicks = 300;
|
||||
}
|
||||
|
||||
if (this.smeltingTicks > 0) {
|
||||
--this.smeltingTicks;
|
||||
if (this.smeltingTicks < 1) {
|
||||
this.work();
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
} else {
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
|
||||
super.wattsReceived = 0.0D;
|
||||
}
|
||||
} else {
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
|
||||
if (super.ticks % 10L == 0L) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager arg0,
|
||||
S35PacketUpdateTileEntity arg1) {
|
||||
NBTTagCompound nbt = arg1.func_148857_g();
|
||||
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
||||
this.waterTank.setFluid(
|
||||
new FluidStack(FluidRegistry.WATER, nbt.getInteger("waterAmount")));
|
||||
this.gasTank.setFluid(
|
||||
new FluidStack(AtomicScience.FLUID_URANIUM_HEXAFLOURIDE,
|
||||
nbt.getInteger("uraniumHexaflourideAmount")));
|
||||
super.disabledTicks = nbt.getInteger("disabledTicks");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
||||
nbt.setInteger("waterAmount", this.waterTank.getFluidAmount());
|
||||
nbt.setInteger("uraniumHexaflourideAmount", this.gasTank.getFluidAmount());
|
||||
nbt.setInteger("disabledTicks", super.disabledTicks);
|
||||
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||
this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canWork() {
|
||||
return !this.isDisabled() && this.waterTank.getFluid().getFluid() != null &&
|
||||
this.waterTank.getFluidAmount() >= 1000 &&
|
||||
super.containingItems[3] != null &&
|
||||
(AtomicScience.itYellowcake == super.containingItems[3].getItem() ||
|
||||
AtomicScience.isUraniumOre(super.containingItems[3]))
|
||||
&&
|
||||
this.gasTank.getFluidAmount() < this.gasTank.getCapacity();
|
||||
}
|
||||
|
||||
public void work() {
|
||||
if (this.canWork()) {
|
||||
this.waterTank.drain(1000, true);
|
||||
// FluidStack liquid = AtomicScience.FLUID_URANIUM_HEXAFLOURIDE.copy();
|
||||
// liquid.amount = AtomicScience.URANIUM_HEXAFLOURIDE_RATIO * 2;
|
||||
this.gasTank.fill(
|
||||
new FluidStack(AtomicScience.FLUID_URANIUM_HEXAFLOURIDE,
|
||||
AtomicScience.URANIUM_HEXAFLOURIDE_RATIO * 2),
|
||||
true);
|
||||
this.decrStackSize(3, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
||||
NBTTagCompound waterCompound = nbt.getCompoundTag("water");
|
||||
this.waterTank.setFluid(FluidStack.loadFluidStackFromNBT(waterCompound));
|
||||
NBTTagCompound gasCompound = nbt.getCompoundTag("gas");
|
||||
this.gasTank.setFluid(FluidStack.loadFluidStackFromNBT(gasCompound));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
||||
NBTTagCompound compound;
|
||||
if (this.waterTank.getFluid() != null) {
|
||||
compound = new NBTTagCompound();
|
||||
this.waterTank.getFluid().writeToNBT(compound);
|
||||
nbt.setTag("water", compound);
|
||||
}
|
||||
|
||||
if (this.gasTank.getFluid() != null) {
|
||||
compound = new NBTTagCompound();
|
||||
this.gasTank.getFluid().writeToNBT(compound);
|
||||
nbt.setTag("gas", compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
||||
if (arg1 == FluidRegistry.WATER) {
|
||||
return this.waterTank.getFluidAmount() < this.waterTank.getCapacity();
|
||||
} else if (arg1 == AtomicScience.FLUID_URANIUM_HEXAFLOURIDE) {
|
||||
return this.gasTank.getFluidAmount() < this.waterTank.getCapacity();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return FluidRegistry.WATER == resource.getFluid()
|
||||
? this.waterTank.fill(resource, doFill)
|
||||
: (AtomicScience.FLUID_URANIUM_HEXAFLOURIDE == resource.getFluid()
|
||||
? this.gasTank.fill(resource, doFill)
|
||||
: 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return this.gasTank.drain(maxDrain, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
||||
return arg1.getFluid() == AtomicScience.FLUID_URANIUM_HEXAFLOURIDE
|
||||
? this.gasTank.drain(arg1.amount, true)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
||||
return arg1 == AtomicScience.FLUID_URANIUM_HEXAFLOURIDE &&
|
||||
this.gasTank.getFluidAmount() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
||||
return new FluidTankInfo[] { new FluidTankInfo(this.waterTank),
|
||||
new FluidTankInfo(this.gasTank) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotID, ItemStack itemStack) {
|
||||
return slotID == 1
|
||||
? AtomicScience.isCellWater(itemStack)
|
||||
: (slotID == 3 ? itemStack.getItem() == AtomicScience.itYellowcake
|
||||
: false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return side == 0 ? new int[] { 2 } : new int[] { 1, 3 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slotID, ItemStack itemStack, int side) {
|
||||
return this.isItemValidForSlot(slotID, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int j) {
|
||||
return slotID == 2;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
package atomicscience.fenlie;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import universalelectricity.core.path.IPathCallBack;
|
||||
import universalelectricity.core.path.Pathfinder;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
||||
|
||||
public class TReactorTap extends TileEntityAdvanced implements IFluidHandler {
|
||||
|
||||
private final Set<FluidTank> tanks = new HashSet<>();
|
||||
private long lastFindTime = -1L;
|
||||
|
||||
public void find() {
|
||||
this.tanks.clear();
|
||||
final World world = this.worldObj;
|
||||
final Vector3 position = new Vector3(this);
|
||||
Pathfinder finder = (new Pathfinder(new IPathCallBack() {
|
||||
public Set getConnectedNodes(Pathfinder finder, Vector3 currentNode) {
|
||||
HashSet<Vector3> neighbors = new HashSet<>();
|
||||
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(i);
|
||||
Vector3 positionx = currentNode.clone().modifyPositionFromSide(direction);
|
||||
Block connectedBlockID = positionx.getBlock(world);
|
||||
if (connectedBlockID == Blocks.air ||
|
||||
connectedBlockID instanceof BlockLiquid ||
|
||||
connectedBlockID instanceof BFissionReactor) {
|
||||
neighbors.add(positionx);
|
||||
}
|
||||
}
|
||||
|
||||
return neighbors;
|
||||
}
|
||||
|
||||
public boolean onSearch(Pathfinder finder, Vector3 node) {
|
||||
if (node.getTileEntity(world) instanceof TFissionReactor) {
|
||||
finder.results.add(node);
|
||||
}
|
||||
|
||||
return node.distanceTo(position) > 6.0D;
|
||||
}
|
||||
}))
|
||||
.init((new Vector3(this))
|
||||
.modifyPositionFromSide(
|
||||
ForgeDirection.getOrientation(this.getBlockMetadata())
|
||||
.getOpposite()));
|
||||
for (Vector3 node : (Set<Vector3>) finder.results) {
|
||||
TileEntity tileEntity = node.getTileEntity(this.worldObj);
|
||||
if (tileEntity instanceof TFissionReactor) {
|
||||
this.tanks.add(((TFissionReactor) tileEntity).wasteTank);
|
||||
}
|
||||
}
|
||||
|
||||
this.lastFindTime = this.worldObj.getWorldTime();
|
||||
}
|
||||
|
||||
public FluidTank getOptimalTank() {
|
||||
if (this.lastFindTime == -1L ||
|
||||
this.worldObj.getWorldTime() - this.lastFindTime > 20L) {
|
||||
this.find();
|
||||
}
|
||||
|
||||
if (this.tanks.size() <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
FluidTank optimalTank = null;
|
||||
for (FluidTank tank : this.tanks) {
|
||||
if (this.getLiquidSafe(tank.getFluid()) > this.getLiquidSafe(optimalTank.getFluid())) {
|
||||
optimalTank = tank;
|
||||
}
|
||||
}
|
||||
|
||||
return optimalTank;
|
||||
}
|
||||
|
||||
public int getLiquidSafe(FluidStack stack) {
|
||||
return stack != null ? stack.amount : 0;
|
||||
}
|
||||
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int fill(int tankIndex, FluidStack resource, boolean doFill) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return this.getOptimalTank() != null
|
||||
? this.getOptimalTank().drain(maxDrain, doDrain)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
||||
return this.getOptimalTank() != null &&
|
||||
arg1.getFluid() == this.getOptimalTank().getFluid().getFluid()
|
||||
? this.drain(arg0, arg1.amount, arg2)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
||||
return this.getOptimalTank() != null &&
|
||||
this.getOptimalTank().getFluid().getFluid() == arg1 &&
|
||||
this.getOptimalTank().getFluidAmount() != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
||||
if (arg0.ordinal() != this.getBlockMetadata())
|
||||
return null;
|
||||
|
||||
this.find();
|
||||
return (FluidTankInfo[]) this.tanks.stream()
|
||||
.map(FluidTankInfo::new)
|
||||
.toArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import atomicscience.api.IElectromagnet;
|
||||
import atomicscience.hecheng.TElectromagnet;
|
||||
import atomicscience.jiqi.BBase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BElectromagnet extends BBase implements IElectromagnet {
|
||||
private IIcon iconTop;
|
||||
|
||||
public BElectromagnet() {
|
||||
super("electromagnet");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side != 0 && side != 1 ? this.blockIcon : this.iconTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon(
|
||||
this.getUnlocalizedName().replace("tile.", "") + "_top");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int meta) {
|
||||
return new TElectromagnet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRunning(World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import atomicscience.api.IElectromagnet;
|
||||
import atomicscience.jiqi.BBase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BElectromagnetGlass extends BBase implements IElectromagnet {
|
||||
public BElectromagnetGlass() {
|
||||
super("electromagnetGlass", Material.glass);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2,
|
||||
int par3, int par4, int par5) {
|
||||
Block i1 = par1IBlockAccess.getBlock(par2, par3, par4);
|
||||
return i1 == this
|
||||
? false
|
||||
: super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRunning(World world, int x, int y, int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(int metadata) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.jiqi.BBase;
|
||||
import atomicscience.render.RH;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BFusionReactor extends BBase {
|
||||
|
||||
public BFusionReactor() {
|
||||
super("fusionReactor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMachineActivated(World world, int x, int y, int z,
|
||||
EntityPlayer entityPlayer, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (entityPlayer.inventory.getCurrentItem() != null &&
|
||||
AtomicScience.isFusionFuel(entityPlayer.inventory.getCurrentItem())) {
|
||||
if (((TFusionReactor) tileEntity).getStackInSlot(0) != null) {
|
||||
ItemStack var10000 = ((TFusionReactor) tileEntity).getStackInSlot(0);
|
||||
var10000.stackSize += entityPlayer.inventory.getCurrentItem().stackSize;
|
||||
} else {
|
||||
((TFusionReactor) tileEntity)
|
||||
.setInventorySlotContents(0,
|
||||
entityPlayer.inventory.getCurrentItem());
|
||||
}
|
||||
|
||||
entityPlayer.inventory.setInventorySlotContents(
|
||||
entityPlayer.inventory.currentItem, (ItemStack) null);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderType() {
|
||||
return RH.BLOCK_RENDER_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int meta) {
|
||||
return new TFusionReactor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import atomicscience.api.IElectromagnet;
|
||||
import atomicscience.api.Plasma;
|
||||
import atomicscience.hecheng.TElectromagnet;
|
||||
import atomicscience.jiqi.BBase;
|
||||
import java.util.Random;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class BPlasma extends BBase implements Plasma.IPlasma {
|
||||
public BPlasma() {
|
||||
super("plasma", Material.lava);
|
||||
this.setLightLevel(0.5F);
|
||||
super.textureName = "portal";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World worldObj, int x, int y, int z) {
|
||||
if (!worldObj.isRemote) {
|
||||
Vector3 diDian = new Vector3((double) x, (double) y, (double) z);
|
||||
int xinMeta = Math.max(diDian.getBlockMetadata(worldObj) - 1, 0);
|
||||
if (xinMeta <= 0) {
|
||||
diDian.setBlock(worldObj, Blocks.fire);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
if ((double) worldObj.rand.nextFloat() <= 0.8D) {
|
||||
Vector3 zhaoDiDian = diDian.clone();
|
||||
zhaoDiDian.modifyPositionFromSide(ForgeDirection.getOrientation(i));
|
||||
if (this.canPlace(worldObj, zhaoDiDian.intX(), zhaoDiDian.intY(),
|
||||
zhaoDiDian.intZ())) {
|
||||
Block tileEntity = zhaoDiDian.getBlock(worldObj);
|
||||
if (tileEntity != this) {
|
||||
zhaoDiDian.setBlock(worldObj, this, xinMeta);
|
||||
}
|
||||
} else {
|
||||
TileEntity var10 = zhaoDiDian.getTileEntity(worldObj);
|
||||
if (var10 instanceof TElectromagnet) {
|
||||
((TElectromagnet) var10)
|
||||
.setTemperature(((TElectromagnet) var10).getTemperature() + 100.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
worldObj.scheduleBlockUpdate(
|
||||
x, y, z, this,
|
||||
(new Vector3((double) x, (double) y, (double) z))
|
||||
.getBlockMetadata(worldObj) *
|
||||
5);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World worldObj, int x, int y, int z,
|
||||
Random par5Random) {
|
||||
Vector3 diDian = new Vector3((double) x, (double) y, (double) z);
|
||||
diDian.setBlock(worldObj, Blocks.fire);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World worldObj, int x, int y, int z,
|
||||
Block neighborID) {
|
||||
if (neighborID != this && neighborID != Blocks.fire) {
|
||||
worldObj.scheduleBlockUpdate(
|
||||
x, y, z, this,
|
||||
(new Vector3((double) x, (double) y, (double) z))
|
||||
.getBlockMetadata(worldObj) *
|
||||
5);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawn(World world, int x, int y, int z, byte strength) {
|
||||
if (this.canPlace(world, x, y, z)) {
|
||||
world.setBlock(x, y, z, this, strength, 3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlace(World world, int x, int y, int z) {
|
||||
Vector3 position = new Vector3((double) x, (double) y, (double) z);
|
||||
Block block = position.getBlock(world);
|
||||
return block == null || block != Blocks.bedrock &&
|
||||
!(block instanceof IElectromagnet) &&
|
||||
block != Blocks.iron_block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3,
|
||||
int par4, int par5) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World,
|
||||
int par2, int par3,
|
||||
int par4) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random par1Random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World par1World) {
|
||||
return 8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4,
|
||||
Entity par5Entity) {
|
||||
if (par5Entity instanceof EntityLivingBase) {
|
||||
if (par5Entity.isImmuneToFire()) {
|
||||
par5Entity.attackEntityFrom(DamageSource.magic, 1073741823);
|
||||
} else {
|
||||
par5Entity.attackEntityFrom(DamageSource.inFire, 1073741823);
|
||||
}
|
||||
} else {
|
||||
par5Entity.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x,
|
||||
int y, int z) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.jiqi.TChemicalExtractor;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.SlotFurnace;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import universalelectricity.core.item.IItemElectric;
|
||||
import universalelectricity.prefab.SlotSpecific;
|
||||
|
||||
public class CChemicalExtractor extends Container {
|
||||
// private static final int slotCount = 4;
|
||||
private TChemicalExtractor tileEntity;
|
||||
|
||||
public CChemicalExtractor(InventoryPlayer par1InventoryPlayer,
|
||||
TChemicalExtractor tileEntity) {
|
||||
this.tileEntity = tileEntity;
|
||||
this.addSlotToContainer(
|
||||
new SlotSpecific(tileEntity, 0, 65, 49, IItemElectric.class));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 1, 25, 50));
|
||||
this.addSlotToContainer(
|
||||
new SlotFurnace(par1InventoryPlayer.player, tileEntity, 2, 118, 25));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 3, 65, 25));
|
||||
|
||||
int var3;
|
||||
for (var3 = 0; var3 < 3; ++var3) {
|
||||
for (int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlotToContainer(new Slot(par1InventoryPlayer,
|
||||
var4 + var3 * 9 + 9, 8 + var4 * 18,
|
||||
84 + var3 * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (var3 = 0; var3 < 9; ++var3) {
|
||||
this.addSlotToContainer(
|
||||
new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
|
||||
}
|
||||
|
||||
tileEntity.openInventory();
|
||||
this.tileEntity.players.add(par1InventoryPlayer.player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer entityplayer) {
|
||||
super.onContainerClosed(entityplayer);
|
||||
this.tileEntity.players.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||
return this.tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer,
|
||||
int par1) {
|
||||
ItemStack var2 = null;
|
||||
Slot var3 = (Slot) super.inventorySlots.get(par1);
|
||||
if (var3 != null && var3.getHasStack()) {
|
||||
ItemStack itemStack = var3.getStack();
|
||||
var2 = itemStack.copy();
|
||||
if (par1 >= 4) {
|
||||
if (itemStack.getItem() instanceof IItemElectric) {
|
||||
if (!this.mergeItemStack(itemStack, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (FluidRegistry.WATER == FluidContainerRegistry.getFluidForFilledItem(itemStack)
|
||||
.getFluid()) {
|
||||
if (!this.mergeItemStack(itemStack, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!AtomicScience.isCell(itemStack) &&
|
||||
!AtomicScience.isUraniumOre(itemStack)) {
|
||||
if (par1 < 31) {
|
||||
if (!this.mergeItemStack(itemStack, 31, 40, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (par1 >= 31 && par1 < 40 &&
|
||||
!this.mergeItemStack(itemStack, 4, 30, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!this.mergeItemStack(itemStack, 3, 4, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!this.mergeItemStack(itemStack, 4, 40, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemStack.stackSize == 0) {
|
||||
var3.putStack((ItemStack) null);
|
||||
} else {
|
||||
var3.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemStack.stackSize == var2.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var3.onPickupFromSlot(par1EntityPlayer, itemStack);
|
||||
}
|
||||
|
||||
return var2;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.fenlie.TNuclearBoiler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import universalelectricity.core.item.IItemElectric;
|
||||
import universalelectricity.prefab.SlotSpecific;
|
||||
|
||||
public class CNuclearBoiler extends Container {
|
||||
// private static final int slotCount = 4;
|
||||
private TNuclearBoiler tileEntity;
|
||||
|
||||
public CNuclearBoiler(InventoryPlayer par1InventoryPlayer,
|
||||
TNuclearBoiler tileEntity) {
|
||||
this.tileEntity = tileEntity;
|
||||
this.addSlotToContainer(
|
||||
new SlotSpecific(tileEntity, 0, 56, 26, IItemElectric.class));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 1, 25, 50));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 2, 136, 50));
|
||||
this.addSlotToContainer(new SlotSpecific(
|
||||
tileEntity, 3, 81, 26,
|
||||
new ItemStack[] { new ItemStack(AtomicScience.itYellowcake),
|
||||
new ItemStack(AtomicScience.bUraniumOre) }));
|
||||
|
||||
int var3;
|
||||
for (var3 = 0; var3 < 3; ++var3) {
|
||||
for (int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlotToContainer(new Slot(par1InventoryPlayer,
|
||||
var4 + var3 * 9 + 9, 8 + var4 * 18,
|
||||
84 + var3 * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (var3 = 0; var3 < 9; ++var3) {
|
||||
this.addSlotToContainer(
|
||||
new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
|
||||
}
|
||||
|
||||
this.tileEntity.players.add(par1InventoryPlayer.player);
|
||||
tileEntity.openInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer entityplayer) {
|
||||
super.onContainerClosed(entityplayer);
|
||||
this.tileEntity.players.remove(entityplayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||
return this.tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer,
|
||||
int slotID) {
|
||||
ItemStack var2 = null;
|
||||
Slot slot = (Slot) super.inventorySlots.get(slotID);
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack itemStack = slot.getStack();
|
||||
var2 = itemStack.copy();
|
||||
if (slotID >= 4) {
|
||||
if (itemStack.getItem() instanceof IItemElectric) {
|
||||
if (!this.mergeItemStack(itemStack, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (FluidRegistry.WATER == FluidContainerRegistry.getFluidForFilledItem(itemStack).getFluid()) {
|
||||
if (!this.mergeItemStack(itemStack, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (this.getSlot(3).isItemValid(itemStack)) {
|
||||
if (!this.mergeItemStack(itemStack, 3, 4, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (slotID < 31) {
|
||||
if (!this.mergeItemStack(itemStack, 31, 40, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (slotID >= 31 && slotID < 40 &&
|
||||
!this.mergeItemStack(itemStack, 4, 30, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!this.mergeItemStack(itemStack, 4, 40, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemStack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemStack.stackSize == var2.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(par1EntityPlayer, itemStack);
|
||||
}
|
||||
|
||||
return var2;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
public class IBAccelerator extends ItemBlock {
|
||||
public IBAccelerator(Block b) {
|
||||
super(b);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
public class IBPlasma extends ItemBlock {
|
||||
public IBPlasma(Block b) {
|
||||
super(b);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
public class IBSiren extends ItemBlock {
|
||||
public IBSiren(Block b) {
|
||||
super(b);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.api.ITemperature;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
||||
|
||||
public class TElectromagnet extends TileEntityAdvanced implements ITemperature {
|
||||
public static final int MAX_TEMP = 5000;
|
||||
private float temperature = 0.0F;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if(!this.worldObj.isRemote && this.temperature > 0.0F) {
|
||||
if(this.temperature > 100.0F) {
|
||||
for(int i = 0; i < 6; ++i) {
|
||||
Vector3 offsetPos = new Vector3(this);
|
||||
offsetPos.modifyPositionFromSide(ForgeDirection.getOrientation(i));
|
||||
Block blockID = this.worldObj.getBlock(offsetPos.intX(), offsetPos.intY(), offsetPos.intZ());
|
||||
if(blockID != Blocks.water && blockID != Blocks.flowing_water) {
|
||||
if(blockID == Blocks.grass) {
|
||||
offsetPos.setBlock(this.worldObj, AtomicScience.blockRadioactive);
|
||||
}
|
||||
} else if(super.ticks % (long)((int)Math.max(40.0F - this.temperature / 5000.0F * 40.0F, 2.0F)) == 0L) {
|
||||
AtomicScience.boilWater(this.worldObj, offsetPos, 2, 20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.temperature = Math.max(Math.min(this.temperature - 0.8F, 5000.0F), 0.0F);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.temperature = nbt.getFloat("temperature");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
|
||||
super.writeToNBT(par1NBTTagCompound);
|
||||
par1NBTTagCompound.setFloat("temperature", this.temperature);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTemperature() {
|
||||
return this.temperature;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTemperature(float celsius) {
|
||||
this.temperature = celsius;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,209 @@
|
|||
package atomicscience.hecheng;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.jiqi.TInventory;
|
||||
import calclavia.lib.render.ITagRender;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import java.util.HashMap;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import universalelectricity.core.block.IElectricityStorage;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class TFusionReactor extends TInventory
|
||||
implements ISidedInventory, IElectricityStorage, ITagRender {
|
||||
|
||||
public static final int YAO_DAO = 1000;
|
||||
public static final int YONG_DIAN = 20000;
|
||||
private ItemStack deuteriumStack = null;
|
||||
public float rotation = 0.0F;
|
||||
|
||||
@Override
|
||||
public ElectricityPack getRequest() {
|
||||
return this.deuteriumStack != null
|
||||
? new ElectricityPack(20000.0D / this.getVoltage(), this.getVoltage())
|
||||
: new ElectricityPack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (!this.isDisabled() && super.wattsReceived >= 20000.0D &&
|
||||
this.deuteriumStack != null && super.ticks % 20L == 0L) {
|
||||
for (int i = 2; i < 6; ++i) {
|
||||
Vector3 diDian = new Vector3(this);
|
||||
diDian.modifyPositionFromSide(ForgeDirection.getOrientation(i), 2.0D);
|
||||
AtomicScience.bPlasma.spawn(this.worldObj, diDian.intX(),
|
||||
diDian.intY(), diDian.intZ(),
|
||||
(byte) 7);
|
||||
}
|
||||
|
||||
this.setJoules(Math.max(super.wattsReceived - 20000.0D, 0.0D));
|
||||
if (this.worldObj.rand.nextInt(10) == 0) {
|
||||
this.decrStackSize(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (super.ticks % 80L == 0L) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setDouble("wattsReceived", super.wattsReceived);
|
||||
nbt.setInteger("stackSize", this.deuteriumStack != null
|
||||
? this.deuteriumStack.stackSize
|
||||
: 0);
|
||||
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||
this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void handlePacketData(INetworkManager network, int packetType,
|
||||
// Packet250CustomPayload packet,
|
||||
// EntityPlayer player,
|
||||
// ByteArrayDataInput dataStream) {
|
||||
// try {
|
||||
// super.wattsReceived = dataStream.readDouble();
|
||||
// this.setInventorySlotContents(
|
||||
// 0, new ItemStack(AtomicScience.itCellDao,
|
||||
// dataStream.readInt()));
|
||||
// } catch (Exception var7) {
|
||||
// var7.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager arg0,
|
||||
S35PacketUpdateTileEntity arg1) {
|
||||
NBTTagCompound nbt = arg1.func_148857_g();
|
||||
super.wattsReceived = nbt.getDouble("wattsReceived");
|
||||
this.setInventorySlotContents(0,
|
||||
new ItemStack(AtomicScience.itCellDeuterium,
|
||||
nbt.getInteger("stackSize")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
super.wattsReceived = nbt.getDouble("wattsReceived");
|
||||
this.deuteriumStack = new ItemStack(AtomicScience.itCellDeuterium,
|
||||
nbt.getInteger("stackSize"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setDouble("wattsReceived", super.wattsReceived);
|
||||
nbt.setInteger("stackSize", this.deuteriumStack != null
|
||||
? this.deuteriumStack.stackSize
|
||||
: 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getJoules() {
|
||||
return super.wattsReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setJoules(double joules) {
|
||||
super.wattsReceived = Math.max(Math.min(joules, this.getMaxJoules()), 0.0D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxJoules() {
|
||||
return 20000.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int var1) {
|
||||
return this.deuteriumStack != null && this.deuteriumStack.stackSize <= 0
|
||||
? null
|
||||
: this.deuteriumStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int amount) {
|
||||
if (this.deuteriumStack != null) {
|
||||
ItemStack itemstack;
|
||||
if (this.deuteriumStack.stackSize <= amount) {
|
||||
itemstack = this.deuteriumStack;
|
||||
this.deuteriumStack = null;
|
||||
return itemstack;
|
||||
} else {
|
||||
itemstack = this.deuteriumStack.splitStack(amount);
|
||||
if (this.deuteriumStack.stackSize == 0) {
|
||||
this.deuteriumStack = null;
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int var1) {
|
||||
return this.deuteriumStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
this.deuteriumStack = itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float addInformation(HashMap map, EntityPlayer player) {
|
||||
if (this.deuteriumStack != null) {
|
||||
map.put("Deuterium: " + this.deuteriumStack.stackSize,
|
||||
Integer.valueOf(16777215));
|
||||
} else {
|
||||
map.put("No Deuterium", Integer.valueOf(16777215));
|
||||
}
|
||||
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int var1) {
|
||||
return new int[] { 0 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slotID, ItemStack itemStack) {
|
||||
return itemStack.getItem() == AtomicScience.itCellDeuterium;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemstack, int j) {
|
||||
return this.isItemValidForSlot(i, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemstack, int j) {
|
||||
return this.isItemValidForSlot(i, itemstack);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.TabAS;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
import universalelectricity.prefab.block.BlockAdvanced;
|
||||
|
||||
public class BBase extends BlockAdvanced {
|
||||
protected String textureName;
|
||||
|
||||
public BBase(String name, Material material) {
|
||||
super(material);
|
||||
this.textureName = "atomicscience:machine";
|
||||
this.setBlockName("atomicscience:" + name);
|
||||
this.setCreativeTab(TabAS.INSTANCE);
|
||||
}
|
||||
|
||||
public BBase(String name) { this(name, UniversalElectricity.machine); }
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
if (this.getRenderType() == 0 &&
|
||||
this.textureName.equals("atomicscience:machine")) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
} else {
|
||||
this.blockIcon = iconRegister.registerIcon(this.textureName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World arg0, int arg1) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.TabAS;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
import universalelectricity.prefab.block.BlockRotatable;
|
||||
|
||||
public abstract class BBaseRotatable extends BlockRotatable {
|
||||
protected String textureName;
|
||||
|
||||
public BBaseRotatable(String name, Material material) {
|
||||
super(material);
|
||||
this.textureName = "atomicscience:machine";
|
||||
this.setBlockName("atomicscience:" + name);
|
||||
this.setCreativeTab(TabAS.INSTANCE);
|
||||
}
|
||||
|
||||
public BBaseRotatable(String name) {
|
||||
this(name, UniversalElectricity.machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
if(this.getRenderType() == 0) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
} else {
|
||||
this.blockIcon = iconRegister.registerIcon(this.textureName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.CommonProxy;
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.render.RH;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BChemicalExtractor extends BBaseRotatable {
|
||||
|
||||
public BChemicalExtractor() {
|
||||
super("chemicalExtractor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMachineActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) {
|
||||
par1World.getBlockMetadata(x, y, z);
|
||||
if(!par1World.isRemote) {
|
||||
par5EntityPlayer.openGui(AtomicScience.instance, CommonProxy.GuiType.DAO_CHOU_QI.ordinal(), par1World, x, y, z);
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int meta) {
|
||||
return new TChemicalExtractor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderType() {
|
||||
return RH.BLOCK_RENDER_ID;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BFunnel extends BBase {
|
||||
private IIcon iconTop;
|
||||
|
||||
public BFunnel() {
|
||||
super("funnel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side != 1 && side != 0 ? this.blockIcon : this.iconTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconTop = iconRegister.registerIcon(
|
||||
this.getUnlocalizedName().replace("tile.", "") + "_top");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int meta) {
|
||||
return new TFunnel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class BThermometer extends BBase {
|
||||
private IIcon iconSide;
|
||||
|
||||
public BThermometer() {
|
||||
super("thermometer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side != 1 && side != 0 ? this.iconSide : this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.iconSide = iconRegister.registerIcon("atomicscience:machine");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onMachineActivated(World world, int x, int y, int z,
|
||||
EntityPlayer entityPlayer, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
TThermometer tileEntity = (TThermometer) world.getTileEntity(x, y, z);
|
||||
if (entityPlayer.getCurrentEquippedItem() != null &&
|
||||
entityPlayer.getCurrentEquippedItem().getItem() instanceof ItThermometer) {
|
||||
Vector3 savedCoords = ((ItThermometer) entityPlayer.getCurrentEquippedItem().getItem())
|
||||
.getSavedCoord(entityPlayer.getCurrentEquippedItem());
|
||||
if (tileEntity.setLinkTile(savedCoords)) {
|
||||
if (world.isRemote) {
|
||||
entityPlayer.addChatMessage(
|
||||
new ChatComponentText("Linked thermal data."));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
tileEntity.setWarningTemp(tileEntity.getWarningTemp() - 100);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSneakMachineActivated(World par1World, int x, int y, int z,
|
||||
EntityPlayer par5EntityPlayer,
|
||||
int side, float hitX, float hitY,
|
||||
float hitZ) {
|
||||
TThermometer tileEntity = (TThermometer) par1World.getTileEntity(x, y, z);
|
||||
tileEntity.setWarningTemp(tileEntity.getWarningTemp() - 10);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUseWrench(World par1World, int x, int y, int z,
|
||||
EntityPlayer par5EntityPlayer, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
TThermometer tileEntity = (TThermometer) par1World.getTileEntity(x, y, z);
|
||||
tileEntity.setWarningTemp(tileEntity.getWarningTemp() + 100);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSneakUseWrench(World par1World, int x, int y, int z,
|
||||
EntityPlayer par5EntityPlayer, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
TThermometer tileEntity = (TThermometer) par1World.getTileEntity(x, y, z);
|
||||
tileEntity.setWarningTemp(tileEntity.getWarningTemp() + 10);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int x, int y, int z,
|
||||
int par5) {
|
||||
return this.isProvidingStrongPower(par1IBlockAccess, x, y, z, par5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int x, int y, int z,
|
||||
int par5) {
|
||||
TThermometer tileEntity = (TThermometer) par1IBlockAccess.getTileEntity(x, y, z);
|
||||
return tileEntity.shouldEmitRedstone() ? 15 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int meta) {
|
||||
return new TThermometer();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.render.RH;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BTurbine extends BBase {
|
||||
|
||||
public BTurbine() {
|
||||
super("turbine");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
return tileEntity instanceof TTurbine?((TTurbine)tileEntity).checkMultiblock():false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if(tileEntity instanceof TTurbine) {
|
||||
if(((TTurbine)tileEntity).isMultiblock) {
|
||||
((TTurbine)tileEntity).checkMultiblock();
|
||||
} else if(((TTurbine)tileEntity).masterTurbine != null) {
|
||||
TileEntity t = ((TTurbine)tileEntity).masterTurbine.getTileEntity(world);
|
||||
if(t instanceof TTurbine) {
|
||||
((TTurbine)t).setMaster((TTurbine)null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderType() {
|
||||
return RH.BLOCK_RENDER_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World var1, int meta) {
|
||||
return new TTurbine();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.TAtomicAssembler;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CAssembler extends Container {
|
||||
private TAtomicAssembler tileEntity;
|
||||
|
||||
public CAssembler(InventoryPlayer par1InventoryPlayer,
|
||||
TAtomicAssembler tileEntity) {
|
||||
this.tileEntity = tileEntity;
|
||||
this.addSlotToContainer(new Slot(tileEntity, 0, 80, 40));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 1, 53, 56));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 2, 107, 56));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 3, 53, 88));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 4, 107, 88));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 5, 80, 103));
|
||||
this.addSlotToContainer(new Slot(tileEntity, 6, 80, 72));
|
||||
|
||||
int var3;
|
||||
for (var3 = 0; var3 < 3; ++var3) {
|
||||
for (int var4 = 0; var4 < 9; ++var4) {
|
||||
this.addSlotToContainer(new Slot(par1InventoryPlayer,
|
||||
var4 + var3 * 9 + 9, 8 + var4 * 18,
|
||||
148 + var3 * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (var3 = 0; var3 < 9; ++var3) {
|
||||
this.addSlotToContainer(
|
||||
new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 206));
|
||||
}
|
||||
|
||||
this.tileEntity.players.add(par1InventoryPlayer.player);
|
||||
tileEntity.openInventory();
|
||||
}
|
||||
|
||||
public void onContainerClosed(EntityPlayer entityplayer) {
|
||||
super.onContainerClosed(entityplayer);
|
||||
this.tileEntity.players.remove(entityplayer);
|
||||
}
|
||||
|
||||
public boolean canInteractWith(EntityPlayer par1EntityPlayer) {
|
||||
return this.tileEntity.isUseableByPlayer(par1EntityPlayer);
|
||||
}
|
||||
|
||||
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer,
|
||||
int par1) {
|
||||
ItemStack var2 = null;
|
||||
Slot var3 = (Slot) super.inventorySlots.get(par1);
|
||||
if (var3 != null && var3.getHasStack()) {
|
||||
ItemStack itemStack = var3.getStack();
|
||||
var2 = itemStack.copy();
|
||||
if (par1 > 6) {
|
||||
if (itemStack.getItem() == AtomicScience.itCellStrangeMatter) {
|
||||
if (!this.mergeItemStack(itemStack, 0, 6, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!this.getSlot(6).getHasStack() &&
|
||||
!this.mergeItemStack(itemStack, 6, 7, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (!this.mergeItemStack(itemStack, 7, 43, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemStack.stackSize == 0) {
|
||||
var3.putStack((ItemStack) null);
|
||||
} else {
|
||||
var3.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemStack.stackSize == var2.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var3.onPickupFromSlot(par1EntityPlayer, itemStack);
|
||||
}
|
||||
|
||||
return var2;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.TabAS;
|
||||
import atomicscience.api.IAntiPoisonArmor;
|
||||
import atomicscience.api.poison.Poison;
|
||||
import atomicscience.api.poison.PoisonRadiation;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItHazmatSuite extends ItemArmor implements IAntiPoisonArmor {
|
||||
|
||||
public ItHazmatSuite(ArmorMaterial par2EnumArmorMaterial, int par3,
|
||||
int par4) {
|
||||
super(par2EnumArmorMaterial, par3, par4);
|
||||
this.setCreativeTab(TabAS.INSTANCE);
|
||||
this.setMaxDamage(200000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack stack, Entity entity, int slot,
|
||||
String layer) {
|
||||
return "/assets/atomicscience/textures/models/hazmat.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isProtectedFromPoison(ItemStack itemStack,
|
||||
EntityLivingBase entityLiving, Poison type) {
|
||||
return type == PoisonRadiation.INSTANCE ||
|
||||
type.getName().equalsIgnoreCase("chemical") ||
|
||||
type.getName().equalsIgnoreCase("contagious");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProtectFromPoison(ItemStack itemStack,
|
||||
EntityLivingBase entityLiving, Poison type) {
|
||||
itemStack.damageItem(1, entityLiving);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Poison.ArmorType getArmorType() {
|
||||
return Poison.ArmorType.values()[super.armorType];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.api.ITemperature;
|
||||
import atomicscience.wujian.ItElectricAS;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.World;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class ItThermometer extends ItElectricAS {
|
||||
public static final int JOULES_CONSUMPTION = 1000;
|
||||
|
||||
public ItThermometer(int texture) {
|
||||
super("thermometer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player,
|
||||
List par3List, boolean par4) {
|
||||
super.addInformation(itemStack, player, par3List, par4);
|
||||
Vector3 coord = this.getSavedCoord(itemStack);
|
||||
TileEntity tileEntity = coord.getTileEntity(player.worldObj);
|
||||
if (tileEntity instanceof ITemperature) {
|
||||
par3List.add("Tracking Thermal Device:");
|
||||
par3List.add("X: " + coord.intX() + ", Y: " + coord.intY() +
|
||||
", Z: " + coord.intZ());
|
||||
par3List.add(Math.round(((ITemperature) tileEntity).getTemperature()) +
|
||||
" Celsius");
|
||||
} else {
|
||||
par3List.add("§4Invalid Thermal Device.");
|
||||
}
|
||||
}
|
||||
|
||||
public void setSavedCoords(ItemStack itemStack, Vector3 position) {
|
||||
if (itemStack.stackTagCompound == null) {
|
||||
itemStack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
|
||||
itemStack.stackTagCompound.setInteger("x", position.intX());
|
||||
itemStack.stackTagCompound.setInteger("y", position.intY());
|
||||
itemStack.stackTagCompound.setInteger("z", position.intZ());
|
||||
}
|
||||
|
||||
public Vector3 getSavedCoord(ItemStack par1ItemStack) {
|
||||
return par1ItemStack.stackTagCompound == null
|
||||
? new Vector3()
|
||||
: new Vector3((double) par1ItemStack.stackTagCompound.getInteger("x"),
|
||||
(double) par1ItemStack.stackTagCompound.getInteger("y"),
|
||||
(double) par1ItemStack.stackTagCompound.getInteger("z"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer par2EntityPlayer,
|
||||
World par3World, int x, int y, int z, int par7,
|
||||
float par8, float par9, float par10) {
|
||||
if (!par3World.isRemote) {
|
||||
if (this.getJoules(itemStack) > 0.0D) {
|
||||
TileEntity tileEntity = par3World.getTileEntity(x, y, z);
|
||||
if (tileEntity instanceof ITemperature) {
|
||||
if (par2EntityPlayer.isSneaking()) {
|
||||
this.setSavedCoords(itemStack, new Vector3(tileEntity));
|
||||
par2EntityPlayer.addChatComponentMessage(
|
||||
new ChatComponentText("Tracking Thermal Device."));
|
||||
} else {
|
||||
par2EntityPlayer.addChatComponentMessage(new ChatComponentText(
|
||||
"Heat: " +
|
||||
Math.round(((ITemperature) tileEntity).getTemperature()) +
|
||||
" C"));
|
||||
}
|
||||
|
||||
this.onProvide(
|
||||
ElectricityPack.getFromWatts(1000.0D, this.getVoltage(itemStack)),
|
||||
itemStack);
|
||||
}
|
||||
} else {
|
||||
par2EntityPlayer.addChatComponentMessage(
|
||||
new ChatComponentText("No Electricity!"));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxJoules(ItemStack itemStack) {
|
||||
return 50000.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getVoltage(ItemStack itemStack) {
|
||||
return 20.0D;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,245 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import universalelectricity.core.electricity.ElectricityPack;
|
||||
import universalelectricity.core.item.ElectricItemHelper;
|
||||
import universalelectricity.prefab.implement.IRotatable;
|
||||
|
||||
public class TChemicalExtractor
|
||||
extends TInventory implements ISidedInventory, IFluidHandler, IRotatable {
|
||||
|
||||
public final int SMELTING_TICKS = 280;
|
||||
// public final float DIAN = 500.0F;
|
||||
public int smeltingTicks = 0;
|
||||
public float rotation = 0.0F;
|
||||
public final FluidTank waterTank;
|
||||
private int playersUsing;
|
||||
|
||||
public TChemicalExtractor() {
|
||||
this.waterTank = new FluidTank(FluidRegistry.WATER, 0, 5000);
|
||||
this.playersUsing = 0;
|
||||
// TODO: WTF
|
||||
// this.waterTank.setTankPressure(-10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ElectricityPack getRequest() {
|
||||
return this.canWork()
|
||||
? new ElectricityPack(500.0D / this.getVoltage(), this.getVoltage())
|
||||
: new ElectricityPack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.worldObj.isRemote && !this.isDisabled()) {
|
||||
if (super.containingItems[1] != null &&
|
||||
FluidContainerRegistry.isFilledContainer(super.containingItems[1])) {
|
||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(
|
||||
super.containingItems[1]);
|
||||
if (liquid.getFluid() == FluidRegistry.WATER &&
|
||||
this.fill(ForgeDirection.UNKNOWN, liquid, false) > 0) {
|
||||
ItemStack resultingContainer = super.containingItems[1].getItem().getContainerItem(
|
||||
super.containingItems[1]);
|
||||
if (resultingContainer == null &&
|
||||
super.containingItems[1].stackSize > 1) {
|
||||
--super.containingItems[1].stackSize;
|
||||
} else {
|
||||
super.containingItems[1] = resultingContainer;
|
||||
}
|
||||
|
||||
this.waterTank.fill(liquid, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.canWork()) {
|
||||
super.wattsReceived += ElectricItemHelper.dechargeItem(
|
||||
super.containingItems[0], 500.0D, this.getVoltage());
|
||||
double var10000 = super.wattsReceived;
|
||||
this.getClass();
|
||||
if (var10000 >= (double) (500.0F / 2.0F)) {
|
||||
if (this.smeltingTicks == 0) {
|
||||
this.smeltingTicks = 280;
|
||||
}
|
||||
|
||||
if (this.smeltingTicks > 0) {
|
||||
--this.smeltingTicks;
|
||||
if (this.smeltingTicks < 1) {
|
||||
this.work();
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
} else {
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
|
||||
super.wattsReceived = 0.0D;
|
||||
}
|
||||
} else {
|
||||
this.smeltingTicks = 0;
|
||||
}
|
||||
|
||||
if (super.ticks % 10L == 0L && this.playersUsing > 0) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager arg0,
|
||||
S35PacketUpdateTileEntity arg1) {
|
||||
NBTTagCompound nbt = arg1.func_148857_g();
|
||||
|
||||
this.smeltingTicks = nbt.getInteger("smeltingTicks");
|
||||
this.waterTank.setFluid(
|
||||
new FluidStack(FluidRegistry.WATER, nbt.getInteger("waterAmount")));
|
||||
super.disabledTicks = nbt.getInteger("disabledTicks");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("smeltingTicks", this.smeltingTicks);
|
||||
nbt.setInteger("waterAmount", this.waterTank.getFluidAmount());
|
||||
nbt.setInteger("disabledTicks", super.disabledTicks);
|
||||
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||
this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
++this.playersUsing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
--this.playersUsing;
|
||||
}
|
||||
|
||||
public boolean canWork() {
|
||||
if (!this.isDisabled() && this.waterTank.getFluid() != null &&
|
||||
this.waterTank.getFluidAmount() >= 1000) {
|
||||
if (AtomicScience.isUraniumOre(super.containingItems[3]) &&
|
||||
this.isItemValidForSlot(
|
||||
2, new ItemStack(AtomicScience.itYellowcake))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (AtomicScience.isCell(super.containingItems[3]) &&
|
||||
this.isItemValidForSlot(
|
||||
2, new ItemStack(AtomicScience.itCellDeuterium))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void work() {
|
||||
if (this.canWork()) {
|
||||
this.waterTank.drain(1000, true);
|
||||
if (AtomicScience.isUraniumOre(super.containingItems[3])) {
|
||||
this.incrStackSize(2, new ItemStack(AtomicScience.itYellowcake, 3));
|
||||
} else {
|
||||
this.incrStackSize(2, new ItemStack(AtomicScience.itCellDeuterium));
|
||||
}
|
||||
|
||||
this.decrStackSize(3, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.smeltingTicks = nbt.getInteger("shiJian");
|
||||
NBTTagCompound compound = nbt.getCompoundTag("water");
|
||||
this.waterTank.setFluid(FluidStack.loadFluidStackFromNBT(compound));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("shiJian", this.smeltingTicks);
|
||||
if (this.waterTank.getFluid() != null) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
this.waterTank.getFluid().writeToNBT(compound);
|
||||
nbt.setTag("water", compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return FluidRegistry.WATER == resource.getFluid()
|
||||
? this.waterTank.fill(resource, doFill)
|
||||
: 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
||||
return new FluidTankInfo[] { new FluidTankInfo(this.waterTank) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
public boolean isItemValidForSlot(int slotID, ItemStack itemStack) {
|
||||
return slotID == 1
|
||||
? AtomicScience.isCellWater(itemStack)
|
||||
: (slotID != 3 ? false
|
||||
: AtomicScience.isCell(itemStack) ||
|
||||
AtomicScience.isUraniumOre(itemStack));
|
||||
}
|
||||
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return new int[] { 1, 2, 3 };
|
||||
}
|
||||
|
||||
public boolean canInsertItem(int slotID, ItemStack itemStack, int side) {
|
||||
return this.isItemValidForSlot(slotID, itemStack);
|
||||
}
|
||||
|
||||
public boolean canExtractItem(int slotID, ItemStack itemstack, int side) {
|
||||
return slotID == 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
||||
return arg1 == FluidRegistry.WATER &&
|
||||
this.waterTank.getFluidAmount() < this.waterTank.getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.api.ISteamReceptor;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import universalelectricity.core.block.IConductor;
|
||||
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
||||
|
||||
public class TFunnel
|
||||
extends TileEntityAdvanced implements ISteamReceptor, IFluidHandler {
|
||||
|
||||
public IConductor connectedWire = null;
|
||||
public final FluidTank gasTank;
|
||||
|
||||
public TFunnel() {
|
||||
this.gasTank = new FluidTank(AtomicScience.FLUID_STEAM, 0, 20000);
|
||||
|
||||
// TODO: WTF
|
||||
// this.gasTank.setTankPressure(10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (super.ticks % 20L == 0L) {
|
||||
TileEntity tileEntity = this.worldObj.getTileEntity(
|
||||
this.xCoord, this.yCoord + 1, this.zCoord);
|
||||
if (tileEntity != null && tileEntity instanceof ISteamReceptor) {
|
||||
FluidStack drainStack = this.gasTank.drain(AtomicScience.STEAM_RATIO, true);
|
||||
if (drainStack != null) {
|
||||
int nengLiang = drainStack.amount;
|
||||
((ISteamReceptor) tileEntity)
|
||||
.onReceiveSteam(nengLiang - nengLiang / 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagCompound gasCompound = nbt.getCompoundTag("gas");
|
||||
this.gasTank.setFluid(FluidStack.loadFluidStackFromNBT(gasCompound));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
if (this.gasTank.getFluid() != null) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
this.gasTank.getFluid().writeToNBT(compound);
|
||||
nbt.setTag("gas", compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceiveSteam(int amount) {
|
||||
this.gasTank.fill(new FluidStack(AtomicScience.FLUID_STEAM,
|
||||
amount * AtomicScience.STEAM_RATIO),
|
||||
true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return this.gasTank.drain(maxDrain, doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
||||
return arg1 == AtomicScience.FLUID_STEAM &&
|
||||
this.gasTank.getFluidAmount() > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
||||
return arg1.getFluid() == AtomicScience.FLUID_STEAM
|
||||
? this.gasTank.drain(arg1.amount, arg2)
|
||||
: null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
||||
return new FluidTankInfo[] { new FluidTankInfo(this.gasTank) };
|
||||
}
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import calclavia.lib.TileEntityUniversalRunnable;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
public abstract class TInventory
|
||||
extends TileEntityUniversalRunnable implements IInventory {
|
||||
public final Set<EntityPlayer> players = new HashSet<>();
|
||||
protected ItemStack[] containingItems = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
|
||||
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this
|
||||
? false
|
||||
: par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D,
|
||||
(double) this.yCoord + 0.5D,
|
||||
(double) this.zCoord + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int par1) {
|
||||
return this.containingItems[par1];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int par1, int par2) {
|
||||
if (this.containingItems[par1] != null) {
|
||||
ItemStack var3;
|
||||
if (this.containingItems[par1].stackSize <= par2) {
|
||||
var3 = this.containingItems[par1];
|
||||
this.containingItems[par1] = null;
|
||||
return var3;
|
||||
} else {
|
||||
var3 = this.containingItems[par1].splitStack(par2);
|
||||
if (this.containingItems[par1].stackSize == 0) {
|
||||
this.containingItems[par1] = null;
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int par1) {
|
||||
if (this.containingItems[par1] != null) {
|
||||
ItemStack var2 = this.containingItems[par1];
|
||||
this.containingItems[par1] = null;
|
||||
return var2;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
|
||||
this.containingItems[par1] = par2ItemStack;
|
||||
if (par2ItemStack != null &&
|
||||
par2ItemStack.stackSize > this.getInventoryStackLimit()) {
|
||||
par2ItemStack.stackSize = this.getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.getBlockType().getLocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack itemStack) {
|
||||
return this.getStackInSlot(slot) == null
|
||||
? true
|
||||
: (this.getStackInSlot(slot).stackSize + 1 <= 64
|
||||
? this.getStackInSlot(slot).isItemEqual(itemStack)
|
||||
: false);
|
||||
}
|
||||
|
||||
public void incrStackSize(int slot, ItemStack itemStack) {
|
||||
if (this.getStackInSlot(slot) == null) {
|
||||
this.setInventorySlotContents(slot, itemStack.copy());
|
||||
} else if (this.getStackInSlot(slot).isItemEqual(itemStack)) {
|
||||
++this.getStackInSlot(slot).stackSize;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList var2 = nbt.getTagList("Items", 10);
|
||||
this.containingItems = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
|
||||
NBTTagCompound var4 = (NBTTagCompound) var2.getCompoundTagAt(var3);
|
||||
byte var5 = var4.getByte("Slot");
|
||||
if (var5 >= 0 && var5 < this.containingItems.length) {
|
||||
this.containingItems[var5] = ItemStack.loadItemStackFromNBT(var4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
NBTTagList var2 = new NBTTagList();
|
||||
|
||||
for (int var3 = 0; var3 < this.containingItems.length; ++var3) {
|
||||
if (this.containingItems[var3] != null) {
|
||||
NBTTagCompound var4 = new NBTTagCompound();
|
||||
var4.setByte("Slot", (byte) var3);
|
||||
this.containingItems[var3].writeToNBT(var4);
|
||||
var2.appendTag(var4);
|
||||
}
|
||||
}
|
||||
|
||||
nbt.setTag("Items", var2);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.api.ITemperature;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.tile.TileEntityDisableable;
|
||||
|
||||
public class TThermometer extends TileEntityDisableable {
|
||||
public static final int MAX_TEMP = 5000;
|
||||
private int warningTemp = 2000;
|
||||
private float prevTemp;
|
||||
public float temp = 0.0F;
|
||||
public Vector3 linkedTileCoords;
|
||||
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.prevTemp = this.temp;
|
||||
if (super.ticks % 10L == 0L) {
|
||||
this.temp = 0.0F;
|
||||
if (this.linkedTileCoords != null &&
|
||||
this.linkedTileCoords.getTileEntity(this.worldObj) instanceof ITemperature) {
|
||||
this.temp = ((ITemperature) this.linkedTileCoords.getTileEntity(this.worldObj))
|
||||
.getTemperature();
|
||||
} else {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
Vector3 offsetPos = new Vector3(this);
|
||||
offsetPos.modifyPositionFromSide(ForgeDirection.getOrientation(i));
|
||||
Block fangGe = offsetPos.getBlock(this.worldObj);
|
||||
if (fangGe instanceof ITemperature) {
|
||||
this.temp += ((ITemperature) fangGe).getTemperature();
|
||||
} else {
|
||||
TileEntity tileEntity = offsetPos.getTileEntity(this.worldObj);
|
||||
if (tileEntity != null && tileEntity instanceof ITemperature) {
|
||||
this.temp += ((ITemperature) tileEntity).getTemperature();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.worldObj.notifyBlocksOfNeighborChange(
|
||||
this.xCoord, this.yCoord, this.zCoord, AtomicScience.bThermometer);
|
||||
if (this.prevTemp != this.temp) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord,
|
||||
this.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setFloat("temp", this.temp);
|
||||
nbt.setInteger("warningTemp", this.warningTemp);
|
||||
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||
this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager arg0,
|
||||
S35PacketUpdateTileEntity arg1) {
|
||||
NBTTagCompound nbt = arg1.func_148857_g();
|
||||
this.temp = nbt.getFloat("temp");
|
||||
this.warningTemp = nbt.getInteger("warningTemp");
|
||||
}
|
||||
|
||||
public boolean setLinkTile(Vector3 linkedTileCoords) {
|
||||
TileEntity thermalTile = linkedTileCoords.getTileEntity(this.worldObj);
|
||||
if (thermalTile instanceof ITemperature) {
|
||||
this.linkedTileCoords = linkedTileCoords;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.warningTemp = nbt.getInteger("warningTemp");
|
||||
this.linkedTileCoords = Vector3.readFromNBT(nbt.getCompoundTag("linkedTileCoords"));
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("warningTemp", this.warningTemp);
|
||||
if (this.linkedTileCoords != null) {
|
||||
nbt.setTag("linkedTileCoords",
|
||||
this.linkedTileCoords.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
public int getWarningTemp() {
|
||||
return this.warningTemp;
|
||||
}
|
||||
|
||||
public void setWarningTemp(int warningTemp) {
|
||||
this.warningTemp = warningTemp;
|
||||
if (this.warningTemp <= 0) {
|
||||
this.warningTemp = 5000;
|
||||
}
|
||||
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
public boolean shouldEmitRedstone() {
|
||||
return !this.isDisabled() && this.temp >= (float) this.getWarningTemp();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,275 @@
|
|||
package atomicscience.jiqi;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import atomicscience.api.ISteamReceptor;
|
||||
import calclavia.lib.TileEntityUniversalProducer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
|
||||
public class TTurbine extends TileEntityUniversalProducer
|
||||
implements ISteamReceptor, IFluidHandler {
|
||||
public float rotation = 0.0F;
|
||||
public float speed = 0.0F;
|
||||
public boolean isMultiblock = false;
|
||||
public Vector3 masterTurbine = null;
|
||||
public static final int BAN_JING = 1;
|
||||
// private static final double MAX_XUAN_ZHUAN = 50.0D;
|
||||
// private static final float ZHUAN_MAN = 0.5F;
|
||||
public final FluidTank tank;
|
||||
|
||||
public TTurbine() {
|
||||
this.tank = new FluidTank(AtomicScience.FLUID_STEAM, 0, 20000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection direction) {
|
||||
return this.masterTurbine != null ? false : direction == ForgeDirection.UP;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (this.tank.getFluid() != null &&
|
||||
this.tank.getFluidAmount() > AtomicScience.STEAM_RATIO) {
|
||||
this.onReceiveSteam(AtomicScience.STEAM_RATIO);
|
||||
this.tank.drain(AtomicScience.STEAM_RATIO, true);
|
||||
}
|
||||
|
||||
if (this.masterTurbine != null) {
|
||||
TileEntity tileEntity = this.masterTurbine.getTileEntity(this.worldObj);
|
||||
if (tileEntity == null) {
|
||||
this.masterTurbine = null;
|
||||
} else if (!tileEntity.isInvalid() && tileEntity instanceof TTurbine) {
|
||||
if (!((TTurbine)tileEntity).isMultiblock) {
|
||||
this.masterTurbine = null;
|
||||
}
|
||||
} else {
|
||||
this.masterTurbine = null;
|
||||
}
|
||||
} else {
|
||||
if (this.speed > 0.0F && !this.isDisabled()) {
|
||||
if (super.ticks % 18L == 0L) {
|
||||
if (this.isMultiblock) {
|
||||
this.worldObj.playSoundEffect(
|
||||
(double)this.xCoord, (double)this.yCoord, (double)this.zCoord,
|
||||
"atomicscience.turbine", 0.6F,
|
||||
(float)(0.699999988079071D +
|
||||
0.2D * ((double)this.speed / 450.0D)));
|
||||
} else {
|
||||
this.worldObj.playSoundEffect(
|
||||
(double)this.xCoord, (double)this.yCoord, (double)this.zCoord,
|
||||
"atomicscience.turbine", 0.15F,
|
||||
(float)(0.699999988079071D +
|
||||
0.2D * ((double)this.speed / 50.0D)));
|
||||
}
|
||||
}
|
||||
|
||||
// If turbine doesn't spin, check packet handler
|
||||
// Original packet handler added to rotation on packet received.
|
||||
// - LordMZTE
|
||||
if (this.isMultiblock) {
|
||||
this.rotation += this.speed / 18.0F / 3.0F;
|
||||
} else {
|
||||
this.rotation += this.speed / 3.0F;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote && super.ticks % 3L == 0L) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord,
|
||||
this.zCoord);
|
||||
}
|
||||
|
||||
if (this.rotation > 360.0F) {
|
||||
this.rotation = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
this.produce(
|
||||
(double)(this.speed * AtomicScience.WOLUN_MULTIPLIER_OUTPUT));
|
||||
if (this.isMultiblock) {
|
||||
this.speed = (float)Math.max(
|
||||
Math.min((double)(this.speed - 4.5F), 450.0D), 0.0D);
|
||||
} else {
|
||||
this.speed =
|
||||
(float)Math.max(Math.min((double)(this.speed - 0.5F), 50.0D), 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onReceiveSteam(int amount) {
|
||||
if (this.masterTurbine != null) {
|
||||
TileEntity tileEntity = this.masterTurbine.getTileEntity(this.worldObj);
|
||||
if (tileEntity != null && tileEntity instanceof TTurbine) {
|
||||
((TTurbine)tileEntity).onReceiveSteam(amount);
|
||||
}
|
||||
} else if (this.isMultiblock) {
|
||||
this.speed =
|
||||
(float)Math.min((double)(this.speed + (float)amount), 450.0D);
|
||||
} else {
|
||||
this.speed = (float)Math.min((double)(this.speed + (float)amount), 50.0D);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager arg0,
|
||||
S35PacketUpdateTileEntity arg1) {
|
||||
NBTTagCompound nbt = arg1.func_148857_g();
|
||||
this.isMultiblock = nbt.getBoolean("isMultiblock");
|
||||
this.masterTurbine = Vector3.readFromNBT(new NBTTagCompound());
|
||||
this.speed = nbt.getFloat("speed");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setBoolean("isMultiblock", this.isMultiblock);
|
||||
nbt.setTag("masterTurbine",
|
||||
this.masterTurbine.writeToNBT(new NBTTagCompound()));
|
||||
nbt.setFloat("speed", this.speed);
|
||||
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord,
|
||||
this.getBlockMetadata(), nbt);
|
||||
}
|
||||
|
||||
public void setMaster(TTurbine newMasterTurbine) {
|
||||
if (newMasterTurbine != null) {
|
||||
this.masterTurbine = new Vector3(newMasterTurbine);
|
||||
} else {
|
||||
this.masterTurbine = null;
|
||||
this.isMultiblock = false;
|
||||
}
|
||||
|
||||
this.worldObj.notifyBlocksOfNeighborChange(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasMaster() { return this.masterTurbine != null; }
|
||||
|
||||
public boolean checkMultiblock() {
|
||||
if (!this.worldObj.isRemote) {
|
||||
ArrayList<TTurbine> xiaoWoLun = new ArrayList<>();
|
||||
ArrayList<TTurbine> lianJie = new ArrayList<>();
|
||||
|
||||
for (int i$ = -1; i$ <= 1; ++i$) {
|
||||
for (int woLun = -1; woLun <= 1; ++woLun) {
|
||||
TileEntity tileEntity = this.worldObj.getTileEntity(
|
||||
this.xCoord + i$, this.yCoord, this.zCoord + woLun);
|
||||
if (tileEntity != null && tileEntity instanceof TTurbine) {
|
||||
if (!((TTurbine)tileEntity).hasMaster() &&
|
||||
!((TTurbine)tileEntity).isMultiblock) {
|
||||
xiaoWoLun.add((TTurbine)tileEntity);
|
||||
}
|
||||
|
||||
lianJie.add((TTurbine)tileEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Iterator var6;
|
||||
TTurbine var7;
|
||||
if (this.isMultiblock) {
|
||||
var6 = lianJie.iterator();
|
||||
|
||||
while (var6.hasNext()) {
|
||||
var7 = (TTurbine)var6.next();
|
||||
if (var7 != this) {
|
||||
var7.setMaster((TTurbine)null);
|
||||
}
|
||||
}
|
||||
|
||||
this.isMultiblock = false;
|
||||
} else if (xiaoWoLun.size() >= 9) {
|
||||
var6 = xiaoWoLun.iterator();
|
||||
|
||||
while (var6.hasNext()) {
|
||||
var7 = (TTurbine)var6.next();
|
||||
if (var7 != this) {
|
||||
var7.setMaster(this);
|
||||
}
|
||||
}
|
||||
|
||||
this.masterTurbine = null;
|
||||
this.isMultiblock = true;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.speed = nbt.getFloat("speed");
|
||||
this.isMultiblock = nbt.getBoolean("isMultiblock");
|
||||
if (nbt.hasKey("masterTurbine")) {
|
||||
this.masterTurbine =
|
||||
Vector3.readFromNBT(nbt.getCompoundTag("masterTurbine"));
|
||||
} else {
|
||||
this.masterTurbine = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setFloat("speed", this.speed);
|
||||
nbt.setBoolean("isMultiblock", this.isMultiblock);
|
||||
if (this.masterTurbine != null) {
|
||||
nbt.setTag("masterTurbine",
|
||||
this.masterTurbine.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
return this.tank.fill(resource, doFill);
|
||||
}
|
||||
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection arg0, Fluid arg1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection arg0, Fluid arg1) {
|
||||
return arg1 == AtomicScience.FLUID_STEAM &&
|
||||
this.tank.getFluidAmount() < this.tank.getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection arg0, FluidStack arg1, boolean arg2) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection arg0) {
|
||||
return new FluidTankInfo[] {new FluidTankInfo(this.tank)};
|
||||
}
|
||||
}
|
|
@ -0,0 +1,369 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class MAtomicAssembler extends ModelBase {
|
||||
ModelRenderer Safety_Glass_Front;
|
||||
ModelRenderer Safety_Glass_Right;
|
||||
ModelRenderer Safety_Glass_Back;
|
||||
ModelRenderer Safety_Glass_Left;
|
||||
ModelRenderer Safety_Glass_Top;
|
||||
ModelRenderer Circuit1;
|
||||
ModelRenderer Circuit2;
|
||||
ModelRenderer Circuit3;
|
||||
ModelRenderer Circuit4;
|
||||
ModelRenderer RAM1;
|
||||
ModelRenderer Control_Pad;
|
||||
ModelRenderer RAM2;
|
||||
ModelRenderer Control_Pad_Ribbon_Cable;
|
||||
ModelRenderer RAM3;
|
||||
ModelRenderer Control_Pad_Ribbon_Connector;
|
||||
ModelRenderer RAM4;
|
||||
ModelRenderer Plinth_Base_Ribbon_Connector;
|
||||
ModelRenderer Material_Plinth_Core;
|
||||
ModelRenderer Material_Plinth_Base;
|
||||
ModelRenderer Material_Plinth_Stand;
|
||||
ModelRenderer Plinth_Base_Plate;
|
||||
ModelRenderer Back_Arm_Upper;
|
||||
ModelRenderer Back_Arm_Lower;
|
||||
ModelRenderer Right_Arm_Upper;
|
||||
ModelRenderer Right_Arm_Lower;
|
||||
ModelRenderer Front_Arm_Upper;
|
||||
ModelRenderer Front_Arm_Lower;
|
||||
ModelRenderer Left_Arm_Upper;
|
||||
ModelRenderer Left_Arm_Lower;
|
||||
ModelRenderer Middle_Rotor_Focus_Lazer;
|
||||
ModelRenderer Middle_Rotor_Uppper_Arm;
|
||||
ModelRenderer Middle_Rotor_Lower_Arm;
|
||||
ModelRenderer Middle_Rotor_Arm_Base;
|
||||
ModelRenderer Middle_Rotor;
|
||||
ModelRenderer Bottom_Rotor_Upper_Arm;
|
||||
ModelRenderer Bottom_Rotor_Lower_Arm;
|
||||
ModelRenderer Bottom_Rotor_Arm_Base;
|
||||
ModelRenderer Bottom_Rotor;
|
||||
ModelRenderer Resonance_Crystal;
|
||||
ModelRenderer Resonator_Unit;
|
||||
ModelRenderer Resonator_Assembly;
|
||||
ModelRenderer Bottom_Rotor_Resonator_Arm;
|
||||
|
||||
|
||||
public MAtomicAssembler() {
|
||||
super.textureWidth = 65;
|
||||
super.textureHeight = 32;
|
||||
this.Safety_Glass_Front = new ModelRenderer(this, 35, 0);
|
||||
this.Safety_Glass_Front.addBox(0.0F, 0.0F, 0.0F, 15, 15, 0);
|
||||
this.Safety_Glass_Front.setRotationPoint(-7.5F, 8.0F, -7.5F);
|
||||
this.Safety_Glass_Front.setTextureSize(65, 32);
|
||||
this.Safety_Glass_Front.mirror = true;
|
||||
this.setRotation(this.Safety_Glass_Front, 0.0F, 0.0F, 0.0F);
|
||||
this.Safety_Glass_Right = new ModelRenderer(this, 35, -15);
|
||||
this.Safety_Glass_Right.addBox(0.0F, 0.0F, 0.0F, 0, 15, 15);
|
||||
this.Safety_Glass_Right.setRotationPoint(-7.5F, 8.0F, -7.5F);
|
||||
this.Safety_Glass_Right.setTextureSize(65, 32);
|
||||
this.Safety_Glass_Right.mirror = true;
|
||||
this.setRotation(this.Safety_Glass_Right, 0.0F, 0.0F, 0.0F);
|
||||
this.Safety_Glass_Back = new ModelRenderer(this, 35, 0);
|
||||
this.Safety_Glass_Back.addBox(0.0F, 0.0F, 0.0F, 15, 15, 0);
|
||||
this.Safety_Glass_Back.setRotationPoint(-7.5F, 8.0F, 7.5F);
|
||||
this.Safety_Glass_Back.setTextureSize(65, 32);
|
||||
this.Safety_Glass_Back.mirror = true;
|
||||
this.setRotation(this.Safety_Glass_Back, 0.0F, 0.0F, 0.0F);
|
||||
this.Safety_Glass_Left = new ModelRenderer(this, 35, -15);
|
||||
this.Safety_Glass_Left.addBox(0.0F, 0.0F, 0.0F, 0, 15, 15);
|
||||
this.Safety_Glass_Left.setRotationPoint(7.5F, 8.0F, -7.5F);
|
||||
this.Safety_Glass_Left.setTextureSize(65, 32);
|
||||
this.Safety_Glass_Left.mirror = true;
|
||||
this.setRotation(this.Safety_Glass_Left, 0.0F, 0.0F, 0.0F);
|
||||
this.Safety_Glass_Top = new ModelRenderer(this, 20, 0);
|
||||
this.Safety_Glass_Top.addBox(0.0F, 0.0F, 0.0F, 15, 0, 15);
|
||||
this.Safety_Glass_Top.setRotationPoint(-7.5F, 8.0F, -7.5F);
|
||||
this.Safety_Glass_Top.setTextureSize(65, 32);
|
||||
this.Safety_Glass_Top.mirror = true;
|
||||
this.setRotation(this.Safety_Glass_Top, 0.0F, 0.0F, 0.0F);
|
||||
this.Circuit1 = new ModelRenderer(this, 27, 11);
|
||||
this.Circuit1.addBox(0.0F, 0.0F, 0.0F, 2, 1, 2);
|
||||
this.Circuit1.setRotationPoint(-6.0F, 22.5F, -6.25F);
|
||||
this.Circuit1.setTextureSize(65, 32);
|
||||
this.Circuit1.mirror = true;
|
||||
this.setRotation(this.Circuit1, 0.0F, 0.0F, 0.0F);
|
||||
this.Circuit2 = new ModelRenderer(this, 27, 11);
|
||||
this.Circuit2.addBox(0.0F, 0.0F, 0.0F, 2, 1, 2);
|
||||
this.Circuit2.setRotationPoint(-5.0F, 22.5F, -1.0F);
|
||||
this.Circuit2.setTextureSize(65, 32);
|
||||
this.Circuit2.mirror = true;
|
||||
this.setRotation(this.Circuit2, 0.0F, 0.0F, 0.0F);
|
||||
this.Circuit3 = new ModelRenderer(this, 27, 11);
|
||||
this.Circuit3.addBox(0.0F, 0.0F, 0.0F, 2, 1, 2);
|
||||
this.Circuit3.setRotationPoint(3.0F, 22.5F, 0.0F);
|
||||
this.Circuit3.setTextureSize(65, 32);
|
||||
this.Circuit3.mirror = true;
|
||||
this.setRotation(this.Circuit3, 0.0F, 0.0F, 0.0F);
|
||||
this.Circuit4 = new ModelRenderer(this, 27, 11);
|
||||
this.Circuit4.addBox(0.0F, 0.0F, 0.0F, 2, 1, 2);
|
||||
this.Circuit4.setRotationPoint(-1.0F, 22.5F, -6.0F);
|
||||
this.Circuit4.setTextureSize(65, 32);
|
||||
this.Circuit4.mirror = true;
|
||||
this.setRotation(this.Circuit4, 0.0F, 0.0F, 0.0F);
|
||||
this.RAM1 = new ModelRenderer(this, 27, 11);
|
||||
this.RAM1.addBox(0.0F, 0.0F, 0.0F, 3, 1, 0);
|
||||
this.RAM1.setRotationPoint(2.0F, 22.0F, 6.0F);
|
||||
this.RAM1.setTextureSize(65, 32);
|
||||
this.RAM1.mirror = true;
|
||||
this.setRotation(this.RAM1, 0.0F, 1.570796F, 0.0F);
|
||||
this.Control_Pad = new ModelRenderer(this, 50, 25);
|
||||
this.Control_Pad.addBox(-3.0F, -1.5F, -1.0F, 4, 4, 1);
|
||||
this.Control_Pad.setRotationPoint(-4.0F, 10.0F, -7.0F);
|
||||
this.Control_Pad.setTextureSize(65, 32);
|
||||
this.Control_Pad.mirror = true;
|
||||
this.setRotation(this.Control_Pad, 0.0F, 0.0F, 0.0F);
|
||||
this.RAM2 = new ModelRenderer(this, 27, 11);
|
||||
this.RAM2.addBox(0.0F, 0.0F, 0.0F, 3, 1, 0);
|
||||
this.RAM2.setRotationPoint(2.5F, 22.0F, 6.0F);
|
||||
this.RAM2.setTextureSize(65, 32);
|
||||
this.RAM2.mirror = true;
|
||||
this.setRotation(this.RAM2, 0.0F, 1.570796F, 0.0F);
|
||||
this.Control_Pad_Ribbon_Cable = new ModelRenderer(this, 61, 18);
|
||||
this.Control_Pad_Ribbon_Cable.addBox(0.0F, 0.0F, 0.0F, 2, 12, 0);
|
||||
this.Control_Pad_Ribbon_Cable.setRotationPoint(-6.0F, 11.0F, -6.7F);
|
||||
this.Control_Pad_Ribbon_Cable.setTextureSize(65, 32);
|
||||
this.Control_Pad_Ribbon_Cable.mirror = true;
|
||||
this.setRotation(this.Control_Pad_Ribbon_Cable, 0.0F, 0.0F, 0.0F);
|
||||
this.RAM3 = new ModelRenderer(this, 27, 11);
|
||||
this.RAM3.addBox(0.0F, 0.0F, 0.0F, 3, 1, 0);
|
||||
this.RAM3.setRotationPoint(1.5F, 22.0F, 6.0F);
|
||||
this.RAM3.setTextureSize(65, 32);
|
||||
this.RAM3.mirror = true;
|
||||
this.setRotation(this.RAM3, 0.0F, 1.570796F, 0.0F);
|
||||
this.Control_Pad_Ribbon_Connector = new ModelRenderer(this, 50, 16);
|
||||
this.Control_Pad_Ribbon_Connector.addBox(0.0F, 0.0F, -0.5F, 3, 1, 1);
|
||||
this.Control_Pad_Ribbon_Connector.setRotationPoint(-6.5F, 11.0F, -6.7F);
|
||||
this.Control_Pad_Ribbon_Connector.setTextureSize(65, 32);
|
||||
this.Control_Pad_Ribbon_Connector.mirror = true;
|
||||
this.setRotation(this.Control_Pad_Ribbon_Connector, 0.0F, 0.0F, 0.0F);
|
||||
this.RAM4 = new ModelRenderer(this, 27, 11);
|
||||
this.RAM4.addBox(0.0F, 0.0F, 0.0F, 3, 1, 0);
|
||||
this.RAM4.setRotationPoint(1.0F, 22.0F, 6.0F);
|
||||
this.RAM4.setTextureSize(65, 32);
|
||||
this.RAM4.mirror = true;
|
||||
this.setRotation(this.RAM4, 0.0F, 1.570796F, 0.0F);
|
||||
this.Plinth_Base_Ribbon_Connector = new ModelRenderer(this, 50, 16);
|
||||
this.Plinth_Base_Ribbon_Connector.addBox(0.0F, 0.0F, -0.5F, 3, 1, 1);
|
||||
this.Plinth_Base_Ribbon_Connector.setRotationPoint(-6.5F, 22.0F, -6.7F);
|
||||
this.Plinth_Base_Ribbon_Connector.setTextureSize(65, 32);
|
||||
this.Plinth_Base_Ribbon_Connector.mirror = true;
|
||||
this.setRotation(this.Plinth_Base_Ribbon_Connector, 0.0F, 0.0F, 0.0F);
|
||||
this.Material_Plinth_Core = new ModelRenderer(this, 5, 27);
|
||||
this.Material_Plinth_Core.addBox(-1.0F, -1.5F, -1.0F, 2, 1, 2);
|
||||
this.Material_Plinth_Core.setRotationPoint(0.0F, 18.4F, 0.0F);
|
||||
this.Material_Plinth_Core.setTextureSize(65, 32);
|
||||
this.Material_Plinth_Core.mirror = true;
|
||||
this.setRotation(this.Material_Plinth_Core, 0.0F, 0.7853982F, 0.0F);
|
||||
this.Material_Plinth_Base = new ModelRenderer(this, 4, 6);
|
||||
this.Material_Plinth_Base.addBox(-1.5F, -1.0F, -1.5F, 3, 1, 3);
|
||||
this.Material_Plinth_Base.setRotationPoint(0.0F, 18.4F, 0.0F);
|
||||
this.Material_Plinth_Base.setTextureSize(65, 32);
|
||||
this.Material_Plinth_Base.mirror = true;
|
||||
this.setRotation(this.Material_Plinth_Base, 0.0F, 0.7853982F, 0.0F);
|
||||
this.Material_Plinth_Stand = new ModelRenderer(this, 0, 9);
|
||||
this.Material_Plinth_Stand.addBox(-0.5F, -9.0F, -0.5F, 1, 6, 1);
|
||||
this.Material_Plinth_Stand.setRotationPoint(0.0F, 26.5F, 0.0F);
|
||||
this.Material_Plinth_Stand.setTextureSize(65, 32);
|
||||
this.Material_Plinth_Stand.mirror = true;
|
||||
this.setRotation(this.Material_Plinth_Stand, 0.0F, 0.7853982F, 0.0F);
|
||||
this.Plinth_Base_Plate = new ModelRenderer(this, 1, 15);
|
||||
this.Plinth_Base_Plate.addBox(-8.0F, 0.0F, -8.0F, 16, 1, 16);
|
||||
this.Plinth_Base_Plate.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.Plinth_Base_Plate.setTextureSize(65, 32);
|
||||
this.Plinth_Base_Plate.mirror = true;
|
||||
this.setRotation(this.Plinth_Base_Plate, 0.0F, 0.0F, 0.0F);
|
||||
this.Back_Arm_Upper = new ModelRenderer(this, 30, 1);
|
||||
this.Back_Arm_Upper.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.Back_Arm_Upper.setRotationPoint(0.0F, 16.9F, 2.5F);
|
||||
this.Back_Arm_Upper.setTextureSize(65, 32);
|
||||
this.Back_Arm_Upper.mirror = true;
|
||||
this.setRotation(this.Back_Arm_Upper, 2.281837F, 3.141593F, 0.0F);
|
||||
this.Back_Arm_Lower = new ModelRenderer(this, 30, 5);
|
||||
this.Back_Arm_Lower.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.Back_Arm_Lower.setRotationPoint(0.0F, 17.4F, 1.0F);
|
||||
this.Back_Arm_Lower.setTextureSize(65, 32);
|
||||
this.Back_Arm_Lower.mirror = true;
|
||||
this.setRotation(this.Back_Arm_Lower, -2.356194F, 3.141593F, 0.0F);
|
||||
this.Right_Arm_Upper = new ModelRenderer(this, 30, 1);
|
||||
this.Right_Arm_Upper.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.Right_Arm_Upper.setRotationPoint(-2.5F, 16.9F, 0.0F);
|
||||
this.Right_Arm_Upper.setTextureSize(65, 32);
|
||||
this.Right_Arm_Upper.mirror = true;
|
||||
this.setRotation(this.Right_Arm_Upper, 2.281837F, 1.570796F, 0.0F);
|
||||
this.Right_Arm_Lower = new ModelRenderer(this, 30, 5);
|
||||
this.Right_Arm_Lower.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.Right_Arm_Lower.setRotationPoint(-1.0F, 17.4F, 0.0F);
|
||||
this.Right_Arm_Lower.setTextureSize(65, 32);
|
||||
this.Right_Arm_Lower.mirror = true;
|
||||
this.setRotation(this.Right_Arm_Lower, -2.356194F, 1.570796F, 0.0F);
|
||||
this.Front_Arm_Upper = new ModelRenderer(this, 30, 1);
|
||||
this.Front_Arm_Upper.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.Front_Arm_Upper.setRotationPoint(0.0F, 16.9F, -2.5F);
|
||||
this.Front_Arm_Upper.setTextureSize(65, 32);
|
||||
this.Front_Arm_Upper.mirror = true;
|
||||
this.setRotation(this.Front_Arm_Upper, 2.281837F, 0.0F, 0.0F);
|
||||
this.Front_Arm_Lower = new ModelRenderer(this, 30, 5);
|
||||
this.Front_Arm_Lower.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.Front_Arm_Lower.setRotationPoint(0.0F, 17.4F, -1.0F);
|
||||
this.Front_Arm_Lower.setTextureSize(65, 32);
|
||||
this.Front_Arm_Lower.mirror = true;
|
||||
this.setRotation(this.Front_Arm_Lower, -2.356194F, 0.0F, 0.0F);
|
||||
this.Left_Arm_Upper = new ModelRenderer(this, 30, 1);
|
||||
this.Left_Arm_Upper.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.Left_Arm_Upper.setRotationPoint(2.5F, 16.9F, 0.0F);
|
||||
this.Left_Arm_Upper.setTextureSize(65, 32);
|
||||
this.Left_Arm_Upper.mirror = true;
|
||||
this.setRotation(this.Left_Arm_Upper, 2.281837F, -1.570796F, 0.0F);
|
||||
this.Left_Arm_Lower = new ModelRenderer(this, 30, 5);
|
||||
this.Left_Arm_Lower.addBox(-0.5F, 0.0F, 0.0F, 1, 2, 1);
|
||||
this.Left_Arm_Lower.setRotationPoint(1.0F, 17.4F, 0.0F);
|
||||
this.Left_Arm_Lower.setTextureSize(65, 32);
|
||||
this.Left_Arm_Lower.mirror = true;
|
||||
this.setRotation(this.Left_Arm_Lower, -2.356194F, -1.570796F, 0.0F);
|
||||
this.Middle_Rotor_Focus_Lazer = new ModelRenderer(this, 11, 18);
|
||||
this.Middle_Rotor_Focus_Lazer.addBox(2.5F, -0.5F, -0.5F, 2, 1, 1);
|
||||
this.Middle_Rotor_Focus_Lazer.setRotationPoint(0.0F, 14.8F, 0.0F);
|
||||
this.Middle_Rotor_Focus_Lazer.setTextureSize(65, 32);
|
||||
this.Middle_Rotor_Focus_Lazer.mirror = true;
|
||||
this.setRotation(this.Middle_Rotor_Focus_Lazer, 0.0F, -0.7853982F, -0.3316126F);
|
||||
this.Middle_Rotor_Uppper_Arm = new ModelRenderer(this, 50, 19);
|
||||
this.Middle_Rotor_Uppper_Arm.addBox(0.8F, -4.0F, -0.5F, 3, 1, 1);
|
||||
this.Middle_Rotor_Uppper_Arm.setRotationPoint(0.0F, 14.3F, 0.0F);
|
||||
this.Middle_Rotor_Uppper_Arm.setTextureSize(65, 32);
|
||||
this.Middle_Rotor_Uppper_Arm.mirror = true;
|
||||
this.setRotation(this.Middle_Rotor_Uppper_Arm, 0.0F, -0.7853982F, 1.082104F);
|
||||
this.Middle_Rotor_Lower_Arm = new ModelRenderer(this, 17, 7);
|
||||
this.Middle_Rotor_Lower_Arm.addBox(-0.5F, -0.6F, 4.5F, 1, 5, 1);
|
||||
this.Middle_Rotor_Lower_Arm.setRotationPoint(0.0F, 14.3F, 0.0F);
|
||||
this.Middle_Rotor_Lower_Arm.setTextureSize(65, 32);
|
||||
this.Middle_Rotor_Lower_Arm.mirror = true;
|
||||
this.setRotation(this.Middle_Rotor_Lower_Arm, -0.3839724F, 0.7853982F, 0.0F);
|
||||
this.Middle_Rotor_Arm_Base = new ModelRenderer(this, 11, 21);
|
||||
this.Middle_Rotor_Arm_Base.addBox(1.5F, -0.5F, -0.5F, 2, 1, 1);
|
||||
this.Middle_Rotor_Arm_Base.setRotationPoint(0.0F, 20.6F, 0.0F);
|
||||
this.Middle_Rotor_Arm_Base.setTextureSize(65, 32);
|
||||
this.Middle_Rotor_Arm_Base.mirror = true;
|
||||
this.setRotation(this.Middle_Rotor_Arm_Base, 0.0F, -0.7853982F, 0.0F);
|
||||
this.Middle_Rotor = new ModelRenderer(this, 4, 1);
|
||||
this.Middle_Rotor.addBox(-1.5F, -0.5F, -1.5F, 3, 1, 3);
|
||||
this.Middle_Rotor.setRotationPoint(0.0F, 20.6F, 0.0F);
|
||||
this.Middle_Rotor.setTextureSize(65, 32);
|
||||
this.Middle_Rotor.mirror = true;
|
||||
this.setRotation(this.Middle_Rotor, 0.0F, 0.0F, 0.0F);
|
||||
this.Bottom_Rotor_Upper_Arm = new ModelRenderer(this, 17, 6);
|
||||
this.Bottom_Rotor_Upper_Arm.addBox(-0.5F, -6.2F, -4.1F, 1, 1, 8);
|
||||
this.Bottom_Rotor_Upper_Arm.setRotationPoint(0.0F, 15.3F, 0.0F);
|
||||
this.Bottom_Rotor_Upper_Arm.setTextureSize(65, 32);
|
||||
this.Bottom_Rotor_Upper_Arm.mirror = true;
|
||||
this.setRotation(this.Bottom_Rotor_Upper_Arm, -1.082104F, -0.7853982F, 0.0F);
|
||||
this.Bottom_Rotor_Lower_Arm = new ModelRenderer(this, 0, 0);
|
||||
this.Bottom_Rotor_Lower_Arm.addBox(-0.5F, -2.2F, 6.0F, 1, 7, 1);
|
||||
this.Bottom_Rotor_Lower_Arm.setRotationPoint(0.0F, 15.3F, 0.0F);
|
||||
this.Bottom_Rotor_Lower_Arm.setTextureSize(65, 32);
|
||||
this.Bottom_Rotor_Lower_Arm.mirror = true;
|
||||
this.setRotation(this.Bottom_Rotor_Lower_Arm, -0.3839724F, -0.7853982F, 0.0F);
|
||||
this.Bottom_Rotor_Arm_Base = new ModelRenderer(this, 50, 22);
|
||||
this.Bottom_Rotor_Arm_Base.addBox(1.0F, -0.5F, -0.5F, 4, 1, 1);
|
||||
this.Bottom_Rotor_Arm_Base.setRotationPoint(0.0F, 21.9F, 0.0F);
|
||||
this.Bottom_Rotor_Arm_Base.setTextureSize(65, 32);
|
||||
this.Bottom_Rotor_Arm_Base.mirror = true;
|
||||
this.setRotation(this.Bottom_Rotor_Arm_Base, 0.0F, -2.356194F, 0.0F);
|
||||
this.Bottom_Rotor = new ModelRenderer(this, 4, 11);
|
||||
this.Bottom_Rotor.addBox(-1.5F, -0.5F, -1.5F, 3, 1, 3);
|
||||
this.Bottom_Rotor.setRotationPoint(0.0F, 21.9F, 0.0F);
|
||||
this.Bottom_Rotor.setTextureSize(65, 32);
|
||||
this.Bottom_Rotor.mirror = true;
|
||||
this.setRotation(this.Bottom_Rotor, 0.0F, -1.570796F, 0.0F);
|
||||
this.Resonance_Crystal = new ModelRenderer(this, 0, 27);
|
||||
this.Resonance_Crystal.addBox(-0.5F, -0.5F, -0.5F, 1, 1, 1);
|
||||
this.Resonance_Crystal.setRotationPoint(0.0F, 10.7F, 0.0F);
|
||||
this.Resonance_Crystal.setTextureSize(65, 32);
|
||||
this.Resonance_Crystal.mirror = true;
|
||||
this.setRotation(this.Resonance_Crystal, 0.7853982F, 3.141593F, 0.6108652F);
|
||||
this.Resonator_Unit = new ModelRenderer(this, 17, 1);
|
||||
this.Resonator_Unit.addBox(-1.0F, -8.0F, -1.0F, 2, 2, 2);
|
||||
this.Resonator_Unit.setRotationPoint(0.0F, 17.0F, 0.0F);
|
||||
this.Resonator_Unit.setTextureSize(65, 32);
|
||||
this.Resonator_Unit.mirror = true;
|
||||
this.setRotation(this.Resonator_Unit, 0.0F, -2.356194F, 0.0F);
|
||||
this.Resonator_Assembly = new ModelRenderer(this, 0, 21);
|
||||
this.Resonator_Assembly.addBox(-1.5F, -8.9F, -1.5F, 3, 2, 3);
|
||||
this.Resonator_Assembly.setRotationPoint(0.0F, 17.0F, 0.0F);
|
||||
this.Resonator_Assembly.setTextureSize(65, 32);
|
||||
this.Resonator_Assembly.mirror = true;
|
||||
this.setRotation(this.Resonator_Assembly, 0.0F, -1.570796F, 0.0F);
|
||||
this.Bottom_Rotor_Resonator_Arm = new ModelRenderer(this, 0, 17);
|
||||
this.Bottom_Rotor_Resonator_Arm.addBox(1.5F, -10.6F, -1.0F, 3, 1, 2);
|
||||
this.Bottom_Rotor_Resonator_Arm.setRotationPoint(0.0F, 19.0F, 0.0F);
|
||||
this.Bottom_Rotor_Resonator_Arm.setTextureSize(65, 32);
|
||||
this.Bottom_Rotor_Resonator_Arm.mirror = true;
|
||||
this.setRotation(this.Bottom_Rotor_Resonator_Arm, 0.0F, -2.356194F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float rotationYaw, float rotationYaw2, float rotationYaw3, float f5) {
|
||||
this.Safety_Glass_Front.render(f5);
|
||||
this.Safety_Glass_Right.render(f5);
|
||||
this.Safety_Glass_Back.render(f5);
|
||||
this.Safety_Glass_Left.render(f5);
|
||||
this.Safety_Glass_Top.render(f5);
|
||||
this.Circuit1.render(f5);
|
||||
this.Circuit2.render(f5);
|
||||
this.Circuit3.render(f5);
|
||||
this.Circuit4.render(f5);
|
||||
this.RAM1.render(f5);
|
||||
this.Control_Pad.render(f5);
|
||||
this.RAM2.render(f5);
|
||||
this.Control_Pad_Ribbon_Cable.render(f5);
|
||||
this.RAM3.render(f5);
|
||||
this.Control_Pad_Ribbon_Connector.render(f5);
|
||||
this.RAM4.render(f5);
|
||||
this.Plinth_Base_Ribbon_Connector.render(f5);
|
||||
this.Material_Plinth_Core.render(f5);
|
||||
this.Material_Plinth_Base.render(f5);
|
||||
this.Material_Plinth_Stand.render(f5);
|
||||
this.Plinth_Base_Plate.render(f5);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(-rotationYaw, 0.0F, 1.0F, 0.0F);
|
||||
this.Back_Arm_Upper.render(f5);
|
||||
this.Back_Arm_Lower.render(f5);
|
||||
this.Right_Arm_Upper.render(f5);
|
||||
this.Right_Arm_Lower.render(f5);
|
||||
this.Front_Arm_Upper.render(f5);
|
||||
this.Front_Arm_Lower.render(f5);
|
||||
this.Left_Arm_Upper.render(f5);
|
||||
this.Left_Arm_Lower.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(rotationYaw2, 0.0F, 1.0F, 0.0F);
|
||||
this.Middle_Rotor_Focus_Lazer.render(f5);
|
||||
this.Middle_Rotor_Uppper_Arm.render(f5);
|
||||
this.Middle_Rotor_Lower_Arm.render(f5);
|
||||
this.Middle_Rotor_Arm_Base.render(f5);
|
||||
this.Middle_Rotor.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(-rotationYaw3, 0.0F, 1.0F, 0.0F);
|
||||
this.Bottom_Rotor_Upper_Arm.render(f5);
|
||||
this.Bottom_Rotor_Lower_Arm.render(f5);
|
||||
this.Bottom_Rotor_Arm_Base.render(f5);
|
||||
this.Bottom_Rotor.render(f5);
|
||||
this.Bottom_Rotor_Resonator_Arm.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
this.Resonance_Crystal.rotateAngleY = (float)Math.toRadians((double)rotationYaw);
|
||||
this.Resonance_Crystal.render(f5);
|
||||
this.Resonator_Unit.render(f5);
|
||||
this.Resonator_Assembly.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MCentrifuge extends ModelBase {
|
||||
ModelRenderer A;
|
||||
ModelRenderer B;
|
||||
ModelRenderer C;
|
||||
ModelRenderer D;
|
||||
ModelRenderer E;
|
||||
ModelRenderer F;
|
||||
ModelRenderer G;
|
||||
ModelRenderer H;
|
||||
ModelRenderer I;
|
||||
ModelRenderer JROT;
|
||||
ModelRenderer KROT;
|
||||
ModelRenderer LROT;
|
||||
ModelRenderer MROT;
|
||||
|
||||
public MCentrifuge() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 128;
|
||||
this.A = new ModelRenderer(this, 0, 0);
|
||||
this.A.addBox(-8.0F, 0.0F, -8.0F, 16, 1, 16);
|
||||
this.A.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.A.setTextureSize(64, 32);
|
||||
this.A.mirror = true;
|
||||
this.setRotation(this.A, 0.0F, 0.0F, 0.0F);
|
||||
this.B = new ModelRenderer(this, 0, 19);
|
||||
this.B.addBox(-6.0F, 0.0F, -6.0F, 12, 1, 12);
|
||||
this.B.setRotationPoint(0.0F, 22.0F, 0.0F);
|
||||
this.B.setTextureSize(64, 32);
|
||||
this.B.mirror = true;
|
||||
this.setRotation(this.B, 0.0F, 0.0F, 0.0F);
|
||||
this.C = new ModelRenderer(this, 0, 43);
|
||||
this.C.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2);
|
||||
this.C.setRotationPoint(0.0F, 10.0F, 0.0F);
|
||||
this.C.setTextureSize(64, 32);
|
||||
this.C.mirror = true;
|
||||
this.setRotation(this.C, 0.0F, 0.0F, 0.0F);
|
||||
this.D = new ModelRenderer(this, 67, 0);
|
||||
this.D.addBox(-4.0F, 0.0F, -4.0F, 8, 4, 8);
|
||||
this.D.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.D.setTextureSize(64, 32);
|
||||
this.D.mirror = true;
|
||||
this.setRotation(this.D, 0.0F, 0.0F, 0.0F);
|
||||
this.E = new ModelRenderer(this, 0, 34);
|
||||
this.E.addBox(-1.0F, 0.0F, 4.0F, 2, 6, 1);
|
||||
this.E.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.E.setTextureSize(64, 32);
|
||||
this.E.mirror = true;
|
||||
this.setRotation(this.E, 0.0F, 0.7853982F, 0.0F);
|
||||
this.F = new ModelRenderer(this, 0, 34);
|
||||
this.F.addBox(-1.0F, 0.0F, 4.0F, 2, 6, 1);
|
||||
this.F.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.F.setTextureSize(64, 32);
|
||||
this.F.mirror = true;
|
||||
this.setRotation(this.F, 0.0F, -0.7853982F, 0.0F);
|
||||
this.G = new ModelRenderer(this, 67, 13);
|
||||
this.G.addBox(-4.0F, 0.0F, -8.0F, 8, 12, 4);
|
||||
this.G.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.G.setTextureSize(64, 32);
|
||||
this.G.mirror = true;
|
||||
this.setRotation(this.G, 0.0F, 0.0F, 0.0F);
|
||||
this.H = new ModelRenderer(this, 67, 31);
|
||||
this.H.addBox(-4.0F, 0.0F, -4.0F, 8, 7, 2);
|
||||
this.H.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.H.setTextureSize(64, 32);
|
||||
this.H.mirror = true;
|
||||
this.setRotation(this.H, -1.064651F, 0.0F, 0.0F);
|
||||
this.I = new ModelRenderer(this, 9, 43);
|
||||
this.I.addBox(-2.0F, -3.0F, -2.0F, 4, 2, 4);
|
||||
this.I.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.I.setTextureSize(64, 32);
|
||||
this.I.mirror = true;
|
||||
this.setRotation(this.I, 0.0F, 0.0F, 0.0F);
|
||||
this.JROT = new ModelRenderer(this, 8, 34);
|
||||
this.JROT.addBox(1.0F, 0.0F, 1.0F, 1, 2, 1);
|
||||
this.JROT.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.JROT.setTextureSize(64, 32);
|
||||
this.JROT.mirror = true;
|
||||
this.setRotation(this.JROT, 0.0F, 0.0F, 0.0F);
|
||||
this.KROT = new ModelRenderer(this, 8, 34);
|
||||
this.KROT.addBox(-2.0F, 0.0F, 1.0F, 1, 2, 1);
|
||||
this.KROT.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.KROT.setTextureSize(64, 32);
|
||||
this.KROT.mirror = true;
|
||||
this.setRotation(this.KROT, 0.0F, 0.0F, 0.0F);
|
||||
this.LROT = new ModelRenderer(this, 8, 34);
|
||||
this.LROT.addBox(1.0F, 0.0F, -2.0F, 1, 2, 1);
|
||||
this.LROT.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.LROT.setTextureSize(64, 32);
|
||||
this.LROT.mirror = true;
|
||||
this.setRotation(this.LROT, 0.0F, 0.0F, 0.0F);
|
||||
this.MROT = new ModelRenderer(this, 8, 34);
|
||||
this.MROT.addBox(-2.0F, 0.0F, -2.0F, 1, 2, 1);
|
||||
this.MROT.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.MROT.setTextureSize(64, 32);
|
||||
this.MROT.mirror = true;
|
||||
this.setRotation(this.MROT, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float xuanZhuan, float f5) {
|
||||
this.A.render(f5);
|
||||
this.B.render(f5);
|
||||
this.C.render(f5);
|
||||
this.D.render(f5);
|
||||
this.E.render(f5);
|
||||
this.F.render(f5);
|
||||
this.G.render(f5);
|
||||
this.H.render(f5);
|
||||
this.I.render(f5);
|
||||
this.JROT.rotateAngleY = xuanZhuan;
|
||||
this.JROT.render(f5);
|
||||
this.KROT.rotateAngleY = xuanZhuan;
|
||||
this.KROT.render(f5);
|
||||
this.LROT.rotateAngleY = xuanZhuan;
|
||||
this.LROT.render(f5);
|
||||
this.MROT.rotateAngleY = xuanZhuan;
|
||||
this.MROT.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MCube extends ModelBase {
|
||||
public static final MCube INSTNACE = new MCube();
|
||||
private ModelRenderer cube = new ModelRenderer(this, 0, 0);
|
||||
|
||||
public MCube() {
|
||||
byte size = 16;
|
||||
this.cube.addBox((float)(-size / 2), (float)(-size / 2), (float)(-size / 2), size, size, size);
|
||||
this.cube.setTextureSize(112, 70);
|
||||
this.cube.mirror = true;
|
||||
}
|
||||
|
||||
public void render() {
|
||||
float f = 0.0625F;
|
||||
this.cube.render(f);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,131 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MExtractor extends ModelBase {
|
||||
ModelRenderer MAIN_BASE;
|
||||
ModelRenderer CORNER_SUPPORT_1;
|
||||
ModelRenderer CORNER_SUPPORT_2;
|
||||
ModelRenderer CORNER_SUPPORT_3;
|
||||
ModelRenderer CORNER_SUPPORT_4;
|
||||
ModelRenderer SUPPORT_BEAM_1;
|
||||
ModelRenderer SUPPORT_BEAM_2;
|
||||
ModelRenderer MAIN_CHAMBER_ROTATES;
|
||||
ModelRenderer MAGNET_1_ROTATES;
|
||||
ModelRenderer MAGNET_2_ROTATES;
|
||||
ModelRenderer ENERGY_PLUG;
|
||||
ModelRenderer KEYBOARD_SUPPORT;
|
||||
ModelRenderer KEYBOARD;
|
||||
|
||||
public MExtractor() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 128;
|
||||
this.MAIN_BASE = new ModelRenderer(this, 0, 0);
|
||||
this.MAIN_BASE.addBox(0.0F, 0.0F, 0.0F, 14, 1, 14);
|
||||
this.MAIN_BASE.setRotationPoint(-7.0F, 23.0F, -7.0F);
|
||||
this.MAIN_BASE.setTextureSize(128, 128);
|
||||
this.MAIN_BASE.mirror = true;
|
||||
this.setRotation(this.MAIN_BASE, 0.0F, 0.0F, 0.0F);
|
||||
this.CORNER_SUPPORT_1 = new ModelRenderer(this, 0, 19);
|
||||
this.CORNER_SUPPORT_1.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2);
|
||||
this.CORNER_SUPPORT_1.setRotationPoint(6.0F, 22.0F, -8.0F);
|
||||
this.CORNER_SUPPORT_1.setTextureSize(128, 128);
|
||||
this.CORNER_SUPPORT_1.mirror = true;
|
||||
this.setRotation(this.CORNER_SUPPORT_1, 0.0F, 0.0F, 0.0F);
|
||||
this.CORNER_SUPPORT_2 = new ModelRenderer(this, 0, 19);
|
||||
this.CORNER_SUPPORT_2.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2);
|
||||
this.CORNER_SUPPORT_2.setRotationPoint(-8.0F, 22.0F, 6.0F);
|
||||
this.CORNER_SUPPORT_2.setTextureSize(128, 128);
|
||||
this.CORNER_SUPPORT_2.mirror = true;
|
||||
this.setRotation(this.CORNER_SUPPORT_2, 0.0F, 0.0F, 0.0F);
|
||||
this.CORNER_SUPPORT_3 = new ModelRenderer(this, 0, 19);
|
||||
this.CORNER_SUPPORT_3.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2);
|
||||
this.CORNER_SUPPORT_3.setRotationPoint(-8.0F, 22.0F, -8.0F);
|
||||
this.CORNER_SUPPORT_3.setTextureSize(128, 128);
|
||||
this.CORNER_SUPPORT_3.mirror = true;
|
||||
this.setRotation(this.CORNER_SUPPORT_3, 0.0F, 0.0F, 0.0F);
|
||||
this.CORNER_SUPPORT_4 = new ModelRenderer(this, 0, 19);
|
||||
this.CORNER_SUPPORT_4.addBox(0.0F, 0.0F, 0.0F, 2, 2, 2);
|
||||
this.CORNER_SUPPORT_4.setRotationPoint(6.0F, 22.0F, 6.0F);
|
||||
this.CORNER_SUPPORT_4.setTextureSize(128, 128);
|
||||
this.CORNER_SUPPORT_4.mirror = true;
|
||||
this.setRotation(this.CORNER_SUPPORT_4, 0.0F, 0.0F, 0.0F);
|
||||
this.SUPPORT_BEAM_1 = new ModelRenderer(this, 10, 19);
|
||||
this.SUPPORT_BEAM_1.addBox(0.0F, 0.0F, 0.0F, 2, 8, 1);
|
||||
this.SUPPORT_BEAM_1.setRotationPoint(2.0F, 16.0F, -8.0F);
|
||||
this.SUPPORT_BEAM_1.setTextureSize(128, 128);
|
||||
this.SUPPORT_BEAM_1.mirror = true;
|
||||
this.setRotation(this.SUPPORT_BEAM_1, 0.0F, 0.0F, 0.0F);
|
||||
this.SUPPORT_BEAM_2 = new ModelRenderer(this, 10, 19);
|
||||
this.SUPPORT_BEAM_2.addBox(0.0F, 0.0F, 0.0F, 2, 8, 1);
|
||||
this.SUPPORT_BEAM_2.setRotationPoint(2.0F, 16.0F, 7.0F);
|
||||
this.SUPPORT_BEAM_2.setTextureSize(128, 128);
|
||||
this.SUPPORT_BEAM_2.mirror = true;
|
||||
this.setRotation(this.SUPPORT_BEAM_2, 0.0F, 0.0F, 0.0F);
|
||||
this.MAIN_CHAMBER_ROTATES = new ModelRenderer(this, 0, 29);
|
||||
this.MAIN_CHAMBER_ROTATES.addBox(-2.0F, -2.0F, -7.0F, 4, 4, 14);
|
||||
this.MAIN_CHAMBER_ROTATES.setRotationPoint(3.0F, 17.0F, 0.0F);
|
||||
this.MAIN_CHAMBER_ROTATES.setTextureSize(128, 128);
|
||||
this.MAIN_CHAMBER_ROTATES.mirror = true;
|
||||
this.setRotation(this.MAIN_CHAMBER_ROTATES, 0.0F, 0.0F, 0.0F);
|
||||
this.MAGNET_1_ROTATES = new ModelRenderer(this, 25, 19);
|
||||
this.MAGNET_1_ROTATES.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4);
|
||||
this.MAGNET_1_ROTATES.setRotationPoint(3.0F, 17.0F, 3.0F);
|
||||
this.MAGNET_1_ROTATES.setTextureSize(128, 128);
|
||||
this.MAGNET_1_ROTATES.mirror = true;
|
||||
this.setRotation(this.MAGNET_1_ROTATES, 0.0F, 0.0F, 0.0F);
|
||||
this.MAGNET_2_ROTATES = new ModelRenderer(this, 25, 19);
|
||||
this.MAGNET_2_ROTATES.addBox(-3.0F, -3.0F, -2.0F, 6, 6, 4);
|
||||
this.MAGNET_2_ROTATES.setRotationPoint(3.0F, 17.0F, -3.0F);
|
||||
this.MAGNET_2_ROTATES.setTextureSize(128, 128);
|
||||
this.MAGNET_2_ROTATES.mirror = true;
|
||||
this.setRotation(this.MAGNET_2_ROTATES, 0.0F, 0.0F, 0.0F);
|
||||
this.ENERGY_PLUG = new ModelRenderer(this, 58, 0);
|
||||
this.ENERGY_PLUG.addBox(0.0F, 0.0F, 0.0F, 4, 12, 11);
|
||||
this.ENERGY_PLUG.setRotationPoint(-6.0F, 12.0F, -3.0F);
|
||||
this.ENERGY_PLUG.setTextureSize(128, 128);
|
||||
this.ENERGY_PLUG.mirror = true;
|
||||
this.setRotation(this.ENERGY_PLUG, 0.0F, 0.0F, 0.0F);
|
||||
this.KEYBOARD_SUPPORT = new ModelRenderer(this, 0, 48);
|
||||
this.KEYBOARD_SUPPORT.addBox(0.0F, 0.0F, 0.0F, 1, 12, 2);
|
||||
this.KEYBOARD_SUPPORT.setRotationPoint(-6.0F, 11.0F, -6.0F);
|
||||
this.KEYBOARD_SUPPORT.setTextureSize(128, 128);
|
||||
this.KEYBOARD_SUPPORT.mirror = true;
|
||||
this.setRotation(this.KEYBOARD_SUPPORT, 0.0F, 1.570796F, 0.0F);
|
||||
this.KEYBOARD = new ModelRenderer(this, 7, 48);
|
||||
this.KEYBOARD.addBox(0.0F, 0.0F, 0.0F, 4, 1, 12);
|
||||
this.KEYBOARD.setRotationPoint(3.0F, 11.0F, -8.0F);
|
||||
this.KEYBOARD.setTextureSize(128, 128);
|
||||
this.KEYBOARD.mirror = true;
|
||||
this.setRotation(this.KEYBOARD, 0.0F, -1.570796F, -0.5235988F);
|
||||
}
|
||||
|
||||
public void render(float rotation, float f5) {
|
||||
this.MAIN_BASE.render(f5);
|
||||
this.CORNER_SUPPORT_1.render(f5);
|
||||
this.CORNER_SUPPORT_2.render(f5);
|
||||
this.CORNER_SUPPORT_3.render(f5);
|
||||
this.CORNER_SUPPORT_4.render(f5);
|
||||
this.SUPPORT_BEAM_1.render(f5);
|
||||
this.SUPPORT_BEAM_2.render(f5);
|
||||
this.MAIN_CHAMBER_ROTATES.rotateAngleZ = rotation;
|
||||
this.MAIN_CHAMBER_ROTATES.render(f5);
|
||||
this.MAGNET_1_ROTATES.rotateAngleZ = rotation;
|
||||
this.MAGNET_1_ROTATES.render(f5);
|
||||
this.MAGNET_2_ROTATES.rotateAngleZ = rotation;
|
||||
this.MAGNET_2_ROTATES.render(f5);
|
||||
this.ENERGY_PLUG.render(f5);
|
||||
this.KEYBOARD_SUPPORT.render(f5);
|
||||
this.KEYBOARD.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,227 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MFusionReactor extends ModelBase {
|
||||
ModelRenderer a;
|
||||
ModelRenderer b;
|
||||
ModelRenderer c;
|
||||
ModelRenderer d;
|
||||
ModelRenderer e;
|
||||
ModelRenderer f;
|
||||
ModelRenderer g;
|
||||
ModelRenderer h;
|
||||
ModelRenderer i;
|
||||
ModelRenderer j;
|
||||
ModelRenderer k;
|
||||
ModelRenderer l;
|
||||
ModelRenderer m;
|
||||
ModelRenderer n;
|
||||
ModelRenderer o;
|
||||
ModelRenderer p;
|
||||
ModelRenderer q;
|
||||
ModelRenderer rrot;
|
||||
ModelRenderer srot;
|
||||
ModelRenderer t;
|
||||
ModelRenderer u;
|
||||
ModelRenderer v;
|
||||
ModelRenderer w;
|
||||
ModelRenderer x;
|
||||
ModelRenderer y;
|
||||
|
||||
|
||||
public MFusionReactor() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 128;
|
||||
this.a = new ModelRenderer(this, 0, 0);
|
||||
this.a.addBox(-8.0F, 0.0F, -8.0F, 16, 1, 16);
|
||||
this.a.setRotationPoint(0.0F, 23.0F, 0.0F);
|
||||
this.a.setTextureSize(128, 128);
|
||||
this.a.mirror = true;
|
||||
this.setRotation(this.a, 0.0F, 0.0F, 0.0F);
|
||||
this.b = new ModelRenderer(this, 0, 66);
|
||||
this.b.addBox(-4.0F, 0.0F, -1.0F, 8, 13, 2);
|
||||
this.b.setRotationPoint(0.0F, 10.0F, 7.0F);
|
||||
this.b.setTextureSize(128, 128);
|
||||
this.b.mirror = true;
|
||||
this.setRotation(this.b, 0.0F, 0.0F, 0.0F);
|
||||
this.c = new ModelRenderer(this, 22, 82);
|
||||
this.c.addBox(-4.0F, 0.0F, -2.0F, 8, 2, 2);
|
||||
this.c.setRotationPoint(0.0F, 8.0F, 6.0F);
|
||||
this.c.setTextureSize(128, 128);
|
||||
this.c.mirror = true;
|
||||
this.setRotation(this.c, 0.0F, 0.0F, 0.0F);
|
||||
this.d = new ModelRenderer(this, 22, 66);
|
||||
this.d.addBox(0.0F, 0.0F, 0.0F, 8, 5, 2);
|
||||
this.d.setRotationPoint(-4.0F, 10.0F, 4.0F);
|
||||
this.d.setTextureSize(128, 128);
|
||||
this.d.mirror = true;
|
||||
this.setRotation(this.d, 0.418879F, 0.0F, 0.0F);
|
||||
this.e = new ModelRenderer(this, 0, 42);
|
||||
this.e.addBox(0.0F, 0.0F, 0.0F, 2, 13, 6);
|
||||
this.e.setRotationPoint(6.0F, 10.0F, -2.0F);
|
||||
this.e.setTextureSize(128, 128);
|
||||
this.e.mirror = true;
|
||||
this.setRotation(this.e, 0.0F, 0.0F, 0.0F);
|
||||
this.f = new ModelRenderer(this, 65, 43);
|
||||
this.f.addBox(-1.0F, -1.0F, -3.0F, 2, 2, 6);
|
||||
this.f.setRotationPoint(6.0F, 10.0F, 1.0F);
|
||||
this.f.setTextureSize(128, 128);
|
||||
this.f.mirror = true;
|
||||
this.setRotation(this.f, 0.0F, 0.0F, 0.7853982F);
|
||||
this.g = new ModelRenderer(this, 17, 42);
|
||||
this.g.addBox(0.0F, 0.0F, 0.0F, 2, 5, 6);
|
||||
this.g.setRotationPoint(4.0F, 10.0F, -2.0F);
|
||||
this.g.setTextureSize(128, 128);
|
||||
this.g.mirror = true;
|
||||
this.setRotation(this.g, 0.0F, 0.0F, -0.4014257F);
|
||||
this.h = new ModelRenderer(this, 0, 18);
|
||||
this.h.addBox(0.0F, 0.0F, 0.0F, 2, 13, 6);
|
||||
this.h.setRotationPoint(-8.0F, 10.0F, -2.0F);
|
||||
this.h.setTextureSize(128, 128);
|
||||
this.h.mirror = true;
|
||||
this.setRotation(this.h, 0.0F, 0.0F, 0.0F);
|
||||
this.i = new ModelRenderer(this, 0, 103);
|
||||
this.i.addBox(0.0F, 0.0F, 0.0F, 12, 2, 6);
|
||||
this.i.setRotationPoint(-6.0F, 8.0F, -2.0F);
|
||||
this.i.setTextureSize(128, 128);
|
||||
this.i.mirror = true;
|
||||
this.setRotation(this.i, 0.0F, 0.0F, 0.0F);
|
||||
this.j = new ModelRenderer(this, 17, 18);
|
||||
this.j.addBox(-2.0F, 0.0F, 0.0F, 2, 5, 6);
|
||||
this.j.setRotationPoint(-4.0F, 10.0F, -2.0F);
|
||||
this.j.setTextureSize(128, 128);
|
||||
this.j.mirror = true;
|
||||
this.setRotation(this.j, 0.0F, 0.0F, 0.418879F);
|
||||
this.k = new ModelRenderer(this, 0, 83);
|
||||
this.k.addBox(-3.0F, 0.0F, -2.0F, 6, 15, 3);
|
||||
this.k.setRotationPoint(5.0F, 8.0F, 5.0F);
|
||||
this.k.setTextureSize(128, 128);
|
||||
this.k.mirror = true;
|
||||
this.setRotation(this.k, 0.0F, 0.7853982F, 0.0F);
|
||||
this.l = new ModelRenderer(this, 0, 83);
|
||||
this.l.addBox(-3.0F, 0.0F, -2.0F, 6, 15, 3);
|
||||
this.l.setRotationPoint(-5.0F, 8.0F, 5.0F);
|
||||
this.l.setTextureSize(128, 128);
|
||||
this.l.mirror = true;
|
||||
this.setRotation(this.l, 0.0F, -0.7853982F, 0.0F);
|
||||
this.m = new ModelRenderer(this, 65, 43);
|
||||
this.m.addBox(-1.0F, -1.0F, -3.0F, 2, 2, 6);
|
||||
this.m.setRotationPoint(-6.0F, 10.0F, 1.0F);
|
||||
this.m.setTextureSize(128, 128);
|
||||
this.m.mirror = true;
|
||||
this.setRotation(this.m, 0.0F, 0.0F, 0.7853982F);
|
||||
this.n = new ModelRenderer(this, 65, 38);
|
||||
this.n.addBox(-4.0F, -1.0F, -1.0F, 8, 2, 2);
|
||||
this.n.setRotationPoint(0.0F, 10.0F, 6.0F);
|
||||
this.n.setTextureSize(128, 128);
|
||||
this.n.mirror = true;
|
||||
this.setRotation(this.n, 0.7853982F, 0.0F, 0.0F);
|
||||
this.o = new ModelRenderer(this, 17, 54);
|
||||
this.o.addBox(0.0F, 0.0F, 0.0F, 1, 4, 6);
|
||||
this.o.setRotationPoint(6.0F, 20.0F, -2.0F);
|
||||
this.o.setTextureSize(128, 128);
|
||||
this.o.mirror = true;
|
||||
this.setRotation(this.o, 0.0F, 0.0F, 0.7330383F);
|
||||
this.p = new ModelRenderer(this, 17, 30);
|
||||
this.p.addBox(-1.0F, 0.0F, 0.0F, 1, 4, 6);
|
||||
this.p.setRotationPoint(-6.0F, 20.0F, -2.0F);
|
||||
this.p.setTextureSize(128, 128);
|
||||
this.p.mirror = true;
|
||||
this.setRotation(this.p, 0.0F, 0.0F, -0.7330383F);
|
||||
this.q = new ModelRenderer(this, 22, 74);
|
||||
this.q.addBox(0.0F, 0.0F, -1.0F, 8, 6, 1);
|
||||
this.q.setRotationPoint(-4.0F, 19.0F, 7.0F);
|
||||
this.q.setTextureSize(128, 128);
|
||||
this.q.mirror = true;
|
||||
this.setRotation(this.q, -0.6283185F, 0.0F, 0.0F);
|
||||
this.rrot = new ModelRenderer(this, 65, 0);
|
||||
this.rrot.addBox(-1.0F, 0.0F, -1.0F, 2, 13, 2);
|
||||
this.rrot.setRotationPoint(0.0F, 10.0F, 0.0F);
|
||||
this.rrot.setTextureSize(128, 128);
|
||||
this.rrot.mirror = true;
|
||||
this.setRotation(this.rrot, 0.0F, 0.0F, 0.0F);
|
||||
this.srot = new ModelRenderer(this, 74, 0);
|
||||
this.srot.addBox(-2.0F, 0.0F, -2.0F, 4, 9, 4);
|
||||
this.srot.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.srot.setTextureSize(128, 128);
|
||||
this.srot.mirror = true;
|
||||
this.setRotation(this.srot, 0.0F, 0.0F, 0.0F);
|
||||
this.t = new ModelRenderer(this, 65, 19);
|
||||
this.t.addBox(-8.0F, 0.0F, 0.0F, 16, 2, 1);
|
||||
this.t.setRotationPoint(0.0F, 21.0F, -3.0F);
|
||||
this.t.setTextureSize(128, 128);
|
||||
this.t.mirror = true;
|
||||
this.setRotation(this.t, 0.0F, 0.0F, 0.0F);
|
||||
this.u = new ModelRenderer(this, 65, 24);
|
||||
this.u.addBox(-1.0F, 0.0F, -1.0F, 2, 10, 2);
|
||||
this.u.setRotationPoint(4.0F, 13.0F, -6.0F);
|
||||
this.u.setTextureSize(128, 128);
|
||||
this.u.mirror = true;
|
||||
this.setRotation(this.u, 0.0F, 0.0F, 0.0F);
|
||||
this.v = new ModelRenderer(this, 74, 24);
|
||||
this.v.addBox(-3.0F, -1.0F, -2.0F, 6, 2, 4);
|
||||
this.v.setRotationPoint(4.0F, 13.0F, -6.0F);
|
||||
this.v.setTextureSize(128, 128);
|
||||
this.v.mirror = true;
|
||||
this.setRotation(this.v, 0.7679449F, 0.0F, 0.0F);
|
||||
this.w = new ModelRenderer(this, 46, 24);
|
||||
this.w.addBox(0.0F, 0.0F, 0.0F, 5, 8, 4);
|
||||
this.w.setRotationPoint(-7.0F, 15.0F, -7.0F);
|
||||
this.w.setTextureSize(128, 128);
|
||||
this.w.mirror = true;
|
||||
this.setRotation(this.w, 0.0F, 0.0F, 0.0F);
|
||||
this.x = new ModelRenderer(this, 46, 38);
|
||||
this.x.addBox(0.0F, 0.0F, 0.0F, 5, 2, 3);
|
||||
this.x.setRotationPoint(-7.0F, 15.0F, -7.0F);
|
||||
this.x.setTextureSize(128, 128);
|
||||
this.x.mirror = true;
|
||||
this.setRotation(this.x, 0.7853982F, 0.0F, 0.0F);
|
||||
this.y = new ModelRenderer(this, 46, 45);
|
||||
this.y.addBox(0.0F, 0.0F, 0.0F, 5, 2, 2);
|
||||
this.y.setRotationPoint(-7.0F, 13.0F, -5.0F);
|
||||
this.y.setTextureSize(128, 128);
|
||||
this.y.mirror = true;
|
||||
this.setRotation(this.y, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float xuanZhuan, float f5) {
|
||||
this.a.render(f5);
|
||||
this.b.render(f5);
|
||||
this.c.render(f5);
|
||||
this.d.render(f5);
|
||||
this.e.render(f5);
|
||||
this.x.render(f5);
|
||||
this.g.render(f5);
|
||||
this.h.render(f5);
|
||||
this.i.render(f5);
|
||||
this.j.render(f5);
|
||||
this.k.render(f5);
|
||||
this.l.render(f5);
|
||||
this.m.render(f5);
|
||||
this.n.render(f5);
|
||||
this.o.render(f5);
|
||||
this.p.render(f5);
|
||||
this.q.render(f5);
|
||||
this.rrot.rotateAngleY = xuanZhuan;
|
||||
this.rrot.render(f5);
|
||||
this.srot.rotateAngleY = xuanZhuan;
|
||||
this.srot.render(f5);
|
||||
this.t.render(f5);
|
||||
this.u.render(f5);
|
||||
this.v.render(f5);
|
||||
this.w.render(f5);
|
||||
this.x.render(f5);
|
||||
this.y.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,408 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class MLargeTurbine extends ModelBase {
|
||||
ModelRenderer Centeraxle;
|
||||
ModelRenderer wall1;
|
||||
ModelRenderer wall2;
|
||||
ModelRenderer wall6;
|
||||
ModelRenderer wall5;
|
||||
ModelRenderer wall3;
|
||||
ModelRenderer wall4;
|
||||
ModelRenderer wallunder1;
|
||||
ModelRenderer wallunder3;
|
||||
ModelRenderer wallunder2;
|
||||
ModelRenderer wallunder6;
|
||||
ModelRenderer wallunder5;
|
||||
ModelRenderer wallunder4;
|
||||
ModelRenderer Blade1;
|
||||
ModelRenderer Blade2;
|
||||
ModelRenderer Blade3;
|
||||
ModelRenderer Blade4;
|
||||
ModelRenderer Blade5;
|
||||
ModelRenderer Blade6;
|
||||
ModelRenderer LargeBlade1;
|
||||
ModelRenderer LargeBlade2;
|
||||
ModelRenderer LargeBlade3;
|
||||
ModelRenderer LargeBlade4;
|
||||
ModelRenderer LargeBlade5;
|
||||
ModelRenderer LargeBlade6;
|
||||
ModelRenderer MediumBlade1;
|
||||
ModelRenderer MediumBlade2;
|
||||
ModelRenderer MediumBlade3;
|
||||
ModelRenderer MediumBlade4;
|
||||
ModelRenderer MediumBlade5;
|
||||
ModelRenderer MediumBlade6;
|
||||
ModelRenderer Support1;
|
||||
ModelRenderer support2;
|
||||
ModelRenderer support3;
|
||||
ModelRenderer cornerbottom1;
|
||||
ModelRenderer corner1;
|
||||
ModelRenderer corner2;
|
||||
ModelRenderer cornerbottom2;
|
||||
ModelRenderer corner6;
|
||||
ModelRenderer cornerbottom6;
|
||||
ModelRenderer corner5;
|
||||
ModelRenderer cornerbottom5;
|
||||
ModelRenderer corner4;
|
||||
ModelRenderer cornerbottom4;
|
||||
ModelRenderer corner3;
|
||||
ModelRenderer cornerbottom3;
|
||||
ModelRenderer Topelectricityoutput;
|
||||
|
||||
|
||||
public MLargeTurbine() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 128;
|
||||
this.Centeraxle = new ModelRenderer(this, 24, 0);
|
||||
this.Centeraxle.addBox(-1.0F, 0.0F, -1.0F, 2, 16, 2);
|
||||
this.Centeraxle.setRotationPoint(0.0F, 8.0F, 0.0F);
|
||||
this.Centeraxle.setTextureSize(128, 128);
|
||||
this.Centeraxle.mirror = true;
|
||||
this.setRotation(this.Centeraxle, 0.0F, 0.0F, 0.0F);
|
||||
this.wall1 = new ModelRenderer(this, 0, 92);
|
||||
this.wall1.addBox(-12.0F, 0.0F, 20.0F, 24, 12, 1);
|
||||
this.wall1.setRotationPoint(0.0F, 14.0F, 0.0F);
|
||||
this.wall1.setTextureSize(128, 128);
|
||||
this.wall1.mirror = true;
|
||||
this.setRotation(this.wall1, 0.2094395F, 0.0F, 0.0F);
|
||||
this.wall2 = new ModelRenderer(this, 0, 92);
|
||||
this.wall2.addBox(-12.0F, 0.0F, 20.0F, 24, 12, 1);
|
||||
this.wall2.setRotationPoint(0.0F, 14.0F, 0.0F);
|
||||
this.wall2.setTextureSize(128, 128);
|
||||
this.wall2.mirror = true;
|
||||
this.setRotation(this.wall2, 0.2094395F, 1.047198F, 0.0F);
|
||||
this.wall6 = new ModelRenderer(this, 0, 92);
|
||||
this.wall6.addBox(-12.0F, 0.0F, 20.0F, 24, 12, 1);
|
||||
this.wall6.setRotationPoint(0.0F, 14.0F, 0.0F);
|
||||
this.wall6.setTextureSize(128, 128);
|
||||
this.wall6.mirror = true;
|
||||
this.setRotation(this.wall6, 0.2094395F, -1.047198F, 0.0F);
|
||||
this.wall5 = new ModelRenderer(this, 0, 92);
|
||||
this.wall5.addBox(-12.0F, 0.0F, 20.0F, 24, 12, 1);
|
||||
this.wall5.setRotationPoint(0.0F, 14.0F, 0.0F);
|
||||
this.wall5.setTextureSize(128, 128);
|
||||
this.wall5.mirror = true;
|
||||
this.setRotation(this.wall5, 0.2094395F, -2.094395F, 0.0F);
|
||||
this.wall3 = new ModelRenderer(this, 0, 92);
|
||||
this.wall3.addBox(-12.0F, 0.0F, 20.0F, 24, 12, 1);
|
||||
this.wall3.setRotationPoint(0.0F, 14.0F, 0.0F);
|
||||
this.wall3.setTextureSize(128, 128);
|
||||
this.wall3.mirror = true;
|
||||
this.setRotation(this.wall3, 0.2094395F, 2.094395F, 0.0F);
|
||||
this.wall4 = new ModelRenderer(this, 0, 92);
|
||||
this.wall4.addBox(-12.0F, 0.0F, -21.0F, 24, 12, 1);
|
||||
this.wall4.setRotationPoint(0.0F, 14.0F, 0.0F);
|
||||
this.wall4.setTextureSize(128, 128);
|
||||
this.wall4.mirror = true;
|
||||
this.setRotation(this.wall4, -0.2094395F, 0.0F, 0.0F);
|
||||
this.wallunder1 = new ModelRenderer(this, 0, 107);
|
||||
this.wallunder1.addBox(-13.0F, 0.0F, 21.0F, 26, 6, 1);
|
||||
this.wallunder1.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.wallunder1.setTextureSize(128, 128);
|
||||
this.wallunder1.mirror = true;
|
||||
this.setRotation(this.wallunder1, 0.0F, 0.0F, 0.0F);
|
||||
this.wallunder3 = new ModelRenderer(this, 0, 107);
|
||||
this.wallunder3.addBox(-13.0F, 0.0F, 21.0F, 26, 6, 1);
|
||||
this.wallunder3.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.wallunder3.setTextureSize(128, 128);
|
||||
this.wallunder3.mirror = true;
|
||||
this.setRotation(this.wallunder3, 0.0F, 2.094395F, 0.0F);
|
||||
this.wallunder2 = new ModelRenderer(this, 0, 107);
|
||||
this.wallunder2.addBox(-13.0F, 0.0F, 21.0F, 26, 6, 1);
|
||||
this.wallunder2.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.wallunder2.setTextureSize(128, 128);
|
||||
this.wallunder2.mirror = true;
|
||||
this.setRotation(this.wallunder2, 0.0F, 1.047198F, 0.0F);
|
||||
this.wallunder6 = new ModelRenderer(this, 0, 107);
|
||||
this.wallunder6.addBox(-13.0F, 0.0F, 21.0F, 26, 6, 1);
|
||||
this.wallunder6.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.wallunder6.setTextureSize(128, 128);
|
||||
this.wallunder6.mirror = true;
|
||||
this.setRotation(this.wallunder6, 0.0F, -1.047198F, 0.0F);
|
||||
this.wallunder5 = new ModelRenderer(this, 0, 107);
|
||||
this.wallunder5.addBox(-13.0F, 0.0F, 21.0F, 26, 6, 1);
|
||||
this.wallunder5.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.wallunder5.setTextureSize(128, 128);
|
||||
this.wallunder5.mirror = true;
|
||||
this.setRotation(this.wallunder5, 0.0F, -2.094395F, 0.0F);
|
||||
this.wallunder4 = new ModelRenderer(this, 0, 107);
|
||||
this.wallunder4.addBox(-13.0F, 0.0F, -22.0F, 26, 6, 1);
|
||||
this.wallunder4.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.wallunder4.setTextureSize(128, 128);
|
||||
this.wallunder4.mirror = true;
|
||||
this.setRotation(this.wallunder4, 0.0F, 0.0F, 0.0F);
|
||||
this.Blade1 = new ModelRenderer(this, 0, 0);
|
||||
this.Blade1.addBox(-1.0F, 0.0F, -18.0F, 2, 1, 36);
|
||||
this.Blade1.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.Blade1.setTextureSize(128, 128);
|
||||
this.Blade1.mirror = true;
|
||||
this.setRotation(this.Blade1, 0.0F, 0.0F, 0.1745329F);
|
||||
this.Blade2 = new ModelRenderer(this, 0, 0);
|
||||
this.Blade2.addBox(-1.0F, 0.0F, -18.0F, 2, 1, 36);
|
||||
this.Blade2.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.Blade2.setTextureSize(128, 128);
|
||||
this.Blade2.mirror = true;
|
||||
this.setRotation(this.Blade2, 0.0F, 0.5235988F, 0.1745329F);
|
||||
this.Blade3 = new ModelRenderer(this, 0, 0);
|
||||
this.Blade3.addBox(-1.0F, 0.0F, -18.0F, 2, 1, 36);
|
||||
this.Blade3.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.Blade3.setTextureSize(128, 128);
|
||||
this.Blade3.mirror = true;
|
||||
this.setRotation(this.Blade3, 0.0F, 1.047198F, 0.1745329F);
|
||||
this.Blade4 = new ModelRenderer(this, 0, 0);
|
||||
this.Blade4.addBox(-1.0F, 0.0F, -18.0F, 2, 1, 36);
|
||||
this.Blade4.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.Blade4.setTextureSize(128, 128);
|
||||
this.Blade4.mirror = true;
|
||||
this.setRotation(this.Blade4, 0.0F, 1.570796F, 0.1745329F);
|
||||
this.Blade5 = new ModelRenderer(this, 0, 0);
|
||||
this.Blade5.addBox(-1.0F, 0.0F, -18.0F, 2, 1, 36);
|
||||
this.Blade5.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.Blade5.setTextureSize(128, 128);
|
||||
this.Blade5.mirror = true;
|
||||
this.setRotation(this.Blade5, 0.0F, 2.094395F, 0.1745329F);
|
||||
this.Blade6 = new ModelRenderer(this, 0, 0);
|
||||
this.Blade6.addBox(-1.0F, 0.0F, -18.0F, 2, 1, 36);
|
||||
this.Blade6.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.Blade6.setTextureSize(128, 128);
|
||||
this.Blade6.mirror = true;
|
||||
this.setRotation(this.Blade6, 0.0F, 2.617994F, 0.1745329F);
|
||||
this.LargeBlade1 = new ModelRenderer(this, 0, 49);
|
||||
this.LargeBlade1.addBox(-3.0F, 0.0F, -20.0F, 6, 1, 40);
|
||||
this.LargeBlade1.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.LargeBlade1.setTextureSize(128, 128);
|
||||
this.LargeBlade1.mirror = true;
|
||||
this.setRotation(this.LargeBlade1, 0.0F, 2.094395F, 0.1745329F);
|
||||
this.LargeBlade2 = new ModelRenderer(this, 0, 49);
|
||||
this.LargeBlade2.addBox(-3.0F, 0.0F, -20.0F, 6, 1, 40);
|
||||
this.LargeBlade2.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.LargeBlade2.setTextureSize(128, 128);
|
||||
this.LargeBlade2.mirror = true;
|
||||
this.setRotation(this.LargeBlade2, 0.0F, 2.617994F, 0.1745329F);
|
||||
this.LargeBlade3 = new ModelRenderer(this, 0, 49);
|
||||
this.LargeBlade3.addBox(-3.0F, 0.0F, -20.0F, 6, 1, 40);
|
||||
this.LargeBlade3.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.LargeBlade3.setTextureSize(128, 128);
|
||||
this.LargeBlade3.mirror = true;
|
||||
this.setRotation(this.LargeBlade3, 0.0F, 0.0F, 0.1745329F);
|
||||
this.LargeBlade4 = new ModelRenderer(this, 0, 49);
|
||||
this.LargeBlade4.addBox(-3.0F, 0.0F, -20.0F, 6, 1, 40);
|
||||
this.LargeBlade4.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.LargeBlade4.setTextureSize(128, 128);
|
||||
this.LargeBlade4.mirror = true;
|
||||
this.setRotation(this.LargeBlade4, 0.0F, 0.5235988F, 0.1745329F);
|
||||
this.LargeBlade5 = new ModelRenderer(this, 0, 49);
|
||||
this.LargeBlade5.addBox(-3.0F, 0.0F, -20.0F, 6, 1, 40);
|
||||
this.LargeBlade5.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.LargeBlade5.setTextureSize(128, 128);
|
||||
this.LargeBlade5.mirror = true;
|
||||
this.setRotation(this.LargeBlade5, 0.0F, 1.047198F, 0.1745329F);
|
||||
this.LargeBlade6 = new ModelRenderer(this, 0, 49);
|
||||
this.LargeBlade6.addBox(-3.0F, 0.0F, -20.0F, 6, 1, 40);
|
||||
this.LargeBlade6.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.LargeBlade6.setTextureSize(128, 128);
|
||||
this.LargeBlade6.mirror = true;
|
||||
this.setRotation(this.LargeBlade6, 0.0F, 1.570796F, 0.1745329F);
|
||||
this.MediumBlade1 = new ModelRenderer(this, 43, 0);
|
||||
this.MediumBlade1.addBox(-2.0F, 0.0F, -19.0F, 4, 1, 38);
|
||||
this.MediumBlade1.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.MediumBlade1.setTextureSize(128, 128);
|
||||
this.MediumBlade1.mirror = true;
|
||||
this.setRotation(this.MediumBlade1, 0.0F, 2.094395F, 0.1745329F);
|
||||
this.MediumBlade2 = new ModelRenderer(this, 43, 0);
|
||||
this.MediumBlade2.addBox(-2.0F, 0.0F, -19.0F, 4, 1, 38);
|
||||
this.MediumBlade2.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.MediumBlade2.setTextureSize(128, 128);
|
||||
this.MediumBlade2.mirror = true;
|
||||
this.setRotation(this.MediumBlade2, 0.0F, 2.617994F, 0.1745329F);
|
||||
this.MediumBlade3 = new ModelRenderer(this, 43, 0);
|
||||
this.MediumBlade3.addBox(-2.0F, 0.0F, -19.0F, 4, 1, 38);
|
||||
this.MediumBlade3.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.MediumBlade3.setTextureSize(128, 128);
|
||||
this.MediumBlade3.mirror = true;
|
||||
this.setRotation(this.MediumBlade3, 0.0F, 0.0F, 0.1745329F);
|
||||
this.MediumBlade4 = new ModelRenderer(this, 43, 0);
|
||||
this.MediumBlade4.addBox(-2.0F, 0.0F, -19.0F, 4, 1, 38);
|
||||
this.MediumBlade4.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.MediumBlade4.setTextureSize(128, 128);
|
||||
this.MediumBlade4.mirror = true;
|
||||
this.setRotation(this.MediumBlade4, 0.0F, 0.5235988F, 0.1745329F);
|
||||
this.MediumBlade5 = new ModelRenderer(this, 43, 0);
|
||||
this.MediumBlade5.addBox(-2.0F, 0.0F, -19.0F, 4, 1, 38);
|
||||
this.MediumBlade5.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.MediumBlade5.setTextureSize(128, 128);
|
||||
this.MediumBlade5.mirror = true;
|
||||
this.setRotation(this.MediumBlade5, 0.0F, 1.047198F, 0.1745329F);
|
||||
this.MediumBlade6 = new ModelRenderer(this, 43, 0);
|
||||
this.MediumBlade6.addBox(-2.0F, 0.0F, -19.0F, 4, 1, 38);
|
||||
this.MediumBlade6.setRotationPoint(0.0F, 16.0F, 0.0F);
|
||||
this.MediumBlade6.setTextureSize(128, 128);
|
||||
this.MediumBlade6.mirror = true;
|
||||
this.setRotation(this.MediumBlade6, 0.0F, 1.570796F, 0.1745329F);
|
||||
this.Support1 = new ModelRenderer(this, 0, 0);
|
||||
this.Support1.addBox(-1.0F, 0.0F, -23.0F, 2, 1, 46);
|
||||
this.Support1.setRotationPoint(0.0F, 10.0F, 0.0F);
|
||||
this.Support1.setTextureSize(128, 128);
|
||||
this.Support1.mirror = true;
|
||||
this.setRotation(this.Support1, 0.0F, 0.5235988F, 0.0F);
|
||||
this.support2 = new ModelRenderer(this, 0, 0);
|
||||
this.support2.addBox(-1.0F, 0.0F, -23.0F, 2, 1, 46);
|
||||
this.support2.setRotationPoint(0.0F, 10.0F, 0.0F);
|
||||
this.support2.setTextureSize(128, 128);
|
||||
this.support2.mirror = true;
|
||||
this.setRotation(this.support2, 0.0F, 2.617994F, 0.0F);
|
||||
this.support3 = new ModelRenderer(this, 0, 0);
|
||||
this.support3.addBox(-1.0F, 0.0F, -23.0F, 2, 1, 46);
|
||||
this.support3.setRotationPoint(0.0F, 10.0F, 0.0F);
|
||||
this.support3.setTextureSize(128, 128);
|
||||
this.support3.mirror = true;
|
||||
this.setRotation(this.support3, 0.0F, 1.570796F, 0.0F);
|
||||
this.cornerbottom1 = new ModelRenderer(this, 10, 0);
|
||||
this.cornerbottom1.addBox(17.0F, 0.0F, 17.0F, 3, 4, 3);
|
||||
this.cornerbottom1.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.cornerbottom1.setTextureSize(128, 128);
|
||||
this.cornerbottom1.mirror = true;
|
||||
this.setRotation(this.cornerbottom1, 0.0F, 2.879793F, 0.0F);
|
||||
this.corner1 = new ModelRenderer(this, 0, 0);
|
||||
this.corner1.addBox(16.0F, 0.0F, 16.0F, 2, 14, 2);
|
||||
this.corner1.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.corner1.setTextureSize(128, 128);
|
||||
this.corner1.mirror = true;
|
||||
this.setRotation(this.corner1, 0.122173F, 2.879793F, -0.1396263F);
|
||||
this.corner2 = new ModelRenderer(this, 0, 0);
|
||||
this.corner2.addBox(16.0F, 0.0F, 16.0F, 2, 14, 2);
|
||||
this.corner2.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.corner2.setTextureSize(128, 128);
|
||||
this.corner2.mirror = true;
|
||||
this.setRotation(this.corner2, 0.122173F, -2.356194F, -0.1396263F);
|
||||
this.cornerbottom2 = new ModelRenderer(this, 10, 0);
|
||||
this.cornerbottom2.addBox(17.0F, 0.0F, 17.0F, 3, 4, 3);
|
||||
this.cornerbottom2.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.cornerbottom2.setTextureSize(128, 128);
|
||||
this.cornerbottom2.mirror = true;
|
||||
this.setRotation(this.cornerbottom2, 0.0F, -2.356194F, 0.0F);
|
||||
this.corner6 = new ModelRenderer(this, 0, 0);
|
||||
this.corner6.addBox(16.0F, 0.0F, 16.0F, 2, 14, 2);
|
||||
this.corner6.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.corner6.setTextureSize(128, 128);
|
||||
this.corner6.mirror = true;
|
||||
this.setRotation(this.corner6, 0.122173F, 1.832596F, -0.1396263F);
|
||||
this.cornerbottom6 = new ModelRenderer(this, 10, 0);
|
||||
this.cornerbottom6.addBox(17.0F, 0.0F, 17.0F, 3, 4, 3);
|
||||
this.cornerbottom6.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.cornerbottom6.setTextureSize(128, 128);
|
||||
this.cornerbottom6.mirror = true;
|
||||
this.setRotation(this.cornerbottom6, 0.0F, 1.832596F, 0.0F);
|
||||
this.corner5 = new ModelRenderer(this, 0, 0);
|
||||
this.corner5.addBox(16.0F, 0.0F, 16.0F, 2, 14, 2);
|
||||
this.corner5.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.corner5.setTextureSize(128, 128);
|
||||
this.corner5.mirror = true;
|
||||
this.setRotation(this.corner5, 0.122173F, 0.7853982F, -0.1396263F);
|
||||
this.cornerbottom5 = new ModelRenderer(this, 10, 0);
|
||||
this.cornerbottom5.addBox(17.0F, 0.0F, 17.0F, 3, 4, 3);
|
||||
this.cornerbottom5.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.cornerbottom5.setTextureSize(128, 128);
|
||||
this.cornerbottom5.mirror = true;
|
||||
this.setRotation(this.cornerbottom5, 0.0F, 0.7853982F, 0.0F);
|
||||
this.corner4 = new ModelRenderer(this, 0, 0);
|
||||
this.corner4.addBox(16.0F, 0.0F, 16.0F, 2, 14, 2);
|
||||
this.corner4.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.corner4.setTextureSize(128, 128);
|
||||
this.corner4.mirror = true;
|
||||
this.setRotation(this.corner4, 0.122173F, -0.2617994F, -0.1396263F);
|
||||
this.cornerbottom4 = new ModelRenderer(this, 10, 0);
|
||||
this.cornerbottom4.addBox(17.0F, 0.0F, 17.0F, 3, 4, 3);
|
||||
this.cornerbottom4.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.cornerbottom4.setTextureSize(128, 128);
|
||||
this.cornerbottom4.mirror = true;
|
||||
this.setRotation(this.cornerbottom4, 0.0F, -0.2617994F, 0.0F);
|
||||
this.corner3 = new ModelRenderer(this, 0, 0);
|
||||
this.corner3.addBox(16.0F, 0.0F, 16.0F, 2, 14, 2);
|
||||
this.corner3.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.corner3.setTextureSize(128, 128);
|
||||
this.corner3.mirror = true;
|
||||
this.setRotation(this.corner3, 0.122173F, -1.308997F, -0.1396263F);
|
||||
this.cornerbottom3 = new ModelRenderer(this, 10, 0);
|
||||
this.cornerbottom3.addBox(17.0F, 0.0F, 17.0F, 3, 4, 3);
|
||||
this.cornerbottom3.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.cornerbottom3.setTextureSize(128, 128);
|
||||
this.cornerbottom3.mirror = true;
|
||||
this.setRotation(this.cornerbottom3, 0.0F, -1.308997F, 0.0F);
|
||||
this.Topelectricityoutput = new ModelRenderer(this, 0, 18);
|
||||
this.Topelectricityoutput.addBox(-3.0F, 0.0F, -3.0F, 6, 2, 6);
|
||||
this.Topelectricityoutput.setRotationPoint(0.0F, 8.0F, 0.0F);
|
||||
this.Topelectricityoutput.setTextureSize(128, 128);
|
||||
this.Topelectricityoutput.mirror = true;
|
||||
this.setRotation(this.Topelectricityoutput, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float rotation, float f5) {
|
||||
this.Centeraxle.render(f5);
|
||||
this.wall1.render(f5);
|
||||
this.wall2.render(f5);
|
||||
this.wall6.render(f5);
|
||||
this.wall5.render(f5);
|
||||
this.wall3.render(f5);
|
||||
this.wall4.render(f5);
|
||||
this.wallunder1.render(f5);
|
||||
this.wallunder3.render(f5);
|
||||
this.wallunder2.render(f5);
|
||||
this.wallunder6.render(f5);
|
||||
this.wallunder5.render(f5);
|
||||
this.wallunder4.render(f5);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
|
||||
this.Blade1.render(f5);
|
||||
this.Blade2.render(f5);
|
||||
this.Blade3.render(f5);
|
||||
this.Blade4.render(f5);
|
||||
this.Blade5.render(f5);
|
||||
this.Blade6.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(-rotation, 0.0F, 1.0F, 0.0F);
|
||||
this.MediumBlade1.render(f5);
|
||||
this.MediumBlade2.render(f5);
|
||||
this.MediumBlade3.render(f5);
|
||||
this.MediumBlade4.render(f5);
|
||||
this.MediumBlade5.render(f5);
|
||||
this.MediumBlade6.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
|
||||
this.LargeBlade1.render(f5);
|
||||
this.LargeBlade2.render(f5);
|
||||
this.LargeBlade3.render(f5);
|
||||
this.LargeBlade4.render(f5);
|
||||
this.LargeBlade5.render(f5);
|
||||
this.LargeBlade6.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
this.Support1.render(f5);
|
||||
this.support2.render(f5);
|
||||
this.support3.render(f5);
|
||||
this.cornerbottom1.render(f5);
|
||||
this.corner1.render(f5);
|
||||
this.corner2.render(f5);
|
||||
this.cornerbottom2.render(f5);
|
||||
this.corner6.render(f5);
|
||||
this.cornerbottom6.render(f5);
|
||||
this.corner5.render(f5);
|
||||
this.cornerbottom5.render(f5);
|
||||
this.corner4.render(f5);
|
||||
this.cornerbottom4.render(f5);
|
||||
this.corner3.render(f5);
|
||||
this.cornerbottom3.render(f5);
|
||||
this.Topelectricityoutput.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,132 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MNuclearBoiler extends ModelBase {
|
||||
ModelRenderer BASE;
|
||||
ModelRenderer THERMAL_DISPLAY;
|
||||
ModelRenderer SUPPORT;
|
||||
ModelRenderer RAD_SHIELD_PLATE_1;
|
||||
ModelRenderer RAD_SHIELD_PLATE_2;
|
||||
ModelRenderer RAD_SHIELD_PLATE_3;
|
||||
ModelRenderer FUEL_BAR_SUPPORT_1_ROTATES;
|
||||
ModelRenderer FUEL_BAR_SUPPORT_2_ROTATES;
|
||||
ModelRenderer FUEL_BAR_1_ROTATES;
|
||||
ModelRenderer FUEL_BAR_2_ROTATES;
|
||||
ModelRenderer TOP_SUPPORT_A;
|
||||
ModelRenderer TOP_SUPPORT_B;
|
||||
ModelRenderer TOP_SUPPORT_C;
|
||||
|
||||
public MNuclearBoiler() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 128;
|
||||
this.BASE = new ModelRenderer(this, 0, 0);
|
||||
this.BASE.addBox(0.0F, 0.0F, 0.0F, 16, 1, 16);
|
||||
this.BASE.setRotationPoint(-8.0F, 23.0F, -8.0F);
|
||||
this.BASE.setTextureSize(128, 128);
|
||||
this.BASE.mirror = true;
|
||||
this.setRotation(this.BASE, 0.0F, 0.0F, 0.0F);
|
||||
this.THERMAL_DISPLAY = new ModelRenderer(this, 0, 37);
|
||||
this.THERMAL_DISPLAY.addBox(0.0F, 0.0F, 0.0F, 8, 11, 3);
|
||||
this.THERMAL_DISPLAY.setRotationPoint(-4.0F, 13.0F, -3.0F);
|
||||
this.THERMAL_DISPLAY.setTextureSize(128, 128);
|
||||
this.THERMAL_DISPLAY.mirror = true;
|
||||
this.setRotation(this.THERMAL_DISPLAY, -0.4363323F, 0.0F, 0.0F);
|
||||
this.SUPPORT = new ModelRenderer(this, 0, 19);
|
||||
this.SUPPORT.addBox(0.0F, 0.0F, 0.0F, 14, 3, 13);
|
||||
this.SUPPORT.setRotationPoint(-7.0F, 20.0F, -5.0F);
|
||||
this.SUPPORT.setTextureSize(128, 128);
|
||||
this.SUPPORT.mirror = true;
|
||||
this.setRotation(this.SUPPORT, 0.0F, 0.0F, 0.0F);
|
||||
this.RAD_SHIELD_PLATE_1 = new ModelRenderer(this, 46, 37);
|
||||
this.RAD_SHIELD_PLATE_1.addBox(0.0F, 0.0F, 0.0F, 8, 14, 1);
|
||||
this.RAD_SHIELD_PLATE_1.setRotationPoint(-4.0F, 9.0F, 0.0F);
|
||||
this.RAD_SHIELD_PLATE_1.setTextureSize(128, 128);
|
||||
this.RAD_SHIELD_PLATE_1.mirror = true;
|
||||
this.setRotation(this.RAD_SHIELD_PLATE_1, 0.0F, 0.0F, 0.0F);
|
||||
this.RAD_SHIELD_PLATE_2 = new ModelRenderer(this, 24, 37);
|
||||
this.RAD_SHIELD_PLATE_2.addBox(0.0F, 0.0F, 0.0F, 8, 14, 2);
|
||||
this.RAD_SHIELD_PLATE_2.setRotationPoint(-8.0F, 9.0F, 7.0F);
|
||||
this.RAD_SHIELD_PLATE_2.setTextureSize(128, 128);
|
||||
this.RAD_SHIELD_PLATE_2.mirror = true;
|
||||
this.setRotation(this.RAD_SHIELD_PLATE_2, 0.0F, 1.064651F, 0.0F);
|
||||
this.RAD_SHIELD_PLATE_3 = new ModelRenderer(this, 24, 37);
|
||||
this.RAD_SHIELD_PLATE_3.addBox(0.0F, 0.0F, -2.0F, 8, 14, 2);
|
||||
this.RAD_SHIELD_PLATE_3.setRotationPoint(8.0F, 9.0F, 7.0F);
|
||||
this.RAD_SHIELD_PLATE_3.setTextureSize(128, 128);
|
||||
this.RAD_SHIELD_PLATE_3.mirror = true;
|
||||
this.setRotation(this.RAD_SHIELD_PLATE_3, 0.0F, 2.094395F, 0.0F);
|
||||
this.FUEL_BAR_SUPPORT_1_ROTATES = new ModelRenderer(this, 75, 13);
|
||||
this.FUEL_BAR_SUPPORT_1_ROTATES.addBox(-2.0F, 0.0F, -2.0F, 4, 1, 4);
|
||||
this.FUEL_BAR_SUPPORT_1_ROTATES.setRotationPoint(3.0F, 19.0F, 5.0F);
|
||||
this.FUEL_BAR_SUPPORT_1_ROTATES.setTextureSize(128, 128);
|
||||
this.FUEL_BAR_SUPPORT_1_ROTATES.mirror = true;
|
||||
this.setRotation(this.FUEL_BAR_SUPPORT_1_ROTATES, 0.0F, 0.5235988F, 0.0F);
|
||||
this.FUEL_BAR_SUPPORT_2_ROTATES = new ModelRenderer(this, 75, 13);
|
||||
this.FUEL_BAR_SUPPORT_2_ROTATES.addBox(-2.0F, 0.0F, -2.0F, 4, 1, 4);
|
||||
this.FUEL_BAR_SUPPORT_2_ROTATES.setRotationPoint(-3.0F, 19.0F, 5.0F);
|
||||
this.FUEL_BAR_SUPPORT_2_ROTATES.setTextureSize(128, 128);
|
||||
this.FUEL_BAR_SUPPORT_2_ROTATES.mirror = true;
|
||||
this.setRotation(this.FUEL_BAR_SUPPORT_2_ROTATES, 0.0F, 1.047198F, 0.0F);
|
||||
this.FUEL_BAR_1_ROTATES = new ModelRenderer(this, 65, 13);
|
||||
this.FUEL_BAR_1_ROTATES.addBox(-1.0F, 0.0F, -1.0F, 2, 9, 2);
|
||||
this.FUEL_BAR_1_ROTATES.setRotationPoint(3.0F, 10.0F, 5.0F);
|
||||
this.FUEL_BAR_1_ROTATES.setTextureSize(128, 128);
|
||||
this.FUEL_BAR_1_ROTATES.mirror = true;
|
||||
this.setRotation(this.FUEL_BAR_1_ROTATES, 0.0F, 0.5235988F, 0.0F);
|
||||
this.FUEL_BAR_2_ROTATES = new ModelRenderer(this, 65, 13);
|
||||
this.FUEL_BAR_2_ROTATES.addBox(-1.0F, 0.0F, -1.0F, 2, 9, 2);
|
||||
this.FUEL_BAR_2_ROTATES.setRotationPoint(-3.0F, 10.0F, 5.0F);
|
||||
this.FUEL_BAR_2_ROTATES.setTextureSize(128, 128);
|
||||
this.FUEL_BAR_2_ROTATES.mirror = true;
|
||||
this.setRotation(this.FUEL_BAR_2_ROTATES, 0.0F, 1.047198F, 0.0F);
|
||||
this.TOP_SUPPORT_A = new ModelRenderer(this, 65, 6);
|
||||
this.TOP_SUPPORT_A.addBox(-4.0F, 0.0F, -4.0F, 5, 1, 4);
|
||||
this.TOP_SUPPORT_A.setRotationPoint(6.0F, 9.0F, 6.0F);
|
||||
this.TOP_SUPPORT_A.setTextureSize(128, 128);
|
||||
this.TOP_SUPPORT_A.mirror = true;
|
||||
this.setRotation(this.TOP_SUPPORT_A, 0.0F, 0.5235988F, 0.0F);
|
||||
this.TOP_SUPPORT_B = new ModelRenderer(this, 65, 6);
|
||||
this.TOP_SUPPORT_B.addBox(0.0F, 0.0F, 0.0F, 5, 1, 4);
|
||||
this.TOP_SUPPORT_B.setRotationPoint(-5.0F, 9.0F, 2.0F);
|
||||
this.TOP_SUPPORT_B.setTextureSize(128, 128);
|
||||
this.TOP_SUPPORT_B.mirror = true;
|
||||
this.setRotation(this.TOP_SUPPORT_B, 0.0F, -0.5235988F, 0.0F);
|
||||
this.TOP_SUPPORT_C = new ModelRenderer(this, 65, 0);
|
||||
this.TOP_SUPPORT_C.addBox(0.0F, 0.0F, 0.0F, 12, 1, 4);
|
||||
this.TOP_SUPPORT_C.setRotationPoint(-6.0F, 9.0F, 4.0F);
|
||||
this.TOP_SUPPORT_C.setTextureSize(128, 128);
|
||||
this.TOP_SUPPORT_C.mirror = true;
|
||||
this.setRotation(this.TOP_SUPPORT_C, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float rotation, float f5) {
|
||||
this.BASE.render(f5);
|
||||
this.THERMAL_DISPLAY.render(f5);
|
||||
this.SUPPORT.render(f5);
|
||||
this.RAD_SHIELD_PLATE_1.render(f5);
|
||||
this.RAD_SHIELD_PLATE_2.render(f5);
|
||||
this.RAD_SHIELD_PLATE_3.render(f5);
|
||||
this.FUEL_BAR_SUPPORT_1_ROTATES.rotateAngleY = rotation;
|
||||
this.FUEL_BAR_SUPPORT_1_ROTATES.render(f5);
|
||||
this.FUEL_BAR_SUPPORT_2_ROTATES.rotateAngleY = rotation;
|
||||
this.FUEL_BAR_SUPPORT_2_ROTATES.render(f5);
|
||||
this.FUEL_BAR_1_ROTATES.rotateAngleY = rotation;
|
||||
this.FUEL_BAR_1_ROTATES.render(f5);
|
||||
this.FUEL_BAR_2_ROTATES.rotateAngleY = rotation;
|
||||
this.FUEL_BAR_2_ROTATES.render(f5);
|
||||
this.TOP_SUPPORT_A.render(f5);
|
||||
this.TOP_SUPPORT_B.render(f5);
|
||||
this.TOP_SUPPORT_C.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,186 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MReactorCellBottom extends ModelBase {
|
||||
|
||||
ModelRenderer BaseWidth;
|
||||
ModelRenderer BottomPad;
|
||||
ModelRenderer BaseDepth;
|
||||
ModelRenderer Base;
|
||||
ModelRenderer MiddleFrontRight;
|
||||
ModelRenderer MiddleFrontLeft;
|
||||
ModelRenderer MiddleBackLeft;
|
||||
ModelRenderer MiddleBackRight;
|
||||
ModelRenderer MiddlePLeft;
|
||||
ModelRenderer MiddlePFront;
|
||||
ModelRenderer MiddlePBack;
|
||||
ModelRenderer MiddlePRight;
|
||||
ModelRenderer OPLeftFront;
|
||||
ModelRenderer OPFrontRight;
|
||||
ModelRenderer OPBackLeft;
|
||||
ModelRenderer OPLeftFront2;
|
||||
ModelRenderer OPRightBack;
|
||||
ModelRenderer OPFrontLeft;
|
||||
ModelRenderer OPLeftBack;
|
||||
ModelRenderer OPBackRight;
|
||||
|
||||
|
||||
public MReactorCellBottom() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 128;
|
||||
this.BaseWidth = new ModelRenderer(this, 53, 16);
|
||||
this.BaseWidth.addBox(0.0F, 0.0F, 0.0F, 14, 1, 10);
|
||||
this.BaseWidth.setRotationPoint(-7.0F, 22.0F, -5.0F);
|
||||
this.BaseWidth.setTextureSize(128, 128);
|
||||
this.BaseWidth.mirror = true;
|
||||
this.setRotation(this.BaseWidth, 0.0F, 0.0F, 0.0F);
|
||||
this.BottomPad = new ModelRenderer(this, 53, 42);
|
||||
this.BottomPad.addBox(0.0F, 0.0F, 0.0F, 10, 1, 10);
|
||||
this.BottomPad.setRotationPoint(-5.0F, 23.0F, -5.0F);
|
||||
this.BottomPad.setTextureSize(128, 128);
|
||||
this.BottomPad.mirror = true;
|
||||
this.setRotation(this.BottomPad, 0.0F, 0.0F, 0.0F);
|
||||
this.BaseDepth = new ModelRenderer(this, 53, 0);
|
||||
this.BaseDepth.addBox(0.0F, 0.0F, 0.0F, 10, 1, 14);
|
||||
this.BaseDepth.setRotationPoint(-5.0F, 22.0F, -7.0F);
|
||||
this.BaseDepth.setTextureSize(128, 128);
|
||||
this.BaseDepth.mirror = true;
|
||||
this.setRotation(this.BaseDepth, 0.0F, 0.0F, 0.0F);
|
||||
this.Base = new ModelRenderer(this, 53, 28);
|
||||
this.Base.addBox(0.0F, 0.0F, 0.0F, 12, 1, 12);
|
||||
this.Base.setRotationPoint(-6.0F, 22.0F, -6.0F);
|
||||
this.Base.setTextureSize(128, 128);
|
||||
this.Base.mirror = true;
|
||||
this.setRotation(this.Base, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleFrontRight = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleFrontRight.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.MiddleFrontRight.setRotationPoint(3.0F, 8.0F, -4.0F);
|
||||
this.MiddleFrontRight.setTextureSize(128, 128);
|
||||
this.MiddleFrontRight.mirror = true;
|
||||
this.setRotation(this.MiddleFrontRight, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleFrontLeft = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleFrontLeft.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.MiddleFrontLeft.setRotationPoint(-4.0F, 8.0F, -4.0F);
|
||||
this.MiddleFrontLeft.setTextureSize(128, 128);
|
||||
this.MiddleFrontLeft.mirror = true;
|
||||
this.setRotation(this.MiddleFrontLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleBackLeft = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleBackLeft.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.MiddleBackLeft.setRotationPoint(-4.0F, 8.0F, 3.0F);
|
||||
this.MiddleBackLeft.setTextureSize(128, 128);
|
||||
this.MiddleBackLeft.mirror = true;
|
||||
this.setRotation(this.MiddleBackLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleBackRight = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleBackRight.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.MiddleBackRight.setRotationPoint(3.0F, 8.0F, 3.0F);
|
||||
this.MiddleBackRight.setTextureSize(128, 128);
|
||||
this.MiddleBackRight.mirror = true;
|
||||
this.setRotation(this.MiddleBackRight, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePLeft = new ModelRenderer(this, 5, 68);
|
||||
this.MiddlePLeft.addBox(0.0F, 1.466667F, 0.0F, 1, 14, 6);
|
||||
this.MiddlePLeft.setRotationPoint(-5.0F, 6.5F, -3.0F);
|
||||
this.MiddlePLeft.setTextureSize(128, 128);
|
||||
this.MiddlePLeft.mirror = true;
|
||||
this.setRotation(this.MiddlePLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePFront = new ModelRenderer(this, 23, 83);
|
||||
this.MiddlePFront.addBox(0.0F, 0.0F, 0.0F, 6, 14, 1);
|
||||
this.MiddlePFront.setRotationPoint(-3.0F, 8.0F, -5.0F);
|
||||
this.MiddlePFront.setTextureSize(128, 128);
|
||||
this.MiddlePFront.mirror = true;
|
||||
this.setRotation(this.MiddlePFront, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePBack = new ModelRenderer(this, 23, 83);
|
||||
this.MiddlePBack.addBox(0.0F, 0.0F, 0.0F, 6, 14, 1);
|
||||
this.MiddlePBack.setRotationPoint(-3.0F, 8.0F, 4.0F);
|
||||
this.MiddlePBack.setTextureSize(128, 128);
|
||||
this.MiddlePBack.mirror = true;
|
||||
this.setRotation(this.MiddlePBack, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePRight = new ModelRenderer(this, 5, 68);
|
||||
this.MiddlePRight.addBox(0.0F, 0.0F, 0.0F, 1, 14, 6);
|
||||
this.MiddlePRight.setRotationPoint(4.0F, 8.0F, -3.0F);
|
||||
this.MiddlePRight.setTextureSize(128, 128);
|
||||
this.MiddlePRight.mirror = true;
|
||||
this.setRotation(this.MiddlePRight, 0.0F, 0.0F, 0.0F);
|
||||
this.OPLeftFront = new ModelRenderer(this, 0, 0);
|
||||
this.OPLeftFront.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.OPLeftFront.setRotationPoint(-7.0F, 8.0F, -4.0F);
|
||||
this.OPLeftFront.setTextureSize(128, 128);
|
||||
this.OPLeftFront.mirror = true;
|
||||
this.setRotation(this.OPLeftFront, 0.0F, 0.0F, 0.0F);
|
||||
this.OPFrontRight = new ModelRenderer(this, 0, 0);
|
||||
this.OPFrontRight.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.OPFrontRight.setRotationPoint(3.0F, 8.0F, -7.0F);
|
||||
this.OPFrontRight.setTextureSize(128, 128);
|
||||
this.OPFrontRight.mirror = true;
|
||||
this.setRotation(this.OPFrontRight, 0.0F, 0.0F, 0.0F);
|
||||
this.OPBackLeft = new ModelRenderer(this, 0, 0);
|
||||
this.OPBackLeft.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.OPBackLeft.setRotationPoint(-4.0F, 8.0F, 6.0F);
|
||||
this.OPBackLeft.setTextureSize(128, 128);
|
||||
this.OPBackLeft.mirror = true;
|
||||
this.setRotation(this.OPBackLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.OPLeftFront2 = new ModelRenderer(this, 0, 0);
|
||||
this.OPLeftFront2.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.OPLeftFront2.setRotationPoint(6.0F, 8.0F, -4.0F);
|
||||
this.OPLeftFront2.setTextureSize(128, 128);
|
||||
this.OPLeftFront2.mirror = true;
|
||||
this.setRotation(this.OPLeftFront2, 0.0F, 0.0F, 0.0F);
|
||||
this.OPRightBack = new ModelRenderer(this, 0, 0);
|
||||
this.OPRightBack.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.OPRightBack.setRotationPoint(6.0F, 8.0F, 3.0F);
|
||||
this.OPRightBack.setTextureSize(128, 128);
|
||||
this.OPRightBack.mirror = true;
|
||||
this.setRotation(this.OPRightBack, 0.0F, 0.0F, 0.0F);
|
||||
this.OPFrontLeft = new ModelRenderer(this, 0, 0);
|
||||
this.OPFrontLeft.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.OPFrontLeft.setRotationPoint(-4.0F, 8.0F, -7.0F);
|
||||
this.OPFrontLeft.setTextureSize(128, 128);
|
||||
this.OPFrontLeft.mirror = true;
|
||||
this.setRotation(this.OPFrontLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.OPLeftBack = new ModelRenderer(this, 0, 0);
|
||||
this.OPLeftBack.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.OPLeftBack.setRotationPoint(-7.0F, 8.0F, 3.0F);
|
||||
this.OPLeftBack.setTextureSize(128, 128);
|
||||
this.OPLeftBack.mirror = true;
|
||||
this.setRotation(this.OPLeftBack, 0.0F, 0.0F, 0.0F);
|
||||
this.OPBackRight = new ModelRenderer(this, 0, 0);
|
||||
this.OPBackRight.addBox(0.0F, 0.0F, 0.0F, 1, 14, 1);
|
||||
this.OPBackRight.setRotationPoint(3.0F, 8.0F, 6.0F);
|
||||
this.OPBackRight.setTextureSize(128, 128);
|
||||
this.OPBackRight.mirror = true;
|
||||
this.setRotation(this.OPBackRight, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float f5) {
|
||||
this.BaseWidth.render(f5);
|
||||
this.BottomPad.render(f5);
|
||||
this.BaseDepth.render(f5);
|
||||
this.Base.render(f5);
|
||||
this.MiddleFrontRight.render(f5);
|
||||
this.MiddleFrontLeft.render(f5);
|
||||
this.MiddleBackLeft.render(f5);
|
||||
this.MiddleBackRight.render(f5);
|
||||
this.MiddlePLeft.render(f5);
|
||||
this.MiddlePFront.render(f5);
|
||||
this.MiddlePBack.render(f5);
|
||||
this.MiddlePRight.render(f5);
|
||||
this.OPLeftFront.render(f5);
|
||||
this.OPFrontRight.render(f5);
|
||||
this.OPBackLeft.render(f5);
|
||||
this.OPLeftFront2.render(f5);
|
||||
this.OPRightBack.render(f5);
|
||||
this.OPFrontLeft.render(f5);
|
||||
this.OPLeftBack.render(f5);
|
||||
this.OPBackRight.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,154 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MReactorCellMiddle extends ModelBase {
|
||||
|
||||
ModelRenderer MiddleFrontRight;
|
||||
ModelRenderer MiddleFrontLeft;
|
||||
ModelRenderer MiddleBackLeft;
|
||||
ModelRenderer MiddleBackRight;
|
||||
ModelRenderer MiddlePLeft;
|
||||
ModelRenderer MiddlePFront;
|
||||
ModelRenderer MiddlePBack;
|
||||
ModelRenderer MiddlePRight;
|
||||
ModelRenderer OPLeftFront;
|
||||
ModelRenderer OPFrontRight;
|
||||
ModelRenderer OPBackLeft;
|
||||
ModelRenderer OPLeftFront2;
|
||||
ModelRenderer OPRightBack;
|
||||
ModelRenderer OPFrontLeft;
|
||||
ModelRenderer OPLeftBack;
|
||||
ModelRenderer OPBackRight;
|
||||
|
||||
|
||||
public MReactorCellMiddle() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 128;
|
||||
this.MiddleFrontRight = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleFrontRight.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.MiddleFrontRight.setRotationPoint(3.0F, 8.0F, -4.0F);
|
||||
this.MiddleFrontRight.setTextureSize(128, 128);
|
||||
this.MiddleFrontRight.mirror = true;
|
||||
this.setRotation(this.MiddleFrontRight, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleFrontLeft = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleFrontLeft.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.MiddleFrontLeft.setRotationPoint(-4.0F, 8.0F, -4.0F);
|
||||
this.MiddleFrontLeft.setTextureSize(128, 128);
|
||||
this.MiddleFrontLeft.mirror = true;
|
||||
this.setRotation(this.MiddleFrontLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleBackLeft = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleBackLeft.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.MiddleBackLeft.setRotationPoint(-4.0F, 8.0F, 3.0F);
|
||||
this.MiddleBackLeft.setTextureSize(128, 128);
|
||||
this.MiddleBackLeft.mirror = true;
|
||||
this.setRotation(this.MiddleBackLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleBackRight = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleBackRight.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.MiddleBackRight.setRotationPoint(3.0F, 8.0F, 3.0F);
|
||||
this.MiddleBackRight.setTextureSize(128, 128);
|
||||
this.MiddleBackRight.mirror = true;
|
||||
this.setRotation(this.MiddleBackRight, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePLeft = new ModelRenderer(this, 5, 68);
|
||||
this.MiddlePLeft.addBox(0.0F, 1.466667F, 0.0F, 1, 16, 6);
|
||||
this.MiddlePLeft.setRotationPoint(-5.0F, 6.5F, -3.0F);
|
||||
this.MiddlePLeft.setTextureSize(128, 128);
|
||||
this.MiddlePLeft.mirror = true;
|
||||
this.setRotation(this.MiddlePLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePFront = new ModelRenderer(this, 23, 83);
|
||||
this.MiddlePFront.addBox(0.0F, 0.0F, 0.0F, 6, 16, 1);
|
||||
this.MiddlePFront.setRotationPoint(-3.0F, 8.0F, -5.0F);
|
||||
this.MiddlePFront.setTextureSize(128, 128);
|
||||
this.MiddlePFront.mirror = true;
|
||||
this.setRotation(this.MiddlePFront, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePBack = new ModelRenderer(this, 23, 83);
|
||||
this.MiddlePBack.addBox(0.0F, 0.0F, 0.0F, 6, 16, 1);
|
||||
this.MiddlePBack.setRotationPoint(-3.0F, 8.0F, 4.0F);
|
||||
this.MiddlePBack.setTextureSize(128, 128);
|
||||
this.MiddlePBack.mirror = true;
|
||||
this.setRotation(this.MiddlePBack, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePRight = new ModelRenderer(this, 5, 68);
|
||||
this.MiddlePRight.addBox(0.0F, 0.0F, 0.0F, 1, 16, 6);
|
||||
this.MiddlePRight.setRotationPoint(4.0F, 8.0F, -3.0F);
|
||||
this.MiddlePRight.setTextureSize(128, 128);
|
||||
this.MiddlePRight.mirror = true;
|
||||
this.setRotation(this.MiddlePRight, 0.0F, 0.0F, 0.0F);
|
||||
this.OPLeftFront = new ModelRenderer(this, 0, 0);
|
||||
this.OPLeftFront.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.OPLeftFront.setRotationPoint(-7.0F, 8.0F, -4.0F);
|
||||
this.OPLeftFront.setTextureSize(128, 128);
|
||||
this.OPLeftFront.mirror = true;
|
||||
this.setRotation(this.OPLeftFront, 0.0F, 0.0F, 0.0F);
|
||||
this.OPFrontRight = new ModelRenderer(this, 0, 0);
|
||||
this.OPFrontRight.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.OPFrontRight.setRotationPoint(3.0F, 8.0F, -7.0F);
|
||||
this.OPFrontRight.setTextureSize(128, 128);
|
||||
this.OPFrontRight.mirror = true;
|
||||
this.setRotation(this.OPFrontRight, 0.0F, 0.0F, 0.0F);
|
||||
this.OPBackLeft = new ModelRenderer(this, 0, 0);
|
||||
this.OPBackLeft.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.OPBackLeft.setRotationPoint(-4.0F, 8.0F, 6.0F);
|
||||
this.OPBackLeft.setTextureSize(128, 128);
|
||||
this.OPBackLeft.mirror = true;
|
||||
this.setRotation(this.OPBackLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.OPLeftFront2 = new ModelRenderer(this, 0, 0);
|
||||
this.OPLeftFront2.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.OPLeftFront2.setRotationPoint(6.0F, 8.0F, -4.0F);
|
||||
this.OPLeftFront2.setTextureSize(128, 128);
|
||||
this.OPLeftFront2.mirror = true;
|
||||
this.setRotation(this.OPLeftFront2, 0.0F, 0.0F, 0.0F);
|
||||
this.OPRightBack = new ModelRenderer(this, 0, 0);
|
||||
this.OPRightBack.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.OPRightBack.setRotationPoint(6.0F, 8.0F, 3.0F);
|
||||
this.OPRightBack.setTextureSize(128, 128);
|
||||
this.OPRightBack.mirror = true;
|
||||
this.setRotation(this.OPRightBack, 0.0F, 0.0F, 0.0F);
|
||||
this.OPFrontLeft = new ModelRenderer(this, 0, 0);
|
||||
this.OPFrontLeft.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.OPFrontLeft.setRotationPoint(-4.0F, 8.0F, -7.0F);
|
||||
this.OPFrontLeft.setTextureSize(128, 128);
|
||||
this.OPFrontLeft.mirror = true;
|
||||
this.setRotation(this.OPFrontLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.OPLeftBack = new ModelRenderer(this, 0, 0);
|
||||
this.OPLeftBack.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.OPLeftBack.setRotationPoint(-7.0F, 8.0F, 3.0F);
|
||||
this.OPLeftBack.setTextureSize(128, 128);
|
||||
this.OPLeftBack.mirror = true;
|
||||
this.setRotation(this.OPLeftBack, 0.0F, 0.0F, 0.0F);
|
||||
this.OPBackRight = new ModelRenderer(this, 0, 0);
|
||||
this.OPBackRight.addBox(0.0F, 0.0F, 0.0F, 1, 16, 1);
|
||||
this.OPBackRight.setRotationPoint(3.0F, 8.0F, 6.0F);
|
||||
this.OPBackRight.setTextureSize(128, 128);
|
||||
this.OPBackRight.mirror = true;
|
||||
this.setRotation(this.OPBackRight, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float f5) {
|
||||
this.MiddleFrontRight.render(f5);
|
||||
this.MiddleFrontLeft.render(f5);
|
||||
this.MiddleBackLeft.render(f5);
|
||||
this.MiddleBackRight.render(f5);
|
||||
this.MiddlePLeft.render(f5);
|
||||
this.MiddlePFront.render(f5);
|
||||
this.MiddlePBack.render(f5);
|
||||
this.MiddlePRight.render(f5);
|
||||
this.OPLeftFront.render(f5);
|
||||
this.OPFrontRight.render(f5);
|
||||
this.OPBackLeft.render(f5);
|
||||
this.OPLeftFront2.render(f5);
|
||||
this.OPRightBack.render(f5);
|
||||
this.OPFrontLeft.render(f5);
|
||||
this.OPLeftBack.render(f5);
|
||||
this.OPBackRight.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,280 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MReactorCellTop extends ModelBase {
|
||||
ModelRenderer TopBaseWidth;
|
||||
ModelRenderer BaseWidth;
|
||||
ModelRenderer BottomPad;
|
||||
ModelRenderer TopBaseDepth;
|
||||
ModelRenderer TopBase;
|
||||
ModelRenderer BaseDepth;
|
||||
ModelRenderer Base;
|
||||
ModelRenderer HatMiddle;
|
||||
ModelRenderer HatCover;
|
||||
ModelRenderer HatTop;
|
||||
ModelRenderer HatDepth;
|
||||
ModelRenderer HatWidth;
|
||||
ModelRenderer MiddleFrontRight;
|
||||
ModelRenderer MiddleFrontLeft;
|
||||
ModelRenderer MiddleBackLeft;
|
||||
ModelRenderer MiddleBackRight;
|
||||
ModelRenderer MiddlePLeft;
|
||||
ModelRenderer MiddlePFront;
|
||||
ModelRenderer MiddlePBack;
|
||||
ModelRenderer MiddlePRight;
|
||||
ModelRenderer FrontLeftSpike;
|
||||
ModelRenderer FrontRightSpike;
|
||||
ModelRenderer BackRightSpike;
|
||||
ModelRenderer BackLeftSpike;
|
||||
ModelRenderer OPLeftFront;
|
||||
ModelRenderer OPFrontRight;
|
||||
ModelRenderer OPBackLeft;
|
||||
ModelRenderer OPLeftFront2;
|
||||
ModelRenderer OPRightBack;
|
||||
ModelRenderer OPFrontLeft;
|
||||
ModelRenderer OPLeftBack;
|
||||
ModelRenderer OPBackRight;
|
||||
|
||||
public MReactorCellTop() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 128;
|
||||
this.TopBaseWidth = new ModelRenderer(this, 53, 16);
|
||||
this.TopBaseWidth.addBox(0.0F, 0.0F, 0.0F, 14, 1, 10);
|
||||
this.TopBaseWidth.setRotationPoint(-7.0F, 13.0F, -5.0F);
|
||||
this.TopBaseWidth.setTextureSize(64, 32);
|
||||
this.TopBaseWidth.mirror = true;
|
||||
this.setRotation(this.TopBaseWidth, 0.0F, 0.0F, 0.0F);
|
||||
this.BaseWidth = new ModelRenderer(this, 53, 16);
|
||||
this.BaseWidth.addBox(0.0F, 0.0F, 0.0F, 14, 1, 10);
|
||||
this.BaseWidth.setRotationPoint(-7.0F, 22.0F, -5.0F);
|
||||
this.BaseWidth.setTextureSize(64, 32);
|
||||
this.BaseWidth.mirror = true;
|
||||
this.setRotation(this.BaseWidth, 0.0F, 0.0F, 0.0F);
|
||||
this.BottomPad = new ModelRenderer(this, 53, 42);
|
||||
this.BottomPad.addBox(0.0F, 0.0F, 0.0F, 10, 1, 10);
|
||||
this.BottomPad.setRotationPoint(-5.0F, 23.0F, -5.0F);
|
||||
this.BottomPad.setTextureSize(64, 32);
|
||||
this.BottomPad.mirror = true;
|
||||
this.setRotation(this.BottomPad, 0.0F, 0.0F, 0.0F);
|
||||
this.TopBaseDepth = new ModelRenderer(this, 53, 0);
|
||||
this.TopBaseDepth.addBox(0.0F, 0.0F, 0.0F, 10, 1, 14);
|
||||
this.TopBaseDepth.setRotationPoint(-5.0F, 13.0F, -7.0F);
|
||||
this.TopBaseDepth.setTextureSize(64, 32);
|
||||
this.TopBaseDepth.mirror = true;
|
||||
this.setRotation(this.TopBaseDepth, 0.0F, 0.0F, 0.0F);
|
||||
this.TopBase = new ModelRenderer(this, 53, 28);
|
||||
this.TopBase.addBox(0.0F, 0.0F, 0.0F, 12, 1, 12);
|
||||
this.TopBase.setRotationPoint(-6.0F, 13.0F, -6.0F);
|
||||
this.TopBase.setTextureSize(64, 32);
|
||||
this.TopBase.mirror = true;
|
||||
this.setRotation(this.TopBase, 0.0F, 0.0F, 0.0F);
|
||||
this.BaseDepth = new ModelRenderer(this, 53, 0);
|
||||
this.BaseDepth.addBox(0.0F, 0.0F, 0.0F, 10, 1, 14);
|
||||
this.BaseDepth.setRotationPoint(-5.0F, 22.0F, -7.0F);
|
||||
this.BaseDepth.setTextureSize(64, 32);
|
||||
this.BaseDepth.mirror = true;
|
||||
this.setRotation(this.BaseDepth, 0.0F, 0.0F, 0.0F);
|
||||
this.Base = new ModelRenderer(this, 53, 28);
|
||||
this.Base.addBox(0.0F, 0.0F, 0.0F, 12, 1, 12);
|
||||
this.Base.setRotationPoint(-6.0F, 22.0F, -6.0F);
|
||||
this.Base.setTextureSize(64, 32);
|
||||
this.Base.mirror = true;
|
||||
this.setRotation(this.Base, 0.0F, 0.0F, 0.0F);
|
||||
this.HatMiddle = new ModelRenderer(this, 0, 42);
|
||||
this.HatMiddle.addBox(0.0F, 0.0F, 0.0F, 10, 1, 10);
|
||||
this.HatMiddle.setRotationPoint(-5.0F, 12.0F, -5.0F);
|
||||
this.HatMiddle.setTextureSize(64, 32);
|
||||
this.HatMiddle.mirror = true;
|
||||
this.setRotation(this.HatMiddle, 0.0F, 0.0F, 0.0F);
|
||||
this.HatCover = new ModelRenderer(this, 0, 12);
|
||||
this.HatCover.addBox(0.0F, 0.0F, 0.0F, 7, 1, 7);
|
||||
this.HatCover.setRotationPoint(-3.5F, 11.0F, -3.5F);
|
||||
this.HatCover.setTextureSize(64, 32);
|
||||
this.HatCover.mirror = true;
|
||||
this.setRotation(this.HatCover, 0.0F, 0.0F, 0.0F);
|
||||
this.HatTop = new ModelRenderer(this, 0, 21);
|
||||
this.HatTop.addBox(0.0F, 0.0F, 0.0F, 9, 1, 9);
|
||||
this.HatTop.setRotationPoint(-4.5F, 11.5F, -4.5F);
|
||||
this.HatTop.setTextureSize(64, 32);
|
||||
this.HatTop.mirror = true;
|
||||
this.setRotation(this.HatTop, 0.0F, 0.0F, 0.0F);
|
||||
this.HatDepth = new ModelRenderer(this, 0, 54);
|
||||
this.HatDepth.addBox(0.0F, 0.0F, 0.0F, 8, 1, 12);
|
||||
this.HatDepth.setRotationPoint(-4.0F, 12.0F, -6.0F);
|
||||
this.HatDepth.setTextureSize(64, 32);
|
||||
this.HatDepth.mirror = true;
|
||||
this.setRotation(this.HatDepth, 0.0F, 0.0F, 0.0F);
|
||||
this.HatWidth = new ModelRenderer(this, 0, 32);
|
||||
this.HatWidth.addBox(0.0F, 0.0F, 0.0F, 12, 1, 8);
|
||||
this.HatWidth.setRotationPoint(-6.0F, 12.0F, -4.0F);
|
||||
this.HatWidth.setTextureSize(64, 32);
|
||||
this.HatWidth.mirror = true;
|
||||
this.setRotation(this.HatWidth, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleFrontRight = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleFrontRight.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.MiddleFrontRight.setRotationPoint(3.0F, 14.0F, -4.0F);
|
||||
this.MiddleFrontRight.setTextureSize(64, 32);
|
||||
this.MiddleFrontRight.mirror = true;
|
||||
this.setRotation(this.MiddleFrontRight, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleFrontLeft = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleFrontLeft.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.MiddleFrontLeft.setRotationPoint(-4.0F, 14.0F, -4.0F);
|
||||
this.MiddleFrontLeft.setTextureSize(64, 32);
|
||||
this.MiddleFrontLeft.mirror = true;
|
||||
this.setRotation(this.MiddleFrontLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleBackLeft = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleBackLeft.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.MiddleBackLeft.setRotationPoint(-4.0F, 14.0F, 3.0F);
|
||||
this.MiddleBackLeft.setTextureSize(64, 32);
|
||||
this.MiddleBackLeft.mirror = true;
|
||||
this.setRotation(this.MiddleBackLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddleBackRight = new ModelRenderer(this, 0, 68);
|
||||
this.MiddleBackRight.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.MiddleBackRight.setRotationPoint(3.0F, 14.0F, 3.0F);
|
||||
this.MiddleBackRight.setTextureSize(64, 32);
|
||||
this.MiddleBackRight.mirror = true;
|
||||
this.setRotation(this.MiddleBackRight, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePLeft = new ModelRenderer(this, 5, 68);
|
||||
this.MiddlePLeft.addBox(0.0F, 1.466667F, 0.0F, 1, 8, 6);
|
||||
this.MiddlePLeft.setRotationPoint(-5.0F, 12.5F, -3.0F);
|
||||
this.MiddlePLeft.setTextureSize(64, 32);
|
||||
this.MiddlePLeft.mirror = true;
|
||||
this.setRotation(this.MiddlePLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePFront = new ModelRenderer(this, 5, 83);
|
||||
this.MiddlePFront.addBox(0.0F, 0.0F, 0.0F, 6, 8, 1);
|
||||
this.MiddlePFront.setRotationPoint(-3.0F, 14.0F, -5.0F);
|
||||
this.MiddlePFront.setTextureSize(64, 32);
|
||||
this.MiddlePFront.mirror = true;
|
||||
this.setRotation(this.MiddlePFront, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePBack = new ModelRenderer(this, 5, 83);
|
||||
this.MiddlePBack.addBox(0.0F, 0.0F, 0.0F, 6, 8, 1);
|
||||
this.MiddlePBack.setRotationPoint(-3.0F, 14.0F, 4.0F);
|
||||
this.MiddlePBack.setTextureSize(64, 32);
|
||||
this.MiddlePBack.mirror = true;
|
||||
this.setRotation(this.MiddlePBack, 0.0F, 0.0F, 0.0F);
|
||||
this.MiddlePRight = new ModelRenderer(this, 5, 68);
|
||||
this.MiddlePRight.addBox(0.0F, 0.0F, 0.0F, 1, 8, 6);
|
||||
this.MiddlePRight.setRotationPoint(4.0F, 14.0F, -3.0F);
|
||||
this.MiddlePRight.setTextureSize(64, 32);
|
||||
this.MiddlePRight.mirror = true;
|
||||
this.setRotation(this.MiddlePRight, 0.0F, 0.0F, 0.0F);
|
||||
this.FrontLeftSpike = new ModelRenderer(this, 44, 0);
|
||||
this.FrontLeftSpike.addBox(-0.5F, -0.5F, 0.0F, 2, 3, 2);
|
||||
this.FrontLeftSpike.setRotationPoint(-6.0F, 11.0F, -3.0F);
|
||||
this.FrontLeftSpike.setTextureSize(64, 32);
|
||||
this.FrontLeftSpike.mirror = true;
|
||||
this.setRotation(this.FrontLeftSpike, 0.0F, 0.0F, -0.4363323F);
|
||||
this.FrontRightSpike = new ModelRenderer(this, 44, 0);
|
||||
this.FrontRightSpike.addBox(-0.5F, -1.0F, 0.0F, 2, 3, 2);
|
||||
this.FrontRightSpike.setRotationPoint(5.0F, 11.0F, -3.0F);
|
||||
this.FrontRightSpike.setTextureSize(64, 32);
|
||||
this.FrontRightSpike.mirror = true;
|
||||
this.setRotation(this.FrontRightSpike, 0.0F, 0.0F, 0.4363323F);
|
||||
this.BackRightSpike = new ModelRenderer(this, 44, 0);
|
||||
this.BackRightSpike.addBox(-0.5F, -1.0F, 0.0F, 2, 3, 2);
|
||||
this.BackRightSpike.setRotationPoint(5.0F, 11.0F, 1.0F);
|
||||
this.BackRightSpike.setTextureSize(64, 32);
|
||||
this.BackRightSpike.mirror = true;
|
||||
this.setRotation(this.BackRightSpike, 0.0F, 0.0F, 0.4363323F);
|
||||
this.BackLeftSpike = new ModelRenderer(this, 44, 0);
|
||||
this.BackLeftSpike.addBox(-0.5F, -0.5F, 0.0F, 2, 3, 2);
|
||||
this.BackLeftSpike.setRotationPoint(-6.0F, 11.0F, 1.0F);
|
||||
this.BackLeftSpike.setTextureSize(64, 32);
|
||||
this.BackLeftSpike.mirror = true;
|
||||
this.setRotation(this.BackLeftSpike, 0.0F, 0.0F, -0.4363323F);
|
||||
this.OPLeftFront = new ModelRenderer(this, 0, 0);
|
||||
this.OPLeftFront.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.OPLeftFront.setRotationPoint(-7.0F, 14.0F, -4.0F);
|
||||
this.OPLeftFront.setTextureSize(64, 32);
|
||||
this.OPLeftFront.mirror = true;
|
||||
this.setRotation(this.OPLeftFront, 0.0F, 0.0F, 0.0F);
|
||||
this.OPFrontRight = new ModelRenderer(this, 0, 0);
|
||||
this.OPFrontRight.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.OPFrontRight.setRotationPoint(3.0F, 14.0F, -7.0F);
|
||||
this.OPFrontRight.setTextureSize(64, 32);
|
||||
this.OPFrontRight.mirror = true;
|
||||
this.setRotation(this.OPFrontRight, 0.0F, 0.0F, 0.0F);
|
||||
this.OPBackLeft = new ModelRenderer(this, 0, 0);
|
||||
this.OPBackLeft.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.OPBackLeft.setRotationPoint(-4.0F, 14.0F, 6.0F);
|
||||
this.OPBackLeft.setTextureSize(64, 32);
|
||||
this.OPBackLeft.mirror = true;
|
||||
this.setRotation(this.OPBackLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.OPLeftFront2 = new ModelRenderer(this, 0, 0);
|
||||
this.OPLeftFront2.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.OPLeftFront2.setRotationPoint(6.0F, 14.0F, -4.0F);
|
||||
this.OPLeftFront2.setTextureSize(64, 32);
|
||||
this.OPLeftFront2.mirror = true;
|
||||
this.setRotation(this.OPLeftFront2, 0.0F, 0.0F, 0.0F);
|
||||
this.OPRightBack = new ModelRenderer(this, 0, 0);
|
||||
this.OPRightBack.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.OPRightBack.setRotationPoint(6.0F, 14.0F, 3.0F);
|
||||
this.OPRightBack.setTextureSize(64, 32);
|
||||
this.OPRightBack.mirror = true;
|
||||
this.setRotation(this.OPRightBack, 0.0F, 0.0F, 0.0F);
|
||||
this.OPFrontLeft = new ModelRenderer(this, 0, 0);
|
||||
this.OPFrontLeft.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.OPFrontLeft.setRotationPoint(-4.0F, 14.0F, -7.0F);
|
||||
this.OPFrontLeft.setTextureSize(64, 32);
|
||||
this.OPFrontLeft.mirror = true;
|
||||
this.setRotation(this.OPFrontLeft, 0.0F, 0.0F, 0.0F);
|
||||
this.OPLeftBack = new ModelRenderer(this, 0, 0);
|
||||
this.OPLeftBack.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.OPLeftBack.setRotationPoint(-7.0F, 14.0F, 3.0F);
|
||||
this.OPLeftBack.setTextureSize(64, 32);
|
||||
this.OPLeftBack.mirror = true;
|
||||
this.setRotation(this.OPLeftBack, 0.0F, 0.0F, 0.0F);
|
||||
this.OPBackRight = new ModelRenderer(this, 0, 0);
|
||||
this.OPBackRight.addBox(0.0F, 0.0F, 0.0F, 1, 8, 1);
|
||||
this.OPBackRight.setRotationPoint(3.0F, 14.0F, 6.0F);
|
||||
this.OPBackRight.setTextureSize(64, 32);
|
||||
this.OPBackRight.mirror = true;
|
||||
this.setRotation(this.OPBackRight, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float f5) {
|
||||
this.TopBaseWidth.render(f5);
|
||||
this.BaseWidth.render(f5);
|
||||
this.BottomPad.render(f5);
|
||||
this.TopBaseDepth.render(f5);
|
||||
this.TopBase.render(f5);
|
||||
this.BaseDepth.render(f5);
|
||||
this.Base.render(f5);
|
||||
this.HatMiddle.render(f5);
|
||||
this.HatCover.render(f5);
|
||||
this.HatTop.render(f5);
|
||||
this.HatDepth.render(f5);
|
||||
this.HatWidth.render(f5);
|
||||
this.MiddleFrontRight.render(f5);
|
||||
this.MiddleFrontLeft.render(f5);
|
||||
this.MiddleBackLeft.render(f5);
|
||||
this.MiddleBackRight.render(f5);
|
||||
this.MiddlePLeft.render(f5);
|
||||
this.MiddlePFront.render(f5);
|
||||
this.MiddlePBack.render(f5);
|
||||
this.MiddlePRight.render(f5);
|
||||
this.FrontLeftSpike.render(f5);
|
||||
this.FrontRightSpike.render(f5);
|
||||
this.BackRightSpike.render(f5);
|
||||
this.BackLeftSpike.render(f5);
|
||||
this.OPLeftFront.render(f5);
|
||||
this.OPFrontRight.render(f5);
|
||||
this.OPBackLeft.render(f5);
|
||||
this.OPLeftFront2.render(f5);
|
||||
this.OPRightBack.render(f5);
|
||||
this.OPFrontLeft.render(f5);
|
||||
this.OPLeftBack.render(f5);
|
||||
this.OPBackRight.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,221 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MTurbine extends ModelBase {
|
||||
ModelRenderer SUPPORT;
|
||||
ModelRenderer PLUG;
|
||||
ModelRenderer MAIN_AXIS_SPINS;
|
||||
ModelRenderer BLADE_A1_SPINS;
|
||||
ModelRenderer BLADE_A2_SPINS;
|
||||
ModelRenderer BLADE_A3_SPINS;
|
||||
ModelRenderer BLADE_B1_SPINS;
|
||||
ModelRenderer BLADE_B2_SPINS;
|
||||
ModelRenderer BLADE_B3_SPINS;
|
||||
ModelRenderer TURBINE_HEAD_SPINS;
|
||||
ModelRenderer SHIELD_A1_SPINS;
|
||||
ModelRenderer SHIELD_A2_SPINS;
|
||||
ModelRenderer SHIELD_A3_SPINS;
|
||||
ModelRenderer SHIELD_A4_SPINS;
|
||||
ModelRenderer SHIELD_A5_SPINS;
|
||||
ModelRenderer SHIELD_A6_SPINS;
|
||||
ModelRenderer SHIELD_B1_SPINS;
|
||||
ModelRenderer SHIELD_B2_SPINS;
|
||||
ModelRenderer SHIELD_B3_SPINS;
|
||||
ModelRenderer SHIELD_B4_SPINS;
|
||||
ModelRenderer SHIELD_B5_SPINS;
|
||||
ModelRenderer SHIELD_B6_SPINS;
|
||||
|
||||
|
||||
public MTurbine() {
|
||||
super.textureWidth = 64;
|
||||
super.textureHeight = 64;
|
||||
this.SUPPORT = new ModelRenderer(this, 0, 0);
|
||||
this.SUPPORT.addBox(0.0F, 0.0F, 0.0F, 8, 1, 8);
|
||||
this.SUPPORT.setRotationPoint(-4.0F, 9.0F, -4.0F);
|
||||
this.SUPPORT.setTextureSize(64, 64);
|
||||
this.SUPPORT.mirror = true;
|
||||
this.setRotation(this.SUPPORT, 0.0F, 0.0F, 0.0F);
|
||||
this.PLUG = new ModelRenderer(this, 0, 10);
|
||||
this.PLUG.addBox(0.0F, 0.0F, 0.0F, 4, 1, 4);
|
||||
this.PLUG.setRotationPoint(-2.0F, 8.0F, -2.0F);
|
||||
this.PLUG.setTextureSize(64, 64);
|
||||
this.PLUG.mirror = true;
|
||||
this.setRotation(this.PLUG, 0.0F, 0.0F, 0.0F);
|
||||
this.MAIN_AXIS_SPINS = new ModelRenderer(this, 33, 0);
|
||||
this.MAIN_AXIS_SPINS.addBox(-1.0F, 0.0F, -1.0F, 2, 13, 2);
|
||||
this.MAIN_AXIS_SPINS.setRotationPoint(0.0F, 10.0F, 0.0F);
|
||||
this.MAIN_AXIS_SPINS.setTextureSize(64, 64);
|
||||
this.MAIN_AXIS_SPINS.mirror = true;
|
||||
this.setRotation(this.MAIN_AXIS_SPINS, 0.0F, 0.0F, 0.0F);
|
||||
this.BLADE_A1_SPINS = new ModelRenderer(this, 0, 16);
|
||||
this.BLADE_A1_SPINS.addBox(-6.0F, 0.0F, -1.0F, 12, 1, 2);
|
||||
this.BLADE_A1_SPINS.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.BLADE_A1_SPINS.setTextureSize(64, 64);
|
||||
this.BLADE_A1_SPINS.mirror = true;
|
||||
this.setRotation(this.BLADE_A1_SPINS, 0.2617994F, 2.094395F, 0.0F);
|
||||
this.BLADE_A2_SPINS = new ModelRenderer(this, 0, 16);
|
||||
this.BLADE_A2_SPINS.addBox(-6.0F, 0.0F, -1.0F, 12, 1, 2);
|
||||
this.BLADE_A2_SPINS.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.BLADE_A2_SPINS.setTextureSize(64, 64);
|
||||
this.BLADE_A2_SPINS.mirror = true;
|
||||
this.setRotation(this.BLADE_A2_SPINS, 0.2617994F, 1.047198F, 0.0F);
|
||||
this.BLADE_A3_SPINS = new ModelRenderer(this, 0, 16);
|
||||
this.BLADE_A3_SPINS.addBox(-6.0F, 0.0F, -1.0F, 12, 1, 2);
|
||||
this.BLADE_A3_SPINS.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.BLADE_A3_SPINS.setTextureSize(64, 64);
|
||||
this.BLADE_A3_SPINS.mirror = true;
|
||||
this.setRotation(this.BLADE_A3_SPINS, 0.2617994F, 0.0F, 0.0F);
|
||||
this.BLADE_B1_SPINS = new ModelRenderer(this, 0, 20);
|
||||
this.BLADE_B1_SPINS.addBox(-5.0F, 0.0F, -1.0F, 10, 1, 2);
|
||||
this.BLADE_B1_SPINS.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.BLADE_B1_SPINS.setTextureSize(64, 64);
|
||||
this.BLADE_B1_SPINS.mirror = true;
|
||||
this.setRotation(this.BLADE_B1_SPINS, 0.2617994F, 1.570796F, 0.0F);
|
||||
this.BLADE_B2_SPINS = new ModelRenderer(this, 0, 20);
|
||||
this.BLADE_B2_SPINS.addBox(-5.0F, 0.0F, -1.0F, 10, 1, 2);
|
||||
this.BLADE_B2_SPINS.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.BLADE_B2_SPINS.setTextureSize(64, 64);
|
||||
this.BLADE_B2_SPINS.mirror = true;
|
||||
this.setRotation(this.BLADE_B2_SPINS, 0.2617994F, 2.617994F, 0.0F);
|
||||
this.BLADE_B3_SPINS = new ModelRenderer(this, 0, 20);
|
||||
this.BLADE_B3_SPINS.addBox(-5.0F, 0.0F, -1.0F, 10, 1, 2);
|
||||
this.BLADE_B3_SPINS.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.BLADE_B3_SPINS.setTextureSize(64, 64);
|
||||
this.BLADE_B3_SPINS.mirror = true;
|
||||
this.setRotation(this.BLADE_B3_SPINS, 0.2617994F, 0.5235988F, 0.0F);
|
||||
this.TURBINE_HEAD_SPINS = new ModelRenderer(this, 0, 24);
|
||||
this.TURBINE_HEAD_SPINS.addBox(-2.0F, 0.0F, -2.0F, 4, 2, 4);
|
||||
this.TURBINE_HEAD_SPINS.setRotationPoint(0.0F, 20.0F, 0.0F);
|
||||
this.TURBINE_HEAD_SPINS.setTextureSize(64, 64);
|
||||
this.TURBINE_HEAD_SPINS.mirror = true;
|
||||
this.setRotation(this.TURBINE_HEAD_SPINS, 0.0F, 0.0F, 0.0F);
|
||||
this.SHIELD_A1_SPINS = new ModelRenderer(this, 0, 40);
|
||||
this.SHIELD_A1_SPINS.addBox(6.0F, 0.0F, -4.0F, 1, 2, 8);
|
||||
this.SHIELD_A1_SPINS.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.SHIELD_A1_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_A1_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_A1_SPINS, 0.0F, -3.141593F, 0.0F);
|
||||
this.SHIELD_A2_SPINS = new ModelRenderer(this, 0, 40);
|
||||
this.SHIELD_A2_SPINS.addBox(6.0F, 0.0F, -4.0F, 1, 2, 8);
|
||||
this.SHIELD_A2_SPINS.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.SHIELD_A2_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_A2_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_A2_SPINS, 0.0F, 1.047198F, 0.0F);
|
||||
this.SHIELD_A3_SPINS = new ModelRenderer(this, 0, 40);
|
||||
this.SHIELD_A3_SPINS.addBox(6.0F, 0.0F, -4.0F, 1, 2, 8);
|
||||
this.SHIELD_A3_SPINS.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.SHIELD_A3_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_A3_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_A3_SPINS, 0.0F, -1.047198F, 0.0F);
|
||||
this.SHIELD_A4_SPINS = new ModelRenderer(this, 0, 40);
|
||||
this.SHIELD_A4_SPINS.addBox(6.0F, 0.0F, -4.0F, 1, 2, 8);
|
||||
this.SHIELD_A4_SPINS.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.SHIELD_A4_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_A4_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_A4_SPINS, 0.0F, -2.094395F, 0.0F);
|
||||
this.SHIELD_A5_SPINS = new ModelRenderer(this, 0, 40);
|
||||
this.SHIELD_A5_SPINS.addBox(6.0F, 0.0F, -4.0F, 1, 2, 8);
|
||||
this.SHIELD_A5_SPINS.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.SHIELD_A5_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_A5_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_A5_SPINS, 0.0F, 0.0F, 0.0F);
|
||||
this.SHIELD_A6_SPINS = new ModelRenderer(this, 0, 40);
|
||||
this.SHIELD_A6_SPINS.addBox(6.0F, 0.0F, -4.0F, 1, 2, 8);
|
||||
this.SHIELD_A6_SPINS.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.SHIELD_A6_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_A6_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_A6_SPINS, 0.0F, 2.094395F, 0.0F);
|
||||
this.SHIELD_B1_SPINS = new ModelRenderer(this, 0, 31);
|
||||
this.SHIELD_B1_SPINS.addBox(5.0F, 0.0F, -3.0F, 1, 2, 6);
|
||||
this.SHIELD_B1_SPINS.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.SHIELD_B1_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_B1_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_B1_SPINS, 0.0F, -0.5235988F, 0.0F);
|
||||
this.SHIELD_B2_SPINS = new ModelRenderer(this, 0, 31);
|
||||
this.SHIELD_B2_SPINS.addBox(5.0F, 0.0F, -3.0F, 1, 2, 6);
|
||||
this.SHIELD_B2_SPINS.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.SHIELD_B2_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_B2_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_B2_SPINS, 0.0F, 1.570796F, 0.0F);
|
||||
this.SHIELD_B3_SPINS = new ModelRenderer(this, 0, 31);
|
||||
this.SHIELD_B3_SPINS.addBox(5.0F, 0.0F, -3.0F, 1, 2, 6);
|
||||
this.SHIELD_B3_SPINS.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.SHIELD_B3_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_B3_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_B3_SPINS, 0.0F, 0.5235988F, 0.0F);
|
||||
this.SHIELD_B4_SPINS = new ModelRenderer(this, 0, 31);
|
||||
this.SHIELD_B4_SPINS.addBox(5.0F, 0.0F, -3.0F, 1, 2, 6);
|
||||
this.SHIELD_B4_SPINS.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.SHIELD_B4_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_B4_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_B4_SPINS, 0.0F, -1.570796F, 0.0F);
|
||||
this.SHIELD_B5_SPINS = new ModelRenderer(this, 0, 31);
|
||||
this.SHIELD_B5_SPINS.addBox(5.0F, 0.0F, -3.0F, 1, 2, 6);
|
||||
this.SHIELD_B5_SPINS.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.SHIELD_B5_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_B5_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_B5_SPINS, 0.0F, 2.617994F, 0.0F);
|
||||
this.SHIELD_B6_SPINS = new ModelRenderer(this, 0, 31);
|
||||
this.SHIELD_B6_SPINS.addBox(5.0F, 0.0F, -3.0F, 1, 2, 6);
|
||||
this.SHIELD_B6_SPINS.setRotationPoint(0.0F, 18.0F, 0.0F);
|
||||
this.SHIELD_B6_SPINS.setTextureSize(64, 64);
|
||||
this.SHIELD_B6_SPINS.mirror = true;
|
||||
this.setRotation(this.SHIELD_B6_SPINS, 0.0F, -2.617994F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float rotation, float f5) {
|
||||
this.SUPPORT.render(f5);
|
||||
this.PLUG.render(f5);
|
||||
this.MAIN_AXIS_SPINS.rotateAngleY = -rotation;
|
||||
this.MAIN_AXIS_SPINS.render(f5);
|
||||
this.BLADE_A1_SPINS.rotateAngleY = (float)(-((double)rotation + 1.570796D));
|
||||
this.BLADE_A1_SPINS.render(f5);
|
||||
this.BLADE_A2_SPINS.rotateAngleY = (float)(-((double)rotation + 2.617994D));
|
||||
this.BLADE_A2_SPINS.render(f5);
|
||||
this.BLADE_A3_SPINS.rotateAngleY = (float)(-((double)rotation + 0.5235988D));
|
||||
this.BLADE_A3_SPINS.render(f5);
|
||||
this.BLADE_B1_SPINS.rotateAngleY = (float)((double)rotation + 1.570796D);
|
||||
this.BLADE_B1_SPINS.render(f5);
|
||||
this.BLADE_B2_SPINS.rotateAngleY = (float)((double)rotation + 2.617994D);
|
||||
this.BLADE_B2_SPINS.render(f5);
|
||||
this.BLADE_B3_SPINS.rotateAngleY = (float)((double)rotation + 0.5235988D);
|
||||
this.BLADE_B3_SPINS.render(f5);
|
||||
this.TURBINE_HEAD_SPINS.rotateAngleY = rotation;
|
||||
this.TURBINE_HEAD_SPINS.render(f5);
|
||||
this.SHIELD_A1_SPINS.rotateAngleY = -rotation;
|
||||
this.SHIELD_A1_SPINS.render(f5);
|
||||
this.SHIELD_A2_SPINS.rotateAngleY = (float)(-((double)rotation + 2.094395D));
|
||||
this.SHIELD_A2_SPINS.render(f5);
|
||||
this.SHIELD_A3_SPINS.rotateAngleY = (float)(-((double)rotation - 3.141593D));
|
||||
this.SHIELD_A3_SPINS.render(f5);
|
||||
this.SHIELD_A4_SPINS.rotateAngleY = (float)(-((double)rotation + 1.047198D));
|
||||
this.SHIELD_A4_SPINS.render(f5);
|
||||
this.SHIELD_A5_SPINS.rotateAngleY = (float)(-((double)rotation - 1.047198D));
|
||||
this.SHIELD_A5_SPINS.render(f5);
|
||||
this.SHIELD_A6_SPINS.rotateAngleY = (float)(-((double)rotation - 2.094395D));
|
||||
this.SHIELD_A6_SPINS.render(f5);
|
||||
this.SHIELD_B1_SPINS.rotateAngleY = rotation;
|
||||
this.SHIELD_B1_SPINS.render(f5);
|
||||
this.SHIELD_B2_SPINS.rotateAngleY = (float)((double)rotation + 2.094395D);
|
||||
this.SHIELD_B2_SPINS.render(f5);
|
||||
this.SHIELD_B3_SPINS.rotateAngleY = (float)((double)rotation - 3.141593D);
|
||||
this.SHIELD_B3_SPINS.render(f5);
|
||||
this.SHIELD_B4_SPINS.rotateAngleY = (float)((double)rotation + 1.047198D);
|
||||
this.SHIELD_B4_SPINS.render(f5);
|
||||
this.SHIELD_B5_SPINS.rotateAngleY = (float)((double)rotation - 1.047198D);
|
||||
this.SHIELD_B5_SPINS.render(f5);
|
||||
this.SHIELD_B6_SPINS.rotateAngleY = (float)((double)rotation - 2.094395D);
|
||||
this.SHIELD_B6_SPINS.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,159 @@
|
|||
package atomicscience.muoxing;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class MUnused extends ModelBase {
|
||||
ModelRenderer BASE;
|
||||
ModelRenderer SHIELD_1;
|
||||
ModelRenderer SHIELD_2;
|
||||
ModelRenderer SHIELD_3;
|
||||
ModelRenderer SHIELD_4;
|
||||
ModelRenderer REACTOR_SUPPORT_ROD_ROTATES;
|
||||
ModelRenderer SUPPORT_PLATE_1_ROTATES;
|
||||
ModelRenderer SUPPORT_PLATE_2_ROTATES;
|
||||
ModelRenderer FUEL_BAR_1_ROTATES;
|
||||
ModelRenderer FUEL_BAR_2_ROTATES;
|
||||
ModelRenderer FUEL_BAR_3_ROTATES;
|
||||
ModelRenderer FUEL_BAR_4_ROTATES;
|
||||
ModelRenderer CONVERTER;
|
||||
ModelRenderer SUB_SHIELD_1;
|
||||
ModelRenderer SUB_SHIELD_2;
|
||||
ModelRenderer Shape1;
|
||||
|
||||
public MUnused() {
|
||||
super.textureWidth = 128;
|
||||
super.textureHeight = 128;
|
||||
this.BASE = new ModelRenderer(this, 0, 0);
|
||||
this.BASE.addBox(0.0F, 0.0F, 0.0F, 16, 1, 16);
|
||||
this.BASE.setRotationPoint(-8.0F, 23.0F, -8.0F);
|
||||
this.BASE.setTextureSize(128, 128);
|
||||
this.BASE.mirror = true;
|
||||
this.setRotation(this.BASE, 0.0F, 0.0F, 0.0F);
|
||||
this.SHIELD_1 = new ModelRenderer(this, 11, 18);
|
||||
this.SHIELD_1.addBox(0.0F, 0.0F, 0.0F, 1, 10, 8);
|
||||
this.SHIELD_1.setRotationPoint(0.0F, 13.0F, 6.0F);
|
||||
this.SHIELD_1.setTextureSize(128, 128);
|
||||
this.SHIELD_1.mirror = true;
|
||||
this.setRotation(this.SHIELD_1, 0.0F, -2.234021F, 0.0F);
|
||||
this.SHIELD_2 = new ModelRenderer(this, 0, 18);
|
||||
this.SHIELD_2.addBox(0.0F, 0.0F, 0.0F, 1, 10, 4);
|
||||
this.SHIELD_2.setRotationPoint(-7.0F, 13.0F, -2.0F);
|
||||
this.SHIELD_2.setTextureSize(128, 128);
|
||||
this.SHIELD_2.mirror = true;
|
||||
this.setRotation(this.SHIELD_2, 0.0F, 0.0F, 0.0F);
|
||||
this.SHIELD_3 = new ModelRenderer(this, 11, 37);
|
||||
this.SHIELD_3.addBox(0.0F, 0.0F, 0.0F, 1, 10, 8);
|
||||
this.SHIELD_3.setRotationPoint(5.0F, 13.0F, -3.0F);
|
||||
this.SHIELD_3.setTextureSize(128, 128);
|
||||
this.SHIELD_3.mirror = true;
|
||||
this.setRotation(this.SHIELD_3, 0.0F, 0.0F, 0.0F);
|
||||
this.SHIELD_4 = new ModelRenderer(this, 0, 37);
|
||||
this.SHIELD_4.addBox(0.0F, 0.0F, 0.0F, 1, 10, 4);
|
||||
this.SHIELD_4.setRotationPoint(6.0F, 13.0F, -3.0F);
|
||||
this.SHIELD_4.setTextureSize(128, 128);
|
||||
this.SHIELD_4.mirror = true;
|
||||
this.setRotation(this.SHIELD_4, 0.0F, -2.094395F, 0.0F);
|
||||
this.REACTOR_SUPPORT_ROD_ROTATES = new ModelRenderer(this, 0, 67);
|
||||
this.REACTOR_SUPPORT_ROD_ROTATES.addBox(-1.0F, 0.0F, -1.0F, 2, 13, 2);
|
||||
this.REACTOR_SUPPORT_ROD_ROTATES.setRotationPoint(0.0F, 10.0F, 0.0F);
|
||||
this.REACTOR_SUPPORT_ROD_ROTATES.setTextureSize(128, 128);
|
||||
this.REACTOR_SUPPORT_ROD_ROTATES.mirror = true;
|
||||
this.setRotation(this.REACTOR_SUPPORT_ROD_ROTATES, 0.0F, 0.0F, 0.0F);
|
||||
this.SUPPORT_PLATE_1_ROTATES = new ModelRenderer(this, 9, 57);
|
||||
this.SUPPORT_PLATE_1_ROTATES.addBox(-3.0F, 0.0F, -3.0F, 6, 1, 6);
|
||||
this.SUPPORT_PLATE_1_ROTATES.setRotationPoint(0.0F, 19.0F, 0.0F);
|
||||
this.SUPPORT_PLATE_1_ROTATES.setTextureSize(128, 128);
|
||||
this.SUPPORT_PLATE_1_ROTATES.mirror = true;
|
||||
this.setRotation(this.SUPPORT_PLATE_1_ROTATES, 0.0F, 0.7853982F, 0.0F);
|
||||
this.SUPPORT_PLATE_2_ROTATES = new ModelRenderer(this, 9, 57);
|
||||
this.SUPPORT_PLATE_2_ROTATES.addBox(-3.0F, 0.0F, -3.0F, 6, 1, 6);
|
||||
this.SUPPORT_PLATE_2_ROTATES.setRotationPoint(0.0F, 13.0F, 0.0F);
|
||||
this.SUPPORT_PLATE_2_ROTATES.setTextureSize(128, 128);
|
||||
this.SUPPORT_PLATE_2_ROTATES.mirror = true;
|
||||
this.setRotation(this.SUPPORT_PLATE_2_ROTATES, 0.0F, 0.7853982F, 0.0F);
|
||||
this.FUEL_BAR_1_ROTATES = new ModelRenderer(this, 0, 54);
|
||||
this.FUEL_BAR_1_ROTATES.addBox(-1.0F, 0.0F, 2.0F, 2, 9, 2);
|
||||
this.FUEL_BAR_1_ROTATES.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.FUEL_BAR_1_ROTATES.setTextureSize(128, 128);
|
||||
this.FUEL_BAR_1_ROTATES.mirror = true;
|
||||
this.setRotation(this.FUEL_BAR_1_ROTATES, 0.0F, 0.0F, 0.0F);
|
||||
this.FUEL_BAR_2_ROTATES = new ModelRenderer(this, 0, 54);
|
||||
this.FUEL_BAR_2_ROTATES.addBox(2.0F, 0.0F, -1.0F, 2, 9, 2);
|
||||
this.FUEL_BAR_2_ROTATES.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.FUEL_BAR_2_ROTATES.setTextureSize(128, 128);
|
||||
this.FUEL_BAR_2_ROTATES.mirror = true;
|
||||
this.setRotation(this.FUEL_BAR_2_ROTATES, 0.0F, 0.0F, 0.0F);
|
||||
this.FUEL_BAR_3_ROTATES = new ModelRenderer(this, 0, 54);
|
||||
this.FUEL_BAR_3_ROTATES.addBox(-1.0F, 0.0F, -4.0F, 2, 9, 2);
|
||||
this.FUEL_BAR_3_ROTATES.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.FUEL_BAR_3_ROTATES.setTextureSize(128, 128);
|
||||
this.FUEL_BAR_3_ROTATES.mirror = true;
|
||||
this.setRotation(this.FUEL_BAR_3_ROTATES, 0.0F, 0.0F, 0.0F);
|
||||
this.FUEL_BAR_4_ROTATES = new ModelRenderer(this, 0, 54);
|
||||
this.FUEL_BAR_4_ROTATES.addBox(-4.0F, 0.0F, -1.0F, 2, 9, 2);
|
||||
this.FUEL_BAR_4_ROTATES.setRotationPoint(0.0F, 12.0F, 0.0F);
|
||||
this.FUEL_BAR_4_ROTATES.setTextureSize(128, 128);
|
||||
this.FUEL_BAR_4_ROTATES.mirror = true;
|
||||
this.setRotation(this.FUEL_BAR_4_ROTATES, 0.0F, 0.0F, 0.0F);
|
||||
this.CONVERTER = new ModelRenderer(this, 35, 56);
|
||||
this.CONVERTER.addBox(0.0F, 0.0F, 0.0F, 7, 10, 1);
|
||||
this.CONVERTER.setRotationPoint(-1.0F, 13.0F, 6.0F);
|
||||
this.CONVERTER.setTextureSize(128, 128);
|
||||
this.CONVERTER.mirror = true;
|
||||
this.setRotation(this.CONVERTER, 0.0F, 0.296706F, 0.0F);
|
||||
this.SUB_SHIELD_1 = new ModelRenderer(this, 53, 37);
|
||||
this.SUB_SHIELD_1.addBox(0.0F, 0.0F, 0.0F, 1, 4, 4);
|
||||
this.SUB_SHIELD_1.setRotationPoint(8.0F, 19.0F, -5.0F);
|
||||
this.SUB_SHIELD_1.setTextureSize(128, 128);
|
||||
this.SUB_SHIELD_1.mirror = true;
|
||||
this.setRotation(this.SUB_SHIELD_1, 0.0F, -2.094395F, 0.0F);
|
||||
this.SUB_SHIELD_2 = new ModelRenderer(this, 30, 37);
|
||||
this.SUB_SHIELD_2.addBox(0.0F, 0.0F, 0.0F, 1, 4, 10);
|
||||
this.SUB_SHIELD_2.setRotationPoint(7.0F, 19.0F, -5.0F);
|
||||
this.SUB_SHIELD_2.setTextureSize(128, 128);
|
||||
this.SUB_SHIELD_2.mirror = true;
|
||||
this.setRotation(this.SUB_SHIELD_2, 0.0F, 0.0F, 0.0F);
|
||||
this.Shape1 = new ModelRenderer(this, 10, 65);
|
||||
this.Shape1.addBox(0.0F, 0.0F, 0.0F, 5, 2, 5);
|
||||
this.Shape1.setRotationPoint(-7.0F, 22.0F, -7.0F);
|
||||
this.Shape1.setTextureSize(128, 128);
|
||||
this.Shape1.mirror = true;
|
||||
this.setRotation(this.Shape1, 0.1745329F, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
public void render(float rotation, float f5) {
|
||||
this.BASE.render(f5);
|
||||
this.SHIELD_1.render(f5);
|
||||
this.SHIELD_2.render(f5);
|
||||
this.SHIELD_3.render(f5);
|
||||
this.SHIELD_4.render(f5);
|
||||
this.REACTOR_SUPPORT_ROD_ROTATES.rotateAngleY = rotation;
|
||||
this.REACTOR_SUPPORT_ROD_ROTATES.render(f5);
|
||||
this.SUPPORT_PLATE_1_ROTATES.rotateAngleY = rotation;
|
||||
this.SUPPORT_PLATE_1_ROTATES.render(f5);
|
||||
this.SUPPORT_PLATE_2_ROTATES.rotateAngleY = rotation;
|
||||
this.SUPPORT_PLATE_2_ROTATES.render(f5);
|
||||
this.FUEL_BAR_1_ROTATES.rotateAngleY = rotation;
|
||||
this.FUEL_BAR_1_ROTATES.render(f5);
|
||||
this.FUEL_BAR_2_ROTATES.rotateAngleY = rotation;
|
||||
this.FUEL_BAR_2_ROTATES.render(f5);
|
||||
this.FUEL_BAR_3_ROTATES.rotateAngleY = rotation;
|
||||
this.FUEL_BAR_3_ROTATES.render(f5);
|
||||
this.FUEL_BAR_4_ROTATES.rotateAngleY = rotation;
|
||||
this.FUEL_BAR_4_ROTATES.render(f5);
|
||||
this.CONVERTER.render(f5);
|
||||
this.SUB_SHIELD_1.render(f5);
|
||||
this.SUB_SHIELD_2.render(f5);
|
||||
this.Shape1.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package atomicscience.render;
|
||||
|
||||
import atomicscience.TAtomicAssembler;
|
||||
import atomicscience.muoxing.MAtomicAssembler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RAtomicAssembler extends TileEntitySpecialRenderer {
|
||||
|
||||
public static final MAtomicAssembler MODEL = new MAtomicAssembler();
|
||||
public static final String TEXTURE = "atomic_assembler.png";
|
||||
//private final RenderBlocks renderBlocks = new RenderBlocks();
|
||||
|
||||
public void renderModelAt(TAtomicAssembler tileEntity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
this.bindTexture(new ResourceLocation("atomicscience", "textures/models/atomic_assembler.png"));
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
MODEL.render(tileEntity.rotationYaw1, tileEntity.rotationYaw2, tileEntity.rotationYaw3, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
RenderItem renderItem = (RenderItem)RenderManager.instance.getEntityClassRenderObject(EntityItem.class);
|
||||
//RenderEngine renderEngine = Minecraft.getMinecraft().renderEngine;
|
||||
GL11.glPushMatrix();
|
||||
if(tileEntity.entityItem != null) {
|
||||
renderItem.doRender(tileEntity.entityItem, x + 0.5D, y + 0.4D, z + 0.5D, 0.0F, 0.0F);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) {
|
||||
this.renderModelAt((TAtomicAssembler)tileEntity, var2, var4, var6, var8);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package atomicscience.render;
|
||||
|
||||
import atomicscience.fenlie.TCentrifuge;
|
||||
import atomicscience.muoxing.MCentrifuge;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RCentrifuge extends TileEntitySpecialRenderer {
|
||||
public static final MCentrifuge MODEL = new MCentrifuge();
|
||||
public static final String TEXTURE = "centrifuge.png";
|
||||
|
||||
|
||||
public void renderAModelAt(TCentrifuge tileEntity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
this.bindTexture(new ResourceLocation("atomicscience", "textures/models/centrifuge.png"));
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
int facingDirection = tileEntity.getBlockMetadata();
|
||||
switch(facingDirection) {
|
||||
case 2:
|
||||
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
break;
|
||||
case 3:
|
||||
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
|
||||
break;
|
||||
case 4:
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
break;
|
||||
case 5:
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
}
|
||||
|
||||
if(tileEntity.smeltingTicks > 0) {
|
||||
tileEntity.xuanZhuan = (float)((double)tileEntity.xuanZhuan + (double)f * 0.3D);
|
||||
}
|
||||
|
||||
MODEL.render(tileEntity.xuanZhuan, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4, double var6, float var8) {
|
||||
this.renderAModelAt((TCentrifuge)tileEntity, var2, var4, var6, var8);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package atomicscience.render;
|
||||
|
||||
import atomicscience.jiqi.TChemicalExtractor;
|
||||
import atomicscience.muoxing.MExtractor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RExtractor extends TileEntitySpecialRenderer {
|
||||
public static final MExtractor MODEL = new MExtractor();
|
||||
public static final String TEXTURE = "extractor.png";
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y,
|
||||
double z, float f) {
|
||||
TChemicalExtractor te = (TChemicalExtractor)tileEntity;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
this.bindTexture(
|
||||
new ResourceLocation("atomicscience", "textures/models/extractor.png"));
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
switch (
|
||||
te.getDirection(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord)) {
|
||||
case NORTH:
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
break;
|
||||
case SOUTH:
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
break;
|
||||
case WEST:
|
||||
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
|
||||
break;
|
||||
case EAST:
|
||||
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (te.smeltingTicks > 0) {
|
||||
te.rotation = (float)((double)te.rotation + (double)f * 0.3D);
|
||||
}
|
||||
|
||||
MODEL.render(te.rotation, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package atomicscience.render;
|
||||
|
||||
import atomicscience.hecheng.TFusionReactor;
|
||||
import atomicscience.muoxing.MFusionReactor;
|
||||
import calclavia.lib.render.RenderTaggedTile;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RFusionReactor extends RenderTaggedTile {
|
||||
|
||||
public static final MFusionReactor MODEL = new MFusionReactor();
|
||||
public static final String TEXTURE = "fusion_reactor.png";
|
||||
|
||||
|
||||
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f) {
|
||||
super.renderTileEntityAt(t, x, y, z, f);
|
||||
TFusionReactor tileEntity = (TFusionReactor)t;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
this.bindTexture(new ResourceLocation("atomicscience", "textures/models/fusion_reactor.png"));
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
MODEL.render((float)Math.toRadians((double)tileEntity.rotation), 0.0625F);
|
||||
tileEntity.rotation = (float)((double)tileEntity.rotation + tileEntity.wattsReceived / 500.0D);
|
||||
if(tileEntity.rotation > 360.0F) {
|
||||
tileEntity.rotation = 0.0F;
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package atomicscience.render;
|
||||
|
||||
import atomicscience.AtomicScience;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RH implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public static final int BLOCK_RENDER_ID =
|
||||
RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID,
|
||||
RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, 1.1F, 0.0F);
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
if (block == AtomicScience.bTurbine) {
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(
|
||||
new ResourceLocation("atomicscience", "textures/models/turbine.png"));
|
||||
RTurbine.MODEL.render(0.0F, 0.0625F);
|
||||
} else if (block == AtomicScience.bCentrifuge) {
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(
|
||||
new ResourceLocation("atomicscience",
|
||||
"textures/models/centrifuge.png"));
|
||||
RCentrifuge.MODEL.render(0.0F, 0.0625F);
|
||||
} else if (block == AtomicScience.bChemicalExtractor) {
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(
|
||||
new ResourceLocation("atomicscience",
|
||||
"textures/models/extractor.png"));
|
||||
RExtractor.MODEL.render(0.0F, 0.0625F);
|
||||
} else if (block == AtomicScience.bNuclearBoiler) {
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(
|
||||
new ResourceLocation("atomicscience",
|
||||
"textures/models/expansion.png"));
|
||||
RNuclearBoiler.MODEL.render(0.0F, 0.0625F);
|
||||
} else if (block == AtomicScience.bFusionReactor) {
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(
|
||||
new ResourceLocation("atomicscience",
|
||||
"textures/models/fusion_reactor.png"));
|
||||
RFusionReactor.MODEL.render(0.0F, 0.0625F);
|
||||
} else if (block == AtomicScience.bAtomicAssembler) {
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(
|
||||
new ResourceLocation("atomicscience",
|
||||
"textures/models/atomic_assembler.png"));
|
||||
RAtomicAssembler.MODEL.render(0.0F, 0.0F, 0.0F, 0.0625F);
|
||||
} else if (block == AtomicScience.bFissionReactor) {
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(
|
||||
new ResourceLocation("atomicscience",
|
||||
"textures/models/reactorCell_top.png"));
|
||||
RReactorCell.MODEL_TOP.render(0.0625F);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public boolean shouldRender3DInInventory(int meta) { return true; }
|
||||
|
||||
public int getRenderId() { return BLOCK_RENDER_ID; }
|
||||
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
|
||||
Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package atomicscience.render;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RMatter extends Render {
|
||||
@Override
|
||||
public void doRender(Entity entity, double x, double y, double z, float var8,
|
||||
float var9) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
float par2;
|
||||
for (par2 = (float)entity.ticksExisted; par2 > 200.0F; par2 -= 100.0F) {
|
||||
;
|
||||
}
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
float var41 = (5.0F + par2) / 200.0F;
|
||||
float var51 = 0.0F;
|
||||
if (var41 > 0.8F) {
|
||||
var51 = (var41 - 0.8F) / 0.2F;
|
||||
}
|
||||
|
||||
Random rand = new Random(432L);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.15F, (float)y + 0.15F, (float)z + 0.15F);
|
||||
GL11.glScalef(0.15F, 0.15F, 0.15F);
|
||||
GL11.glDisable(3553);
|
||||
GL11.glShadeModel(7425);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 1);
|
||||
GL11.glDisable(3008);
|
||||
GL11.glEnable(2884);
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(0.0F, -1.0F, -2.0F);
|
||||
|
||||
for (int i1 = 0; (float)i1 < (var41 + var41 * var41) / 2.0F * 60.0F; ++i1) {
|
||||
GL11.glRotatef(rand.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(rand.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(rand.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(rand.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(rand.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(rand.nextFloat() * 360.0F + var41 * 90.0F, 0.0F, 0.0F,
|
||||
1.0F);
|
||||
tessellator.startDrawing(6);
|
||||
float var81 = rand.nextFloat() * 20.0F + 5.0F + var51 * 10.0F;
|
||||
float var91 = rand.nextFloat() * 2.0F + 1.0F + var51 * 2.0F;
|
||||
tessellator.setColorRGBA_I(16777215, (int)(255.0F * (1.0F - var51)));
|
||||
tessellator.addVertex(0.0D, 0.0D, 0.0D);
|
||||
tessellator.setColorRGBA_I(0, 0);
|
||||
tessellator.addVertex(-0.866D * (double)var91, (double)var81,
|
||||
(double)(-0.5F * var91));
|
||||
tessellator.addVertex(0.866D * (double)var91, (double)var81,
|
||||
(double)(-0.5F * var91));
|
||||
tessellator.addVertex(0.0D, (double)var81, (double)(1.0F * var91));
|
||||
tessellator.addVertex(-0.866D * (double)var91, (double)var81,
|
||||
(double)(-0.5F * var91));
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glDisable(2884);
|
||||
GL11.glDisable(3042);
|
||||
GL11.glShadeModel(7424);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(3553);
|
||||
GL11.glEnable(3008);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
// TODO: NPE?
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture(Entity arg0) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package atomicscience.render;
|
||||
|
||||
import atomicscience.fenlie.TNuclearBoiler;
|
||||
import atomicscience.muoxing.MNuclearBoiler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RNuclearBoiler extends TileEntitySpecialRenderer {
|
||||
public static final MNuclearBoiler MODEL = new MNuclearBoiler();
|
||||
public static final String TEXTURE = "expansion.png";
|
||||
|
||||
public void renderAModelAt(TNuclearBoiler tileEntity, double x, double y,
|
||||
double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||
this.bindTexture(
|
||||
new ResourceLocation("atomicscience", "textures/models/expansion.png"));
|
||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
switch (tileEntity.getDirection(tileEntity.getWorldObj(), tileEntity.xCoord,
|
||||
tileEntity.yCoord, tileEntity.zCoord)) {
|
||||
case NORTH:
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
break;
|
||||
case SOUTH:
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
break;
|
||||
case WEST:
|
||||
GL11.glRotatef(0.0F, 0.0F, 1.0F, 0.0F);
|
||||
break;
|
||||
case EAST:
|
||||
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (tileEntity.smeltingTicks > 0) {
|
||||
tileEntity.rotation =
|
||||
(float)((double)tileEntity.rotation + (double)f * 0.3D);
|
||||
}
|
||||
|
||||
MODEL.render(tileEntity.rotation, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double var2, double var4,
|
||||
double var6, float var8) {
|
||||
this.renderAModelAt((TNuclearBoiler)tileEntity, var2, var4, var6, var8);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue