Added enantiomorphic reactor frames

This commit is contained in:
Unknown 2018-07-24 15:08:09 +02:00 committed by unknown
parent ddf84e92a3
commit f1ac449045
22 changed files with 344 additions and 0 deletions

View file

@ -0,0 +1,66 @@
package cr0s.warpdrive.block.energy;
import cr0s.warpdrive.block.BlockAbstractBase;
import cr0s.warpdrive.config.WarpDriveConfig;
import cr0s.warpdrive.data.EnumTier;
import javax.annotation.Nonnull;
import net.minecraft.block.BlockGlass;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockEnanReactorFrameGlass extends BlockAbstractBase {
public BlockEnanReactorFrameGlass(final String registryName, final EnumTier enumTier) {
super(registryName, enumTier, Material.GLASS);
setHardness(WarpDriveConfig.HULL_HARDNESS[enumTier.getIndex()] / 3);
setResistance(WarpDriveConfig.HULL_BLAST_RESISTANCE[enumTier.getIndex()] / 3 * 5 / 3);
setUnlocalizedName("warpdrive.energy.enan_reactor_frame." + enumTier.getName());
}
@SuppressWarnings("deprecation")
@Override
public boolean isOpaqueCube(final IBlockState state) {
return false;
}
@SuppressWarnings("deprecation")
@Override
public boolean isTranslucent(final IBlockState state) {
return true;
}
@Nonnull
@SideOnly(Side.CLIENT)
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.TRANSLUCENT;
}
@SuppressWarnings("deprecation")
@SideOnly(Side.CLIENT)
@Override
public boolean shouldSideBeRendered(final IBlockState blockState, @Nonnull final IBlockAccess blockAccess, @Nonnull final BlockPos blockPos, final EnumFacing facing) {
final BlockPos blockPosSide = blockPos.offset(facing);
if (blockAccess.isAirBlock(blockPosSide)) {
return true;
}
final EnumFacing opposite = facing.getOpposite();
final IBlockState blockStateSide = blockAccess.getBlockState(blockPosSide);
if ( blockStateSide.getBlock() instanceof BlockGlass
|| blockStateSide.getBlock() instanceof BlockEnanReactorFrameGlass ) {
return blockState.getBlock().getMetaFromState(blockState)
!= blockStateSide.getBlock().getMetaFromState(blockStateSide);
}
return !blockAccess.isSideSolid(blockPosSide, opposite, false);
}
}

View file

@ -0,0 +1,72 @@
package cr0s.warpdrive.block.energy;
import cr0s.warpdrive.block.BlockAbstractBase;
import cr0s.warpdrive.block.ItemBlockAbstractBase;
import cr0s.warpdrive.config.WarpDriveConfig;
import cr0s.warpdrive.data.BlockProperties;
import cr0s.warpdrive.data.EnumFrameType;
import cr0s.warpdrive.data.EnumTier;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockEnanReactorFramePlain extends BlockAbstractBase {
public BlockEnanReactorFramePlain(final String registryName, final EnumTier enumTier) {
super(registryName, enumTier, Material.ROCK);
setHardness(WarpDriveConfig.HULL_HARDNESS[enumTier.getIndex()] / 3);
setResistance(WarpDriveConfig.HULL_BLAST_RESISTANCE[enumTier.getIndex()] / 3 * 5 / 3);
setUnlocalizedName("warpdrive.energy.enan_reactor_frame." + enumTier.getName());
setDefaultState(blockState.getBaseState().withProperty(BlockProperties.FRAME, EnumFrameType.PLAIN));
}
@SuppressWarnings("deprecation")
@Nonnull
@Override
public IBlockState getStateFromMeta(final int metadata) {
return this.getDefaultState().withProperty(BlockProperties.FRAME, EnumFrameType.byMetadata(metadata));
}
@Override
public int getMetaFromState(final IBlockState blockState) {
return blockState.getValue(BlockProperties.FRAME).getMetadata();
}
@Nonnull
@Override
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, BlockProperties.FRAME);
}
@Override
public int damageDropped(final IBlockState blockState) {
return blockState.getValue(BlockProperties.FRAME).getMetadata();
}
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(final CreativeTabs creativeTab, final NonNullList<ItemStack> list) {
for (final EnumFrameType enumFrameType : EnumFrameType.values()) {
list.add(new ItemStack(this, 1, enumFrameType.getMetadata()));
}
}
@Nullable
@Override
public ItemBlock createItemBlock() {
return new ItemBlockAbstractBase(this, true, true);
}
}

