1.12: Creative tab opt-out handling added (issue #90). 1.14/1.15: Dev snapshot.
This commit is contained in:
parent
22b8d53f6e
commit
adc0df9d47
14 changed files with 95 additions and 33 deletions
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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).
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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(); }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue