Compare commits
No commits in common. "9ce3f948ed7075512664c3f4581e5d36ef2e9e63" and "4d01133a1473aaa1c5e114ed2f3534920fba5be3" have entirely different histories.
9ce3f948ed
...
4d01133a14
140
build.gradle
140
build.gradle
|
@ -1,140 +0,0 @@
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven {
|
|
||||||
name = "forge"
|
|
||||||
url = "http://files.minecraftforge.net/maven"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
name = "CurseForge"
|
|
||||||
url = "https://minecraft.curseforge.com/api/maven/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
// JEI & TiC
|
|
||||||
name = "progwml6"
|
|
||||||
url = "http://dvs1.progwml6.com/files/maven/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
// CraftTweaker
|
|
||||||
name = "blamejared"
|
|
||||||
url = "http://maven.blamejared.com/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
// IC2
|
|
||||||
name = "ic2"
|
|
||||||
url = "http://maven.ic2.player.to/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
// OpenComputers
|
|
||||||
name = "cil"
|
|
||||||
url = "http://maven.cil.li/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "CoFH Maven"
|
|
||||||
url = "http://maven.covers1624.net"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
name = "CCL Maven"
|
|
||||||
url = "http://chickenbones.net/maven/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
// CyclopsMC
|
|
||||||
name = "CyclopsMC"
|
|
||||||
url = "https://oss.jfrog.org/artifactory/simple/libs-release/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
// tterrag
|
|
||||||
name 'tterrag Maven'
|
|
||||||
url "https://maven.tterrag.com/"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
// General
|
|
||||||
name = "mcmoddev"
|
|
||||||
url = "https://maven.mcmoddev.com"
|
|
||||||
}
|
|
||||||
maven {
|
|
||||||
// Fallbacks
|
|
||||||
name = "ModMaven"
|
|
||||||
url = "https://modmaven.k-4u.nl"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
version = "${mod_version}-${mc_version}"
|
|
||||||
group = "nc"
|
|
||||||
archivesBaseName = "NuclearCraft"
|
|
||||||
sourceCompatibility = targetCompatibility = '1.8'
|
|
||||||
compileJava {
|
|
||||||
sourceCompatibility = targetCompatibility = '1.8'
|
|
||||||
}
|
|
||||||
|
|
||||||
minecraft {
|
|
||||||
version = "${mc_version}-${forge_version}"
|
|
||||||
runDir = "run"
|
|
||||||
replace "@VERSION@", "${mod_version}"
|
|
||||||
mappings = "${mapping_version}"
|
|
||||||
makeObfSourceJar = true
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// compile against the JEI API but do not include it at runtime
|
|
||||||
deobfProvided "mezz.jei:jei_${mc_version}:${jei_version}:api"
|
|
||||||
// at runtime, use the full JEI jar
|
|
||||||
runtime "mezz.jei:jei_${mc_version}:${jei_version}"
|
|
||||||
deobfCompile "baubles:Baubles:${baubles_version}"
|
|
||||||
deobfCompile ("cofh:CoFHCore:${cofh_core_version}:universal") {
|
|
||||||
transitive = false
|
|
||||||
}
|
|
||||||
deobfCompile "codechicken:CodeChickenLib:1.12.2-+:universal"
|
|
||||||
deobfCompile "cofh:RedstoneFlux:1.12-+:universal"
|
|
||||||
deobfCompile "net.industrial-craft:industrialcraft-2:${ic2_version}:api"
|
|
||||||
deobfCompile "CraftTweaker2:CraftTweaker2-MC1120-Main:${crafttweaker_version}"
|
|
||||||
deobfCompile "slimeknights.mantle:Mantle:${mantle_version}"
|
|
||||||
deobfCompile "slimeknights:TConstruct:${tic_version}"
|
|
||||||
deobfCompile "constructs-armory:conarm:${conarm_version}"
|
|
||||||
deobfCompile "li.cil.oc:OpenComputers:${oc_version}"
|
|
||||||
deobfCompile "gregtechce:gregtech:${gregtech_version}"
|
|
||||||
deobfCompile "mekanism:Mekanism:${mekanism_version}"
|
|
||||||
deobfCompile "projecte:ProjectE:${projecte_version}"
|
|
||||||
deobfCompile "org.cyclops.commoncapabilities:CommonCapabilities:${mc_version}-${common_capabilities_version}"
|
|
||||||
deobfCompile "net.darkhax.bookshelf:Bookshelf-${mc_version}:${bookshelf_version}"
|
|
||||||
deobfCompile "net.darkhax.gamestages:GameStages-${mc_version}:${gamestages_version}"
|
|
||||||
deobfCompile ("appeng:appliedenergistics2:rv6-stable-6") {
|
|
||||||
transitive = false
|
|
||||||
}
|
|
||||||
deobfCompile "mcjty.theoneprobe:TheOneProbe-1.12:${top_version}"
|
|
||||||
deobfCompile "hwyla:Hwyla:${hwyla_version}"
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources {
|
|
||||||
exclude '**/Thumbs.db'
|
|
||||||
|
|
||||||
inputs.property "version", project.version
|
|
||||||
inputs.property "mcversion", project.minecraft.version
|
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
include 'mcmod.info'
|
|
||||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
|
||||||
}
|
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
|
||||||
exclude 'mcmod.info'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task deobfJar(type: Jar) {
|
|
||||||
from sourceSets.main.output
|
|
||||||
classifier = 'deobf'
|
|
||||||
}
|
|
||||||
|
|
||||||
artifacts {
|
|
||||||
archives deobfJar
|
|
||||||
}
|
|
|
@ -1,15 +1,3 @@
|
||||||
v2o.3.2
|
|
||||||
|
|
||||||
* Remade turbine render rotor
|
|
||||||
|
|
||||||
+ Added support for The One Probe to display large energy storages correctly
|
|
||||||
* Fixed heavy water moderator not having a creative tab
|
|
||||||
* Minor refactors and texture changes
|
|
||||||
|
|
||||||
v2o.3.1
|
|
||||||
|
|
||||||
* Fixed crash during load with QMD and/or Trinity also installed
|
|
||||||
|
|
||||||
v2o.3.0
|
v2o.3.0
|
||||||
|
|
||||||
+ Added configurable fission and turbine dynamo placement rules
|
+ Added configurable fission and turbine dynamo placement rules
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
mc_version=1.12.2
|
mc_version=1.12.2
|
||||||
forge_version=14.23.5.2847
|
forge_version=14.23.5.2847
|
||||||
mapping_version=stable_39
|
mapping_version=stable_39
|
||||||
mod_version=2o.3.2
|
mod_version=2o.3.0
|
||||||
|
|
||||||
ic2_version=2.8.197-ex112
|
ic2_version=2.8.197-ex112
|
||||||
jei_version=4.15.0.293
|
jei_version=4.15.0.293
|
||||||
|
@ -13,7 +13,6 @@ cofh_core_version=1.12.2-4.6.3.27
|
||||||
common_capabilities_version=2.4.6-328
|
common_capabilities_version=2.4.6-328
|
||||||
bookshelf_version=2.3.590
|
bookshelf_version=2.3.590
|
||||||
gamestages_version=2.0.119
|
gamestages_version=2.0.119
|
||||||
top_version=1.12-1.4.28-17
|
|
||||||
|
|
||||||
baubles_version=1.12:1.5.2
|
baubles_version=1.12:1.5.2
|
||||||
conarm_version=1.12.2:1.2.5.4
|
conarm_version=1.12.2:1.2.5.4
|
||||||
|
|
|
@ -8,7 +8,7 @@ import nc.network.PacketHandler;
|
||||||
import nc.network.config.ConfigUpdatePacket;
|
import nc.network.config.ConfigUpdatePacket;
|
||||||
import nc.radiation.RadSources;
|
import nc.radiation.RadSources;
|
||||||
import nc.recipe.ProcessorRecipeHandler;
|
import nc.recipe.ProcessorRecipeHandler;
|
||||||
import nc.util.*;
|
import nc.util.Lang;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.util.text.*;
|
import net.minecraft.util.text.*;
|
||||||
|
@ -96,7 +96,8 @@ public class NCConfig {
|
||||||
public static double[] fission_irradiator_heat_per_flux;
|
public static double[] fission_irradiator_heat_per_flux;
|
||||||
public static double[] fission_irradiator_efficiency;
|
public static double[] fission_irradiator_efficiency;
|
||||||
public static int fission_cooling_efficiency_leniency;
|
public static int fission_cooling_efficiency_leniency;
|
||||||
public static double[] fission_sparsity_penalty_params; // Multiplier and threshold
|
public static double[] fission_sparsity_penalty_params; // Multiplier and
|
||||||
|
// threshold
|
||||||
public static boolean fission_overheat;
|
public static boolean fission_overheat;
|
||||||
public static boolean fission_explosions;
|
public static boolean fission_explosions;
|
||||||
public static double fission_meltdown_radiation_multiplier;
|
public static double fission_meltdown_radiation_multiplier;
|
||||||
|
@ -208,8 +209,6 @@ public class NCConfig {
|
||||||
public static double turbine_tension_throughput_factor;
|
public static double turbine_tension_throughput_factor;
|
||||||
public static double turbine_power_bonus_multiplier;
|
public static double turbine_power_bonus_multiplier;
|
||||||
public static double turbine_sound_volume;
|
public static double turbine_sound_volume;
|
||||||
public static double turbine_render_blade_width;
|
|
||||||
public static double turbine_render_rotor_expansion;
|
|
||||||
|
|
||||||
public static double accelerator_electromagnet_power;
|
public static double accelerator_electromagnet_power;
|
||||||
public static double accelerator_supercooler_coolant;
|
public static double accelerator_supercooler_coolant;
|
||||||
|
@ -732,10 +731,6 @@ public class NCConfig {
|
||||||
propertyTurbinePowerBonusMultiplier.setLanguageKey("gui.nc.config.turbine_power_bonus_multiplier");
|
propertyTurbinePowerBonusMultiplier.setLanguageKey("gui.nc.config.turbine_power_bonus_multiplier");
|
||||||
Property propertyTurbineSoundVolume = config.get(CATEGORY_TURBINE, "turbine_sound_volume", 1D, Lang.localise("gui.nc.config.turbine_sound_volume.comment"), 0D, 15D);
|
Property propertyTurbineSoundVolume = config.get(CATEGORY_TURBINE, "turbine_sound_volume", 1D, Lang.localise("gui.nc.config.turbine_sound_volume.comment"), 0D, 15D);
|
||||||
propertyTurbineSoundVolume.setLanguageKey("gui.nc.config.turbine_sound_volume");
|
propertyTurbineSoundVolume.setLanguageKey("gui.nc.config.turbine_sound_volume");
|
||||||
Property propertyTurbineRenderBladeWidth = config.get(CATEGORY_TURBINE, "turbine_render_blade_width", NCMath.SQRT2, Lang.localise("gui.nc.config.turbine_render_blade_width.comment"), 0.01D, 4D);
|
|
||||||
propertyTurbineRenderBladeWidth.setLanguageKey("gui.nc.config.turbine_render_blade_width");
|
|
||||||
Property propertyTurbineRenderRotorExpansion = config.get(CATEGORY_TURBINE, "turbine_render_rotor_expansion", 4D, Lang.localise("gui.nc.config.turbine_render_rotor_expansion.comment"), 1D, 15D);
|
|
||||||
propertyTurbineRenderRotorExpansion.setLanguageKey("gui.nc.config.turbine_render_rotor_expansion");
|
|
||||||
|
|
||||||
Property propertyAcceleratorElectromagnetPower = config.get(CATEGORY_ACCELERATOR, "accelerator_electromagnet_power", 1000D, Lang.localise("gui.nc.config.accelerator_electromagnet_power.comment"), 0D, Integer.MAX_VALUE);
|
Property propertyAcceleratorElectromagnetPower = config.get(CATEGORY_ACCELERATOR, "accelerator_electromagnet_power", 1000D, Lang.localise("gui.nc.config.accelerator_electromagnet_power.comment"), 0D, Integer.MAX_VALUE);
|
||||||
propertyAcceleratorElectromagnetPower.setLanguageKey("gui.nc.config.accelerator_electromagnet_power");
|
propertyAcceleratorElectromagnetPower.setLanguageKey("gui.nc.config.accelerator_electromagnet_power");
|
||||||
|
@ -1174,8 +1169,6 @@ public class NCConfig {
|
||||||
propertyOrderTurbine.add(propertyTurbineTensionThroughputFactor.getName());
|
propertyOrderTurbine.add(propertyTurbineTensionThroughputFactor.getName());
|
||||||
propertyOrderTurbine.add(propertyTurbinePowerBonusMultiplier.getName());
|
propertyOrderTurbine.add(propertyTurbinePowerBonusMultiplier.getName());
|
||||||
propertyOrderTurbine.add(propertyTurbineSoundVolume.getName());
|
propertyOrderTurbine.add(propertyTurbineSoundVolume.getName());
|
||||||
propertyOrderTurbine.add(propertyTurbineRenderBladeWidth.getName());
|
|
||||||
propertyOrderTurbine.add(propertyTurbineRenderRotorExpansion.getName());
|
|
||||||
config.setCategoryPropertyOrder(CATEGORY_TURBINE, propertyOrderTurbine);
|
config.setCategoryPropertyOrder(CATEGORY_TURBINE, propertyOrderTurbine);
|
||||||
|
|
||||||
List<String> propertyOrderAccelerator = new ArrayList<>();
|
List<String> propertyOrderAccelerator = new ArrayList<>();
|
||||||
|
@ -1494,8 +1487,6 @@ public class NCConfig {
|
||||||
turbine_tension_throughput_factor = propertyTurbineTensionThroughputFactor.getDouble();
|
turbine_tension_throughput_factor = propertyTurbineTensionThroughputFactor.getDouble();
|
||||||
turbine_power_bonus_multiplier = propertyTurbinePowerBonusMultiplier.getDouble();
|
turbine_power_bonus_multiplier = propertyTurbinePowerBonusMultiplier.getDouble();
|
||||||
turbine_sound_volume = propertyTurbineSoundVolume.getDouble();
|
turbine_sound_volume = propertyTurbineSoundVolume.getDouble();
|
||||||
turbine_render_blade_width = propertyTurbineRenderBladeWidth.getDouble();
|
|
||||||
turbine_render_rotor_expansion = propertyTurbineRenderRotorExpansion.getDouble();
|
|
||||||
|
|
||||||
accelerator_electromagnet_power = propertyAcceleratorElectromagnetPower.getDouble();
|
accelerator_electromagnet_power = propertyAcceleratorElectromagnetPower.getDouble();
|
||||||
accelerator_supercooler_coolant = propertyAcceleratorSupercoolerCoolant.getDouble();
|
accelerator_supercooler_coolant = propertyAcceleratorSupercoolerCoolant.getDouble();
|
||||||
|
@ -1811,8 +1802,6 @@ public class NCConfig {
|
||||||
propertyTurbineTensionThroughputFactor.set(turbine_tension_throughput_factor);
|
propertyTurbineTensionThroughputFactor.set(turbine_tension_throughput_factor);
|
||||||
propertyTurbinePowerBonusMultiplier.set(turbine_power_bonus_multiplier);
|
propertyTurbinePowerBonusMultiplier.set(turbine_power_bonus_multiplier);
|
||||||
propertyTurbineSoundVolume.set(turbine_sound_volume);
|
propertyTurbineSoundVolume.set(turbine_sound_volume);
|
||||||
propertyTurbineRenderBladeWidth.set(turbine_render_blade_width);
|
|
||||||
propertyTurbineRenderRotorExpansion.set(turbine_render_rotor_expansion);
|
|
||||||
|
|
||||||
propertyAcceleratorElectromagnetPower.set(accelerator_electromagnet_power);
|
propertyAcceleratorElectromagnetPower.set(accelerator_electromagnet_power);
|
||||||
propertyAcceleratorSupercoolerCoolant.set(accelerator_supercooler_coolant);
|
propertyAcceleratorSupercoolerCoolant.set(accelerator_supercooler_coolant);
|
||||||
|
|
|
@ -199,7 +199,7 @@ public class NCBlocks {
|
||||||
|
|
||||||
supercold_ice = withName(new NCBlockIce(0.999F).setCreativeTab(NCTabs.MATERIAL), "supercold_ice");
|
supercold_ice = withName(new NCBlockIce(0.999F).setCreativeTab(NCTabs.MATERIAL), "supercold_ice");
|
||||||
|
|
||||||
heavy_water_moderator = withName(new NCBlock(Material.IRON).setCreativeTab(NCTabs.MISC), "heavy_water_moderator");
|
heavy_water_moderator = withName(new NCBlock(Material.IRON), "heavy_water_moderator");
|
||||||
|
|
||||||
if (register_processor[0]) {
|
if (register_processor[0]) {
|
||||||
nuclear_furnace = withName(new BlockNuclearFurnace(), "nuclear_furnace");
|
nuclear_furnace = withName(new BlockNuclearFurnace(), "nuclear_furnace");
|
||||||
|
|
|
@ -129,7 +129,7 @@ public abstract class MultiblockLogic<MULTIBLOCK extends Multiblock<T, PACKET> &
|
||||||
Int2IntMap targetCountMap = new Int2IntOpenHashMap();
|
Int2IntMap targetCountMap = new Int2IntOpenHashMap();
|
||||||
for (PORT port : portMap.values()) {
|
for (PORT port : portMap.values()) {
|
||||||
int filter = port.getFilterID();
|
int filter = port.getFilterID();
|
||||||
if (PosHelper.DEFAULT_NON.equals(port.getMasterPortPos()) && !masterPortMap.containsKey(filter)) {
|
if (BlockPosHelper.DEFAULT_NON.equals(port.getMasterPortPos()) && !masterPortMap.containsKey(filter)) {
|
||||||
masterPortMap.put(filter, port);
|
masterPortMap.put(filter, port);
|
||||||
targetCountMap.put(filter, 0);
|
targetCountMap.put(filter, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -311,7 +311,7 @@ public abstract class PlacementRule<T extends ITileMultiblockPart> {
|
||||||
return count == amount / 2;
|
return count == amount / 2;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
loop: for (EnumFacing[] axialDirs : PosHelper.axialDirsList()) {
|
loop: for (EnumFacing[] axialDirs : BlockPosHelper.axialDirsList()) {
|
||||||
for (EnumFacing dir : axialDirs) {
|
for (EnumFacing dir : axialDirs) {
|
||||||
if (!satisfied(tile, dir)) {
|
if (!satisfied(tile, dir)) {
|
||||||
continue loop;
|
continue loop;
|
||||||
|
@ -339,7 +339,7 @@ public abstract class PlacementRule<T extends ITileMultiblockPart> {
|
||||||
}
|
}
|
||||||
if (count != amount) return false;
|
if (count != amount) return false;
|
||||||
|
|
||||||
loop: for (EnumFacing[] vertexDirs : PosHelper.vertexDirsList()) {
|
loop: for (EnumFacing[] vertexDirs : BlockPosHelper.vertexDirsList()) {
|
||||||
for (EnumFacing dir : vertexDirs) {
|
for (EnumFacing dir : vertexDirs) {
|
||||||
if (!dirs[dir.getIndex()]) {
|
if (!dirs[dir.getIndex()]) {
|
||||||
continue loop;
|
continue loop;
|
||||||
|
@ -350,7 +350,7 @@ public abstract class PlacementRule<T extends ITileMultiblockPart> {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
loop: for (EnumFacing[] vertexDirs : PosHelper.vertexDirsList()) {
|
loop: for (EnumFacing[] vertexDirs : BlockPosHelper.vertexDirsList()) {
|
||||||
for (EnumFacing dir : vertexDirs) {
|
for (EnumFacing dir : vertexDirs) {
|
||||||
if (!satisfied(tile, dir)) {
|
if (!satisfied(tile, dir)) {
|
||||||
continue loop;
|
continue loop;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package nc.multiblock.cuboidal;
|
package nc.multiblock.cuboidal;
|
||||||
|
|
||||||
import javax.vecmath.Vector3f;
|
|
||||||
|
|
||||||
import nc.multiblock.*;
|
import nc.multiblock.*;
|
||||||
import nc.multiblock.network.MultiblockUpdatePacket;
|
import nc.multiblock.network.MultiblockUpdatePacket;
|
||||||
import nc.multiblock.tile.ITileMultiblockPart;
|
import nc.multiblock.tile.ITileMultiblockPart;
|
||||||
|
@ -463,12 +461,6 @@ public abstract class CuboidalMultiblock<T extends ITileMultiblockPart, PACKET e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3f getMiddleInteriorPlaneCoord(EnumFacing normal, int depth, int minUCushion, int minVCushion, int maxUCushion, int maxVCushion) {
|
|
||||||
BlockPos min = getMinimumInteriorPlaneCoord(normal, depth, minUCushion, minVCushion);
|
|
||||||
BlockPos max = getMaximumInteriorPlaneCoord(normal, depth, maxUCushion, maxVCushion);
|
|
||||||
return new Vector3f((min.getX() + max.getX()) / 2F, (min.getY() + max.getY()) / 2F, (min.getZ() + max.getZ()) / 2F);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Iterable<MutableBlockPos> getInteriorPlaneMinX(int depth, int minUCushion, int minVCushion, int maxUCushion, int maxVCushion) {
|
public Iterable<MutableBlockPos> getInteriorPlaneMinX(int depth, int minUCushion, int minVCushion, int maxUCushion, int maxVCushion) {
|
||||||
return BlockPos.getAllInBoxMutable(getMinimumInteriorPlaneCoord(EnumFacing.WEST, depth, minUCushion, minVCushion), getMaximumInteriorPlaneCoord(EnumFacing.WEST, depth, maxUCushion, maxVCushion));
|
return BlockPos.getAllInBoxMutable(getMinimumInteriorPlaneCoord(EnumFacing.WEST, depth, minUCushion, minVCushion), getMaximumInteriorPlaneCoord(EnumFacing.WEST, depth, maxUCushion, maxVCushion));
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
|
|
||||||
import nc.multiblock.fission.block.BlockFissionPart;
|
import nc.multiblock.fission.block.BlockFissionPart;
|
||||||
import nc.multiblock.fission.tile.port.*;
|
import nc.multiblock.fission.tile.port.*;
|
||||||
import nc.util.PosHelper;
|
import nc.util.BlockPosHelper;
|
||||||
import net.minecraft.block.state.*;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -28,7 +28,7 @@ public abstract class BlockFissionPort<PORT extends TileFissionPort<PORT, TARGET
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta) {
|
public IBlockState getStateFromMeta(int meta) {
|
||||||
return getDefaultState().withProperty(AXIS_ALL, PosHelper.AXES[meta]);
|
return getDefaultState().withProperty(AXIS_ALL, BlockPosHelper.AXES[meta]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,7 +3,7 @@ package nc.multiblock.fission.salt.tile;
|
||||||
import static nc.config.NCConfig.enable_mek_gas;
|
import static nc.config.NCConfig.enable_mek_gas;
|
||||||
import static nc.init.NCCoolantFluids.COOLANTS;
|
import static nc.init.NCCoolantFluids.COOLANTS;
|
||||||
import static nc.recipe.NCRecipes.coolant_heater;
|
import static nc.recipe.NCRecipes.coolant_heater;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package nc.multiblock.fission.salt.tile;
|
||||||
|
|
||||||
import static nc.config.NCConfig.*;
|
import static nc.config.NCConfig.*;
|
||||||
import static nc.recipe.NCRecipes.*;
|
import static nc.recipe.NCRecipes.*;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package nc.multiblock.fission.solid.tile;
|
||||||
|
|
||||||
import static nc.config.NCConfig.*;
|
import static nc.config.NCConfig.*;
|
||||||
import static nc.recipe.NCRecipes.solid_fission;
|
import static nc.recipe.NCRecipes.solid_fission;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package nc.multiblock.fission.tile;
|
||||||
|
|
||||||
import static nc.config.NCConfig.smart_processor_input;
|
import static nc.config.NCConfig.smart_processor_input;
|
||||||
import static nc.recipe.NCRecipes.fission_irradiator;
|
import static nc.recipe.NCRecipes.fission_irradiator;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package nc.multiblock.fission.tile;
|
package nc.multiblock.fission.tile;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.FACING_ALL;
|
import static nc.block.property.BlockProperties.FACING_ALL;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
import nc.multiblock.cuboidal.CuboidalPartPositionType;
|
||||||
import nc.multiblock.fission.FissionReactor;
|
import nc.multiblock.fission.FissionReactor;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package nc.multiblock.fission.tile;
|
package nc.multiblock.fission.tile;
|
||||||
|
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import nc.multiblock.fission.*;
|
||||||
import nc.multiblock.fission.block.BlockFissionShield;
|
import nc.multiblock.fission.block.BlockFissionShield;
|
||||||
import nc.multiblock.fission.tile.IFissionFuelComponent.*;
|
import nc.multiblock.fission.tile.IFissionFuelComponent.*;
|
||||||
import nc.multiblock.fission.tile.manager.*;
|
import nc.multiblock.fission.tile.manager.*;
|
||||||
import nc.util.PosHelper;
|
import nc.util.BlockPosHelper;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
@ -98,8 +98,8 @@ public abstract class TileFissionShield extends TileFissionPart implements IFiss
|
||||||
validActiveModeratorPos[dir.getIndex()] = false;
|
validActiveModeratorPos[dir.getIndex()] = false;
|
||||||
}
|
}
|
||||||
flux = 0;
|
flux = 0;
|
||||||
for (Axis axis : PosHelper.AXES) {
|
for (Axis axis : BlockPosHelper.AXES) {
|
||||||
activeModeratorLines[PosHelper.getAxisIndex(axis)] = null;
|
activeModeratorLines[BlockPosHelper.getAxisIndex(axis)] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ public abstract class TileFissionShield extends TileFissionPart implements IFiss
|
||||||
if (validActiveModeratorPos[dir.getIndex()]) {
|
if (validActiveModeratorPos[dir.getIndex()]) {
|
||||||
activeModerator = true;
|
activeModerator = true;
|
||||||
}
|
}
|
||||||
int index = PosHelper.getAxisIndex(dir.getAxis());
|
int index = BlockPosHelper.getAxisIndex(dir.getAxis());
|
||||||
if (activeModeratorLines[index] == null) {
|
if (activeModeratorLines[index] == null) {
|
||||||
flux += getLineFluxContribution(line, thisInfo);
|
flux += getLineFluxContribution(line, thisInfo);
|
||||||
activeModeratorLines[index] = line;
|
activeModeratorLines[index] = line;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package nc.multiblock.fission.tile.port;
|
package nc.multiblock.fission.tile.port;
|
||||||
|
|
||||||
import static nc.recipe.NCRecipes.solid_fission;
|
import static nc.recipe.NCRecipes.solid_fission;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package nc.multiblock.fission.tile.port;
|
package nc.multiblock.fission.tile.port;
|
||||||
|
|
||||||
import static nc.config.NCConfig.enable_mek_gas;
|
import static nc.config.NCConfig.enable_mek_gas;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package nc.multiblock.fission.tile.port;
|
||||||
|
|
||||||
import static nc.init.NCCoolantFluids.COOLANTS;
|
import static nc.init.NCCoolantFluids.COOLANTS;
|
||||||
import static nc.recipe.NCRecipes.coolant_heater;
|
import static nc.recipe.NCRecipes.coolant_heater;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package nc.multiblock.fission.tile.port;
|
package nc.multiblock.fission.tile.port;
|
||||||
|
|
||||||
import static nc.recipe.NCRecipes.fission_irradiator;
|
import static nc.recipe.NCRecipes.fission_irradiator;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package nc.multiblock.fission.tile.port;
|
package nc.multiblock.fission.tile.port;
|
||||||
|
|
||||||
import static nc.config.NCConfig.smart_processor_input;
|
import static nc.config.NCConfig.smart_processor_input;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package nc.multiblock.fission.tile.port;
|
package nc.multiblock.fission.tile.port;
|
||||||
|
|
||||||
import static nc.block.property.BlockProperties.AXIS_ALL;
|
import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
|
|
||||||
import javax.annotation.*;
|
import javax.annotation.*;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package nc.multiblock.fission.tile.port;
|
package nc.multiblock.fission.tile.port;
|
||||||
|
|
||||||
import static nc.recipe.NCRecipes.*;
|
import static nc.recipe.NCRecipes.*;
|
||||||
import static nc.util.PosHelper.DEFAULT_NON;
|
import static nc.util.BlockPosHelper.DEFAULT_NON;
|
||||||
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
import static nc.util.FluidStackHelper.INGOT_BLOCK_VOLUME;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
|
@ -3,7 +3,7 @@ package nc.multiblock.heatExchanger.block;
|
||||||
import static nc.block.property.BlockProperties.AXIS_ALL;
|
import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
|
|
||||||
import nc.multiblock.heatExchanger.tile.TileHeatExchangerVent;
|
import nc.multiblock.heatExchanger.tile.TileHeatExchangerVent;
|
||||||
import nc.util.PosHelper;
|
import nc.util.BlockPosHelper;
|
||||||
import net.minecraft.block.state.*;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -26,7 +26,7 @@ public class BlockHeatExchangerVent extends BlockHeatExchangerPart {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta) {
|
public IBlockState getStateFromMeta(int meta) {
|
||||||
return getDefaultState().withProperty(AXIS_ALL, PosHelper.AXES[meta]);
|
return getDefaultState().withProperty(AXIS_ALL, BlockPosHelper.AXES[meta]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
package nc.multiblock.network;
|
|
||||||
|
|
||||||
import javax.vecmath.Vector3f;
|
|
||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
|
||||||
import nc.multiblock.turbine.Turbine;
|
|
||||||
import nc.multiblock.turbine.tile.TileTurbineController;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class TurbineFormPacket extends MultiblockUpdatePacket {
|
|
||||||
|
|
||||||
public BlockPos[] bladePosArray;
|
|
||||||
public Vector3f[] renderPosArray;
|
|
||||||
public float[] bladeAngleArray;
|
|
||||||
|
|
||||||
public TurbineFormPacket() {
|
|
||||||
messageValid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TurbineFormPacket(BlockPos pos, BlockPos[] bladePosArray, Vector3f[] renderPosArray, float[] bladeAngleArray) {
|
|
||||||
this.pos = pos;
|
|
||||||
this.bladePosArray = bladePosArray;
|
|
||||||
this.renderPosArray = renderPosArray;
|
|
||||||
this.bladeAngleArray = bladeAngleArray;
|
|
||||||
|
|
||||||
messageValid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readMessage(ByteBuf buf) {
|
|
||||||
pos = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
|
|
||||||
bladePosArray = new BlockPos[buf.readInt()];
|
|
||||||
for (int i = 0; i < bladePosArray.length; i++) {
|
|
||||||
bladePosArray[i] = new BlockPos(buf.readInt(), buf.readInt(), buf.readInt());
|
|
||||||
}
|
|
||||||
renderPosArray = new Vector3f[buf.readInt()];
|
|
||||||
for (int i = 0; i < renderPosArray.length; i++) {
|
|
||||||
renderPosArray[i] = new Vector3f(buf.readFloat(), buf.readFloat(), buf.readFloat());
|
|
||||||
}
|
|
||||||
bladeAngleArray = new float[buf.readInt()];
|
|
||||||
for (int i = 0; i < bladeAngleArray.length; i++) {
|
|
||||||
bladeAngleArray[i] = buf.readFloat();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeMessage(ByteBuf buf) {
|
|
||||||
buf.writeInt(pos.getX());
|
|
||||||
buf.writeInt(pos.getY());
|
|
||||||
buf.writeInt(pos.getZ());
|
|
||||||
buf.writeInt(bladePosArray.length);
|
|
||||||
for (BlockPos rotorPos : bladePosArray) {
|
|
||||||
buf.writeInt(rotorPos.getX());
|
|
||||||
buf.writeInt(rotorPos.getY());
|
|
||||||
buf.writeInt(rotorPos.getZ());
|
|
||||||
}
|
|
||||||
buf.writeInt(renderPosArray.length);
|
|
||||||
for (Vector3f planePos : renderPosArray) {
|
|
||||||
buf.writeFloat(planePos.x);
|
|
||||||
buf.writeFloat(planePos.y);
|
|
||||||
buf.writeFloat(planePos.z);
|
|
||||||
}
|
|
||||||
buf.writeInt(bladeAngleArray.length);
|
|
||||||
for (float bladeAngle : bladeAngleArray) {
|
|
||||||
buf.writeFloat(bladeAngle);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Handler extends MultiblockUpdatePacket.Handler<TurbineFormPacket, Turbine, TileTurbineController> {
|
|
||||||
|
|
||||||
public Handler() {
|
|
||||||
super(TileTurbineController.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPacket(TurbineFormPacket message, Turbine multiblock) {
|
|
||||||
multiblock.onFormPacket(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -6,16 +6,13 @@ import java.lang.reflect.Constructor;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.vecmath.Vector3f;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.doubles.*;
|
import it.unimi.dsi.fastutil.doubles.*;
|
||||||
import it.unimi.dsi.fastutil.ints.*;
|
|
||||||
import it.unimi.dsi.fastutil.objects.*;
|
import it.unimi.dsi.fastutil.objects.*;
|
||||||
import nc.Global;
|
import nc.Global;
|
||||||
import nc.handler.SoundHandler.SoundInfo;
|
import nc.handler.SoundHandler.SoundInfo;
|
||||||
import nc.init.NCBlocks;
|
|
||||||
import nc.multiblock.*;
|
import nc.multiblock.*;
|
||||||
import nc.multiblock.container.ContainerTurbineController;
|
import nc.multiblock.container.ContainerTurbineController;
|
||||||
import nc.multiblock.cuboidal.CuboidalMultiblock;
|
import nc.multiblock.cuboidal.CuboidalMultiblock;
|
||||||
|
@ -28,7 +25,6 @@ import nc.recipe.*;
|
||||||
import nc.tile.internal.energy.EnergyStorage;
|
import nc.tile.internal.energy.EnergyStorage;
|
||||||
import nc.tile.internal.fluid.Tank;
|
import nc.tile.internal.fluid.Tank;
|
||||||
import nc.util.NCMath;
|
import nc.util.NCMath;
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -75,12 +71,6 @@ public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacke
|
||||||
public long prevRenderTime = 0L;
|
public long prevRenderTime = 0L;
|
||||||
public Iterable<MutableBlockPos>[] inputPlane = new Iterable[4];
|
public Iterable<MutableBlockPos>[] inputPlane = new Iterable[4];
|
||||||
|
|
||||||
public BlockPos[] bladePosArray = null;
|
|
||||||
public Vector3f[] renderPosArray = null;
|
|
||||||
public float[] bladeAngleArray = null;
|
|
||||||
public IBlockState[] rotorStateArray = null;
|
|
||||||
public IntList bladeDepths = null, statorDepths = null;
|
|
||||||
|
|
||||||
public Turbine(World world) {
|
public Turbine(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
for (Class<? extends ITurbinePart> clazz : PART_CLASSES) {
|
for (Class<? extends ITurbinePart> clazz : PART_CLASSES) {
|
||||||
|
@ -243,7 +233,7 @@ public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacke
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public TurbinePartDir getBladeDir(PlaneDir planeDir) {
|
protected TurbinePartDir getBladeDir(PlaneDir planeDir) {
|
||||||
switch (flowDir.getAxis()) {
|
switch (flowDir.getAxis()) {
|
||||||
case Y:
|
case Y:
|
||||||
switch (planeDir) {
|
switch (planeDir) {
|
||||||
|
@ -271,7 +261,7 @@ public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacke
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PlaneDir {
|
protected enum PlaneDir {
|
||||||
U,
|
U,
|
||||||
V;
|
V;
|
||||||
}
|
}
|
||||||
|
@ -436,37 +426,6 @@ public class Turbine extends CuboidalMultiblock<ITurbinePart, TurbineUpdatePacke
|
||||||
logic.onRenderPacket(message);
|
logic.onRenderPacket(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected TurbineFormPacket getFormPacket() {
|
|
||||||
return logic.getFormPacket();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onFormPacket(TurbineFormPacket message) {
|
|
||||||
bladePosArray = message.bladePosArray;
|
|
||||||
renderPosArray = message.renderPosArray;
|
|
||||||
bladeAngleArray = message.bladeAngleArray;
|
|
||||||
|
|
||||||
rotorStateArray = new IBlockState[1 + 4 * getFlowLength()];
|
|
||||||
rotorStateArray[4 * getFlowLength()] = NCBlocks.turbine_rotor_shaft.getDefaultState().withProperty(TurbineRotorBladeUtil.DIR, getShaftDir());
|
|
||||||
|
|
||||||
for (int i = 0; i < bladePosArray.length; i++) {
|
|
||||||
BlockPos pos = bladePosArray[i];
|
|
||||||
ITurbineRotorBlade thisBlade = getBlade(pos);
|
|
||||||
rotorStateArray[i] = thisBlade == null ? WORLD.getBlockState(pos).getBlock().getDefaultState() : thisBlade.getRenderState();
|
|
||||||
}
|
|
||||||
|
|
||||||
bladeDepths = new IntArrayList();
|
|
||||||
statorDepths = new IntArrayList();
|
|
||||||
|
|
||||||
for (int i = 0; i < getFlowLength(); i++) {
|
|
||||||
if (getBlade(bladePosArray[i]).getBladeType() == TurbineRotorStatorType.STATOR) {
|
|
||||||
statorDepths.add(i);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
bladeDepths.add(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ContainerTurbineController getContainer(EntityPlayer player) {
|
public ContainerTurbineController getContainer(EntityPlayer player) {
|
||||||
return logic.getContainer(player);
|
return logic.getContainer(player);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,6 @@ import static nc.recipe.NCRecipes.turbine;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import javax.vecmath.Vector3f;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.doubles.*;
|
import it.unimi.dsi.fastutil.doubles.*;
|
||||||
|
@ -101,13 +99,11 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
getTurbine().energyStorage.setMaxTransfer(Turbine.BASE_MAX_ENERGY * getTurbine().getExteriorSurfaceArea());
|
getTurbine().energyStorage.setMaxTransfer(Turbine.BASE_MAX_ENERGY * getTurbine().getExteriorSurfaceArea());
|
||||||
getTurbine().tanks.get(0).setCapacity(Turbine.BASE_MAX_INPUT * getTurbine().getExteriorSurfaceArea());
|
getTurbine().tanks.get(0).setCapacity(Turbine.BASE_MAX_INPUT * getTurbine().getExteriorSurfaceArea());
|
||||||
getTurbine().tanks.get(1).setCapacity(Turbine.BASE_MAX_OUTPUT * getTurbine().getExteriorSurfaceArea());
|
getTurbine().tanks.get(1).setCapacity(Turbine.BASE_MAX_OUTPUT * getTurbine().getExteriorSurfaceArea());
|
||||||
}
|
|
||||||
|
|
||||||
if (getTurbine().flowDir == null) {
|
if (getTurbine().flowDir == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getWorld().isRemote) {
|
|
||||||
componentFailCache.clear();
|
componentFailCache.clear();
|
||||||
do {
|
do {
|
||||||
assumedValidCache.clear();
|
assumedValidCache.clear();
|
||||||
|
@ -154,30 +150,10 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EnumFacing oppositeDir = getTurbine().flowDir.getOpposite();
|
getTurbine().inputPlane[0] = getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), 0, 0, 0, getTurbine().bladeLength, getTurbine().shaftWidth + getTurbine().bladeLength);
|
||||||
int flowLength = getTurbine().getFlowLength(), bladeLength = getTurbine().bladeLength, shaftWidth = getTurbine().shaftWidth;
|
getTurbine().inputPlane[1] = getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), 0, getTurbine().shaftWidth + getTurbine().bladeLength, 0, 0, getTurbine().bladeLength);
|
||||||
|
getTurbine().inputPlane[2] = getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), 0, getTurbine().bladeLength, getTurbine().shaftWidth + getTurbine().bladeLength, 0, 0);
|
||||||
getTurbine().inputPlane[0] = getTurbine().getInteriorPlane(oppositeDir, 0, 0, 0, bladeLength, shaftWidth + bladeLength);
|
getTurbine().inputPlane[3] = getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), 0, 0, getTurbine().bladeLength, getTurbine().shaftWidth + getTurbine().bladeLength, 0);
|
||||||
getTurbine().inputPlane[1] = getTurbine().getInteriorPlane(oppositeDir, 0, shaftWidth + bladeLength, 0, 0, bladeLength);
|
|
||||||
getTurbine().inputPlane[2] = getTurbine().getInteriorPlane(oppositeDir, 0, bladeLength, shaftWidth + bladeLength, 0, 0);
|
|
||||||
getTurbine().inputPlane[3] = getTurbine().getInteriorPlane(oppositeDir, 0, 0, bladeLength, shaftWidth + bladeLength, 0);
|
|
||||||
|
|
||||||
getTurbine().renderPosArray = new Vector3f[(1 + 4 * shaftWidth) * flowLength];
|
|
||||||
|
|
||||||
for (int depth = 0; depth < flowLength; depth++) {
|
|
||||||
for (int w = 0; w < shaftWidth; w++) {
|
|
||||||
getTurbine().renderPosArray[w + depth * shaftWidth] = getTurbine().getMiddleInteriorPlaneCoord(oppositeDir, depth, 1 + w + bladeLength, 0, shaftWidth - w + bladeLength, shaftWidth + bladeLength);
|
|
||||||
getTurbine().renderPosArray[w + (depth + flowLength) * shaftWidth] = getTurbine().getMiddleInteriorPlaneCoord(oppositeDir, depth, 0, shaftWidth - w + bladeLength, shaftWidth + bladeLength, 1 + w + bladeLength);
|
|
||||||
getTurbine().renderPosArray[w + (depth + 2 * flowLength) * shaftWidth] = getTurbine().getMiddleInteriorPlaneCoord(oppositeDir, depth, shaftWidth + bladeLength, 1 + w + bladeLength, 0, shaftWidth - w + bladeLength);
|
|
||||||
getTurbine().renderPosArray[w + (depth + 3 * flowLength) * shaftWidth] = getTurbine().getMiddleInteriorPlaneCoord(oppositeDir, depth, shaftWidth - w + bladeLength, shaftWidth + bladeLength, 1 + w + bladeLength, 0);
|
|
||||||
}
|
|
||||||
getTurbine().renderPosArray[depth + 4 * flowLength * shaftWidth] = getTurbine().getMiddleInteriorPlaneCoord(oppositeDir, depth, 0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (getTurbine().controller != null) {
|
|
||||||
PacketHandler.instance.sendToAll(getFormPacket());
|
|
||||||
getTurbine().sendUpdateToListeningPlayers();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void refreshDynamos() {
|
protected void refreshDynamos() {
|
||||||
|
@ -350,7 +326,9 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
dirMaxZ = true;
|
dirMaxZ = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
notInAWall = true; // If the bearing is not at any of those positions, that means our bearing isn't part of the wall at all
|
notInAWall = true; // If the bearing is not at any of those
|
||||||
|
// positions, that means our bearing isn't
|
||||||
|
// part of the wall at all
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,8 +362,10 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// At this point, all bearings are guaranteed to be part of walls in the same axis
|
// At this point, all bearings are guaranteed to be part of walls in the
|
||||||
// Also, it can only ever succeed up to this point if we already have at least two bearings, so no need to check for that
|
// same axis
|
||||||
|
// Also, it can only ever succeed up to this point if we already have at
|
||||||
|
// least two bearings, so no need to check for that
|
||||||
|
|
||||||
int internalDiameter;
|
int internalDiameter;
|
||||||
if (axis == Axis.X) {
|
if (axis == Axis.X) {
|
||||||
|
@ -412,7 +392,8 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Last thing that needs to be checked concerning bearings is whether they are grouped correctly at the centre of their respective walls
|
// Last thing that needs to be checked concerning bearings is whether
|
||||||
|
// they are grouped correctly at the centre of their respective walls
|
||||||
|
|
||||||
getTurbine().bladeLength = (internalDiameter - getTurbine().shaftWidth) / 2;
|
getTurbine().bladeLength = (internalDiameter - getTurbine().shaftWidth) / 2;
|
||||||
|
|
||||||
|
@ -490,9 +471,6 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
|
|
||||||
int flowLength = getTurbine().getFlowLength();
|
int flowLength = getTurbine().getFlowLength();
|
||||||
|
|
||||||
getTurbine().bladePosArray = new BlockPos[4 * flowLength];
|
|
||||||
getTurbine().bladeAngleArray = new float[4 * flowLength];
|
|
||||||
|
|
||||||
for (int slice = 0; slice < flowLength; slice++) {
|
for (int slice = 0; slice < flowLength; slice++) {
|
||||||
for (BlockPos pos : getTurbine().getInteriorPlane(EnumFacing.getFacingFromAxis(AxisDirection.POSITIVE, axis), slice, getTurbine().bladeLength, getTurbine().bladeLength, getTurbine().bladeLength, getTurbine().bladeLength)) {
|
for (BlockPos pos : getTurbine().getInteriorPlane(EnumFacing.getFacingFromAxis(AxisDirection.POSITIVE, axis), slice, getTurbine().bladeLength, getTurbine().bladeLength, getTurbine().bladeLength, getTurbine().bladeLength)) {
|
||||||
TileEntity tile = getWorld().getTileEntity(pos);
|
TileEntity tile = getWorld().getTileEntity(pos);
|
||||||
|
@ -572,9 +550,6 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
thisBlade.setDir(getTurbine().getBladeDir(PlaneDir.V));
|
thisBlade.setDir(getTurbine().getBladeDir(PlaneDir.V));
|
||||||
thisBlade.setDepth(depth);
|
thisBlade.setDepth(depth);
|
||||||
thisBlade.setRenderRotation(45F);
|
thisBlade.setRenderRotation(45F);
|
||||||
|
|
||||||
getTurbine().bladePosArray[depth] = thisBlade.bladePos();
|
|
||||||
getTurbine().bladeAngleArray[depth] = thisBlade.getRenderRotation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BlockPos pos : getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), depth, 0, getTurbine().bladeLength, getTurbine().shaftWidth + getTurbine().bladeLength, getTurbine().bladeLength)) {
|
for (BlockPos pos : getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), depth, 0, getTurbine().bladeLength, getTurbine().shaftWidth + getTurbine().bladeLength, getTurbine().bladeLength)) {
|
||||||
|
@ -591,9 +566,6 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
thisBlade.setDir(getTurbine().getBladeDir(PlaneDir.U));
|
thisBlade.setDir(getTurbine().getBladeDir(PlaneDir.U));
|
||||||
thisBlade.setDepth(depth);
|
thisBlade.setDepth(depth);
|
||||||
thisBlade.setRenderRotation(getTurbine().flowDir.getAxis() == Axis.Z ? -45F : 45F);
|
thisBlade.setRenderRotation(getTurbine().flowDir.getAxis() == Axis.Z ? -45F : 45F);
|
||||||
|
|
||||||
getTurbine().bladePosArray[depth + flowLength] = thisBlade.bladePos();
|
|
||||||
getTurbine().bladeAngleArray[depth + flowLength] = thisBlade.getRenderRotation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BlockPos pos : getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), depth, getTurbine().shaftWidth + getTurbine().bladeLength, getTurbine().bladeLength, 0, getTurbine().bladeLength)) {
|
for (BlockPos pos : getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), depth, getTurbine().shaftWidth + getTurbine().bladeLength, getTurbine().bladeLength, 0, getTurbine().bladeLength)) {
|
||||||
|
@ -610,9 +582,6 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
thisBlade.setDir(getTurbine().getBladeDir(PlaneDir.U));
|
thisBlade.setDir(getTurbine().getBladeDir(PlaneDir.U));
|
||||||
thisBlade.setDepth(depth);
|
thisBlade.setDepth(depth);
|
||||||
thisBlade.setRenderRotation(getTurbine().flowDir.getAxis() == Axis.Z ? 45F : -45F);
|
thisBlade.setRenderRotation(getTurbine().flowDir.getAxis() == Axis.Z ? 45F : -45F);
|
||||||
|
|
||||||
getTurbine().bladePosArray[depth + 2 * flowLength] = thisBlade.bladePos();
|
|
||||||
getTurbine().bladeAngleArray[depth + 2 * flowLength] = thisBlade.getRenderRotation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BlockPos pos : getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), depth, getTurbine().bladeLength, getTurbine().shaftWidth + getTurbine().bladeLength, getTurbine().bladeLength, 0)) {
|
for (BlockPos pos : getTurbine().getInteriorPlane(getTurbine().flowDir.getOpposite(), depth, getTurbine().bladeLength, getTurbine().shaftWidth + getTurbine().bladeLength, getTurbine().bladeLength, 0)) {
|
||||||
|
@ -629,9 +598,6 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
thisBlade.setDir(getTurbine().getBladeDir(PlaneDir.V));
|
thisBlade.setDir(getTurbine().getBladeDir(PlaneDir.V));
|
||||||
thisBlade.setDepth(depth);
|
thisBlade.setDepth(depth);
|
||||||
thisBlade.setRenderRotation(-45F);
|
thisBlade.setRenderRotation(-45F);
|
||||||
|
|
||||||
getTurbine().bladePosArray[depth + 3 * flowLength] = thisBlade.bladePos();
|
|
||||||
getTurbine().bladeAngleArray[depth + 3 * flowLength] = thisBlade.getRenderRotation();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentBladeType == null) {
|
if (currentBladeType == null) {
|
||||||
|
@ -643,7 +609,7 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
if (currentBladeType == TurbineRotorStatorType.STATOR) {
|
if (currentBladeType == TurbineRotorStatorType.STATOR) {
|
||||||
getTurbine().totalExpansionLevel *= turbine_stator_expansion;
|
getTurbine().totalExpansionLevel *= turbine_stator_expansion;
|
||||||
getTurbine().expansionLevels.add((prevExpansionLevel + getTurbine().totalExpansionLevel) / 2D);
|
getTurbine().expansionLevels.add((prevExpansionLevel + getTurbine().totalExpansionLevel) / 2D);
|
||||||
getTurbine().rawBladeEfficiencies.add(-1D);
|
getTurbine().rawBladeEfficiencies.add(0D);
|
||||||
}
|
}
|
||||||
else if (currentBladeType instanceof TurbineRotorBladeType) {
|
else if (currentBladeType instanceof TurbineRotorBladeType) {
|
||||||
getTurbine().totalExpansionLevel *= ((TurbineRotorBladeType) currentBladeType).getExpansionCoefficient();
|
getTurbine().totalExpansionLevel *= ((TurbineRotorBladeType) currentBladeType).getExpansionCoefficient();
|
||||||
|
@ -905,18 +871,6 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
return getTurbine().rotorEfficiency * getExpansionIdealityMultiplier(getTurbine().idealTotalExpansionLevel, getTurbine().totalExpansionLevel) * recipeInputRate * getTurbine().basePowerPerMB;
|
return getTurbine().rotorEfficiency * getExpansionIdealityMultiplier(getTurbine().idealTotalExpansionLevel, getTurbine().totalExpansionLevel) * recipeInputRate * getTurbine().basePowerPerMB;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRotorEfficiency() {
|
|
||||||
getTurbine().rotorEfficiency = 0D;
|
|
||||||
|
|
||||||
for (int depth = 0; depth < getTurbine().getFlowLength(); depth++) {
|
|
||||||
if (getTurbine().rawBladeEfficiencies.get(depth) < 0D) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
getTurbine().rotorEfficiency += getTurbine().rawBladeEfficiencies.get(depth) * getExpansionIdealityMultiplier(getIdealExpansionLevel(depth), getTurbine().expansionLevels.get(depth));
|
|
||||||
}
|
|
||||||
getTurbine().rotorEfficiency /= getTurbine().noBladeSets;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double getExpansionIdealityMultiplier(double ideal, double actual) {
|
public static double getExpansionIdealityMultiplier(double ideal, double actual) {
|
||||||
if (ideal <= 0D || actual <= 0D) {
|
if (ideal <= 0D || actual <= 0D) {
|
||||||
return 0D;
|
return 0D;
|
||||||
|
@ -928,6 +882,22 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
return Math.pow(getTurbine().idealTotalExpansionLevel, (depth + 0.5D) / getTurbine().getFlowLength());
|
return Math.pow(getTurbine().idealTotalExpansionLevel, (depth + 0.5D) / getTurbine().getFlowLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setRotorEfficiency() {
|
||||||
|
getTurbine().rotorEfficiency = 0D;
|
||||||
|
|
||||||
|
for (int depth = 0; depth < getTurbine().getFlowLength(); depth++) {
|
||||||
|
if (getTurbine().rawBladeEfficiencies.get(depth) <= 0D) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
getTurbine().rotorEfficiency += getTurbine().rawBladeEfficiencies.get(depth) * getExpansionIdealityMultiplier(getIdealExpansionLevel(depth), getTurbine().expansionLevels.get(depth));
|
||||||
|
}
|
||||||
|
getTurbine().rotorEfficiency /= getTurbine().noBladeSets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInputRatePowerBonus() {
|
||||||
|
getTurbine().powerBonus = 1D + turbine_power_bonus_multiplier * Math.min(getTurbine().recipeInputRate, getMaxRecipeRateMultiplier()) / (2D * turbine_mb_per_blade * NCMath.sq(getMaximumInteriorLength()));
|
||||||
|
}
|
||||||
|
|
||||||
public DoubleList getIdealExpansionLevels() {
|
public DoubleList getIdealExpansionLevels() {
|
||||||
DoubleList levels = new DoubleArrayList();
|
DoubleList levels = new DoubleArrayList();
|
||||||
if (getTurbine().flowDir == null) {
|
if (getTurbine().flowDir == null) {
|
||||||
|
@ -939,10 +909,6 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
return levels;
|
return levels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInputRatePowerBonus() {
|
|
||||||
getTurbine().powerBonus = 1D + turbine_power_bonus_multiplier * Math.min(getTurbine().recipeInputRate, getMaxRecipeRateMultiplier()) / (2D * turbine_mb_per_blade * NCMath.sq(getMaximumInteriorLength()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Client
|
// Client
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1115,14 +1081,6 @@ public class TurbineLogic extends MultiblockLogic<Turbine, TurbineLogic, ITurbin
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public TurbineFormPacket getFormPacket() {
|
|
||||||
return new TurbineFormPacket(getTurbine().controller.getTilePos(), getTurbine().bladePosArray, getTurbine().renderPosArray, getTurbine().bladeAngleArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onFormPacket(TurbineFormPacket message) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public ContainerTurbineController getContainer(EntityPlayer player) {
|
public ContainerTurbineController getContainer(EntityPlayer player) {
|
||||||
return new ContainerTurbineController(player, (TileTurbineController) getTurbine().controller);
|
return new ContainerTurbineController(player, (TileTurbineController) getTurbine().controller);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.*;
|
import net.minecraft.util.*;
|
||||||
import net.minecraft.util.math.*;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.*;
|
import net.minecraft.world.*;
|
||||||
|
|
||||||
public class BlockTurbineController extends BlockTurbinePart {
|
public class BlockTurbineController extends BlockTurbinePart {
|
||||||
|
@ -83,19 +83,6 @@ public class BlockTurbineController extends BlockTurbinePart {
|
||||||
return rightClickOnPart(world, pos, player, hand, facing, true);
|
return rightClickOnPart(world, pos, player, hand, facing, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
|
||||||
/*TileEntity tile = source.getTileEntity(pos);
|
|
||||||
if (tile instanceof TileTurbineController) {
|
|
||||||
TileTurbineController controller = (TileTurbineController) tile;
|
|
||||||
if (!controller.isRenderer || !controller.isMultiblockAssembled()) {
|
|
||||||
return FULL_BLOCK_AABB;
|
|
||||||
}
|
|
||||||
return new AxisAlignedBB(controller.getMultiblock().getMinimumCoord().subtract(pos), controller.getMultiblock().getMaximumCoord().subtract(pos));
|
|
||||||
}*/
|
|
||||||
return FULL_BLOCK_AABB;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) {
|
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, @Nullable EnumFacing side) {
|
||||||
return side != null;
|
return side != null;
|
||||||
|
|
|
@ -3,7 +3,7 @@ package nc.multiblock.turbine.block;
|
||||||
import static nc.block.property.BlockProperties.AXIS_ALL;
|
import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
|
|
||||||
import nc.multiblock.turbine.tile.TileTurbineInlet;
|
import nc.multiblock.turbine.tile.TileTurbineInlet;
|
||||||
import nc.util.PosHelper;
|
import nc.util.BlockPosHelper;
|
||||||
import net.minecraft.block.state.*;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -26,7 +26,7 @@ public class BlockTurbineInlet extends BlockTurbinePart {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta) {
|
public IBlockState getStateFromMeta(int meta) {
|
||||||
return getDefaultState().withProperty(AXIS_ALL, PosHelper.AXES[meta]);
|
return getDefaultState().withProperty(AXIS_ALL, BlockPosHelper.AXES[meta]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,7 +3,7 @@ package nc.multiblock.turbine.block;
|
||||||
import static nc.block.property.BlockProperties.AXIS_ALL;
|
import static nc.block.property.BlockProperties.AXIS_ALL;
|
||||||
|
|
||||||
import nc.multiblock.turbine.tile.TileTurbineOutlet;
|
import nc.multiblock.turbine.tile.TileTurbineOutlet;
|
||||||
import nc.util.PosHelper;
|
import nc.util.BlockPosHelper;
|
||||||
import net.minecraft.block.state.*;
|
import net.minecraft.block.state.*;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
@ -26,7 +26,7 @@ public class BlockTurbineOutlet extends BlockTurbinePart {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getStateFromMeta(int meta) {
|
public IBlockState getStateFromMeta(int meta) {
|
||||||
return getDefaultState().withProperty(AXIS_ALL, PosHelper.AXES[meta]);
|
return getDefaultState().withProperty(AXIS_ALL, BlockPosHelper.AXES[meta]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -57,21 +57,10 @@ public class TileTurbineController extends TileTurbinePart implements ITurbineCo
|
||||||
if (!isRenderer || !isMultiblockAssembled()) {
|
if (!isRenderer || !isMultiblockAssembled()) {
|
||||||
return Block.FULL_BLOCK_AABB.offset(pos);
|
return Block.FULL_BLOCK_AABB.offset(pos);
|
||||||
}
|
}
|
||||||
return new AxisAlignedBB(getMultiblock().getMinimumCoord(), getMultiblock().getMaximumCoord());
|
return new AxisAlignedBB(pos.add(getMultiblock().getMinX() - pos.getX(), getMultiblock().getMinY() - pos.getY(), getMultiblock().getMinZ() - pos.getZ()), pos.add(getMultiblock().getMaxX() - pos.getX(), getMultiblock().getMaxY() - pos.getY(), getMultiblock().getMaxZ() - pos.getZ()));
|
||||||
// return INFINITE_EXTENT_AABB;
|
// return INFINITE_EXTENT_AABB;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public double getMaxRenderDistanceSquared() {
|
|
||||||
return super.getMaxRenderDistanceSquared();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasFastRenderer() {
|
|
||||||
return super.hasFastRenderer();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockNeighborChanged(IBlockState state, World world, BlockPos pos, BlockPos fromPos) {
|
public void onBlockNeighborChanged(IBlockState state, World world, BlockPos pos, BlockPos fromPos) {
|
||||||
super.onBlockNeighborChanged(state, world, pos, fromPos);
|
super.onBlockNeighborChanged(state, world, pos, fromPos);
|
||||||
|
|
|
@ -65,7 +65,6 @@ public class PacketHandler {
|
||||||
instance.registerMessage(HeatExchangerUpdatePacket.Handler.class, HeatExchangerUpdatePacket.class, nextID(), Side.CLIENT);
|
instance.registerMessage(HeatExchangerUpdatePacket.Handler.class, HeatExchangerUpdatePacket.class, nextID(), Side.CLIENT);
|
||||||
instance.registerMessage(TurbineUpdatePacket.Handler.class, TurbineUpdatePacket.class, nextID(), Side.CLIENT);
|
instance.registerMessage(TurbineUpdatePacket.Handler.class, TurbineUpdatePacket.class, nextID(), Side.CLIENT);
|
||||||
instance.registerMessage(TurbineRenderPacket.Handler.class, TurbineRenderPacket.class, nextID(), Side.CLIENT);
|
instance.registerMessage(TurbineRenderPacket.Handler.class, TurbineRenderPacket.class, nextID(), Side.CLIENT);
|
||||||
instance.registerMessage(TurbineFormPacket.Handler.class, TurbineFormPacket.class, nextID(), Side.CLIENT);
|
|
||||||
instance.registerMessage(QuantumComputerQubitRenderPacket.Handler.class, QuantumComputerQubitRenderPacket.class, nextID(), Side.CLIENT);
|
instance.registerMessage(QuantumComputerQubitRenderPacket.Handler.class, QuantumComputerQubitRenderPacket.class, nextID(), Side.CLIENT);
|
||||||
|
|
||||||
instance.registerMessage(PlayerRadsUpdatePacket.Handler.class, PlayerRadsUpdatePacket.class, nextID(), Side.CLIENT);
|
instance.registerMessage(PlayerRadsUpdatePacket.Handler.class, PlayerRadsUpdatePacket.class, nextID(), Side.CLIENT);
|
||||||
|
|
|
@ -18,43 +18,43 @@ public class NCRecipes {
|
||||||
|
|
||||||
private static boolean initialized = false;
|
private static boolean initialized = false;
|
||||||
|
|
||||||
public static ManufactoryRecipes manufactory;
|
public static ProcessorRecipeHandler manufactory;
|
||||||
public static SeparatorRecipes separator;
|
public static ProcessorRecipeHandler separator;
|
||||||
public static DecayHastenerRecipes decay_hastener;
|
public static ProcessorRecipeHandler decay_hastener;
|
||||||
public static FuelReprocessorRecipes fuel_reprocessor;
|
public static ProcessorRecipeHandler fuel_reprocessor;
|
||||||
public static AlloyFurnaceRecipes alloy_furnace;
|
public static ProcessorRecipeHandler alloy_furnace;
|
||||||
public static InfuserRecipes infuser;
|
public static ProcessorRecipeHandler infuser;
|
||||||
public static MelterRecipes melter;
|
public static ProcessorRecipeHandler melter;
|
||||||
public static SupercoolerRecipes supercooler;
|
public static ProcessorRecipeHandler supercooler;
|
||||||
public static ElectrolyzerRecipes electrolyzer;
|
public static ProcessorRecipeHandler electrolyzer;
|
||||||
public static AssemblerRecipes assembler;
|
public static ProcessorRecipeHandler assembler;
|
||||||
public static IngotFormerRecipes ingot_former;
|
public static ProcessorRecipeHandler ingot_former;
|
||||||
public static PressurizerRecipes pressurizer;
|
public static ProcessorRecipeHandler pressurizer;
|
||||||
public static ChemicalReactorRecipes chemical_reactor;
|
public static ProcessorRecipeHandler chemical_reactor;
|
||||||
public static SaltMixerRecipes salt_mixer;
|
public static ProcessorRecipeHandler salt_mixer;
|
||||||
public static CrystallizerRecipes crystallizer;
|
public static ProcessorRecipeHandler crystallizer;
|
||||||
public static EnricherRecipes enricher;
|
public static ProcessorRecipeHandler enricher;
|
||||||
public static ExtractorRecipes extractor;
|
public static ProcessorRecipeHandler extractor;
|
||||||
public static CentrifugeRecipes centrifuge;
|
public static ProcessorRecipeHandler centrifuge;
|
||||||
public static RockCrusherRecipes rock_crusher;
|
public static ProcessorRecipeHandler rock_crusher;
|
||||||
public static CollectorRecipes collector;
|
public static ProcessorRecipeHandler collector;
|
||||||
public static DecayGeneratorRecipes decay_generator;
|
public static ProcessorRecipeHandler decay_generator;
|
||||||
public static FissionModeratorRecipes fission_moderator;
|
public static ProcessorRecipeHandler fission_moderator;
|
||||||
public static FissionReflectorRecipes fission_reflector;
|
public static ProcessorRecipeHandler fission_reflector;
|
||||||
public static FissionIrradiatorRecipes fission_irradiator;
|
public static ProcessorRecipeHandler fission_irradiator;
|
||||||
public static PebbleFissionRecipes pebble_fission;
|
public static ProcessorRecipeHandler pebble_fission;
|
||||||
public static SolidFissionRecipes solid_fission;
|
public static ProcessorRecipeHandler solid_fission;
|
||||||
public static FissionHeatingRecipes fission_heating;
|
public static ProcessorRecipeHandler fission_heating;
|
||||||
public static SaltFissionRecipes salt_fission;
|
public static ProcessorRecipeHandler salt_fission;
|
||||||
public static FusionRecipes fusion;
|
public static ProcessorRecipeHandler fusion;
|
||||||
public static CoolantHeaterRecipes coolant_heater;
|
public static ProcessorRecipeHandler coolant_heater;
|
||||||
public static FissionEmergencyCoolingRecipes fission_emergency_cooling;
|
public static ProcessorRecipeHandler fission_emergency_cooling;
|
||||||
public static HeatExchangerRecipes heat_exchanger;
|
public static ProcessorRecipeHandler heat_exchanger;
|
||||||
public static CondenserRecipes condenser;
|
public static ProcessorRecipeHandler condenser;
|
||||||
public static TurbineRecipes turbine;
|
public static ProcessorRecipeHandler turbine;
|
||||||
public static RadiationScrubberRecipes radiation_scrubber;
|
public static ProcessorRecipeHandler radiation_scrubber;
|
||||||
public static RadiationBlockMutation radiation_block_mutation;
|
public static ProcessorRecipeHandler radiation_block_mutation;
|
||||||
public static RadiationBlockPurification radiation_block_purification;
|
public static ProcessorRecipeHandler radiation_block_purification;
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.LOW)
|
@SubscribeEvent(priority = EventPriority.LOW)
|
||||||
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
package nc.render.tile;
|
package nc.render.tile;
|
||||||
|
|
||||||
import javax.vecmath.Vector3f;
|
import nc.init.NCBlocks;
|
||||||
|
|
||||||
import nc.config.NCConfig;
|
|
||||||
import nc.multiblock.turbine.*;
|
import nc.multiblock.turbine.*;
|
||||||
import nc.multiblock.turbine.Turbine.PlaneDir;
|
|
||||||
import nc.multiblock.turbine.TurbineRotorBladeUtil.TurbinePartDir;
|
import nc.multiblock.turbine.TurbineRotorBladeUtil.TurbinePartDir;
|
||||||
import nc.multiblock.turbine.tile.TileTurbineController;
|
import nc.multiblock.turbine.tile.*;
|
||||||
import nc.util.NCMath;
|
import nc.util.NCMath;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -39,20 +36,34 @@ public class RenderTurbineRotor extends TileEntitySpecialRenderer<TileTurbineCon
|
||||||
}
|
}
|
||||||
|
|
||||||
Turbine turbine = controller.getMultiblock();
|
Turbine turbine = controller.getMultiblock();
|
||||||
if (turbine == null) return;
|
if (turbine == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
EnumFacing dir = turbine.flowDir;
|
EnumFacing dir = turbine.flowDir;
|
||||||
if (dir == null) return;
|
if (dir == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IBlockState shaftState = NCBlocks.turbine_rotor_shaft.getDefaultState().withProperty(TurbineRotorBladeUtil.DIR, turbine.getShaftDir());
|
||||||
|
|
||||||
|
boolean[] isStatorSet = new boolean[turbine.getFlowLength()];
|
||||||
|
for (TileTurbineRotorStator stator : turbine.getPartMap(TileTurbineRotorStator.class).values()) {
|
||||||
|
isStatorSet[dir.getAxisDirection() == AxisDirection.POSITIVE ? turbine.getFlowLength() - stator.getDepth() - 1 : stator.getDepth()] = true;
|
||||||
|
}
|
||||||
|
|
||||||
BlockRendererDispatcher renderer = MC.getBlockRendererDispatcher();
|
BlockRendererDispatcher renderer = MC.getBlockRendererDispatcher();
|
||||||
|
// brightness =
|
||||||
// brightness = tile.getWorld().getLightBrightness(turbine.getMinimumInteriorPlaneCoord(dir, turbine.getFlowLength()/2, bladeLength - 1,bladeLength - 1));
|
// tile.getWorld().getLightBrightness(turbine.getMinimumInteriorPlaneCoord(dir,
|
||||||
|
// turbine.getFlowLength()/2, turbine.bladeLength - 1,
|
||||||
|
// turbine.bladeLength - 1));
|
||||||
brightness[count] = controller.getWorld().getLightBrightness(turbine.getExtremeInteriorCoord(NCMath.getBit(count, 0) == 1, NCMath.getBit(count, 1) == 1, NCMath.getBit(count, 2) == 1));
|
brightness[count] = controller.getWorld().getLightBrightness(turbine.getExtremeInteriorCoord(NCMath.getBit(count, 0) == 1, NCMath.getBit(count, 1) == 1, NCMath.getBit(count, 2) == 1));
|
||||||
count++;
|
count++;
|
||||||
count %= 8;
|
count %= 8;
|
||||||
float bright = (brightness[0] + brightness[1] + brightness[2] + brightness[3] + brightness[4] + brightness[5] + brightness[6] + brightness[7]) / 8F;
|
float bright = (brightness[0] + brightness[1] + brightness[2] + brightness[3] + brightness[4] + brightness[5] + brightness[6] + brightness[7]) / 8F;
|
||||||
|
|
||||||
MC.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
MC.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||||
|
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 0, 15 * 16);
|
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 0, 15 * 16);
|
||||||
|
|
||||||
|
@ -62,104 +73,77 @@ public class RenderTurbineRotor extends TileEntitySpecialRenderer<TileTurbineCon
|
||||||
double rY = -turbine.getMaxY() + pos.getY() + (dir.getAxis() == Axis.Y ? 0D : r);
|
double rY = -turbine.getMaxY() + pos.getY() + (dir.getAxis() == Axis.Y ? 0D : r);
|
||||||
double rZ = -turbine.getMaxZ() + pos.getZ() + (dir.getAxis() == Axis.Z ? 0D : r);
|
double rZ = -turbine.getMaxZ() + pos.getZ() + (dir.getAxis() == Axis.Z ? 0D : r);
|
||||||
|
|
||||||
int flowLength = turbine.getFlowLength(), bladeLength = turbine.bladeLength, shaftWidth = turbine.shaftWidth;
|
double scale = r / Math.sqrt(r * r + NCMath.sq(turbine.shaftWidth) / 4D);
|
||||||
double scale = r / Math.sqrt(r * r + NCMath.sq(shaftWidth) / 4D);
|
|
||||||
|
|
||||||
// Enter rotated frame
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translate(posX - rX, posY - rY, posZ - rZ);
|
GlStateManager.translate(posX - rX, posY - rY, posZ - rZ);
|
||||||
GlStateManager.scale(dir.getAxis() == Axis.X ? 1D : scale, dir.getAxis() == Axis.Y ? 1D : scale, dir.getAxis() == Axis.Z ? 1D : scale);
|
GlStateManager.scale(dir.getAxis() == Axis.X ? 1D : scale, dir.getAxis() == Axis.Y ? 1D : scale, dir.getAxis() == Axis.Z ? 1D : scale);
|
||||||
{
|
|
||||||
long systemTime = Minecraft.getSystemTime();
|
long systemTime = Minecraft.getSystemTime();
|
||||||
if (!MC.isGamePaused()) turbine.rotorAngle = (turbine.rotorAngle + (systemTime - turbine.prevRenderTime) * turbine.angVel) % 360F;
|
if (!MC.isGamePaused()) {
|
||||||
|
turbine.rotorAngle = (turbine.rotorAngle + (systemTime - turbine.prevRenderTime) * turbine.angVel) % 360F;
|
||||||
|
}
|
||||||
turbine.prevRenderTime = systemTime;
|
turbine.prevRenderTime = systemTime;
|
||||||
GlStateManager.rotate(turbine.rotorAngle, dir.getAxis() == Axis.X ? 1F : 0F, dir.getAxis() == Axis.Y ? 1F : 0F, dir.getAxis() == Axis.Z ? 1F : 0F);
|
GlStateManager.rotate(turbine.rotorAngle, dir.getAxis() == Axis.X ? 1F : 0F, dir.getAxis() == Axis.Y ? 1F : 0F, dir.getAxis() == Axis.Z ? 1F : 0F);
|
||||||
}
|
|
||||||
GlStateManager.translate(-pos.getX() + rX, -pos.getY() + rY, -pos.getZ() + rZ);
|
GlStateManager.translate(-pos.getX() + rX, -pos.getY() + rY, -pos.getZ() + rZ);
|
||||||
|
|
||||||
if (turbine.rotorStateArray == null) return;
|
for (TileTurbineRotorShaft shaft : turbine.getPartMap(TileTurbineRotorShaft.class).values()) {
|
||||||
IBlockState shaftState = turbine.rotorStateArray[turbine.bladePosArray.length];
|
if (!shaft.render || isStatorSet[shaft.depth]) {
|
||||||
|
continue;
|
||||||
for (int depth : turbine.bladeDepths) {
|
}
|
||||||
renderRotor(turbine, renderer, bright, shaftState, dir, flowLength, bladeLength, shaftWidth, NCConfig.turbine_render_blade_width, depth);
|
GlStateManager.pushMatrix();
|
||||||
|
pos = shaft.getPos();
|
||||||
|
GlStateManager.translate(pos.getX(), pos.getY(), pos.getZ());
|
||||||
|
GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
||||||
|
renderer.renderBlockBrightness(shaftState, bright);
|
||||||
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Leave rotated frame
|
for (TileTurbineRotorBlade blade : turbine.getPartMap(TileTurbineRotorBlade.class).values()) {
|
||||||
|
GlStateManager.pushMatrix();
|
||||||
|
pos = blade.bladePos();
|
||||||
|
TurbinePartDir bladeDir = blade.getDir();
|
||||||
|
GlStateManager.translate(pos.getX(), pos.getY(), pos.getZ());
|
||||||
|
GlStateManager.translate(0.5D, 0.5D, 0.5D);
|
||||||
|
GlStateManager.rotate(blade.getRenderRotation() * (dir.getAxisDirection() == AxisDirection.POSITIVE ^ dir.getAxis() == Axis.X ? 1F : -1F), bladeDir == TurbinePartDir.X ? 1F : 0F, bladeDir == TurbinePartDir.Y ? 1F : 0F, bladeDir == TurbinePartDir.Z ? 1F : 0F);
|
||||||
|
GlStateManager.translate(-0.5D, -0.5D, -0.5D);
|
||||||
|
GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
||||||
|
renderer.renderBlockBrightness(blade.getRenderState(), bright);
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
}
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
// Enter stationary frame
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
pos = controller.getPos();
|
pos = controller.getPos();
|
||||||
GlStateManager.translate(posX - rX, posY - rY, posZ - rZ);
|
GlStateManager.translate(posX - rX, posY - rY, posZ - rZ);
|
||||||
GlStateManager.scale(dir.getAxis() == Axis.X ? 1D : scale, dir.getAxis() == Axis.Y ? 1D : scale, dir.getAxis() == Axis.Z ? 1D : scale);
|
GlStateManager.scale(dir.getAxis() == Axis.X ? 1D : scale, dir.getAxis() == Axis.Y ? 1D : scale, dir.getAxis() == Axis.Z ? 1D : scale);
|
||||||
GlStateManager.translate(-pos.getX() + rX, -pos.getY() + rY, -pos.getZ() + rZ);
|
GlStateManager.translate(-pos.getX() + rX, -pos.getY() + rY, -pos.getZ() + rZ);
|
||||||
|
|
||||||
for (int depth : turbine.statorDepths) {
|
for (TileTurbineRotorShaft shaft : turbine.getPartMap(TileTurbineRotorShaft.class).values()) {
|
||||||
renderRotor(turbine, renderer, bright, shaftState, dir, flowLength, bladeLength, shaftWidth, NCConfig.turbine_render_blade_width, depth);
|
if (!shaft.render || !isStatorSet[shaft.depth]) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderRotor(Turbine turbine, BlockRendererDispatcher renderer, float bright, IBlockState shaftState, EnumFacing flowDir, int flowLength, int bladeLength, int shaftWidth, double bladeWidth, int depth) {
|
|
||||||
double depthScale = Math.pow(NCConfig.turbine_render_rotor_expansion, (double) (1 + depth - flowLength) / (double) flowLength);
|
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
pos = shaft.getPos();
|
||||||
Vector3f renderPos = turbine.renderPosArray[4 * flowLength * shaftWidth + depth];
|
GlStateManager.translate(pos.getX(), pos.getY(), pos.getZ());
|
||||||
GlStateManager.translate(renderPos.x + 0.5D, renderPos.y + 0.5D, renderPos.z + 0.5D);
|
|
||||||
GlStateManager.scale(flowDir.getAxis() == Axis.X ? 1D : depthScale, flowDir.getAxis() == Axis.Y ? 1D : depthScale, flowDir.getAxis() == Axis.Z ? 1D : depthScale);
|
|
||||||
GlStateManager.translate(-renderPos.x - 0.5D, -renderPos.y - 0.5D, -renderPos.z - 0.5D);
|
|
||||||
|
|
||||||
renderShaft(turbine, renderer, bright, shaftState, flowDir, flowLength, shaftWidth, depth);
|
|
||||||
for (int j : new int[] { 0, flowLength, 2 * flowLength, 3 * flowLength }) {
|
|
||||||
renderBlades(turbine, renderer, bright, flowDir, flowLength, bladeLength, shaftWidth, bladeWidth, j, depth);
|
|
||||||
}
|
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void renderShaft(Turbine turbine, BlockRendererDispatcher renderer, float bright, IBlockState shaftState, EnumFacing flowDir, int flowLength, int shaftWidth, int depth) {
|
|
||||||
GlStateManager.pushMatrix();
|
|
||||||
|
|
||||||
Vector3f renderPos = turbine.renderPosArray[4 * flowLength * shaftWidth + depth];
|
|
||||||
GlStateManager.translate(renderPos.x + 0.5D, renderPos.y + 0.5D, renderPos.z + 0.5D);
|
|
||||||
GlStateManager.scale(flowDir.getAxis() == Axis.X ? 1D : shaftWidth, flowDir.getAxis() == Axis.Y ? 1D : shaftWidth, flowDir.getAxis() == Axis.Z ? 1D : shaftWidth);
|
|
||||||
|
|
||||||
GlStateManager.translate(-0.5D, -0.5D, -0.5D);
|
|
||||||
GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
||||||
|
|
||||||
renderer.renderBlockBrightness(shaftState, bright);
|
renderer.renderBlockBrightness(shaftState, bright);
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderBlades(Turbine turbine, BlockRendererDispatcher renderer, float bright, EnumFacing flowDir, int flowLength, int bladeLength, int shaftWidth, double bladeWidth, int jMult, int depth) {
|
for (TileTurbineRotorStator stator : turbine.getPartMap(TileTurbineRotorStator.class).values()) {
|
||||||
Vector3f renderPos;
|
|
||||||
IBlockState rotorState;
|
|
||||||
TurbinePartDir bladeDir;
|
|
||||||
PlaneDir planeDir;
|
|
||||||
|
|
||||||
int i = jMult + depth;
|
|
||||||
|
|
||||||
for (int w = 0; w < shaftWidth; w++) {
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
pos = stator.bladePos();
|
||||||
renderPos = turbine.renderPosArray[w + i * shaftWidth];
|
TurbinePartDir bladeDir = stator.getDir();
|
||||||
rotorState = turbine.rotorStateArray[i];
|
GlStateManager.translate(pos.getX(), pos.getY(), pos.getZ());
|
||||||
bladeDir = rotorState.getValue(TurbineRotorBladeUtil.DIR);
|
GlStateManager.translate(0.5D, 0.5D, 0.5D);
|
||||||
planeDir = (i < flowLength || i >= 3 * flowLength) ? PlaneDir.V : PlaneDir.U;
|
GlStateManager.rotate(stator.getRenderRotation() * (dir.getAxisDirection() == AxisDirection.POSITIVE ^ dir.getAxis() == Axis.X ? 1F : -1F), bladeDir == TurbinePartDir.X ? 1F : 0F, bladeDir == TurbinePartDir.Y ? 1F : 0F, bladeDir == TurbinePartDir.Z ? 1F : 0F);
|
||||||
|
|
||||||
GlStateManager.translate(renderPos.x + 0.5D, renderPos.y + 0.5D, renderPos.z + 0.5D);
|
|
||||||
GlStateManager.scale(flowDir.getAxis() == Axis.X ? 1D : (turbine.getBladeDir(planeDir) == TurbinePartDir.X ? bladeLength : bladeWidth), flowDir.getAxis() == Axis.Y ? 1D : (turbine.getBladeDir(planeDir) == TurbinePartDir.Y ? bladeLength : bladeWidth), flowDir.getAxis() == Axis.Z ? 1D : (turbine.getBladeDir(planeDir) == TurbinePartDir.Z ? bladeLength : bladeWidth));
|
|
||||||
GlStateManager.rotate(turbine.bladeAngleArray[i] * (flowDir.getAxisDirection() == AxisDirection.POSITIVE ^ flowDir.getAxis() == Axis.X ? 1F : -1F), bladeDir == TurbinePartDir.X ? 1F : 0F, bladeDir == TurbinePartDir.Y ? 1F : 0F, bladeDir == TurbinePartDir.Z ? 1F : 0F);
|
|
||||||
|
|
||||||
GlStateManager.translate(-0.5D, -0.5D, -0.5D);
|
GlStateManager.translate(-0.5D, -0.5D, -0.5D);
|
||||||
GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
||||||
|
renderer.renderBlockBrightness(stator.getRenderState(), bright);
|
||||||
renderer.renderBlockBrightness(rotorState, bright);
|
GlStateManager.popMatrix();
|
||||||
|
}
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
|
||||||
public class NCTabs {
|
public class NCTabs {
|
||||||
|
|
||||||
private static final CreativeTabs NUCLEARCRAFT = single_creative_tab ? new TabNuclearCraft() : CreativeTabs.MISC;
|
public static final CreativeTabs NUCLEARCRAFT = single_creative_tab ? new TabNuclearCraft() : CreativeTabs.MISC;
|
||||||
|
|
||||||
public static final CreativeTabs MATERIAL = single_creative_tab ? NUCLEARCRAFT : new TabMaterial();
|
public static final CreativeTabs MATERIAL = single_creative_tab ? NUCLEARCRAFT : new TabMaterial();
|
||||||
public static final CreativeTabs MACHINE = single_creative_tab ? NUCLEARCRAFT : new TabMachine();
|
public static final CreativeTabs MACHINE = single_creative_tab ? NUCLEARCRAFT : new TabMachine();
|
||||||
|
|
|
@ -6,7 +6,6 @@ import javax.annotation.*;
|
||||||
|
|
||||||
import gregtech.api.capability.*;
|
import gregtech.api.capability.*;
|
||||||
import ic2.api.energy.tile.IEnergySink;
|
import ic2.api.energy.tile.IEnergySink;
|
||||||
import mcjty.lib.api.power.IBigPower;
|
|
||||||
import nc.ModCheck;
|
import nc.ModCheck;
|
||||||
import nc.tile.ITile;
|
import nc.tile.ITile;
|
||||||
import nc.tile.internal.energy.*;
|
import nc.tile.internal.energy.*;
|
||||||
|
@ -20,8 +19,7 @@ import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraftforge.energy.*;
|
import net.minecraftforge.energy.*;
|
||||||
import net.minecraftforge.fml.common.Optional;
|
import net.minecraftforge.fml.common.Optional;
|
||||||
|
|
||||||
@Optional.Interface(iface = "mcjty.lib.api.power.IBigPower", modid = "theoneprobe")
|
public interface ITileEnergy extends ITile {
|
||||||
public interface ITileEnergy extends ITile, IBigPower {
|
|
||||||
|
|
||||||
// Storage
|
// Storage
|
||||||
|
|
||||||
|
@ -245,18 +243,4 @@ public interface ITileEnergy extends ITile, IBigPower {
|
||||||
public default boolean hasEnergySideCapability(@Nullable EnumFacing side) {
|
public default boolean hasEnergySideCapability(@Nullable EnumFacing side) {
|
||||||
return side == null || getEnergyConnection(side).canConnect();
|
return side == null || getEnergyConnection(side).canConnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TOP
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "theoneprobe")
|
|
||||||
public default long getStoredPower() {
|
|
||||||
return getEnergyStorage().getEnergyStoredLong();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "theoneprobe")
|
|
||||||
public default long getCapacity() {
|
|
||||||
return getEnergyStorage().getMaxEnergyStoredLong();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,293 @@
|
||||||
|
package nc.util;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
|
public class BlockPosHelper {
|
||||||
|
|
||||||
|
public static final BlockPos DEFAULT_NON = new BlockPos(0, -1, 0);
|
||||||
|
|
||||||
|
private final BlockPos pos;
|
||||||
|
|
||||||
|
public BlockPosHelper(BlockPos pos) {
|
||||||
|
this.pos = pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPosHelper(int x, int y, int z) {
|
||||||
|
pos = new BlockPos(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] offsets(EnumFacing[] sides, int dist) {
|
||||||
|
BlockPos[] posList = new BlockPos[sides.length];
|
||||||
|
for (int i = 0; i < sides.length; i++) {
|
||||||
|
posList[i] = pos.offset(sides[i], dist);
|
||||||
|
}
|
||||||
|
return posList;
|
||||||
|
}
|
||||||
|
|
||||||
|
private BlockPos position(int x, int y, int z) {
|
||||||
|
return new BlockPos(pos.getX() + x, pos.getY() + y, pos.getZ() + z);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Adjacents
|
||||||
|
|
||||||
|
public BlockPos[] adjacents(int dist) {
|
||||||
|
return offsets(EnumFacing.VALUES, dist);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] adjacents() {
|
||||||
|
return adjacents(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Horizontals
|
||||||
|
|
||||||
|
private static final EnumFacing[] HORIZONTALS_X = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.UP, EnumFacing.NORTH, EnumFacing.SOUTH};
|
||||||
|
private static final EnumFacing[] HORIZONTALS_Y = EnumFacing.HORIZONTALS;
|
||||||
|
private static final EnumFacing[] HORIZONTALS_Z = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.UP, EnumFacing.WEST, EnumFacing.EAST};
|
||||||
|
|
||||||
|
public BlockPos[] horizontalsX(int dist) {
|
||||||
|
return offsets(HORIZONTALS_X, dist);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] horizontalsX() {
|
||||||
|
return horizontalsX(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] horizontalsY(int dist) {
|
||||||
|
return offsets(HORIZONTALS_Y, dist);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] horizontalsY() {
|
||||||
|
return horizontalsY(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] horizontalsZ(int dist) {
|
||||||
|
return offsets(HORIZONTALS_Z, dist);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] horizontalsZ() {
|
||||||
|
return horizontalsZ(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos[]> horizontalsList(int dist) {
|
||||||
|
return Lists.newArrayList(horizontalsX(dist), horizontalsY(dist), horizontalsZ(dist));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos[]> horizontalsList() {
|
||||||
|
return horizontalsList(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumFacing[] getHorizontals(EnumFacing dir) {
|
||||||
|
switch (dir) {
|
||||||
|
case DOWN:
|
||||||
|
return HORIZONTALS_Y;
|
||||||
|
case UP:
|
||||||
|
return HORIZONTALS_Y;
|
||||||
|
case NORTH:
|
||||||
|
return HORIZONTALS_Z;
|
||||||
|
case SOUTH:
|
||||||
|
return HORIZONTALS_Z;
|
||||||
|
case WEST:
|
||||||
|
return HORIZONTALS_X;
|
||||||
|
case EAST:
|
||||||
|
return HORIZONTALS_X;
|
||||||
|
default:
|
||||||
|
return HORIZONTALS_Y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Axials
|
||||||
|
|
||||||
|
private static final EnumFacing[] AXIALS_X = new EnumFacing[] {EnumFacing.WEST, EnumFacing.EAST};
|
||||||
|
private static final EnumFacing[] AXIALS_Y = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.UP};
|
||||||
|
private static final EnumFacing[] AXIALS_Z = new EnumFacing[] {EnumFacing.NORTH, EnumFacing.SOUTH};
|
||||||
|
|
||||||
|
public BlockPos[] axialsX(int dist) {
|
||||||
|
return offsets(AXIALS_X, dist);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] axialsX() {
|
||||||
|
return axialsX(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] axialsY(int dist) {
|
||||||
|
return offsets(AXIALS_Y, dist);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] axialsY() {
|
||||||
|
return axialsY(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] axialsZ(int dist) {
|
||||||
|
return offsets(AXIALS_Z, dist);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] axialsZ() {
|
||||||
|
return axialsZ(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos[]> axialsList(int dist) {
|
||||||
|
return Lists.newArrayList(axialsX(dist), axialsY(dist), axialsZ(dist));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos[]> axialsList() {
|
||||||
|
return axialsList(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<EnumFacing[]> axialDirsList() {
|
||||||
|
return Lists.newArrayList(AXIALS_X, AXIALS_Y, AXIALS_Z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static EnumFacing[] getAxialDirs(EnumFacing dir) {
|
||||||
|
switch (dir) {
|
||||||
|
case DOWN:
|
||||||
|
return AXIALS_Y;
|
||||||
|
case UP:
|
||||||
|
return AXIALS_Y;
|
||||||
|
case NORTH:
|
||||||
|
return AXIALS_Z;
|
||||||
|
case SOUTH:
|
||||||
|
return AXIALS_Z;
|
||||||
|
case WEST:
|
||||||
|
return AXIALS_X;
|
||||||
|
case EAST:
|
||||||
|
return AXIALS_X;
|
||||||
|
default:
|
||||||
|
return AXIALS_Y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Vertices
|
||||||
|
|
||||||
|
private static final EnumFacing[] VERTEX_DNW = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.WEST};
|
||||||
|
private static final EnumFacing[] VERTEX_DNE = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.EAST};
|
||||||
|
private static final EnumFacing[] VERTEX_DSW = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.SOUTH, EnumFacing.WEST};
|
||||||
|
private static final EnumFacing[] VERTEX_DSE = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.SOUTH, EnumFacing.EAST};
|
||||||
|
private static final EnumFacing[] VERTEX_UNW = new EnumFacing[] {EnumFacing.UP, EnumFacing.NORTH, EnumFacing.WEST};
|
||||||
|
private static final EnumFacing[] VERTEX_UNE = new EnumFacing[] {EnumFacing.UP, EnumFacing.NORTH, EnumFacing.EAST};
|
||||||
|
private static final EnumFacing[] VERTEX_USW = new EnumFacing[] {EnumFacing.UP, EnumFacing.SOUTH, EnumFacing.WEST};
|
||||||
|
private static final EnumFacing[] VERTEX_USE = new EnumFacing[] {EnumFacing.UP, EnumFacing.SOUTH, EnumFacing.EAST};
|
||||||
|
|
||||||
|
public BlockPos[] vertexDNW() {
|
||||||
|
return offsets(VERTEX_DNW, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] vertexDNE() {
|
||||||
|
return offsets(VERTEX_DNE, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] vertexDSW() {
|
||||||
|
return offsets(VERTEX_DSW, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] vertexDSE() {
|
||||||
|
return offsets(VERTEX_DSE, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] vertexUNW() {
|
||||||
|
return offsets(VERTEX_UNW, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] vertexUNE() {
|
||||||
|
return offsets(VERTEX_UNE, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] vertexUSW() {
|
||||||
|
return offsets(VERTEX_USW, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockPos[] vertexUSE() {
|
||||||
|
return offsets(VERTEX_USE, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos[]> vertexList() {
|
||||||
|
return Lists.newArrayList(vertexDNW(), vertexDNE(), vertexDSW(), vertexDSE(), vertexUNW(), vertexUNE(), vertexUSW(), vertexUSE());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<EnumFacing[]> vertexDirsList() {
|
||||||
|
return Lists.newArrayList(VERTEX_DNW, VERTEX_DNE, VERTEX_DSW, VERTEX_DSE, VERTEX_UNW, VERTEX_UNE, VERTEX_USW, VERTEX_USE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ring
|
||||||
|
|
||||||
|
public List<BlockPos> squareRing(int radius, int height) {
|
||||||
|
List<BlockPos> posList = new ArrayList<>();
|
||||||
|
for (int i = -radius; i < radius; i++) {
|
||||||
|
posList.add(position(i, height, radius));
|
||||||
|
posList.add(position(-i, height, -radius));
|
||||||
|
posList.add(position(radius, height, -i));
|
||||||
|
posList.add(position(-radius, height, i));
|
||||||
|
}
|
||||||
|
return posList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos> cutoffRing(int radius, int height) {
|
||||||
|
List<BlockPos> posList = new ArrayList<>();
|
||||||
|
for (int i = -radius + 1; i < radius; i++) {
|
||||||
|
posList.add(position(i, height, radius));
|
||||||
|
posList.add(position(-i, height, -radius));
|
||||||
|
posList.add(position(radius, height, -i));
|
||||||
|
posList.add(position(-radius, height, i));
|
||||||
|
}
|
||||||
|
return posList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos> squareTube(int radius, int height) {
|
||||||
|
return CollectionHelper.concatenate(squareRing(radius - 1, height), squareRing(radius, height - 1), squareRing(radius, height + 1), squareRing(radius + 1, height));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos> squareTubeDiagonals(int radius, int height) {
|
||||||
|
return CollectionHelper.concatenate(squareRing(radius - 1, height - 1), squareRing(radius - 1, height + 1), squareRing(radius + 1, height - 1), squareRing(radius + 1, height + 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos> squareTubeNotHidden(int radius, int height) {
|
||||||
|
return CollectionHelper.concatenate(cutoffRing(radius - 1, height), squareRing(radius, height - 1), squareRing(radius, height + 1), squareRing(radius + 1, height));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Other
|
||||||
|
|
||||||
|
public static final EnumFacing.Axis[] AXES = new EnumFacing.Axis[] {EnumFacing.Axis.X, EnumFacing.Axis.Y, EnumFacing.Axis.Z};
|
||||||
|
|
||||||
|
public static int getAxisIndex(@Nonnull EnumFacing.Axis axis) {
|
||||||
|
return axis == EnumFacing.Axis.X ? 0 : axis == EnumFacing.Axis.Y ? 1 : 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final EnumFacing.AxisDirection[] AXISDIRS = new EnumFacing.AxisDirection[] {EnumFacing.AxisDirection.POSITIVE, EnumFacing.AxisDirection.NEGATIVE};
|
||||||
|
|
||||||
|
public static int getAxisDirIndex(@Nonnull EnumFacing.AxisDirection dir) {
|
||||||
|
return dir == EnumFacing.AxisDirection.POSITIVE ? 0 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BlockPos> cuboid(int x1, int y1, int z1, int x2, int y2, int z2) {
|
||||||
|
List<BlockPos> posList = new ArrayList<>();
|
||||||
|
for (BlockPos pos : BlockPos.getAllInBox(position(x1, y1, z1), position(x2, y2, z2))) {
|
||||||
|
posList.add(pos);
|
||||||
|
}
|
||||||
|
return posList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String stringPos(BlockPos pos) {
|
||||||
|
return "[" + pos.getX() + ", " + pos.getY() + ", " + pos.getZ() + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlockPos[] getOtherPlaneCorners(BlockPos pos1, BlockPos pos2) {
|
||||||
|
if (pos1.getX() == pos2.getX()) {
|
||||||
|
return new BlockPos[] {new BlockPos(pos1.getX(), pos2.getY(), pos1.getZ()), new BlockPos(pos1.getX(), pos1.getY(), pos2.getZ())};
|
||||||
|
}
|
||||||
|
else if (pos1.getY() == pos2.getY()) {
|
||||||
|
return new BlockPos[] {new BlockPos(pos1.getX(), pos1.getY(), pos2.getZ()), new BlockPos(pos2.getX(), pos1.getY(), pos1.getZ())};
|
||||||
|
}
|
||||||
|
else if (pos1.getZ() == pos2.getZ()) {
|
||||||
|
return new BlockPos[] {new BlockPos(pos2.getX(), pos1.getY(), pos1.getZ()), new BlockPos(pos1.getX(), pos2.getY(), pos1.getZ())};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return new BlockPos[] {pos1, pos2};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,98 +0,0 @@
|
||||||
package nc.util;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.util.math.BlockPos;
|
|
||||||
|
|
||||||
public class PosHelper {
|
|
||||||
|
|
||||||
public static final BlockPos DEFAULT_NON = new BlockPos(0, -1, 0);
|
|
||||||
|
|
||||||
// Horizontals
|
|
||||||
|
|
||||||
private static final EnumFacing[] HORIZONTALS_X = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.UP, EnumFacing.NORTH, EnumFacing.SOUTH};
|
|
||||||
private static final EnumFacing[] HORIZONTALS_Y = EnumFacing.HORIZONTALS;
|
|
||||||
private static final EnumFacing[] HORIZONTALS_Z = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.UP, EnumFacing.WEST, EnumFacing.EAST};
|
|
||||||
|
|
||||||
public static EnumFacing[] getHorizontals(EnumFacing dir) {
|
|
||||||
switch (dir) {
|
|
||||||
case DOWN:
|
|
||||||
return HORIZONTALS_Y;
|
|
||||||
case UP:
|
|
||||||
return HORIZONTALS_Y;
|
|
||||||
case NORTH:
|
|
||||||
return HORIZONTALS_Z;
|
|
||||||
case SOUTH:
|
|
||||||
return HORIZONTALS_Z;
|
|
||||||
case WEST:
|
|
||||||
return HORIZONTALS_X;
|
|
||||||
case EAST:
|
|
||||||
return HORIZONTALS_X;
|
|
||||||
default:
|
|
||||||
return HORIZONTALS_Y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Axials
|
|
||||||
|
|
||||||
private static final EnumFacing[] AXIALS_X = new EnumFacing[] {EnumFacing.WEST, EnumFacing.EAST};
|
|
||||||
private static final EnumFacing[] AXIALS_Y = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.UP};
|
|
||||||
private static final EnumFacing[] AXIALS_Z = new EnumFacing[] {EnumFacing.NORTH, EnumFacing.SOUTH};
|
|
||||||
|
|
||||||
public static List<EnumFacing[]> axialDirsList() {
|
|
||||||
return Lists.newArrayList(AXIALS_X, AXIALS_Y, AXIALS_Z);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EnumFacing[] getAxialDirs(EnumFacing dir) {
|
|
||||||
switch (dir) {
|
|
||||||
case DOWN:
|
|
||||||
return AXIALS_Y;
|
|
||||||
case UP:
|
|
||||||
return AXIALS_Y;
|
|
||||||
case NORTH:
|
|
||||||
return AXIALS_Z;
|
|
||||||
case SOUTH:
|
|
||||||
return AXIALS_Z;
|
|
||||||
case WEST:
|
|
||||||
return AXIALS_X;
|
|
||||||
case EAST:
|
|
||||||
return AXIALS_X;
|
|
||||||
default:
|
|
||||||
return AXIALS_Y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vertices
|
|
||||||
|
|
||||||
private static final EnumFacing[] VERTEX_DNW = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.WEST};
|
|
||||||
private static final EnumFacing[] VERTEX_DNE = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.NORTH, EnumFacing.EAST};
|
|
||||||
private static final EnumFacing[] VERTEX_DSW = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.SOUTH, EnumFacing.WEST};
|
|
||||||
private static final EnumFacing[] VERTEX_DSE = new EnumFacing[] {EnumFacing.DOWN, EnumFacing.SOUTH, EnumFacing.EAST};
|
|
||||||
private static final EnumFacing[] VERTEX_UNW = new EnumFacing[] {EnumFacing.UP, EnumFacing.NORTH, EnumFacing.WEST};
|
|
||||||
private static final EnumFacing[] VERTEX_UNE = new EnumFacing[] {EnumFacing.UP, EnumFacing.NORTH, EnumFacing.EAST};
|
|
||||||
private static final EnumFacing[] VERTEX_USW = new EnumFacing[] {EnumFacing.UP, EnumFacing.SOUTH, EnumFacing.WEST};
|
|
||||||
private static final EnumFacing[] VERTEX_USE = new EnumFacing[] {EnumFacing.UP, EnumFacing.SOUTH, EnumFacing.EAST};
|
|
||||||
|
|
||||||
public static List<EnumFacing[]> vertexDirsList() {
|
|
||||||
return Lists.newArrayList(VERTEX_DNW, VERTEX_DNE, VERTEX_DSW, VERTEX_DSE, VERTEX_UNW, VERTEX_UNE, VERTEX_USW, VERTEX_USE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Axes
|
|
||||||
|
|
||||||
public static final EnumFacing.Axis[] AXES = new EnumFacing.Axis[] {EnumFacing.Axis.X, EnumFacing.Axis.Y, EnumFacing.Axis.Z};
|
|
||||||
|
|
||||||
public static int getAxisIndex(@Nonnull EnumFacing.Axis axis) {
|
|
||||||
return axis == EnumFacing.Axis.X ? 0 : axis == EnumFacing.Axis.Y ? 1 : 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final EnumFacing.AxisDirection[] AXISDIRS = new EnumFacing.AxisDirection[] {EnumFacing.AxisDirection.POSITIVE, EnumFacing.AxisDirection.NEGATIVE};
|
|
||||||
|
|
||||||
public static int getAxisDirIndex(@Nonnull EnumFacing.AxisDirection dir) {
|
|
||||||
return dir == EnumFacing.AxisDirection.POSITIVE ? 0 : 1;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +1,9 @@
|
||||||
{
|
{
|
||||||
"forge_marker": 1,
|
"forge_marker": 1,
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"model": "cube_column",
|
"model": "cube_all",
|
||||||
"textures": {
|
"textures": {
|
||||||
"end": "nuclearcraft:blocks/turbine/rotor_shaft_end",
|
"all": "nuclearcraft:blocks/turbine/rotor_shaft"
|
||||||
"side": "nuclearcraft:blocks/turbine/rotor_shaft_side"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"variants": {
|
"variants": {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
"gui": {
|
"gui": {
|
||||||
"rotation": [ 30, 225, 0 ],
|
"rotation": [ 30, 45, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale": [ 0.625, 0.625, 0.625 ]
|
"scale": [ 0.625, 0.625, 0.625 ]
|
||||||
},
|
},
|
||||||
|
@ -16,24 +16,24 @@
|
||||||
"scale": [ 0.25, 0.25, 0.25 ]
|
"scale": [ 0.25, 0.25, 0.25 ]
|
||||||
},
|
},
|
||||||
"fixed": {
|
"fixed": {
|
||||||
"rotation": [ 0, 0, 0 ],
|
"rotation": [ 0, 180, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale":[ 0.5, 0.5, 0.5 ]
|
"scale": [ 1, 1, 1 ]
|
||||||
},
|
},
|
||||||
"thirdperson_righthand": {
|
"head": {
|
||||||
"rotation": [ 75, 45, 0 ],
|
"rotation": [ 0, 180, 0 ],
|
||||||
"translation": [ 0, 2.5, 0],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale": [ 0.375, 0.375, 0.375 ]
|
"scale": [ 1, 1, 1 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 0, 45, 0 ],
|
"rotation": [ 0, 315, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 2.5, 0 ],
|
||||||
"scale": [ 0.40, 0.40, 0.40 ]
|
"scale": [ 0.4, 0.4, 0.4 ]
|
||||||
},
|
},
|
||||||
"firstperson_lefthand": {
|
"thirdperson_righthand": {
|
||||||
"rotation": [ 0, 225, 0 ],
|
"rotation": [ 75, 315, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 2.5, 0 ],
|
||||||
"scale": [ 0.40, 0.40, 0.40 ]
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
"gui": {
|
"gui": {
|
||||||
"rotation": [ 30, 225, 0 ],
|
"rotation": [ 30, 45, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale": [ 0.625, 0.625, 0.625 ]
|
"scale": [ 0.625, 0.625, 0.625 ]
|
||||||
},
|
},
|
||||||
|
@ -16,24 +16,24 @@
|
||||||
"scale": [ 0.25, 0.25, 0.25 ]
|
"scale": [ 0.25, 0.25, 0.25 ]
|
||||||
},
|
},
|
||||||
"fixed": {
|
"fixed": {
|
||||||
"rotation": [ 0, 0, 0 ],
|
"rotation": [ 0, 180, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale":[ 0.5, 0.5, 0.5 ]
|
"scale": [ 1, 1, 1 ]
|
||||||
},
|
},
|
||||||
"thirdperson_righthand": {
|
"head": {
|
||||||
"rotation": [ 75, 45, 0 ],
|
"rotation": [ 0, 180, 0 ],
|
||||||
"translation": [ 0, 2.5, 0],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale": [ 0.375, 0.375, 0.375 ]
|
"scale": [ 1, 1, 1 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 0, 45, 0 ],
|
"rotation": [ 0, 315, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 2.5, 0 ],
|
||||||
"scale": [ 0.40, 0.40, 0.40 ]
|
"scale": [ 0.4, 0.4, 0.4 ]
|
||||||
},
|
},
|
||||||
"firstperson_lefthand": {
|
"thirdperson_righthand": {
|
||||||
"rotation": [ 0, 225, 0 ],
|
"rotation": [ 75, 315, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 2.5, 0 ],
|
||||||
"scale": [ 0.40, 0.40, 0.40 ]
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
{
|
{
|
||||||
"parent": "block/cube",
|
"parent": "block/cube",
|
||||||
|
"display": {
|
||||||
|
"firstperson_righthand": {
|
||||||
|
"rotation": [ 0, 135, 0 ],
|
||||||
|
"translation": [ 0, 0, 0 ],
|
||||||
|
"scale": [ 0.40, 0.40, 0.40 ]
|
||||||
|
}
|
||||||
|
},
|
||||||
"textures": {
|
"textures": {
|
||||||
"particle": "#top",
|
"particle": "#top",
|
||||||
"down": "#bottom",
|
"down": "#bottom",
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
"gui": {
|
"gui": {
|
||||||
"rotation": [ 30, 225, 0 ],
|
"rotation": [ 30, 45, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale": [ 0.625, 0.625, 0.625 ]
|
"scale": [ 0.625, 0.625, 0.625 ]
|
||||||
},
|
},
|
||||||
|
@ -17,24 +17,24 @@
|
||||||
"scale": [ 0.25, 0.25, 0.25 ]
|
"scale": [ 0.25, 0.25, 0.25 ]
|
||||||
},
|
},
|
||||||
"fixed": {
|
"fixed": {
|
||||||
"rotation": [ 0, 0, 0 ],
|
"rotation": [ 0, 180, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale":[ 0.5, 0.5, 0.5 ]
|
"scale": [ 1, 1, 1 ]
|
||||||
},
|
},
|
||||||
"thirdperson_righthand": {
|
"head": {
|
||||||
"rotation": [ 75, 45, 0 ],
|
"rotation": [ 0, 180, 0 ],
|
||||||
"translation": [ 0, 2.5, 0],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale": [ 0.375, 0.375, 0.375 ]
|
"scale": [ 1, 1, 1 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 0, 45, 0 ],
|
"rotation": [ 0, 315, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 2.5, 0 ],
|
||||||
"scale": [ 0.40, 0.40, 0.40 ]
|
"scale": [ 0.4, 0.4, 0.4 ]
|
||||||
},
|
},
|
||||||
"firstperson_lefthand": {
|
"thirdperson_righthand": {
|
||||||
"rotation": [ 0, 225, 0 ],
|
"rotation": [ 75, 315, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 2.5, 0 ],
|
||||||
"scale": [ 0.40, 0.40, 0.40 ]
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
"gui": {
|
"gui": {
|
||||||
"rotation": [ 30, 225, 0 ],
|
"rotation": [ 30, 45, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale": [ 0.625, 0.625, 0.625 ]
|
"scale": [ 0.625, 0.625, 0.625 ]
|
||||||
},
|
},
|
||||||
|
@ -16,24 +16,24 @@
|
||||||
"scale": [ 0.25, 0.25, 0.25 ]
|
"scale": [ 0.25, 0.25, 0.25 ]
|
||||||
},
|
},
|
||||||
"fixed": {
|
"fixed": {
|
||||||
"rotation": [ 0, 0, 0 ],
|
"rotation": [ 0, 180, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale":[ 0.5, 0.5, 0.5 ]
|
"scale": [ 1, 1, 1 ]
|
||||||
},
|
},
|
||||||
"thirdperson_righthand": {
|
"head": {
|
||||||
"rotation": [ 75, 45, 0 ],
|
"rotation": [ 0, 180, 0 ],
|
||||||
"translation": [ 0, 2.5, 0],
|
"translation": [ 0, 0, 0 ],
|
||||||
"scale": [ 0.375, 0.375, 0.375 ]
|
"scale": [ 1, 1, 1 ]
|
||||||
},
|
},
|
||||||
"firstperson_righthand": {
|
"firstperson_righthand": {
|
||||||
"rotation": [ 0, 45, 0 ],
|
"rotation": [ 0, 315, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 2.5, 0 ],
|
||||||
"scale": [ 0.40, 0.40, 0.40 ]
|
"scale": [ 0.4, 0.4, 0.4 ]
|
||||||
},
|
},
|
||||||
"firstperson_lefthand": {
|
"thirdperson_righthand": {
|
||||||
"rotation": [ 0, 225, 0 ],
|
"rotation": [ 75, 315, 0 ],
|
||||||
"translation": [ 0, 0, 0 ],
|
"translation": [ 0, 2.5, 0 ],
|
||||||
"scale": [ 0.40, 0.40, 0.40 ]
|
"scale": [ 0.375, 0.375, 0.375 ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
|
|
|
@ -1,5 +1,12 @@
|
||||||
{
|
{
|
||||||
"parent": "block/cube",
|
"parent": "block/cube",
|
||||||
|
"display": {
|
||||||
|
"firstperson_righthand": {
|
||||||
|
"rotation": [ 0, 135, 0 ],
|
||||||
|
"translation": [ 0, 0, 0 ],
|
||||||
|
"scale": [ 0.40, 0.40, 0.40 ]
|
||||||
|
}
|
||||||
|
},
|
||||||
"textures": {
|
"textures": {
|
||||||
"particle": "#side",
|
"particle": "#side",
|
||||||
"down": "#top",
|
"down": "#top",
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 344 B |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"ctm": {
|
|
||||||
"ctm_version": 1,
|
|
||||||
"type":"ctm",
|
|
||||||
"layer":"SOLID",
|
|
||||||
"textures":[
|
|
||||||
"nuclearcraft:blocks/turbine/rotor_shaft_end_ctm"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
Loading…
Reference in New Issue