Integrated hull creative tabs and omnipanels

This commit is contained in:
Unknown 2018-09-29 16:03:12 +02:00 committed by unknown
parent a0676b6b97
commit cd1e11e37d
14 changed files with 150 additions and 22 deletions

View file

@ -57,12 +57,31 @@ public abstract class BlockAbstractOmnipanel extends BlockAbstractBase {
return getMetaFromState(blockState);
}
@SuppressWarnings("deprecation")
@Override
public boolean isBlockNormalCube(final IBlockState blockState) {
// not supposed to be called, upstream should use isNormalCube(IBlockState, IBlockAccess, BlockPos) instead
// practically, Forge still use it in WorldEntitySpawner.isValidEmptySpawnBlock() calling BlockStateContainer$StateImplementation.isBlockNormalCube()
return false;
}
@Override
public boolean isNormalCube(final IBlockState blockState, final IBlockAccess blockAccess, final BlockPos blockPos) {
return false;
}
@SuppressWarnings("deprecation")
@Override
public boolean isOpaqueCube(final IBlockState blockState) {
return false;
}
@SuppressWarnings("deprecation")
@Override
public boolean isFullCube(final IBlockState blockState) {
return false;
}
@SuppressWarnings("deprecation")
@SideOnly(Side.CLIENT)
@Override

View file

