1.12.2: Added panzer glass. Added rebar concrete tile. Crafting table supports shift-click.
This commit is contained in:
parent
064c7684ee
commit
c76dd25555
34 changed files with 245 additions and 66 deletions
|
@ -158,10 +158,6 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
renderHoveredToolTip(mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
|
||||
{
|
||||
|
@ -251,19 +247,18 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
|
||||
{
|
||||
ItemStack stack = ItemStack.EMPTY;
|
||||
Slot slot = this.inventorySlots.get(index);
|
||||
if((slot == null) || (!slot.getHasStack())) return stack;
|
||||
if((slot == null) || (!slot.getHasStack())) return ItemStack.EMPTY;
|
||||
ItemStack slotstack = slot.getStack();
|
||||
stack = slotstack.copy();
|
||||
ItemStack stack = slotstack.copy();
|
||||
if(index == 0) {
|
||||
slotstack.getItem().onCreated(slotstack, this.world, playerIn);
|
||||
if(!this.mergeItemStack(slotstack, 10, 46, true)) return ItemStack.EMPTY;
|
||||
slot.onSlotChange(slotstack, stack);
|
||||
} else if (index >= 10 && (index < 37)) {
|
||||
if(!this.mergeItemStack(slotstack, 37, 46, false)) return ItemStack.EMPTY;
|
||||
} else if((index >= 37) && (index < 46)) {
|
||||
if(!this.mergeItemStack(slotstack, 10, 37, false)) return ItemStack.EMPTY;
|
||||
} else if(index >= 10 && (index < 46)) {
|
||||
if(!this.mergeItemStack(slotstack, 46, 54, false)) return ItemStack.EMPTY;
|
||||
} else if((index >= 46) && (index < 54)) {
|
||||
if(!this.mergeItemStack(slotstack, 10, 46, false)) return ItemStack.EMPTY;
|
||||
} else if(!this.mergeItemStack(slotstack, 10, 46, false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
@ -374,18 +369,6 @@ public class BlockDecorCraftingTable extends BlockDecorDirected
|
|||
public NBTTagCompound writeToNBT(NBTTagCompound compound)
|
||||
{ super.writeToNBT(compound); writenbt(compound); return compound; }
|
||||
|
||||
//@Override
|
||||
//public NBTTagCompound getUpdateTag()
|
||||
//{ return writeToNBT(new NBTTagCompound()); }
|
||||
|
||||
//@Override
|
||||
//public SPacketUpdateTileEntity getUpdatePacket()
|
||||
//{ return new SPacketUpdateTileEntity(getPos(), 0x1, getUpdateTag()); }
|
||||
//
|
||||
//@Override
|
||||
//public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
|
||||
//{ readFromNBT(pkt.getNbtCompound()); super.onDataPacket(net, pkt); }
|
||||
|
||||
// IWorldNamable ---------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* @file BlockDecorFull.java
|
||||
* @author Stefan Wilhelm (wile)
|
||||
* @copyright (C) 2019 Stefan Wilhelm
|
||||
* @license MIT (see https://opensource.org/licenses/MIT)
|
||||
*
|
||||
* Full block characteristics class.
|
||||
*/
|
||||
package wile.engineersdecor.blocks;
|
||||
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockFaceShape;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
public class BlockDecorGlassBlock extends BlockDecor
|
||||
{
|
||||
public BlockDecorGlassBlock(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound)
|
||||
{
|
||||
super(registryName, config, material, hardness, resistance, sound);
|
||||
setLightOpacity(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getRenderLayer()
|
||||
{ return BlockRenderLayer.TRANSLUCENT; }
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
||||
{
|
||||
final IBlockState neighbourState = world.getBlockState(pos.offset(side));
|
||||
return ((neighbourState==null) || (!(neighbourState.getBlock() instanceof BlockDecorGlassBlock)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SuppressWarnings("deprecation")
|
||||
public float getAmbientOcclusionLightValue(IBlockState state)
|
||||
{ return 1.0F; }
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state)
|
||||
{ return false; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public BlockFaceShape getBlockFaceShape(IBlockAccess world, IBlockState state, BlockPos pos, EnumFacing face)
|
||||
{ return BlockFaceShape.SOLID; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{ return FULL_BLOCK_AABB; }
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{ return FULL_BLOCK_AABB; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isFullCube(IBlockState state)
|
||||
{ return true; }
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean isNormalCube(IBlockState state)
|
||||
{ return true; }
|
||||
|
||||
}
|
|
@ -16,7 +16,6 @@ import net.minecraft.block.SoundType;
|
|||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import wile.engineersdecor.ModEngineersDecor;
|
||||
import wile.engineersdecor.detail.ModAuxiliaries;
|
||||
|
@ -38,22 +37,23 @@ public class ModBlocks
|
|||
{
|
||||
public static final BlockDecorFull CLINKER_BRICK_BLOCK = new BlockDecorFull("clinker_brick_block", 0, Material.ROCK, 2f, 50f, SoundType.STONE);
|
||||
public static final BlockDecorStairs CLINKER_BRICK_STAIRS = new BlockDecorStairs("clinker_brick_stairs", CLINKER_BRICK_BLOCK.getDefaultState());
|
||||
public static final BlockDecorWall CLINKER_BRICK_WALL = new BlockDecorWall("clinker_brick_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 50f, SoundType.STONE);
|
||||
|
||||
public static final BlockDecorFull SLAG_BRICK_BLOCK = new BlockDecorFull("slag_brick_block", 0, Material.ROCK, 2f, 50f, SoundType.STONE);
|
||||
public static final BlockDecorStairs SLAG_BRICK_STAIRS = new BlockDecorStairs("slag_brick_stairs", SLAG_BRICK_BLOCK.getDefaultState());
|
||||
|
||||
public static final BlockDecorFull IRON_SHEET_ROOF_FULLBLOCK = new BlockDecorFull("iron_sheet_roof_block", 0, Material.IRON, 1.8f, 25f, SoundType.METAL);
|
||||
public static final BlockDecorFull REBAR_CONCRETE_BLOCK = new BlockDecorFull("rebar_concrete", 0, Material.ROCK, 8f, 2000f, SoundType.STONE);
|
||||
public static final BlockDecorStairs REBAR_CONCRETE_STAIRS = new BlockDecorStairs("rebar_concrete_stairs", REBAR_CONCRETE_BLOCK.getDefaultState());
|
||||
public static final BlockDecorWall REBAR_CONCRETE_WALL = new BlockDecorWall("rebar_concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 2000f, SoundType.STONE);
|
||||
public static final BlockDecorFull REBAR_CONCRETE_TILE = new BlockDecorFull("rebar_concrete_tile", 0, Material.ROCK, 8f, 2000f, SoundType.STONE);
|
||||
|
||||
public static final BlockDecorWall CONCRETE_WALL = new BlockDecorWall("concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 50f, SoundType.STONE);
|
||||
|
||||
public static final BlockDecorLadder METAL_RUNG_LADDER = new BlockDecorLadder("metal_rung_ladder", 0, Material.IRON, 1.0f, 25f, SoundType.METAL);
|
||||
public static final BlockDecorLadder METAL_RUNG_STEPS = new BlockDecorLadder("metal_rung_steps", 0, Material.IRON, 1.0f, 25f, SoundType.METAL);
|
||||
public static final BlockDecorLadder TREATED_WOOD_LADDER = new BlockDecorLadder("treated_wood_ladder", 0, Material.WOOD, 1.0f, 15f, SoundType.WOOD);
|
||||
|
||||
public static final BlockDecorFull REBAR_CONCRETE_BLOCK = new BlockDecorFull("rebar_concrete", 0, Material.ROCK, 8f, 2000f, SoundType.STONE);
|
||||
public static final BlockDecorStairs REBAR_CONCRETE_STAIRS = new BlockDecorStairs("rebar_concrete_stairs", REBAR_CONCRETE_BLOCK.getDefaultState());
|
||||
public static final BlockDecorWall REBAR_CONCRETE_WALL = new BlockDecorWall("rebar_concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 2000f, SoundType.STONE);
|
||||
|
||||
public static final BlockDecorWall CONCRETE_WALL = new BlockDecorWall("concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 50f, SoundType.STONE);
|
||||
public static final BlockDecorWall CLINKER_BRICK_WALL = new BlockDecorWall("clinker_brick_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 50f, SoundType.STONE);
|
||||
public static final BlockDecorGlassBlock PANZERGLASS_BLOCK = new BlockDecorGlassBlock("panzerglass_block", 0, Material.ROCK, 3f, 2000f, SoundType.GLASS);
|
||||
|
||||
public static final BlockDecorDirected TREATED_WOOD_POLE = new BlockDecorDirected(
|
||||
"treated_wood_pole",
|
||||
|
@ -88,6 +88,7 @@ public class ModBlocks
|
|||
ModAuxiliaries.getPixeledAABB(5.2,5.2,15.7, 10.8,10.8,16.0)
|
||||
);
|
||||
|
||||
public static final BlockDecorFull IRON_SHEET_ROOF_FULLBLOCK = new BlockDecorFull("iron_sheet_roof_block", 0, Material.IRON, 1.8f, 25f, SoundType.METAL);
|
||||
public static final BlockDecorStairs IRON_SHEET_ROOF = new BlockDecorStairs("iron_sheet_roof", IRON_SHEET_ROOF_FULLBLOCK.getDefaultState());
|
||||
|
||||
private static final Block modBlocks[] = {
|
||||
|
@ -103,13 +104,12 @@ public class ModBlocks
|
|||
REBAR_CONCRETE_BLOCK,
|
||||
REBAR_CONCRETE_STAIRS,
|
||||
REBAR_CONCRETE_WALL,
|
||||
REBAR_CONCRETE_TILE,
|
||||
CLINKER_BRICK_WALL,
|
||||
TREATED_WOOD_STOOL,
|
||||
TREATED_WOOD_CRAFTING_TABLE,
|
||||
INSET_LIGHT_IRON,
|
||||
};
|
||||
|
||||
private static final Block ieDependentBlocks[] = {
|
||||
PANZERGLASS_BLOCK,
|
||||
CONCRETE_WALL
|
||||
};
|
||||
|
||||
|
@ -129,10 +129,7 @@ public class ModBlocks
|
|||
// Config based registry selection
|
||||
ArrayList<Block> allBlocks = new ArrayList<>();
|
||||
Collections.addAll(allBlocks, modBlocks);
|
||||
if(Loader.isModLoaded("immersiveengineering")) {
|
||||
ModEngineersDecor.logger.info("Immersive Engineering installed, registering dependent blocks...");
|
||||
Collections.addAll(allBlocks, ieDependentBlocks);
|
||||
}
|
||||
//if(Loader.isModLoaded("immersiveengineering")){}
|
||||
if(ModConfig.zmisc.with_experimental) Collections.addAll(allBlocks, devBlocks);
|
||||
for(Block e:allBlocks) registeredBlocks.add(e);
|
||||
for(Block e:registeredBlocks) event.getRegistry().register(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue