1.14.3: Fixed issue #35, issue #36, #37. 1.12: Treated Wood Side Table work in progress. 1.12: Release version prepared.

This commit is contained in:
stfwi 2019-07-06 15:28:16 +02:00
parent 8b99f38f17
commit d880b90a48
17 changed files with 535 additions and 260 deletions

View file

@ -8,7 +8,6 @@
*/
package wile.engineersdecor;
import net.minecraft.item.crafting.IRecipe;
import wile.engineersdecor.detail.*;
import wile.engineersdecor.blocks.*;
import wile.engineersdecor.items.*;
@ -21,6 +20,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.network.IGuiHandler;
@ -78,6 +78,7 @@ public class ModEngineersDecor
default void init(final FMLInitializationEvent e) {}
default void postInit(final FMLPostInitializationEvent e) {}
default World getWorlClientSide() { return null; }
default EntityPlayer getPlayerClientSide() { return null; }
}
//--------------------------------------------------------------------------------------------------------------------

View file

@ -13,6 +13,7 @@
*/
package wile.engineersdecor.blocks;
import net.minecraftforge.fml.common.Mod;
import wile.engineersdecor.ModEngineersDecor;
import wile.engineersdecor.detail.ModAuxiliaries;
import net.minecraft.block.SoundType;
@ -30,6 +31,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nonnull;
@ -58,9 +60,15 @@ public class BlockDecor extends Block
public static final long CFG_ANALOG = 0x0000000000040000L; // Denotes if a component has analog behaviour
public static final long CFG_HARD_IE_DEPENDENT = 0x8000000000000000L; // Defines that this block abolutely needs IE to be installed.
protected final AxisAlignedBB aabb;
protected final AxisAlignedBB[] aabb;
public BlockDecor(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound)
{ this(registryName, config, material, hardness, resistance, sound, (new AxisAlignedBB[]{FULL_BLOCK_AABB})); }
public BlockDecor(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nullable AxisAlignedBB boundingbox)
{ this(registryName, config, material, hardness, resistance, sound, (boundingbox==null) ? (new AxisAlignedBB[]{FULL_BLOCK_AABB}) : (new AxisAlignedBB[]{boundingbox})); }
public BlockDecor(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB[] boundingboxes)
{
super((material!=null) ? (material) : (Material.IRON));
setCreativeTab(ModEngineersDecor.CREATIVE_TAB_ENGINEERSDECOR);
@ -74,12 +82,9 @@ public class BlockDecor extends Block
// @todo double check that instance variable
// not sure here ... if((config & CFG_TRANSLUCENT) != 0) this.translucent = true;
this.config = config;
this.aabb = (boundingbox==null) ? (FULL_BLOCK_AABB) : (boundingbox);
this.aabb = boundingboxes;
}
public BlockDecor(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound)
{ this(registryName, config, material, hardness, resistance, sound, null); }
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag flag)
@ -166,12 +171,19 @@ public class BlockDecor extends Block
@Override
@SuppressWarnings("deprecation")
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{ return aabb; }
{ return aabb[0]; }
@SideOnly(Side.CLIENT)
@SuppressWarnings("deprecation")
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World worldIn, BlockPos pos)
{ return state.getBoundingBox(worldIn, pos).offset(pos); }
public AxisAlignedBB getSelectedBoundingBox(IBlockState state, World world, BlockPos pos)
{ return state.getBoundingBox(world, pos).offset(pos); }
@SuppressWarnings("deprecation")
public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean isActualState)
{
addCollisionBoxToList(pos, entityBox, collidingBoxes, getBoundingBox(state, world, pos));
for(int i=1; i<aabb.length; ++i) addCollisionBoxToList(pos, entityBox, collidingBoxes, aabb[i]);
}
@Override
public boolean hasTileEntity(IBlockState state)

View file

@ -137,6 +137,13 @@ public class ModBlocks
ModAuxiliaries.getPixeledAABB(4.1,0,4.1, 11.8,8.8,11.8)
);
public static final BlockDecor TREATED_WOOD_SIDE_TABLE = new BlockDecor(
"treated_wood_side_table",
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT,
Material.WOOD, 1.0f, 15f, SoundType.WOOD,
ModAuxiliaries.getPixeledAABB(2,0,2, 14,15.9,14)
);
public static final BlockDecorCraftingTable TREATED_WOOD_CRAFTING_TABLE = new BlockDecorCraftingTable(
"treated_wood_crafting_table",
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT,
@ -417,6 +424,7 @@ public class ModBlocks
THICK_STEEL_POLE_HEAD,
STEEL_DOUBLE_T_SUPPORT,
SIGN_HOTWIRE, SIGN_DANGER, SIGN_DEFENSE, SIGN_FACTORY_AREA, SIGN_MODLOGO,
TREATED_WOOD_SIDE_TABLE,
HALFSLAB_REBARCONCRETE, HALFSLAB_CONCRETE, HALFSLAB_TREATEDWOOD,
HALFSLAB_SHEETMETALIRON, HALFSLAB_SHEETMETALSTEEL, HALFSLAB_SHEETMETALCOPPER,
HALFSLAB_SHEETMETALGOLD, HALFSLAB_SHEETMETALALUMINIUM,

View file

@ -8,8 +8,9 @@
*/
package wile.engineersdecor.detail;
import net.minecraft.world.World;
import wile.engineersdecor.ModEngineersDecor;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
@ -23,4 +24,9 @@ public class ClientProxy implements ModEngineersDecor.IProxy
@Override
public World getWorlClientSide()
{ return Minecraft.getMinecraft().world; }
@Override
public EntityPlayer getPlayerClientSide()
{ return Minecraft.getMinecraft().player; }
}

View file