@ -6,11 +6,15 @@ import cr0s.warpdrive.data.EnumTier;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockAirShield extends BlockAbstractOmnipanel {
@ -69,14 +73,15 @@ public class BlockAirShield extends BlockAbstractOmnipanel {
@SuppressWarnings("deprecation")
@Override
public boolean isOpaqueCube(final IBlockState blockState) {
public boolean isFullBlock(final IBlockState blockState) {
return false;
}
@SuppressWarnings("deprecation")
@Override
public boolean isFullBlock(final IBlockState blockState) {
return false;
public void addCollisionBoxToList(final IBlockState blockState, final @Nonnull World world, final @Nonnull BlockPos blockPos,
final @Nonnull AxisAlignedBB entityBox, final @Nonnull List<AxisAlignedBB> collidingBoxes,
final @Nullable Entity entity, final boolean isActualState) {
}
@SuppressWarnings("deprecation")

View file

@ -6,6 +6,7 @@ import cr0s.warpdrive.block.BlockAbstractOmnipanel;
import cr0s.warpdrive.config.WarpDriveConfig;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import cr0s.warpdrive.data.EnumTier;
import cr0s.warpdrive.data.Vector3;
@ -18,6 +19,7 @@ import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.NonNullList;
@ -31,7 +33,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockHullOmnipanel extends BlockAbstractOmnipanel implements IDamageReceiver {
public BlockHullOmnipanel(final String registryName, final EnumTier enumTier) {
super(null, enumTier, Material.GLASS);
super(registryName, enumTier, Material.GLASS);
setHardness(WarpDriveConfig.HULL_HARDNESS[enumTier.getIndex()]);
setResistance(WarpDriveConfig.HULL_BLAST_RESISTANCE[enumTier.getIndex()] * 5 / 3);
@ -41,8 +43,13 @@ public class BlockHullOmnipanel extends BlockAbstractOmnipanel implements IDamag
setDefaultState(getDefaultState()
.withProperty(BlockColored.COLOR, EnumDyeColor.WHITE)
);
setRegistryName(registryName);
WarpDrive.register(this, new ItemBlockHull(this));
setCreativeTab(WarpDrive.creativeTabHull);
}
@Nullable
@Override
public ItemBlock createItemBlock() {
return new ItemBlockHull(this);
}
@SuppressWarnings("deprecation")

View file

@ -1,6 +1,7 @@
package cr0s.warpdrive.client;
import cr0s.warpdrive.WarpDrive;
import cr0s.warpdrive.data.EnumTier;
import javax.annotation.Nonnull;
@ -20,9 +21,9 @@ public class CreativeTabHull extends CreativeTabAbstractBase {
@Override
@SideOnly(Side.CLIENT)
public ItemStack createIcon() {
final int tier = random.nextInt(3);
final int tier = 1 + random.nextInt(EnumTier.length - 1);
final int metadata = random.nextInt(16);
switch (random.nextInt(6)) {
switch (random.nextInt(7)) {
case 0: return new ItemStack(WarpDrive.blockHulls_plain[tier][0], 1, metadata);
case 1: return new ItemStack(WarpDrive.blockHulls_plain[tier][1], 1, metadata);
case 2: return new ItemStack(WarpDrive.blockHulls_glass[tier], 1, metadata);

View file

@ -0,0 +1,32 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "warpdrive:blocks/hull/glass-black"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}],
"color": {
"black" : { "textures": { "all": "warpdrive:blocks/hull/glass-black" } },
"blue" : { "textures": { "all": "warpdrive:blocks/hull/glass-blue" } },
"brown" : { "textures": { "all": "warpdrive:blocks/hull/glass-brown" } },
"cyan" : { "textures": { "all": "warpdrive:blocks/hull/glass-cyan" } },
"gray" : { "textures": { "all": "warpdrive:blocks/hull/glass-gray" } },
"green" : { "textures": { "all": "warpdrive:blocks/hull/glass-green" } },
"light_blue": { "textures": { "all": "warpdrive:blocks/hull/glass-light_blue" } },
"lime" : { "textures": { "all": "warpdrive:blocks/hull/glass-lime" } },
"magenta" : { "textures": { "all": "warpdrive:blocks/hull/glass-magenta" } },
"orange" : { "textures": { "all": "warpdrive:blocks/hull/glass-orange" } },
"pink" : { "textures": { "all": "warpdrive:blocks/hull/glass-pink" } },
"purple" : { "textures": { "all": "warpdrive:blocks/hull/glass-purple" } },
"red" : { "textures": { "all": "warpdrive:blocks/hull/glass-red" } },
"silver" : { "textures": { "all": "warpdrive:blocks/hull/glass-silver" } },
"white" : { "textures": { "all": "warpdrive:blocks/hull/glass-white" } },
"yellow" : { "textures": { "all": "warpdrive:blocks/hull/glass-yellow" } }
}
}
}

View file

@ -0,0 +1,32 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "warpdrive:blocks/hull/glass-black"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}],
"color": {
"black" : { "textures": { "all": "warpdrive:blocks/hull/glass-black" } },
"blue" : { "textures": { "all": "warpdrive:blocks/hull/glass-blue" } },
"brown" : { "textures": { "all": "warpdrive:blocks/hull/glass-brown" } },
"cyan" : { "textures": { "all": "warpdrive:blocks/hull/glass-cyan" } },
"gray" : { "textures": { "all": "warpdrive:blocks/hull/glass-gray" } },
"green" : { "textures": { "all": "warpdrive:blocks/hull/glass-green" } },
"light_blue": { "textures": { "all": "warpdrive:blocks/hull/glass-light_blue" } },
"lime" : { "textures": { "all": "warpdrive:blocks/hull/glass-lime" } },
"magenta" : { "textures": { "all": "warpdrive:blocks/hull/glass-magenta" } },
"orange" : { "textures": { "all": "warpdrive:blocks/hull/glass-orange" } },
"pink" : { "textures": { "all": "warpdrive:blocks/hull/glass-pink" } },
"purple" : { "textures": { "all": "warpdrive:blocks/hull/glass-purple" } },
"red" : { "textures": { "all": "warpdrive:blocks/hull/glass-red" } },
"silver" : { "textures": { "all": "warpdrive:blocks/hull/glass-silver" } },
"white" : { "textures": { "all": "warpdrive:blocks/hull/glass-white" } },
"yellow" : { "textures": { "all": "warpdrive:blocks/hull/glass-yellow" } }
}
}
}

View file

@ -0,0 +1,32 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "warpdrive:blocks/hull/glass-black"
},
"transform": "forge:default-block"
},
"variants": {
"normal": [{}],
"inventory": [{}],
"color": {
"black" : { "textures": { "all": "warpdrive:blocks/hull/glass-black" } },
"blue" : { "textures": { "all": "warpdrive:blocks/hull/glass-blue" } },
"brown" : { "textures": { "all": "warpdrive:blocks/hull/glass-brown" } },
"cyan" : { "textures": { "all": "warpdrive:blocks/hull/glass-cyan" } },
"gray" : { "textures": { "all": "warpdrive:blocks/hull/glass-gray" } },
"green" : { "textures": { "all": "warpdrive:blocks/hull/glass-green" } },
"light_blue": { "textures": { "all": "warpdrive:blocks/hull/glass-light_blue" } },
"lime" : { "textures": { "all": "warpdrive:blocks/hull/glass-lime" } },
"magenta" : { "textures": { "all": "warpdrive:blocks/hull/glass-magenta" } },
"orange" : { "textures": { "all": "warpdrive:blocks/hull/glass-orange" } },
"pink" : { "textures": { "all": "warpdrive:blocks/hull/glass-pink" } },
"purple" : { "textures": { "all": "warpdrive:blocks/hull/glass-purple" } },
"red" : { "textures": { "all": "warpdrive:blocks/hull/glass-red" } },
"silver" : { "textures": { "all": "warpdrive:blocks/hull/glass-silver" } },
"white" : { "textures": { "all": "warpdrive:blocks/hull/glass-white" } },
"yellow" : { "textures": { "all": "warpdrive:blocks/hull/glass-yellow" } }
}
}
}