View file

@ -16,6 +16,7 @@ import cr0s.warpdrive.item.ItemTuningDriver;
import java.util.Map.Entry;
import net.minecraft.block.Block;
import net.minecraft.item.EnumDyeColor;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
@ -1105,6 +1106,45 @@ public class Recipes {
'l', ItemComponent.getItemStack(EnumComponentType.LENS),
'S', ItemComponent.getItemStack(EnumComponentType.SUPERCONDUCTOR) ));
// Enantiomorphic reactor frame is 1 Hull block, 4 Iron bars, gives 4
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(WarpDrive.blockEnanReactorFramePlain[1], 4, 0), false, " b ", "bhb", " b ",
'h', "blockHull1_plain",
'b', ironBars ));
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(WarpDrive.blockEnanReactorFramePlain[2], 4, 0), false, " b ", "bhb", " b ",
'h', "blockHull2_plain",
'b', ironBars ));
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(WarpDrive.blockEnanReactorFramePlain[3], 4, 0), false, " b ", "bhb", " b ",
'h', "blockHull3_plain",
'b', ironBars ));
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(WarpDrive.blockEnanReactorFrameGlass[1], 4, 0), false, " b ", "bhb", " b ",
'h', "blockHull1_glass",
'b', ironBars ));
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(WarpDrive.blockEnanReactorFrameGlass[2], 4, 0), false, " b ", "bhb", " b ",
'h', "blockHull2_glass",
'b', ironBars ));
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(WarpDrive.blockEnanReactorFrameGlass[3], 4, 0), false, " b ", "bhb", " b ",
'h', "blockHull3_glass",
'b', ironBars ));
// Enantiomorphic reactor frame symbols are from dies
for (final EnumTier enumTier : EnumTier.nonCreative()) {
final Block blockFrame = WarpDrive.blockEnanReactorFramePlain[enumTier.getIndex()];
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(blockFrame, 1, 1), false, " y ", " f ", "y y",
'f', blockFrame,
'y', "dyeYellow" ));
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(blockFrame, 1, 2), false, " y ", "yf ", " y ",
'f', blockFrame,
'y', "dyeYellow" ));
}
// Enantiomorphic reactor stabilization laser is 1 HV Machine casing, 2 Advanced hull, 1 Computer interface, 1 Power interface, 1 Lense, 1 Redstone, 2 glass pane
WarpDrive.register(new ShapedOreRecipe(groupMachines,
new ItemStack(WarpDrive.blockEnanReactorLaser), false, "ghr", "ldm", "ghc",

View file

@ -11,5 +11,6 @@ public class BlockProperties {
public static final PropertyDirection FACING = PropertyDirection.create("facing");
public static final UnlistedPropertyBlockState CAMOUFLAGE = new UnlistedPropertyBlockState("camouflage");
public static final PropertyEnum<EnumValidPowered> VALID_POWERED = PropertyEnum.create("valid_powered", EnumValidPowered.class);
public static final PropertyEnum<EnumFrameType> FRAME = PropertyEnum.create("frame", EnumFrameType.class);
}

View file

@ -0,0 +1,45 @@
package cr0s.warpdrive.data;
import javax.annotation.Nonnull;
import java.util.HashMap;
import net.minecraft.util.IStringSerializable;
public enum EnumFrameType implements IStringSerializable {
PLAIN ("plain" , 0),
RADIATION ("radiation", 1),
ELECTRIC ("electric" , 2),
;
private final String name;
private final int metadata;
// cached values
public static final int length;
private static final HashMap<Integer, EnumFrameType> ID_MAP = new HashMap<>();
static {
length = EnumFrameType.values().length;
for (final EnumFrameType enumFrameType : values()) {
ID_MAP.put(enumFrameType.getMetadata(), enumFrameType);
}
}
EnumFrameType(final String name, final int metadata) {
this.name = name;
this.metadata = metadata;
}
public static EnumFrameType byMetadata(final int metadata) {
return ID_MAP.get(metadata);
}
@Nonnull
@Override
public String getName() { return name; }
public int getMetadata() {
return metadata;
}
}

View file

@ -0,0 +1,14 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "warpdrive:blocks/energy/enan_reactor_frame_glass"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}

View file

@ -0,0 +1,19 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "warpdrive:blocks/energy/enan_reactor_frame_plain-plain"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}],
"frame": {
"plain" : { "textures": { "all": "warpdrive:blocks/energy/enan_reactor_frame_plain-plain" } },
"radiation" : { "textures": { "all": "warpdrive:blocks/energy/enan_reactor_frame_plain-radiation" } },
"electric" : { "textures": { "all": "warpdrive:blocks/energy/enan_reactor_frame_plain-electric" } }
}
}
}

