1.12: Creative tab opt-out handling added (issue #90). 1.14/1.15: Dev snapshot.

This commit is contained in:
stfwi 2020-02-24 20:49:44 +01:00
parent 22b8d53f6e
commit adc0df9d47
14 changed files with 95 additions and 33 deletions

View file

@ -1,6 +1,7 @@
{
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
"1.12.2": {
"1.0.19-b4": "[A] Creative tab opt-out visibility handling added (issue #90, thx pimalel233).",
"1.0.19-b3": "[A] Factory Hopper: Added bottom item handler (CR#227).",
"1.0.19-b2": "[F] Fixed Floor Grating item pass-through jitters (thx Cid).\n[M] Removed obsolete recipe collision testing recipes.",
"1.0.19-b1": "[F] Fixed Tree Cutter / Block Breaker not accepting small energy transfers (thx WindFox, issue #82).",
@ -80,6 +81,6 @@
},
"promos": {
"1.12.2-recommended": "1.0.18",
"1.12.2-latest": "1.0.19-b3"
"1.12.2-latest": "1.0.19-b4"
}
}

View file

@ -10,7 +10,7 @@ Mod sources for Minecraft version 1.12.2.
----
## Version history
~ v1.0.19-b4
- v1.0.19-b4 [A] Creative tab opt-out visibility handling added (issue #90, thx pimalel233).
- v1.0.19-b3 [A] Factory Hopper: Added bottom item handler (CR#227).

View file

@ -22,7 +22,6 @@ import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
@ -714,13 +713,7 @@ public class ModContent
// Invoked from CommonProxy.registerItems()
public static final void registerItemBlocks(RegistryEvent.Register<Item> event)
{
int n = 0;
for(Block e:registeredBlocks) {
ResourceLocation rl = e.getRegistryName();
if(rl == null) continue;
event.getRegistry().register(new ItemBlock(e).setRegistryName(rl));
++n;
}
for(Block e:registeredBlocks) event.getRegistry().register(new ItemDecor(e));
}
}

View file

@ -14,6 +14,7 @@ import wile.engineersdecor.ModEngineersDecor;
import wile.engineersdecor.blocks.*;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.Item;
import net.minecraftforge.common.config.Config;
import net.minecraftforge.common.config.ConfigManager;
@ -78,6 +79,11 @@ public class ModConfig
@Config.RequiresMcRestart
public boolean without_rebar_concrete = false;
@Config.Comment({"Disable gas concrete and derived blocks."})
@Config.Name("Without gas concrete")
@Config.RequiresMcRestart
public boolean without_gas_concrete = false;
@Config.Comment({"Disable all mod wall blocks."})
@Config.Name("Without walls")
@Config.RequiresMcRestart
@ -554,6 +560,7 @@ public class ModConfig
if(optout.without_clinker_bricks && (rn.startsWith("clinker_brick_"))) return true;
if(optout.without_slag_bricks && rn.startsWith("slag_brick_")) return true;
if(optout.without_rebar_concrete && rn.startsWith("rebar_concrete")) return true;
if(optout.without_gas_concrete && rn.startsWith("gas_concrete")) return true;
if(optout.without_ie_concrete_wall && rn.startsWith("concrete_wall")) return true;
if(optout.without_panzer_glass && rn.startsWith("panzerglass_")) return true;
if(optout.without_light_sources && rn.endsWith("_light")) return true;
@ -561,8 +568,11 @@ public class ModConfig
if(optout.without_treated_wood_furniture) {
if(block instanceof BlockDecorChair) return true;
if(rn.equals("treated_wood_table")) return true;
if(rn.equals("treated_wood_side_table")) return true;
if(rn.equals("treated_wood_stool")) return true;
if(rn.equals("treated_wood_windowsill")) return true;
if(rn.equals("treated_wood_broad_windowsill")) return true;
if(rn.equals("steel_table")) return true;
}
return false;
}
@ -570,6 +580,7 @@ public class ModConfig
public static final boolean isOptedOut(final @Nullable Item item)
{
if((item == null) || (optout == null)) return true;
if(item instanceof ItemBlock) return isOptedOut(((ItemBlock)item).getBlock());
return false;
}

View file

@ -8,28 +8,31 @@
*/
package wile.engineersdecor.items;
import wile.engineersdecor.ModEngineersDecor;
import wile.engineersdecor.detail.ModAuxiliaries;
import wile.engineersdecor.detail.ModConfig;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import wile.engineersdecor.ModEngineersDecor;
import wile.engineersdecor.detail.ModAuxiliaries;
import javax.annotation.Nullable;
import java.util.List;
public class ItemDecor extends Item
public class ItemDecor extends ItemBlock
{
ItemDecor(String registryName)
public ItemDecor(Block block)
{
super();
setRegistryName(ModEngineersDecor.MODID, registryName);
setTranslationKey(ModEngineersDecor.MODID + "." + registryName);
super(block);
setRegistryName(block.getRegistryName());
setTranslationKey(ModEngineersDecor.MODID + "." + block.getRegistryName().getPath());
setMaxStackSize(64);
setCreativeTab(ModEngineersDecor.CREATIVE_TAB_ENGINEERSDECOR);
setHasSubtypes(false);
@ -48,4 +51,7 @@ public class ItemDecor extends Item
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag flag)
{ ModAuxiliaries.Tooltip.addInformation(stack, world, tooltip, flag, true); }
@Nullable
public CreativeTabs getCreativeTab()
{ return ModConfig.isOptedOut(this) ? null : super.getCreativeTab(); }
}

View file

@ -5,4 +5,4 @@ version_minecraft=1.14.4
version_forge_minecraft=1.14.4-28.2.0
version_fml_mappings=20190719-1.14.3
version_jei=1.14.4:6.0.0.10
version_engineersdecor=1.0.19-b4
version_engineersdecor=1.0.19-b5

View file

@ -11,6 +11,10 @@ Mod sources for Minecraft version 1.14.4.
## Version history
~ v1.0.19-b5 [A] Factory Hopper: Resetting NBT when breaking with empty inventory (for stacking), enabled
item cap for all sides.
[A] Mod manual 1st edition release recipe added.
- v1.0.19-b4 [A] Ported primary Immersive Engineering dependent recipes (alternative recipes
will still work if IE is not installed).
[M] Furni comparator output overrides reflect input slots and empty fuel state/power-cutoff.

View file

@ -227,9 +227,11 @@ public class BlockDecorHopper extends StandardBlocks.Directed implements IDecorB
CompoundNBT nbt = new CompoundNBT();
block_power_signal_ = false;
writenbt(nbt, false);
for(int i=0; i<stacks_.size(); ++i) stacks_.set(i, ItemStack.EMPTY);
boolean is_empty = true;
for(int i=0; i<stacks_.size(); ++i) { is_empty &= stacks_.get(i).isEmpty(); stacks_.set(i, ItemStack.EMPTY); }
reset_rtstate();
block_power_updated_ = false;
if(is_empty) nbt = new CompoundNBT();
return nbt;
}
@ -398,7 +400,7 @@ public class BlockDecorHopper extends StandardBlocks.Directed implements IDecorB
// ISidedInventory --------------------------------------------------------------------------------------
LazyOptional<? extends IItemHandler>[] item_handlers = SidedInvWrapper.create(this, Direction.UP, Direction.DOWN);
LazyOptional<? extends IItemHandler>[] item_handlers = SidedInvWrapper.create(this, Direction.UP);
private static final int[] SIDED_INV_SLOTS;
static {
SIDED_INV_SLOTS = new int[NUM_OF_SLOTS];
@ -423,10 +425,7 @@ public class BlockDecorHopper extends StandardBlocks.Directed implements IDecorB
public <T> LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable Direction facing)
{
if(!this.removed && (facing != null)) {
if(capability==CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
if(facing == Direction.UP) return item_handlers[0].cast();
if(facing == Direction.DOWN) return item_handlers[1].cast();
}
if(capability==CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return item_handlers[0].cast();
}
return super.getCapability(capability, facing);
}

View file

@ -0,0 +1,22 @@
{
"conditions": [
{
"type": "engineersdecor:optional",
"result": "patchouli:guide_book",
"required": ["minecraft:iron_nugget", "minecraft:book"]
}
],
"type": "minecraft:crafting_shaped",
"pattern": [
"BN",
"N "
],
"key": {
"B": { "item": "minecraft:book" },
"N": { "item": "minecraft:iron_nugget" }
},
"result": {
"item": "patchouli:guide_book",
"nbt": { "patchouli:book": "engineersdecor:engineersdecor_manual" }
}
}

View file

@ -5,4 +5,4 @@ version_minecraft=1.15.2
version_forge_minecraft=1.15.2-31.1.1
version_fml_mappings=20191105-1.14.3
version_jei=1.15.2:6.0.0.2
version_engineersdecor=1.0.19-b4
version_engineersdecor=1.0.19-b5

View file

@ -11,6 +11,10 @@ Mod sources for Minecraft version 1.15.1.
## Version history
~ v1.0.19-b5 [A] Factory Hopper: Resetting NBT when breaking with empty inventory (for stacking), enabled
item cap for all sides.
[A] Mod manual 1st edition release recipe added.
- v1.0.19-b4 [A] Ported primary Immersive Engineering dependent recipes (alternative recipes
will still work if IE is not installed).
[F] Blacklisted Treated Wood Crafting Table in inventorysorter mod (issue #88, thx Nachtflame).

View file

@ -226,9 +226,11 @@ public class BlockDecorHopper extends BlockDecor.Directed implements IDecorBlock
CompoundNBT nbt = new CompoundNBT();
block_power_signal_ = false;
writenbt(nbt, false);
for(int i=0; i<stacks_.size(); ++i) stacks_.set(i, ItemStack.EMPTY);
boolean is_empty = true;
for(int i=0; i<stacks_.size(); ++i) { is_empty &= stacks_.get(i).isEmpty(); stacks_.set(i, ItemStack.EMPTY); }
reset_rtstate();
block_power_updated_ = false;
if(is_empty) nbt = new CompoundNBT();
return nbt;
}
@ -397,7 +399,7 @@ public class BlockDecorHopper extends BlockDecor.Directed implements IDecorBlock
// ISidedInventory --------------------------------------------------------------------------------------
LazyOptional<? extends IItemHandler>[] item_handlers = SidedInvWrapper.create(this, Direction.UP, Direction.DOWN);
LazyOptional<? extends IItemHandler>[] item_handlers = SidedInvWrapper.create(this, Direction.UP);
private static final int[] SIDED_INV_SLOTS;
static {
SIDED_INV_SLOTS = new int[NUM_OF_SLOTS];
@ -422,10 +424,7 @@ public class BlockDecorHopper extends BlockDecor.Directed implements IDecorBlock
public <T> LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable Direction facing)
{
if(!this.removed && (facing != null)) {
if(capability==CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
if(facing == Direction.UP) return item_handlers[0].cast();
if(facing == Direction.DOWN) return item_handlers[1].cast();
}
if(capability==CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return item_handlers[0].cast();
}
return super.getCapability(capability, facing);
}

View file

@ -0,0 +1,22 @@
{
"conditions": [
{
"type": "engineersdecor:optional",
"result": "patchouli:guide_book",
"required": ["minecraft:iron_nugget", "minecraft:book"]
}
],
"type": "minecraft:crafting_shaped",
"pattern": [
"BN",
"N "
],
"key": {
"B": { "item": "minecraft:book" },
"N": { "item": "minecraft:iron_nugget" }
},
"result": {
"item": "patchouli:guide_book",
"nbt": { "patchouli:book": "engineersdecor:engineersdecor_manual" }
}
}

View file

@ -2,13 +2,14 @@
"homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/",
"promos": {
"1.12.2-recommended": "1.0.18",
"1.12.2-latest": "1.0.19-b3",
"1.12.2-latest": "1.0.19-b4",
"1.14.4-recommended": "",
"1.14.4-latest": "1.0.19-b4",
"1.15.2-recommended": "",
"1.15.2-latest": "1.0.19-b4"
},
"1.12.2": {
"1.0.19-b4": "[A] Creative tab opt-out visibility handling added (issue #90, thx pimalel233).",
"1.0.19-b3": "[A] Factory Hopper: Added bottom item handler (CR#227).",
"1.0.19-b2": "[F] Fixed Floor Grating item pass-through jitters (thx Cid).\n[M] Removed obsolete recipe collision testing recipes.",
"1.0.19-b1": "[F] Fixed Tree Cutter / Block Breaker not accepting small energy transfers (thx WindFox, issue #82).",