Updated ship scanner rendering to 1.12
This commit is contained in:
parent
193bfa8ae6
commit
0c9aa168c8
13 changed files with 95 additions and 20 deletions
|
@ -151,13 +151,6 @@ public abstract class TileEntityAbstractBase extends TileEntity implements IBloc
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
protected void updateMetadata(final int metadata) {
|
||||
if (getBlockMetadata() != metadata) {
|
||||
world.setBlockState(pos, getBlockType().getStateFromMeta(metadata), 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
if ( hasWorld()
|
||||
|
|
|
@ -3,6 +3,7 @@ package cr0s.warpdrive.block.building;
|
|||
import cr0s.warpdrive.Commons;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -13,6 +14,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.World;
|
||||
|
||||
import cr0s.warpdrive.block.BlockAbstractContainer;
|
||||
import cr0s.warpdrive.data.BlockProperties;
|
||||
import cr0s.warpdrive.data.EnumTier;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
@ -22,7 +24,30 @@ public class BlockShipScanner extends BlockAbstractContainer {
|
|||
public BlockShipScanner(final String registryName, final EnumTier enumTier) {
|
||||
super(registryName, enumTier, Material.IRON);
|
||||
|
||||
setTranslationKey("warpdrive.building.ship_scanner");
|
||||
setTranslationKey("warpdrive.building.ship_scanner." + enumTier.getName());
|
||||
|
||||
setDefaultState(getDefaultState()
|
||||
.withProperty(BlockProperties.ACTIVE, false)
|
||||
);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, BlockProperties.ACTIVE);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Nonnull
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(final int metadata) {
|
||||
return getDefaultState()
|
||||
.withProperty(BlockProperties.ACTIVE, (metadata & 0x8) != 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(final IBlockState blockState) {
|
||||
return blockState.getValue(BlockProperties.ACTIVE) ? 0x8 : 0;
|
||||
}
|
||||
|
||||
/* @TODO camouflage
|
||||
|
|
|
@ -9,6 +9,7 @@ import cr0s.warpdrive.block.movement.BlockShipCore;
|
|||
import cr0s.warpdrive.block.movement.TileEntityShipCore;
|
||||
import cr0s.warpdrive.config.Dictionary;
|
||||
import cr0s.warpdrive.config.WarpDriveConfig;
|
||||
import cr0s.warpdrive.data.BlockProperties;
|
||||
import cr0s.warpdrive.data.EnumShipScannerState;
|
||||
import cr0s.warpdrive.data.JumpBlock;
|
||||
import cr0s.warpdrive.data.JumpShip;
|
||||
|
@ -215,12 +216,10 @@ public class TileEntityShipScanner extends TileEntityAbstractMachine implements
|
|||
}
|
||||
enumShipScannerState = newState;
|
||||
if (blockCamouflage == null) {
|
||||
if (getBlockMetadata() == newState.getMetadata()) {
|
||||
updateMetadata(newState.getMetadata());
|
||||
}
|
||||
updateBlockState(null, BlockProperties.ACTIVE, newState != EnumShipScannerState.IDLE);
|
||||
} else {
|
||||
if (getBlockMetadata() != metadataCamouflage) {
|
||||
updateMetadata(metadataCamouflage);
|
||||
world.setBlockState(pos, getBlockType().getStateFromMeta(metadataCamouflage), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}]
|
||||
"inventory": [{}],
|
||||
"active": {
|
||||
"false": {},
|
||||
"true": {}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "minecraft:cube_bottom_top",
|
||||
"textures": {
|
||||
"side" : "warpdrive:blocks/building/ship_scanner-side",
|
||||
"bottom": "warpdrive:blocks/building/ship_scanner-bottom",
|
||||
"top" : "warpdrive:blocks/building/ship_scanner-top"
|
||||
},
|
||||
"transform": "forge:default-block"
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}],
|
||||
"active": {
|
||||
"false": {},
|
||||
"true": {}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "minecraft:cube_bottom_top",
|
||||
"textures": {
|
||||
"side" : "warpdrive:blocks/building/ship_scanner-side",
|
||||
"bottom": "warpdrive:blocks/building/ship_scanner-bottom",
|
||||
"top" : "warpdrive:blocks/building/ship_scanner-top"
|
||||
},
|
||||
"transform": "forge:default-block"
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}],
|
||||
"active": {
|
||||
"false": {},
|
||||
"true": {}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -247,7 +247,9 @@ tile.warpdrive.breathing.air_generator.advanced.name=Weiterentwickeltes Luftgene
|
|||
tile.warpdrive.breathing.air_generator.superior.name=Überlegenes Luftgenerator
|
||||
tile.warpdrive.breathing.air_shield.name=Energie-Luftschild
|
||||
|
||||
tile.warpdrive.building.ship_scanner.name=Raumschiff Scanner
|
||||
tile.warpdrive.building.ship_scanner.basic.name=Shuttle Raumschiff Scanner
|
||||
tile.warpdrive.building.ship_scanner.advanced.name=Corvette Raumschiff Scanner
|
||||
tile.warpdrive.building.ship_scanner.superior.name=Frigate Raumschiff Scanner
|
||||
|
||||
tile.warpdrive.collection.laser_tree_farm.name=Laser Baumfarm
|
||||
tile.warpdrive.collection.mining_laser.name=Bergbau Laser
|
||||
|
|
|
@ -244,7 +244,9 @@ tile.warpdrive.breathing.air_generator.advanced.name=Advanced Air Generator
|
|||
tile.warpdrive.breathing.air_generator.superior.name=Superior Air Generator
|
||||
tile.warpdrive.breathing.air_shield.name=Energy Air Shield
|
||||
|
||||
tile.warpdrive.building.ship_scanner.name=Ship Scanner
|
||||
tile.warpdrive.building.ship_scanner.basic.name=Shuttle Ship Scanner
|
||||
tile.warpdrive.building.ship_scanner.advanced.name=Corvette Ship Scanner
|
||||
tile.warpdrive.building.ship_scanner.superior.name=Frigate Ship Scanner
|
||||
|
||||
tile.warpdrive.collection.laser_tree_farm.name=Laser Tree Farm
|
||||
tile.warpdrive.collection.mining_laser.name=Mining Laser
|
||||
|
|
|
@ -245,7 +245,9 @@ tile.warpdrive.breathing.air_generator.advanced.name=Générateur d'air avancé
|
|||
tile.warpdrive.breathing.air_generator.superior.name=Générateur d'air supérieur
|
||||
tile.warpdrive.breathing.air_shield.name=Bouclier d'air d'énergie
|
||||
|
||||
tile.warpdrive.building.ship_scanner.name=Scanneur de vaisseau
|
||||
tile.warpdrive.building.ship_scanner.basic.name=Scanneur de vaisseau navette
|
||||
tile.warpdrive.building.ship_scanner.advanced.name=Scanneur de vaisseau corvette
|
||||
tile.warpdrive.building.ship_scanner.superior.name=Scanneur de vaisseau frégate
|
||||
|
||||
tile.warpdrive.collection.laser_tree_farm.name=Laser de plantation arboricole
|
||||
tile.warpdrive.collection.mining_laser.name=Laser d'exploitation minière
|
||||
|
|
|
@ -245,7 +245,9 @@ tile.warpdrive.breathing.air_generator.advanced.name=Geavanceerde zuurstofgenera
|
|||
tile.warpdrive.breathing.air_generator.superior.name=Superieure zuurstof
|
||||
tile.warpdrive.breathing.air_shield.name=Energie-gebaseerd Luchtschild
|
||||
|
||||
tile.warpdrive.building.ship_scanner.name=Schip Scanner
|
||||
tile.warpdrive.building.ship_scanner.basic.name=Shuttle Schip Scanner
|
||||
tile.warpdrive.building.ship_scanner.advanced.name=Corvette Schip Scanner
|
||||
tile.warpdrive.building.ship_scanner.superior.name=Frigate Schip Scanner
|
||||
|
||||
tile.warpdrive.collection.laser_tree_farm.name=Laser-boomboerderij
|
||||
tile.warpdrive.collection.mining_laser.name=Mijnlaser
|
||||
|
|
|
@ -245,7 +245,9 @@ tile.warpdrive.breathing.air_generator.advanced.name=Advanced Генератор
|
|||
tile.warpdrive.breathing.air_generator.superior.name=Superior Генератор воздуха
|
||||
tile.warpdrive.breathing.air_shield.name=Energy Air Shield
|
||||
|
||||
tile.warpdrive.building.ship_scanner.name=Сканер кораблей
|
||||
tile.warpdrive.building.ship_scanner.basic.name=Shuttle Сканер кораблей
|
||||
tile.warpdrive.building.ship_scanner.advanced.name=Corvette Сканер кораблей
|
||||
tile.warpdrive.building.ship_scanner.superior.name=Frigate Сканер кораблей
|
||||
|
||||
tile.warpdrive.collection.laser_tree_farm.name=Лазерная ферма деревьев
|
||||
tile.warpdrive.collection.mining_laser.name=Лазерная буровая установка
|
||||
|
|
|
@ -245,7 +245,9 @@ tile.warpdrive.breathing.air_generator.advanced.name=先进空气供给机
|
|||
tile.warpdrive.breathing.air_generator.superior.name=卓越空气供给机
|
||||
tile.warpdrive.breathing.air_shield.name=能量空气护罩
|
||||
|
||||
tile.warpdrive.building.ship_scanner.name=船体扫描仪
|
||||
tile.warpdrive.building.ship_scanner.basic.name=Shuttle 船体扫描仪
|
||||
tile.warpdrive.building.ship_scanner.advanced.name=Corvette 船体扫描仪
|
||||
tile.warpdrive.building.ship_scanner.superior.name=Frigate 船体扫描仪
|
||||
|
||||
tile.warpdrive.collection.laser_tree_farm.name=激光林场
|
||||
tile.warpdrive.collection.mining_laser.name=采掘激光
|
||||
|
|
|
@ -245,7 +245,9 @@ tile.warpdrive.breathing.air_generator.advanced.name=Advanced Air Generator /
|
|||
tile.warpdrive.breathing.air_generator.superior.name=Superior Air Generator / 空氣發生器
|
||||
tile.warpdrive.breathing.air_shield.name=Energy Air Shield
|
||||
|
||||
tile.warpdrive.building.ship_scanner.name=船隻掃描儀
|
||||
tile.warpdrive.building.ship_scanner.basic.name=Shuttle 船隻掃描儀
|
||||
tile.warpdrive.building.ship_scanner.advanced.name=Corvette 船隻掃描儀
|
||||
tile.warpdrive.building.ship_scanner.superior.name=Frigate 船隻掃描儀
|
||||
|
||||
tile.warpdrive.collection.laser_tree_farm.name=激光樹農場
|
||||
tile.warpdrive.collection.mining_laser.name=采礦鐳射
|
||||
|
|
Loading…
Reference in a new issue