View file

@ -0,0 +1,14 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "warpdrive:blocks/energy/enan_reactor_frame_glass"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}

View file

@ -0,0 +1,19 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "warpdrive:blocks/energy/enan_reactor_frame_plain-plain"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}],
"frame": {
"plain" : { "textures": { "all": "warpdrive:blocks/energy/enan_reactor_frame_plain-plain" } },
"radiation" : { "textures": { "all": "warpdrive:blocks/energy/enan_reactor_frame_plain-radiation" } },
"electric" : { "textures": { "all": "warpdrive:blocks/energy/enan_reactor_frame_plain-electric" } }
}
}
}

View file

@ -0,0 +1,14 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "warpdrive:blocks/energy/enan_reactor_frame_glass"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}

View file

@ -0,0 +1,19 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "warpdrive:blocks/energy/enan_reactor_frame_plain-plain"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}],
"frame": {
"plain" : { "textures": { "all": "warpdrive:blocks/energy/enan_reactor_frame_plain-plain" } },
"radiation" : { "textures": { "all": "warpdrive:blocks/energy/enan_reactor_frame_plain-radiation" } },
"electric" : { "textures": { "all": "warpdrive:blocks/energy/enan_reactor_frame_plain-electric" } }
}
}
}

View file

@ -274,6 +274,9 @@ tile.warpdrive.detection.siren_military.tooltip.usage=Lässt einen Alarm bis zu
tile.warpdrive.energy.enan_reactor_core.basic.name=Standard Enantiomorpher Reaktorkern
tile.warpdrive.energy.enan_reactor_core.advanced.name=Weiterentwickelte Enantiomorpher Reaktorkern
tile.warpdrive.energy.enan_reactor_core.superior.name=Überlegene Enantiomorpher Reaktorkern
tile.warpdrive.energy.enan_reactor_frame.basic.name=Standard Enantiomorpher Reaktorkern Frame
tile.warpdrive.energy.enan_reactor_frame.advanced.name=Weiterentwickelte Enantiomorpher Reaktorkern Frame
tile.warpdrive.energy.enan_reactor_frame.superior.name=Überlegene Enantiomorpher Reaktorkern Frame
tile.warpdrive.energy.enan_reactor_laser.name=Enantiomorper Reaktor Stabilisierungs Laser
tile.warpdrive.energy.capacitor.creative.name=Null-Punkt-Modul
tile.warpdrive.energy.capacitor.creative.tooltip=Kreativ Subraum Kondensator

View file

@ -271,6 +271,9 @@ tile.warpdrive.detection.siren_military.tooltip.usage=Sounds an alarm up to %1$d
tile.warpdrive.energy.enan_reactor_core.basic.name=Basic Enantiomorphic Reactor Core
tile.warpdrive.energy.enan_reactor_core.advanced.name=Advanced Enantiomorphic Reactor Core
tile.warpdrive.energy.enan_reactor_core.superior.name=Superior Enantiomorphic Reactor Core
tile.warpdrive.energy.enan_reactor_frame.basic.name=Basic Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_frame.advanced.name=Advanced Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_frame.superior.name=Superior Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_laser.name=Enantiomorphic Reactor Stabilization Laser
tile.warpdrive.energy.capacitor.creative.name=Zero-Point Module
tile.warpdrive.energy.capacitor.creative.tooltip=Creative Subspace Capacitor

View file

@ -272,6 +272,9 @@ tile.warpdrive.detection.siren_military.tooltip.usage=Emet une alarme audible à
tile.warpdrive.energy.enan_reactor_core.basic.name=Noyau de réacteur Enantiomorphic basique
tile.warpdrive.energy.enan_reactor_core.advanced.name=Noyau de réacteur Enantiomorphic avancé
tile.warpdrive.energy.enan_reactor_core.superior.name=Noyau de réacteur Enantiomorphic supérieur
tile.warpdrive.energy.enan_reactor_frame.basic.name=Structure de réacteur Enantiomorphic basique
tile.warpdrive.energy.enan_reactor_frame.advanced.name=Structure de réacteur Enantiomorphic avancé
tile.warpdrive.energy.enan_reactor_frame.superior.name=Structure de réacteur Enantiomorphic supérieur
tile.warpdrive.energy.enan_reactor_laser.name=Laser de stabilisation pour réacteur Enantiomorphic
tile.warpdrive.energy.capacitor.creative.name=Extracteur du potentiel de point zéro
tile.warpdrive.energy.capacitor.creative.tooltip=Condensateur subspatial creatif

View file

@ -272,6 +272,9 @@ tile.warpdrive.detection.siren_military.tooltip.usage=Je kan deze Sirene vanaf %
tile.warpdrive.energy.enan_reactor_core.basic.name=Normale Enantiomorfe Reactor Kern
tile.warpdrive.energy.enan_reactor_core.advanced.name=Geavanceerde Enantiomorfe Reactor Kern
tile.warpdrive.energy.enan_reactor_core.superior.name=Superieure Enantiomorfe Reactor Kern
tile.warpdrive.energy.enan_reactor_frame.basic.name=Normale Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_frame.advanced.name=Geavanceerde Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_frame.superior.name=Superieure Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_laser.name=Enantiomorfe Stabilizatielaser
tile.warpdrive.energy.capacitor.creative.name=Nullpunt Module
tile.warpdrive.energy.capacitor.creative.tooltip=Creative Subruimte Condensator

View file

@ -272,6 +272,9 @@ tile.warpdrive.detection.siren_military.tooltip.usage=Sounds an alarm up to %1$d
tile.warpdrive.energy.enan_reactor_core.basic.name=Basic Ядро энантиоморфного реактора
tile.warpdrive.energy.enan_reactor_core.advanced.name=Advanced Ядро энантиоморфного реактора
tile.warpdrive.energy.enan_reactor_core.superior.name=Superior Ядро энантиоморфного реактора
tile.warpdrive.energy.enan_reactor_frame.basic.name=Basic Frame энантиоморфного реактора
tile.warpdrive.energy.enan_reactor_frame.advanced.name=Advanced Frame энантиоморфного реактора
tile.warpdrive.energy.enan_reactor_frame.superior.name=Superior Frame энантиоморфного реактора
tile.warpdrive.energy.enan_reactor_laser.name=Лазер стабилизации энантиоморфного реактора
tile.warpdrive.energy.capacitor.creative.name=Zero-Point Module
tile.warpdrive.energy.capacitor.creative.tooltip=Creative Subspace Capacitor

View file

@ -272,6 +272,9 @@ tile.warpdrive.detection.siren_military.tooltip.usage=探测半径%1$d米
tile.warpdrive.energy.enan_reactor_core.basic.name=Basic 镜像体反应堆芯
tile.warpdrive.energy.enan_reactor_core.advanced.name=Advanced 镜像体反应堆芯
tile.warpdrive.energy.enan_reactor_core.superior.name=Superior 镜像体反应堆芯
tile.warpdrive.energy.enan_reactor_frame.basic.name=Basic Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_frame.advanced.name=Advanced Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_frame.superior.name=Superior Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_laser.name=镜像体反应堆稳定激光
tile.warpdrive.energy.capacitor.creative.name=零点模块
tile.warpdrive.energy.capacitor.creative.tooltip=创造子空间电容

View file

@ -272,6 +272,9 @@ tile.warpdrive.detection.siren_military.tooltip.usage=距離%1$d格範圍内有
tile.warpdrive.energy.enan_reactor_core.basic.name=Basic 核反應堆核
tile.warpdrive.energy.enan_reactor_core.advanced.name=Advanced 核反應堆核
tile.warpdrive.energy.enan_reactor_core.superior.name=Superior 核反應堆核
tile.warpdrive.energy.enan_reactor_frame.basic.name=Basic Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_frame.advanced.name=Advanced Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_frame.superior.name=Superior Enantiomorphic Reactor Frame
tile.warpdrive.energy.enan_reactor_laser.name=反應堆穩定激光
tile.warpdrive.energy.capacitor.creative.name=零點模具
tile.warpdrive.energy.capacitor.creative.tooltip=創造子空間電容

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB