mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +01:00
Added Seasonal Mode
This commit is contained in:
parent
f036ed0a44
commit
c9c0d2952a
8 changed files with 54 additions and 14 deletions
|
@ -13,6 +13,7 @@ package ellpeck.actuallyadditions.blocks;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
|
||||
import ellpeck.actuallyadditions.proxy.ClientProxy;
|
||||
import ellpeck.actuallyadditions.util.IActAddItemOrBlock;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -32,6 +33,9 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
|
|||
public static final TheMiscBlocks[] allMiscBlocks = TheMiscBlocks.values();
|
||||
public IIcon[] textures = new IIcon[allMiscBlocks.length];
|
||||
|
||||
private IIcon stoneCasingSeasonalTop;
|
||||
private IIcon stoneCasingSeasonal;
|
||||
|
||||
public BlockMisc(){
|
||||
super(Material.rock);
|
||||
this.setHardness(1.5F);
|
||||
|
@ -41,6 +45,9 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
|
|||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata){
|
||||
if(ClientProxy.jingleAllTheWay && metadata == TheMiscBlocks.STONE_CASING.ordinal() && side != 0){
|
||||
return side == 1 ? this.stoneCasingSeasonalTop : this.stoneCasingSeasonal;
|
||||
}
|
||||
return metadata >= textures.length ? null : textures[metadata];
|
||||
}
|
||||
|
||||
|
@ -63,6 +70,9 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
|
|||
for(int i = 0; i < textures.length; i++){
|
||||
textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+allMiscBlocks[i].getName());
|
||||
}
|
||||
|
||||
this.stoneCasingSeasonalTop = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockMiscStoneCasingSnowTop");
|
||||
this.stoneCasingSeasonal = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockMiscStoneCasingSnow");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -14,6 +14,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.ActuallyAdditions;
|
||||
import ellpeck.actuallyadditions.config.values.ConfigIntValues;
|
||||
import ellpeck.actuallyadditions.proxy.ClientProxy;
|
||||
import ellpeck.actuallyadditions.tile.*;
|
||||
import ellpeck.actuallyadditions.util.IActAddItemOrBlock;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
|
@ -37,6 +38,8 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
|
|||
public Type type;
|
||||
public int range;
|
||||
|
||||
private IIcon iconSeasonal;
|
||||
|
||||
public BlockPhantom(Type type){
|
||||
super(Material.rock);
|
||||
this.type = type;
|
||||
|
@ -79,7 +82,7 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
|
|||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int metadata){
|
||||
return this.blockIcon;
|
||||
return (this.type == Type.FACE && ClientProxy.pumpkinBlurPumpkinBlur && side > 1) ? this.iconSeasonal : this.blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -121,6 +124,8 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconReg){
|
||||
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
|
||||
|
||||
this.iconSeasonal = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockPhantomfacePumpkin");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -14,6 +14,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import ellpeck.actuallyadditions.booklet.page.BookletPage;
|
||||
import ellpeck.actuallyadditions.config.GuiConfiguration;
|
||||
import ellpeck.actuallyadditions.proxy.ClientProxy;
|
||||
import ellpeck.actuallyadditions.update.UpdateChecker;
|
||||
import ellpeck.actuallyadditions.util.AssetUtil;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
|
@ -39,6 +40,8 @@ import java.util.List;
|
|||
public class GuiBooklet extends GuiScreen{
|
||||
|
||||
public static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBooklet");
|
||||
public static final ResourceLocation resLocHalloween = AssetUtil.getGuiLocation("guiBookletHalloween");
|
||||
public static final ResourceLocation resLocChristmas = AssetUtil.getGuiLocation("guiBookletChristmas");
|
||||
public static final int CHAPTER_BUTTONS_AMOUNT = 13;
|
||||
public static final int TOOLTIP_SPLIT_LENGTH = 200;
|
||||
public int xSize;
|
||||
|
@ -83,8 +86,9 @@ public class GuiBooklet extends GuiScreen{
|
|||
this.fontRendererObj.setUnicodeFlag(true);
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(resLoc);
|
||||
this.mc.getTextureManager().bindTexture(ClientProxy.jingleAllTheWay ? resLocChristmas : (ClientProxy.pumpkinBlurPumpkinBlur ? resLocHalloween : resLoc));
|
||||
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||
this.mc.getTextureManager().bindTexture(resLoc);
|
||||
|
||||
if(this.currentIndexEntry instanceof BookletEntryAllSearch && this.currentChapter == null){
|
||||
this.drawTexturedModalRect(this.guiLeft+146, this.guiTop+160, 146, 80, 70, 14);
|
||||
|
|
|
@ -16,6 +16,7 @@ import ellpeck.actuallyadditions.blocks.InitBlocks;
|
|||
import ellpeck.actuallyadditions.items.InitItems;
|
||||
import ellpeck.actuallyadditions.misc.RenderSpecial;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
|
@ -23,7 +24,7 @@ import java.util.UUID;
|
|||
|
||||
public class RenderPlayerEventAA{
|
||||
|
||||
public static RenderSpecial lariRender = new RenderSpecial(null);
|
||||
public static RenderSpecial lariRender = new RenderSpecial(new ItemStack(Items.dye));
|
||||
private static RenderSpecial ellpeckRender = new RenderSpecial(new ItemStack(InitItems.itemPhantomConnector));
|
||||
private static RenderSpecial hoseRender = new RenderSpecial(new ItemStack(Blocks.torch));
|
||||
private static RenderSpecial paktoRender = new RenderSpecial(new ItemStack(Blocks.wool, 1, 6));
|
||||
|
|
|
@ -10,18 +10,22 @@
|
|||
|
||||
package ellpeck.actuallyadditions.misc;
|
||||
|
||||
import ellpeck.actuallyadditions.event.RenderPlayerEventAA;
|
||||
import ellpeck.actuallyadditions.proxy.ClientProxy;
|
||||
import ellpeck.actuallyadditions.util.AssetUtil;
|
||||
import ellpeck.actuallyadditions.util.ModUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelSquid;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
public class RenderSpecial{
|
||||
|
||||
private static final ResourceLocation squidTextures = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/specialSquid.png");
|
||||
|
@ -37,6 +41,12 @@ public class RenderSpecial{
|
|||
return;
|
||||
}
|
||||
|
||||
if(ClientProxy.pumpkinBlurPumpkinBlur){
|
||||
this.theThingToRender = new ItemStack(Calendar.getInstance().get(Calendar.DAY_OF_MONTH) % 2 == 0 ? Blocks.lit_pumpkin : Blocks.pumpkin);
|
||||
size = 0.3F;
|
||||
offsetUp = 0;
|
||||
}
|
||||
|
||||
int bobHeight = 70;
|
||||
long theTime = Minecraft.getSystemTime();
|
||||
long time = theTime/50;
|
||||
|
@ -60,18 +70,20 @@ public class RenderSpecial{
|
|||
GL11.glRotated((double)theTime/20, 0, 1, 0);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
if(this == RenderPlayerEventAA.lariRender){
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(squidTextures);
|
||||
GL11.glRotatef(180F, 1F, 0F, 0F);
|
||||
new ModelSquid().render(null, 0F, 0F, 0.25F, 0F, 0F, 0.0625F);
|
||||
}
|
||||
else{
|
||||
if(this.theThingToRender.getItem() instanceof ItemBlock){
|
||||
AssetUtil.renderBlock(Block.getBlockFromItem(this.theThingToRender.getItem()), this.theThingToRender.getItemDamage());
|
||||
if(this.theThingToRender != null){
|
||||
if(this.theThingToRender.getItem() == Items.dye && this.theThingToRender.getItemDamage() == 0){
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(squidTextures);
|
||||
GL11.glRotatef(180F, 1F, 0F, 0F);
|
||||
new ModelSquid().render(null, 0F, 0F, 0.25F, 0F, 0F, 0.0625F);
|
||||
}
|
||||
else{
|
||||
GL11.glTranslatef(-0.5F, 0F, 0F);
|
||||
AssetUtil.renderItem(this.theThingToRender, 0);
|
||||
if(this.theThingToRender.getItem() instanceof ItemBlock){
|
||||
AssetUtil.renderBlock(Block.getBlockFromItem(this.theThingToRender.getItem()), this.theThingToRender.getItemDamage());
|
||||
}
|
||||
else{
|
||||
GL11.glTranslatef(-0.5F, 0F, 0F);
|
||||
AssetUtil.renderItem(this.theThingToRender, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
|
|
@ -31,14 +31,22 @@ import net.minecraft.util.ResourceLocation;
|
|||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Calendar;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class ClientProxy implements IProxy{
|
||||
|
||||
public static boolean pumpkinBlurPumpkinBlur;
|
||||
public static boolean jingleAllTheWay;
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event){
|
||||
ModUtil.LOGGER.info("PreInitializing ClientProxy...");
|
||||
|
||||
Calendar c = Calendar.getInstance();
|
||||
pumpkinBlurPumpkinBlur = c.get(Calendar.MONTH) == Calendar.OCTOBER;
|
||||
jingleAllTheWay = c.get(Calendar.MONTH) == Calendar.DECEMBER && c.get(Calendar.DAY_OF_MONTH) >= 6 && c.get(Calendar.DAY_OF_MONTH) <= 26;
|
||||
|
||||
PersistentClientData.setTheFile(new File(Minecraft.getMinecraft().mcDataDir, ModUtil.MOD_ID+"Data.dat"));
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 12 KiB |
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 11 KiB |
Loading…
Reference in a new issue