Skip to content

Commit

Permalink
Removed custom plaster recipe
Browse files Browse the repository at this point in the history
Made Mudbricks configurable
Made plastered blocks colorable via brush
Added Cubey79's new icons for Lanterns
Minor fixes & refactoring
  • Loading branch information
nuckable committed Feb 25, 2024
1 parent 2d28cff commit f9d3ecf
Show file tree
Hide file tree
Showing 40 changed files with 262 additions and 456 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies {
compile "codechicken:CodeChickenCore:1.7.10-1.0.4.35:dev"
compile "codechicken:CodeChickenLib:1.7.10-1.1.3.127:dev"
compile "codechicken:NotEnoughItems:1.7.10-1.0.4.95:dev"
compile "mcp.mobius.waila:Waila:1.5.11-RC2-NONEI_1.7.10"
//compile "mcp.mobius.waila:Waila:1.5.11-RC2-NONEI_1.7.10"
}

processResources {
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/com/aleksey/decorations/ClientProxy.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.aleksey.decorations;

import com.aleksey.decorations.TESR.TESRGem;
import com.aleksey.decorations.core.BlockList;
import com.aleksey.decorations.render.blocks.RenderLantern;
import com.aleksey.decorations.render.blocks.RenderMudBrickRaw;
import com.aleksey.decorations.TESR.TESRGem;
import com.aleksey.decorations.tileentities.TileEntityGem;

import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;

Expand All @@ -15,7 +14,9 @@ public class ClientProxy extends CommonProxy
public void registerRenderInformation()
{
RenderingRegistry.registerBlockHandler(BlockList.LanternRenderId = RenderingRegistry.getNextAvailableRenderId(), new RenderLantern());
RenderingRegistry.registerBlockHandler(BlockList.MudBrickRawRenderId = RenderingRegistry.getNextAvailableRenderId(), new RenderMudBrickRaw());
if (DecorationsMod.isMudBricksEnabled) {
RenderingRegistry.registerBlockHandler(BlockList.MudBrickRawRenderId = RenderingRegistry.getNextAvailableRenderId(), new RenderMudBrickRaw());
}
}

@Override
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/aleksey/decorations/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.aleksey.decorations.handlers.ServerTickHandler;
import com.aleksey.decorations.tileentities.TileEntityGem;
import com.aleksey.decorations.tileentities.TileEntityMudBrickRaw;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.registry.GameRegistry;

Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/aleksey/decorations/DecorationConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public static void loadConfig(FMLPreInitializationEvent event)
loadLanterns(config);
loadGems(config);
loadModules(config);
loadMudBricks(config);

config.save();
}
Expand Down Expand Up @@ -61,6 +62,11 @@ else if(info.LightLevel > 15)

private static void loadModules(Configuration config)
{
DecorationsMod.instance.isGemsEnabled = config.get(CategoryName_Modules, "GemsEnabled", true).getBoolean();
DecorationsMod.isGemsEnabled = config.get(CategoryName_Modules, "GemsEnabled", true).getBoolean();
}

private static void loadMudBricks(Configuration config)
{
DecorationsMod.isMudBricksEnabled = config.get(CategoryName_Modules, "MudBricksEnabled", false).getBoolean();
}
}
11 changes: 3 additions & 8 deletions src/main/java/com/aleksey/decorations/DecorationsMod.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
package com.aleksey.decorations;

import net.minecraftforge.common.MinecraftForge;

import com.aleksey.decorations.core.BlockList;
import com.aleksey.decorations.core.FluidList;
import com.aleksey.decorations.core.ItemList;
import com.aleksey.decorations.core.Recipes;
import com.aleksey.decorations.core.player.PlayerTracker;
import com.aleksey.decorations.handlers.ChunkEventHandler;
import com.aleksey.decorations.handlers.CraftingHandler;
import com.aleksey.decorations.handlers.network.InitClientWorldPacket;
import com.dunk.tfc.TerraFirmaCraft;

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
Expand All @@ -22,6 +18,7 @@
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.ExistingSubstitutionException;
import net.minecraftforge.common.MinecraftForge;

@Mod(modid="DecorationsTFC", name="Decorations", version="1.0.21", dependencies="required-after:terrafirmacraftplus")
public class DecorationsMod
Expand All @@ -34,7 +31,8 @@ public class DecorationsMod

public static final boolean isLanternsEnabled = !Loader.isModLoaded("LanternsTFC");
public static boolean isGemsEnabled;

public static boolean isMudBricksEnabled;

@EventHandler
public void preInit(FMLPreInitializationEvent event) throws ExistingSubstitutionException
{
Expand Down Expand Up @@ -62,9 +60,6 @@ public void initialize(FMLInitializationEvent event)

FMLCommonHandler.instance().bus().register(new PlayerTracker());

//Register Crafting Handler
FMLCommonHandler.instance().bus().register(new CraftingHandler());

// Register the Chunk Load/Save Handler
MinecraftForge.EVENT_BUS.register(new ChunkEventHandler());

Expand Down
43 changes: 35 additions & 8 deletions src/main/java/com/aleksey/decorations/blocks/BlockAlabaster.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
package com.aleksey.decorations.blocks;

import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;

import com.aleksey.decorations.core.FluidList;
import com.dunk.tfc.Blocks.Terrain.BlockSmooth;
import com.aleksey.decorations.tileentities.TileEntityAlabasterBlock;
import com.dunk.tfc.Blocks.BlockPlasteredBlock;
import com.dunk.tfc.Core.TFCTabs;
import com.dunk.tfc.Core.TFC_Core;
import com.dunk.tfc.Items.ItemDyeCustom;
import com.dunk.tfc.TileEntities.TEPlasteredBlock;
import com.dunk.tfc.api.TFCBlocks;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;

public class BlockAlabaster extends BlockSmooth
public class BlockAlabaster extends BlockPlasteredBlock
{
protected String[] names;
protected IIcon[] icons;
public BlockAlabaster()
{
super(Material.rock);
this.setHardness(12f);
this.setResistance(10.0f);
this.setCreativeTab(TFCTabs.TFC_BUILDING);

this.names = new String[16];
Expand All @@ -41,4 +47,25 @@ public void registerBlockIcons(IIconRegister iconRegisterer)
for(int i = 0; i < this.icons.length; i++)
this.icons[i] = iconRegisterer.registerIcon("decorations:alabasters/" + this.names[i]);
}

@Override
public TileEntity createNewTileEntity(World var1, int var2) {
return new TileEntityAlabasterBlock();
}

@Override
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean canHarvest) {
if (!canHarvest && !player.capabilities.isCreativeMode) {
return false;
} else {
TileEntityAlabasterBlock tileEntityAlabasterBlock = (TileEntityAlabasterBlock)world.getTileEntity(x, y, z);
world.setBlock(x, y, z, TFCBlocks.plasteredBlock, tileEntityAlabasterBlock.blockMeta, 2);
TEPlasteredBlock te = (TEPlasteredBlock)world.getTileEntity(x, y, z);
te.block = tileEntityAlabasterBlock.block;
te.meta = tileEntityAlabasterBlock.meta;
te.markDirty();
TFC_Core.addPlayerExhaustion(player, 0.001F);
return false;
}
}
}
24 changes: 11 additions & 13 deletions src/main/java/com/aleksey/decorations/blocks/BlockMudBrickRaw.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
package com.aleksey.decorations.blocks;

import java.util.List;

import com.aleksey.decorations.core.BlockList;
import com.aleksey.decorations.core.Constants;
import com.aleksey.decorations.render.blocks.RenderMudBrickRaw;
import com.aleksey.decorations.tileentities.TileEntityMudBrickRaw;
import com.dunk.tfc.Blocks.BlockTerraContainer;
import com.dunk.tfc.Core.TFCTabs;
import com.dunk.tfc.api.Constant.Global;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.material.Material;
import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.client.renderer.texture.IIconRegister;
Expand All @@ -14,16 +21,7 @@
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;

import com.aleksey.decorations.core.BlockList;
import com.aleksey.decorations.core.Constants;
import com.aleksey.decorations.render.blocks.RenderMudBrickRaw;
import com.aleksey.decorations.tileentities.TileEntityMudBrickRaw;
import com.dunk.tfc.Blocks.BlockTerraContainer;
import com.dunk.tfc.Core.TFCTabs;
import com.dunk.tfc.api.Constant.Global;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;

public class BlockMudBrickRaw extends BlockTerraContainer
{
Expand All @@ -33,7 +31,7 @@ public class BlockMudBrickRaw extends BlockTerraContainer
@SideOnly(Side.CLIENT)
private IIcon _topIcon;

private int _stoneIndex;
private final int _stoneIndex;

public int getStoneIndex()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public class BlockMudBricks extends BlockSmooth
{
private int _startIndex;
private final int _startIndex;

public int getStartIndex()
{
Expand Down
45 changes: 22 additions & 23 deletions src/main/java/com/aleksey/decorations/core/BlockList.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
package com.aleksey.decorations.core;

import net.minecraft.block.Block;

import com.aleksey.decorations.DecorationsMod;
import com.aleksey.decorations.blocks.BlockAlabaster;
import com.aleksey.decorations.blocks.BlockCustomGem;
import com.aleksey.decorations.blocks.BlockCustomLantern;
import com.aleksey.decorations.blocks.BlockMudBrickRaw;
import com.aleksey.decorations.blocks.BlockMudBricks;
import com.aleksey.decorations.blocks.*;
import com.aleksey.decorations.core.data.GemInfo;
import com.aleksey.decorations.core.data.LanternInfo;
import com.aleksey.decorations.items.itemblocks.ItemAlabaster;
import com.aleksey.decorations.items.itemblocks.ItemLantern;
import com.aleksey.decorations.items.itemblocks.ItemMudBrickRaw;
import com.aleksey.decorations.items.itemblocks.ItemMudBricks;
import com.dunk.tfc.api.Constant.Global;

import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;

public class BlockList
{
Expand Down Expand Up @@ -45,11 +39,14 @@ public static void registerBlocks()

GameRegistry.registerBlock(Alabaster, ItemAlabaster.class, Alabaster.getUnlocalizedName().substring(5));

for (Block mudBrickRaw : MudBrickRaws)
GameRegistry.registerBlock(mudBrickRaw, ItemMudBrickRaw.class, mudBrickRaw.getUnlocalizedName().substring(5));

GameRegistry.registerBlock(MudBricks, ItemMudBricks.class, MudBricks.getUnlocalizedName().substring(5));
GameRegistry.registerBlock(MudBricks2, ItemMudBricks.class, MudBricks2.getUnlocalizedName().substring(5));
if (DecorationsMod.isMudBricksEnabled) {
for (Block mudBrickRaw : MudBrickRaws)
GameRegistry.registerBlock(mudBrickRaw, ItemMudBrickRaw.class, mudBrickRaw.getUnlocalizedName().substring(5));

GameRegistry.registerBlock(MudBricks, ItemMudBricks.class, MudBricks.getUnlocalizedName().substring(5));
GameRegistry.registerBlock(MudBricks2, ItemMudBricks.class, MudBricks2.getUnlocalizedName().substring(5));
}

}

public static void loadBlocks()
Expand Down Expand Up @@ -82,16 +79,18 @@ public static void loadBlocks()
}
}

//Gypsum
//Alabaster
Alabaster = new BlockAlabaster().setBlockName("Alabaster");

//Mud Bricks
MudBrickRaws = new Block[Global.STONE_ALL.length];

for(int i = 0; i < MudBrickRaws.length; i++)
MudBrickRaws[i] = new BlockMudBrickRaw(i).setBlockName("MudBrickRaw." + Global.STONE_ALL[i].replaceAll(" ", ""));

MudBricks = new BlockMudBricks(0).setBlockName("MudBricks");
MudBricks2 = new BlockMudBricks(16).setBlockName("MudBricks2");

if (DecorationsMod.isMudBricksEnabled) {
//Mud Bricks
MudBrickRaws = new Block[Global.STONE_ALL.length];

for (int i = 0; i < MudBrickRaws.length; i++)
MudBrickRaws[i] = new BlockMudBrickRaw(i).setBlockName("MudBrickRaw." + Global.STONE_ALL[i].replaceAll(" ", ""));

MudBricks = new BlockMudBricks(0).setBlockName("MudBricks");
MudBricks2 = new BlockMudBricks(16).setBlockName("MudBricks2");
}
}
}
2 changes: 0 additions & 2 deletions src/main/java/com/aleksey/decorations/core/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public class Constants
new GemInfo("Exquisite", 15),
};

public static String[] Powders = { "Gypsum Powder" };

public static int[] DyeColors = new int[] { 1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 0xB4B8B8, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320 };

public static int Brush_MbPerUse = 200;
Expand Down
19 changes: 5 additions & 14 deletions src/main/java/com/aleksey/decorations/core/FluidList.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package com.aleksey.decorations.core;

import com.aleksey.decorations.DecorationsMod;
import com.dunk.tfc.Items.ItemDyeCustom;
import com.dunk.tfc.api.TFCFluids;
import com.dunk.tfc.api.TFCItems;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;

import com.aleksey.decorations.DecorationsMod;
import com.dunk.tfc.Core.FluidBaseTFC;
import com.dunk.tfc.Items.ItemDyeCustom;
import com.dunk.tfc.api.TFCFluids;
import com.dunk.tfc.api.TFCItems;

public class FluidList
{
public static final Fluid[] alcoholFluids = new Fluid[]
Expand Down Expand Up @@ -40,16 +38,11 @@ public class FluidList
TFCFluids.BARLEYWHISKEY,
TFCFluids.RICEWHISKEY
};

public static FluidBaseTFC Plaster = new FluidBaseTFC("plaster").setBaseColor(0xD5D1C0);


public static DyeFluid[] LiquidDyes;

public static void register()
{

FluidRegistry.registerFluid(Plaster);

LiquidDyes = new DyeFluid[ItemDyeCustom.DYE_COLOR_NAMES.length];

for(int i = 0; i < LiquidDyes.length; i++)
Expand Down Expand Up @@ -92,8 +85,6 @@ public static void registerFluidContainers()
}
}

FluidContainerRegistry.registerFluidContainer(new FluidStack(Plaster, 1000), new ItemStack(ItemList.plaster), new ItemStack(TFCItems.woodenBucketEmpty));

for(int i = 0; i < LiquidDyes.length; i++)
FluidContainerRegistry.registerFluidContainer(new FluidStack(LiquidDyes[i], 1000), new ItemStack(ItemList.liquidDye, 1, i), new ItemStack(TFCItems.woodenBucketEmpty));
}
Expand Down
Loading

0 comments on commit f9d3ecf

Please sign in to comment.