1.15: Crafting Table TER implemented. Crafting Table refab tweaks added.

This commit is contained in:
stfwi 2020-01-12 17:43:56 +01:00
parent d4488df2b7
commit df4fe500ba
18 changed files with 1269 additions and 844 deletions

View file

@ -2,7 +2,7 @@
org.gradle.daemon=false
org.gradle.jvmargs=-Xmx8G
version_minecraft=1.15.1
version_forge_minecraft=1.15.1-30.0.35
version_forge_minecraft=1.15.1-30.0.36
version_fml_mappings=20191105-1.14.3
version_jei=1.15.1-6.0.0.1
version_engineersdecor=1.0.18-b3
version_engineersdecor=1.0.18-b4

View file

@ -1,7 +1,7 @@
{
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
"1.15.1": {
"1.0.18-b3": "[A] Added Treated Wood Crafting table tweaks (ctrl-shift moves all same stacks from the inventory, mouse wheel over crafting slot increases/decreases crafting grid stacks).\n[F] EN Lang file fixed (issue #76, thx Riverstar907).\n[F] Fixed Tree Cutter not respecting power-required config (thx federsavo, issue #77).\n[F] Fixed Small Solar Panel not exposing energy capability (thx MatthiasMann, issue #78).",
"1.0.18-b3": "[A] Added Treated Wood Crafting Table tweaks (ctrl-shift moves all same stacks from the inventory, mouse wheel over crafting slot increases/decreases crafting grid stacks).\n[F] EN Lang file fixed (issue #76, thx Riverstar907).\n[F] Fixed Tree Cutter not respecting power-required config (thx federsavo, issue #77).\n[F] Fixed Small Solar Panel not exposing energy capability (thx MatthiasMann, issue #78).",
"1.0.18-b2": "[M] Lang ru_ru updated (Smollet777).",
"1.0.18-b1": "[U] Updated to Forge 1.15.1-30.0.16/20190719-1.14.3.\n[F] Client setup Dist annotation fixed (issue #73, thx hitsu420).\n[F] Double newline escapes in lang files fixed (\"\\n\" in a tooltip).\n[M] Updated zh_cn lang file (scikirbypoke).\n[A] Added opt-out config for the Small Tree Cutter",
"1.0.17-b2": "[A] Initial port."

View file

@ -11,7 +11,9 @@ Mod sources for Minecraft version 1.15.1.
## Version history
- v1.0.18-b3 [A] Added Treated Wood Crafting table tweaks (ctrl-shift moves all same stacks from the
~ v1.0.18-b4 [A] Ported Treated Wood Crafting Table item rendering.
- v1.0.18-b3 [A] Added Treated Wood Crafting Table tweaks (ctrl-shift moves all same stacks from the
inventory, mouse wheel over crafting slot increases/decreases crafting grid stacks).
[F] EN Lang file fixed (issue #76, thx Riverstar907).
[F] Fixed Tree Cutter not respecting power-required config (thx federsavo, issue #77).

View file

@ -33,6 +33,7 @@ import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.client.registry.ClientRegistry;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import org.apache.commons.lang3.ArrayUtils;
import java.util.ArrayList;
@ -373,7 +374,7 @@ public class ModContent
// -------------------------------------------------------------------------------------------------------------------
public static final BlockDecorCraftingTable TREATED_WOOD_CRAFTING_TABLE = (BlockDecorCraftingTable)(new BlockDecorCraftingTable(
public static final BlockDecorCraftingTable.CraftingTableBlock TREATED_WOOD_CRAFTING_TABLE = (BlockDecorCraftingTable.CraftingTableBlock)(new BlockDecorCraftingTable.CraftingTableBlock(
BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT,
Block.Properties.create(Material.WOOD, MaterialColor.WOOD).hardnessAndResistance(1f, 15f).sound(SoundType.WOOD),
ModAuxiliaries.getPixeledAABB(1,0,1, 15,15.9,15)
@ -626,7 +627,7 @@ public class ModContent
//--------------------------------------------------------------------------------------------------------------------
public static final TileEntityType<?> TET_TREATED_WOOD_CRAFTING_TABLE = TileEntityType.Builder
.create(BlockDecorCraftingTable.BTileEntity::new, TREATED_WOOD_CRAFTING_TABLE)
.create(BlockDecorCraftingTable.CraftingTableTileEntity::new, TREATED_WOOD_CRAFTING_TABLE)
.build(null)
.setRegistryName(ModEngineersDecor.MODID, "te_treated_wood_crafting_table");
@ -747,7 +748,7 @@ public class ModContent
// Container registration
//--------------------------------------------------------------------------------------------------------------------
public static final ContainerType<BlockDecorCraftingTable.BContainer> CT_TREATED_WOOD_CRAFTING_TABLE;
public static final ContainerType<BlockDecorCraftingTable.CraftingTableContainer> CT_TREATED_WOOD_CRAFTING_TABLE;
public static final ContainerType<BlockDecorDropper.BContainer> CT_FACTORY_DROPPER;
public static final ContainerType<BlockDecorPlacer.BContainer> CT_FACTORY_PLACER;
public static final ContainerType<BlockDecorHopper.BContainer> CT_FACTORY_HOPPER;
@ -756,7 +757,7 @@ public class ModContent
public static final ContainerType<BlockDecorWasteIncinerator.BContainer> CT_WASTE_INCINERATOR;
static {
CT_TREATED_WOOD_CRAFTING_TABLE = (new ContainerType<BlockDecorCraftingTable.BContainer>(BlockDecorCraftingTable.BContainer::new));
CT_TREATED_WOOD_CRAFTING_TABLE = (new ContainerType<BlockDecorCraftingTable.CraftingTableContainer>(BlockDecorCraftingTable.CraftingTableContainer::new));
CT_TREATED_WOOD_CRAFTING_TABLE.setRegistryName(ModEngineersDecor.MODID,"ct_treated_wood_crafting_table");
CT_FACTORY_DROPPER = (new ContainerType<BlockDecorDropper.BContainer>(BlockDecorDropper.BContainer::new));
CT_FACTORY_DROPPER.setRegistryName(ModEngineersDecor.MODID,"ct_factory_dropper");
@ -857,7 +858,7 @@ public class ModContent
@OnlyIn(Dist.CLIENT)
public static final void registerContainerGuis(final FMLClientSetupEvent event)
{
ScreenManager.registerFactory(CT_TREATED_WOOD_CRAFTING_TABLE, BlockDecorCraftingTable.BGui::new);
ScreenManager.registerFactory(CT_TREATED_WOOD_CRAFTING_TABLE, BlockDecorCraftingTable.CraftingTableGui::new);
ScreenManager.registerFactory(CT_FACTORY_DROPPER, BlockDecorDropper.BGui::new);
ScreenManager.registerFactory(CT_FACTORY_PLACER, BlockDecorPlacer.BGui::new);
ScreenManager.registerFactory(CT_FACTORY_HOPPER, BlockDecorHopper.BGui::new);
@ -867,10 +868,13 @@ public class ModContent
}
@OnlyIn(Dist.CLIENT)
@SuppressWarnings("unchecked")
public static final void registerTileEntityRenderers(final FMLClientSetupEvent event)
{
// @todo: re-enable
//ClientRegistry.bindTileEntityRenderer(TET_TREATED_WOOD_CRAFTING_TABLE, new wile.engineersdecor.detail.ModRenderers.TesrDecorCraftingTable());
ClientRegistry.bindTileEntityRenderer(
(TileEntityType<BlockDecorCraftingTable.CraftingTableTileEntity>)TET_TREATED_WOOD_CRAFTING_TABLE,
wile.engineersdecor.detail.ModRenderers.CraftingTableTer::new
);
}
@OnlyIn(Dist.CLIENT)

View file

@ -524,7 +524,7 @@ public class ModConfig
excludes_.clear();
}
// Early non-opt out type based evaluation
if(block instanceof BlockDecorCraftingTable) return COMMON.without_crafting_table.get();
if(block instanceof BlockDecorCraftingTable.CraftingTableBlock) return COMMON.without_crafting_table.get();
if(block instanceof BlockDecorFurnaceElectrical) return COMMON.without_electrical_furnace.get();
if((block instanceof BlockDecorFurnace) && (!(block instanceof BlockDecorFurnaceElectrical))) return COMMON.without_lab_furnace.get();
if(block instanceof BlockDecorPassiveFluidAccumulator) return COMMON.without_passive_fluid_accumulator.get();

View file

@ -10,32 +10,24 @@
package wile.engineersdecor.detail;
import wile.engineersdecor.ModEngineersDecor;
import wile.engineersdecor.blocks.BlockDecorChair;
import wile.engineersdecor.blocks.BlockDecorCraftingTable;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.model.ModelManager;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemFrameEntity;
import net.minecraft.item.FilledMapItem;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.storage.MapData;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.matrix.MatrixStack;
public class ModRenderers
{
//--------------------------------------------------------------------------------------------------------------------
@ -71,56 +63,55 @@ public class ModRenderers
// Crafting table
//--------------------------------------------------------------------------------------------------------------------
/*
@OnlyIn(Dist.CLIENT)
public static class TesrDecorCraftingTable extends TileEntityRenderer<BlockDecorCraftingTable.BTileEntity>
public static class CraftingTableTer extends TileEntityRenderer<BlockDecorCraftingTable.CraftingTableTileEntity>
{
private static int tesr_error_counter = 4;
private static double scaler = 0.10;
private static double gap = 0.19;
private static double yrotations[] = {0, 90, 180, 270}; // [hdirection] S-W-N-E
private static double offsets[][][] = { // [hdirection][slotindex][xz]
private static float scaler = 0.1f;
private static float gap = 0.19f;
private static float yrotations[] = {0, 90, 180, 270}; // [hdirection] S-W-N-E
private static float offsets[][][] = { // [hdirection][slotindex][xz]
{ {-1,-1},{+0,-1},{+1,-1}, {-1,+0},{+0,+0},{+1,+0}, {-1,+1},{+0,+1},{+1,+1} }, // S
{ {+1,-1},{+1,+0},{+1,+1}, {+0,-1},{+0,+0},{+0,+1}, {-1,-1},{-1,+0},{-1,+1} }, // W
{ {+1,+1},{+0,+1},{-1,+1}, {+1,+0},{+0,+0},{-1,+0}, {+1,-1},{+0,-1},{-1,-1} }, // N
{ {-1,+1},{-1,+0},{-1,-1}, {+0,+1},{+0,+0},{+0,-1}, {+1,+1},{+1,+0},{+1,-1} }, // E
};
public CraftingTableTer(TileEntityRendererDispatcher dispatcher)
{ super(dispatcher); }
@Override
public void func_225616_a_(final BlockDecorCraftingTable.BTileEntity te, float p_225616_2_, MatrixStack p_225616_3_, IRenderTypeBuffer p_225616_4_, int p_225616_5_, int p_225616_6_)
{
render(final BlockDecorCraftingTable.BTileEntity te, double x, double y, double z, float partialTicks, int destroyStage);
}
public void func_225616_a_(final BlockDecorCraftingTable.CraftingTableTileEntity te, float f2, MatrixStack mxs, IRenderTypeBuffer buf, int i5, int i6)
{ render(te, f2, mxs, buf, i5, i6); }
@SuppressWarnings("deprecation")
public void render(final BlockDecorCraftingTable.BTileEntity te, double x, double y, double z, float partialTicks, int destroyStage)
public void render(final BlockDecorCraftingTable.CraftingTableTileEntity te, float unused1, MatrixStack mxs, IRenderTypeBuffer buf, int i5, int i6)
{
if(tesr_error_counter<=0) return;
if(tesr_error_counter <= 0) return;
try {
int di = MathHelper.clamp(te.getWorld().getBlockState(te.getPos()).get(BlockDecorCraftingTable.FACING).getHorizontalIndex(), 0, 3);
final int di = MathHelper.clamp(te.getWorld().getBlockState(te.getPos()).get(BlockDecorCraftingTable.CraftingTableBlock.FACING).getHorizontalIndex(), 0, 3);
long posrnd = te.getPos().toLong();
posrnd = (posrnd>>16)^(posrnd<<1);
for(int i=0; i<9; ++i) {
final ItemStack stack = te.getStackInSlot(i);
if(stack.isEmpty()) continue;
double prnd = ((double)(((Integer.rotateRight(stack.getItem().hashCode()^(int)posrnd,(stack.getCount()+i)&31)))&1023))/1024.0;
double rndo = gap * ((prnd*0.1)-0.05);
double ox = gap * offsets[di][i][0], oz = gap * offsets[di][i][1];
double oy = 0.5;
double ry = ((yrotations[di]+180) + ((prnd*60)-30)) % 360;
float prnd = ((float)(((Integer.rotateRight(stack.getItem().hashCode()^(int)posrnd,(stack.getCount()+i)&31)))&1023))/1024f;
float rndo = gap * ((prnd*0.1f)-0.05f);
float ox = gap * offsets[di][i][0], oz = gap * offsets[di][i][1];
float oy = 0.5f;
float ry = ((yrotations[di]+180) + ((prnd*60)-30)) % 360;
if(stack.isEmpty()) return;
GlStateManager.pushMatrix();
GlStateManager.disableLighting();
RenderHelper.enableStandardItemLighting();
GlStateManager.translated(x+0.5+ox, y+0.5+oy, z+0.5+oz);
GlStateManager.rotated(90, 1, 0, 0);
GlStateManager.rotated(ry, 0, 0, 1);
GlStateManager.translated(rndo, rndo, 0);
GlStateManager.scaled(scaler, scaler, scaler);
Minecraft.getInstance().getItemRenderer().renderItem(stack, net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType.FIXED);
RenderHelper.disableStandardItemLighting();
GlStateManager.enableLighting();
GlStateManager.popMatrix();
mxs.func_227860_a_(); // mxs.push()
mxs.func_227861_a_(0.5+ox, 0.5+oy, 0.5+oz); // mxs.translate()
mxs.func_227863_a_(Vector3f.field_229179_b_.func_229187_a_(90.0f)); // mxs.transform(Vector3f.x_plus.rotation(90))
mxs.func_227863_a_(Vector3f.field_229183_f_.func_229187_a_(ry)); // mxs.transform(Vector3f.z_plus.rotation(ry))
mxs.func_227861_a_(rndo, rndo, 0); // mxs.translate()
mxs.func_227862_a_(scaler, scaler, scaler); // mxs.scale()
Minecraft.getInstance().getItemRenderer().func_229110_a_(stack, net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType.FIXED, i5, i6, mxs, buf);
mxs.func_227865_b_(); // mxs.pop()
}
} catch(Throwable e) {
if(--tesr_error_counter<=0) {
@ -130,5 +121,4 @@ public class ModRenderers
}
}
}
*/
}