View file

@ -14,8 +14,8 @@ death.attack.warpdrive.teleportation.player=%1$s wurde durch %2$s beim teleporti
death.attack.warpdrive.warm=%1$s verglühte
death.attack.warpdrive.warm.player=%1$s wurde von %2$s gebruzelt
itemGroup.warpdrive.hull=WarpDrive (hull)
itemGroup.warpdrive.main=WarpDrive (main)
itemGroup.warpdrive.hull=WarpDrive's rumpfs
itemGroup.warpdrive.main=WarpDrive
item.warpdrive.component.malformed.name=Fehlerhaftes Item
item.warpdrive.component.memory_crystal.name=Speicherkristall

View file

@ -14,8 +14,8 @@ death.attack.warpdrive.teleportation.player=%1$s was teleporkilled by %2$s
death.attack.warpdrive.warm=%1$s died from excessive temperature
death.attack.warpdrive.warm.player=%1$s was cooked by %2$s
itemGroup.warpdrive.hull=WarpDrive (hull)
itemGroup.warpdrive.main=WarpDrive (main)
itemGroup.warpdrive.hull=WarpDrive's hulls
itemGroup.warpdrive.main=WarpDrive
item.warpdrive.component.malformed.name=Bad Item
item.warpdrive.component.memory_crystal.name=Memory Crystal

View file

@ -14,8 +14,8 @@ death.attack.warpdrive.teleportation.player=%1$s a été tué par %2$s durant sa
death.attack.warpdrive.warm=%1$s est mort de brûlure sévère
death.attack.warpdrive.warm.player=%1$s a été cuit par %2$s
itemGroup.warpdrive.hull=WarpDrive (hull)
itemGroup.warpdrive.main=WarpDrive (main)
itemGroup.warpdrive.hull=WarpDrive: coques
itemGroup.warpdrive.main=WarpDrive
item.warpdrive.component.malformed.name=Item invalide
item.warpdrive.component.memory_crystal.name=Cristal de mémoire

View file

@ -14,8 +14,8 @@ death.attack.warpdrive.teleportation.player=%1$s was gedoos door teleportatie va
death.attack.warpdrive.warm=%1$s is doodgegaan door oververhitting
death.attack.warpdrive.warm.player=%1$s is gekookt door %2$s
itemGroup.warpdrive.hull=WarpDrive (hull)
itemGroup.warpdrive.main=WarpDrive (main)
itemGroup.warpdrive.hull=WarpDrive's hulls
itemGroup.warpdrive.main=WarpDrive
item.warpdrive.component.malformed.name=Verkeerd item
item.warpdrive.component.memory_crystal.name=Geheugen Kristal

View file

@ -14,8 +14,8 @@ death.attack.warpdrive.teleportation.player=%2$s убил %1$s телепорт
death.attack.warpdrive.warm=%1$s died from excessive temperature
death.attack.warpdrive.warm.player=%1$s was cooked by %2$s
itemGroup.warpdrive.hull=WarpDrive (hull)
itemGroup.warpdrive.main=WarpDrive (main)
itemGroup.warpdrive.hull=WarpDrive's hulls
itemGroup.warpdrive.main=WarpDrive
item.warpdrive.component.malformed.name=Поврежденный предмет
item.warpdrive.component.memory_crystal.name=Кристалл памяти

View file

@ -14,8 +14,8 @@ death.attack.warpdrive.teleportation.player=%2$s传送%1$s时“失误”了
death.attack.warpdrive.warm=%1$s死于高温
death.attack.warpdrive.warm.player=%1$s被%2$s煮熟了
itemGroup.warpdrive.hull=曲率驱动 (hull)
itemGroup.warpdrive.main=曲率驱动 (main)
itemGroup.warpdrive.hull=曲率驱动: hull
itemGroup.warpdrive.main=曲率驱动
item.warpdrive.component.malformed.name=畸变废品
item.warpdrive.component.memory_crystal.name=记忆水晶

View file

@ -14,8 +14,8 @@ death.attack.warpdrive.teleportation.player=%2$s 對 %1$s 使出了超時空傳
death.attack.warpdrive.warm=%1$s 在傳送中失去聯係了
death.attack.warpdrive.warm.player=%2$s 把 %1$s 變成了綠色香蕉
itemGroup.warpdrive.hull=WarpDrive (hull)
itemGroup.warpdrive.main=WarpDrive (main)
itemGroup.warpdrive.hull=WarpDrive's hulls
itemGroup.warpdrive.main=WarpDrive
item.warpdrive.component.malformed.name=不良道具[WD]
item.warpdrive.component.memory_crystal.name=記憶水晶