@ -0,0 +1,10 @@
{
"forge_marker": 1,
"defaults": {
"model": "engineersdecor:furniture/treated_wood_side_table_model"
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}

View file

@ -93,6 +93,8 @@ tile.engineersdecor.treated_wood_crafting_table.help=§6Robust and weather-proof
Click up/down arrow buttons for crafting history selection, output slot for item placement, X-button \
to clear crafting grid and history. Shift-click stack: player-to-storage stack transfer when crafting \
grid empty, otherwise player-to-grid stack transfer. Automatically distributes the clicked stack.
tile.engineersdecor.treated_wood_side_table.name=Treated Wood Side Table
tile.engineersdecor.treated_wood_side_table.help=§6Needed after the work's done.
tile.engineersdecor.iron_inset_light.name=Inset Light
tile.engineersdecor.iron_inset_light.help=§6Small glowstone light source, sunk into the floor, ceiling or wall.§r\n\
Useful to light up places where electrical light installations are problematic.\

View file

@ -90,6 +90,8 @@ tile.engineersdecor.treated_wood_stool.name=Табурет из обработа
tile.engineersdecor.treated_wood_stool.help=§6Крепкий деревянный табурет.§r Для использования в помещении и на улице.
tile.engineersdecor.treated_wood_crafting_table.name=Верстак из обработанного дерева
tile.engineersdecor.treated_wood_crafting_table.help=§6Прочный и устойчивый к погодным условиям. Восемь слотов для хранения. Хранит инвентарь.
tile.engineersdecor.treated_wood_side_table.name=Treated Wood Side Table
#tile.engineersdecor.treated_wood_side_table.help=§6Needed after the work's done.
tile.engineersdecor.iron_inset_light.name=Встраиваемый осветитель
tile.engineersdecor.iron_inset_light.help=§6Маленький источник света, интегрируемый в стены, пол или потолок.§r\n\
Полезно для освещения мест, где проблематичны электрические осветительные установки.\

View file

@ -91,6 +91,8 @@ tile.engineersdecor.treated_wood_crafting_table.name=Treated Wood Crafting Table
Click up/down arrow buttons for crafting history selection, output slot for item placement, X-button \
to clear crafting grid and history. Shift-click stack: player-to-storage stack transfer when crafting \
grid empty, otherwise player-to-grid stack transfer. Automatically distributes the clicked stack.
tile.engineersdecor.treated_wood_side_table.name=Treated Wood Side Table
#tile.engineersdecor.treated_wood_side_table.help=§6Needed after the work's done.
tile.engineersdecor.iron_inset_light.name=Inset Light
#tile.engineersdecor.iron_inset_light.help=§6Small glowstone light source, sunk into the floor, ceiling or wall.§r\n\
Useful to light up places where electrical light installations are problematic.\

View file

@ -0,0 +1,206 @@
{
"parent": "block/cube",
"textures": {
"o": "engineersdecor:blocks/iestyle/treated_wood_framed_texture",
"particle": "engineersdecor:blocks/iestyle/treated_wood_framed_texture"
},
"elements": [
{
"from": [7, 2.5, 7],
"to": [9, 14, 9],
"faces": {
"north": {"uv": [7, 1, 9, 13.5], "texture": "#o"},
"east": {"uv": [7, 1, 9, 13.5], "texture": "#o"},
"south": {"uv": [7, 1, 9, 13.5], "texture": "#o"},
"west": {"uv": [7, 1, 9, 13.5], "texture": "#o"},
"down": {"uv": [7, 7, 9, 9], "texture": "#o", "cullface": "down"}
}
},
{
"from": [9.375, 0.375, 7.25],
"to": [10.875, 4.875, 8.75],
"rotation": {"angle": 45, "axis": "z", "origin": [10.5, 2.375, 8]},
"faces": {
"north": {"uv": [5, 11, 6, 15], "texture": "#o"},
"east": {"uv": [7.5, 9, 9.5, 15], "texture": "#o"},
"south": {"uv": [10, 10, 12, 15], "texture": "#o"},
"west": {"uv": [7.5, 11, 8.5, 15], "texture": "#o"}
}
},
{
"from": [3, 14, 3],
"to": [13, 15, 13],
"faces": {
"north": {"uv": [3, 1, 13, 2], "texture": "#o"},
"east": {"uv": [3, 1, 13, 2], "texture": "#o"},
"south": {"uv": [3, 1, 13, 2], "texture": "#o"},
"west": {"uv": [3, 1, 13, 2], "texture": "#o"},
"up": {"uv": [3, 3, 13, 13], "texture": "#o"},
"down": {"uv": [3, 3, 13, 13], "texture": "#o"}
}
},
{
"from": [11, 0, 7],
"to": [14, 1.25, 9],
"faces": {
"north": {"uv": [2, 14.75, 5, 16], "texture": "#o"},
"east": {"uv": [7, 14.75, 9, 16], "texture": "#o"},
"south": {"uv": [11, 14.75, 14, 16], "texture": "#o"},
"west": {"uv": [7, 14.75, 9, 16], "texture": "#o"},
"up": {"uv": [11, 7, 14, 9], "texture": "#o"},
"down": {"uv": [11, 7, 14, 9], "texture": "#o"}
}
},
{
"from": [2, 0, 7],
"to": [5, 1.25, 9],
"faces": {
"north": {"uv": [11, 14.75, 14, 16], "texture": "#o"},
"east": {"uv": [7, 14.75, 9, 16], "texture": "#o"},
"south": {"uv": [2, 14.75, 5, 16], "texture": "#o"},
"west": {"uv": [7, 14.75, 9, 16], "texture": "#o"},
"up": {"uv": [2, 7, 5, 9], "texture": "#o"},
"down": {"uv": [2, 7, 5, 9], "texture": "#o"}
}
},
{
"from": [7, 0, 2],
"to": [9, 1.25, 5],
"faces": {
"north": {"uv": [7, 14.75, 9, 16], "texture": "#o"},
"east": {"uv": [11, 14.75, 14, 16], "texture": "#o"},
"south": {"uv": [7, 14.75, 9, 16], "texture": "#o"},
"west": {"uv": [2, 14.75, 5, 16], "texture": "#o"},
"up": {"uv": [7, 2, 9, 5], "rotation": 270, "texture": "#o"},
"down": {"uv": [7, 11, 9, 14], "rotation": 90, "texture": "#o"}
}
},
{
"from": [7, 0, 11],
"to": [9, 1.25, 14],
"faces": {
"north": {"uv": [7, 14.75, 9, 16], "texture": "#o"},
"east": {"uv": [2, 14.75, 5, 16], "texture": "#o"},
"south": {"uv": [7, 14.75, 9, 16], "texture": "#o"},
"west": {"uv": [11, 14.75, 14, 16], "texture": "#o"},
"up": {"uv": [7, 11, 9, 14], "rotation": 270, "texture": "#o"},
"down": {"uv": [7, 2, 9, 5], "rotation": 90, "texture": "#o"}
}
},
{
"from": [5.125, 0.375, 7.25],
"to": [6.625, 4.875, 8.75],
"rotation": {"angle": -45, "axis": "z", "origin": [5.5, 2.375, 8]},
"faces": {
"north": {"uv": [5, 11, 6, 15], "texture": "#o"},
"east": {"uv": [7.5, 9, 9.5, 15], "texture": "#o"},
"south": {"uv": [10, 10, 12, 15], "texture": "#o"},
"west": {"uv": [7.5, 11, 8.5, 15], "texture": "#o"}
}
},
{
"from": [7.25, 0.375, 9.375],
"to": [8.75, 4.875, 10.875],
"rotation": {"angle": -45, "axis": "x", "origin": [8, 2.375, 10.5]},
"faces": {
"north": {"uv": [5, 11, 6, 15], "texture": "#o"},
"east": {"uv": [7.5, 9, 9.5, 15], "texture": "#o"},
"south": {"uv": [10, 10, 12, 15], "texture": "#o"},
"west": {"uv": [7.5, 11, 8.5, 15], "texture": "#o"}
}
},
{
"from": [7.25, 0.375, 5.125],
"to": [8.75, 4.875, 6.625],
"rotation": {"angle": 45, "axis": "x", "origin": [8, 2.375, 5.5]},
"faces": {
"north": {"uv": [5, 11, 6, 15], "texture": "#o"},
"east": {"uv": [7.5, 9, 9.5, 15], "texture": "#o"},
"south": {"uv": [10, 10, 12, 15], "texture": "#o"},
"west": {"uv": [7.5, 11, 8.5, 15], "texture": "#o"}
}
},
{
"from": [2, 15, 2],
"to": [14, 16, 14],
"faces": {
"north": {"uv": [2, 0, 14, 1], "texture": "#o"},
"east": {"uv": [2, 0, 14, 1], "texture": "#o"},
"south": {"uv": [2, 0, 14, 1], "texture": "#o"},
"west": {"uv": [2, 0, 14, 1], "texture": "#o"},
"up": {"uv": [2, 2, 14, 14], "texture": "#o"},
"down": {"uv": [2, 2, 14, 14], "texture": "#o"}
}
},
{
"from": [1, 15, 3],
"to": [2, 16, 13],
"faces": {
"north": {"uv": [14, 0, 15, 1], "texture": "#o"},
"east": {"uv": [3, 0, 13, 1], "texture": "#o"},
"south": {"uv": [1, 0, 2, 1], "texture": "#o"},
"west": {"uv": [3, 0, 13, 1], "texture": "#o"},
"up": {"uv": [1, 3, 2, 13], "texture": "#o"},
"down": {"uv": [1, 3, 2, 13], "texture": "#o"}
}
},
{
"from": [14, 15, 3],
"to": [15, 16, 13],
"faces": {
"north": {"uv": [1, 0, 2, 1], "texture": "#o"},
"east": {"uv": [3, 0, 13, 1], "texture": "#o"},
"south": {"uv": [14, 0, 15, 1], "texture": "#o"},
"west": {"uv": [3, 0, 13, 1], "texture": "#o"},
"up": {"uv": [14, 3, 15, 13], "texture": "#o"},
"down": {"uv": [14, 3, 15, 13], "texture": "#o"}
}
},
{
"from": [3, 15, 1],
"to": [13, 16, 2],
"faces": {
"north": {"uv": [3, 0, 13, 1], "texture": "#o"},
"east": {"uv": [14, 0, 15, 1], "texture": "#o"},
"south": {"uv": [3, 0, 13, 1], "texture": "#o"},
"west": {"uv": [1, 0, 2, 1], "texture": "#o"},
"up": {"uv": [3, 1, 13, 2], "texture": "#o"},
"down": {"uv": [3, 14, 13, 15], "texture": "#o"}
}
},
{
"from": [3, 15, 14],
"to": [13, 16, 15],
"faces": {
"north": {"uv": [3, 0, 13, 1], "texture": "#o"},
"east": {"uv": [1, 0, 2, 1], "texture": "#o"},
"south": {"uv": [3, 0, 13, 1], "texture": "#o"},
"west": {"uv": [14, 0, 15, 1], "texture": "#o"},
"up": {"uv": [3, 14, 13, 15], "texture": "#o"},
"down": {"uv": [3, 1, 13, 2], "texture": "#o"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [24, -27, 10],
"translation": [0.75, -1.25, -0.25],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_righthand": {
"rotation": [-15, 20, 0],
"translation": [0.5, -0.25, 0.75],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"scale": [0.2, 0.2, 0.2]
},
"gui": {
"rotation": [30, 225, 0],
"scale": [0.625, 0.625, 0.625]
},
"fixed": {
"scale": [0.5, 0.5, 0.5]
}
}
}

View file

@ -14,12 +14,12 @@
],
"key": {
"S": {
"item": "#ingotIron",
"item": "#nuggetIron",
"data": 0
}
},
"result": {
"item": "engineersdecor:metal_rung_ladder",
"count": 4
"count": 1
}
}