Added Seasonal Mode

This commit is contained in:
Ellpeck 2015-10-18 19:56:18 +02:00
parent f036ed0a44
commit c9c0d2952a
8 changed files with 54 additions and 14 deletions

View file

@ -13,6 +13,7 @@ package ellpeck.actuallyadditions.blocks;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks;
import ellpeck.actuallyadditions.proxy.ClientProxy;
import ellpeck.actuallyadditions.util.IActAddItemOrBlock; import ellpeck.actuallyadditions.util.IActAddItemOrBlock;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -32,6 +33,9 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
public static final TheMiscBlocks[] allMiscBlocks = TheMiscBlocks.values(); public static final TheMiscBlocks[] allMiscBlocks = TheMiscBlocks.values();
public IIcon[] textures = new IIcon[allMiscBlocks.length]; public IIcon[] textures = new IIcon[allMiscBlocks.length];
private IIcon stoneCasingSeasonalTop;
private IIcon stoneCasingSeasonal;
public BlockMisc(){ public BlockMisc(){
super(Material.rock); super(Material.rock);
this.setHardness(1.5F); this.setHardness(1.5F);
@ -41,6 +45,9 @@ public class BlockMisc extends Block implements IActAddItemOrBlock{
@Override @Override
public IIcon getIcon(int side, int metadata){ 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]; 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++){ for(int i = 0; i < textures.length; i++){
textures[i] = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()+allMiscBlocks[i].getName()); 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 @Override

View file

@ -14,6 +14,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.ActuallyAdditions;
import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.config.values.ConfigIntValues;
import ellpeck.actuallyadditions.proxy.ClientProxy;
import ellpeck.actuallyadditions.tile.*; import ellpeck.actuallyadditions.tile.*;
import ellpeck.actuallyadditions.util.IActAddItemOrBlock; import ellpeck.actuallyadditions.util.IActAddItemOrBlock;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
@ -37,6 +38,8 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
public Type type; public Type type;
public int range; public int range;
private IIcon iconSeasonal;
public BlockPhantom(Type type){ public BlockPhantom(Type type){
super(Material.rock); super(Material.rock);
this.type = type; this.type = type;
@ -79,7 +82,7 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
@Override @Override
public IIcon getIcon(int side, int metadata){ public IIcon getIcon(int side, int metadata){
return this.blockIcon; return (this.type == Type.FACE && ClientProxy.pumpkinBlurPumpkinBlur && side > 1) ? this.iconSeasonal : this.blockIcon;
} }
@Override @Override
@ -121,6 +124,8 @@ public class BlockPhantom extends BlockContainerBase implements IActAddItemOrBlo
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconReg){ public void registerBlockIcons(IIconRegister iconReg){
this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName()); this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":"+this.getName());
this.iconSeasonal = iconReg.registerIcon(ModUtil.MOD_ID_LOWER+":blockPhantomfacePumpkin");
} }
@Override @Override

View file

@ -14,6 +14,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import ellpeck.actuallyadditions.booklet.page.BookletPage; import ellpeck.actuallyadditions.booklet.page.BookletPage;
import ellpeck.actuallyadditions.config.GuiConfiguration; import ellpeck.actuallyadditions.config.GuiConfiguration;
import ellpeck.actuallyadditions.proxy.ClientProxy;
import ellpeck.actuallyadditions.update.UpdateChecker; import ellpeck.actuallyadditions.update.UpdateChecker;
import ellpeck.actuallyadditions.util.AssetUtil; import ellpeck.actuallyadditions.util.AssetUtil;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
@ -39,6 +40,8 @@ import java.util.List;
public class GuiBooklet extends GuiScreen{ public class GuiBooklet extends GuiScreen{
public static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiBooklet"); 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 CHAPTER_BUTTONS_AMOUNT = 13;
public static final int TOOLTIP_SPLIT_LENGTH = 200; public static final int TOOLTIP_SPLIT_LENGTH = 200;
public int xSize; public int xSize;
@ -83,8 +86,9 @@ public class GuiBooklet extends GuiScreen{
this.fontRendererObj.setUnicodeFlag(true); this.fontRendererObj.setUnicodeFlag(true);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); 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.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
this.mc.getTextureManager().bindTexture(resLoc);
if(this.currentIndexEntry instanceof BookletEntryAllSearch && this.currentChapter == null){ if(this.currentIndexEntry instanceof BookletEntryAllSearch && this.currentChapter == null){
this.drawTexturedModalRect(this.guiLeft+146, this.guiTop+160, 146, 80, 70, 14); this.drawTexturedModalRect(this.guiLeft+146, this.guiTop+160, 146, 80, 70, 14);

View file

@ -16,6 +16,7 @@ import ellpeck.actuallyadditions.blocks.InitBlocks;
import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.InitItems;
import ellpeck.actuallyadditions.misc.RenderSpecial; import ellpeck.actuallyadditions.misc.RenderSpecial;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.client.event.RenderPlayerEvent;
@ -23,7 +24,7 @@ import java.util.UUID;
public class RenderPlayerEventAA{ 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 ellpeckRender = new RenderSpecial(new ItemStack(InitItems.itemPhantomConnector));
private static RenderSpecial hoseRender = new RenderSpecial(new ItemStack(Blocks.torch)); private static RenderSpecial hoseRender = new RenderSpecial(new ItemStack(Blocks.torch));
private static RenderSpecial paktoRender = new RenderSpecial(new ItemStack(Blocks.wool, 1, 6)); private static RenderSpecial paktoRender = new RenderSpecial(new ItemStack(Blocks.wool, 1, 6));

View file

@ -10,18 +10,22 @@
package ellpeck.actuallyadditions.misc; package ellpeck.actuallyadditions.misc;
import ellpeck.actuallyadditions.event.RenderPlayerEventAA; import ellpeck.actuallyadditions.proxy.ClientProxy;
import ellpeck.actuallyadditions.util.AssetUtil; import ellpeck.actuallyadditions.util.AssetUtil;
import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelSquid; import net.minecraft.client.model.ModelSquid;
import net.minecraft.entity.player.EntityPlayer; 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.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import java.util.Calendar;
public class RenderSpecial{ public class RenderSpecial{
private static final ResourceLocation squidTextures = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/specialSquid.png"); private static final ResourceLocation squidTextures = new ResourceLocation(ModUtil.MOD_ID_LOWER, "textures/specialSquid.png");
@ -37,6 +41,12 @@ public class RenderSpecial{
return; 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; int bobHeight = 70;
long theTime = Minecraft.getSystemTime(); long theTime = Minecraft.getSystemTime();
long time = theTime/50; long time = theTime/50;
@ -60,7 +70,8 @@ public class RenderSpecial{
GL11.glRotated((double)theTime/20, 0, 1, 0); GL11.glRotated((double)theTime/20, 0, 1, 0);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
if(this == RenderPlayerEventAA.lariRender){ if(this.theThingToRender != null){
if(this.theThingToRender.getItem() == Items.dye && this.theThingToRender.getItemDamage() == 0){
Minecraft.getMinecraft().renderEngine.bindTexture(squidTextures); Minecraft.getMinecraft().renderEngine.bindTexture(squidTextures);
GL11.glRotatef(180F, 1F, 0F, 0F); GL11.glRotatef(180F, 1F, 0F, 0F);
new ModelSquid().render(null, 0F, 0F, 0.25F, 0F, 0F, 0.0625F); new ModelSquid().render(null, 0F, 0F, 0.25F, 0F, 0F, 0.0625F);
@ -74,6 +85,7 @@ public class RenderSpecial{
AssetUtil.renderItem(this.theThingToRender, 0); AssetUtil.renderItem(this.theThingToRender, 0);
} }
} }
}
GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix(); GL11.glPopMatrix();

View file

@ -31,14 +31,22 @@ import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.MinecraftForgeClient;
import java.io.File; import java.io.File;
import java.util.Calendar;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class ClientProxy implements IProxy{ public class ClientProxy implements IProxy{
public static boolean pumpkinBlurPumpkinBlur;
public static boolean jingleAllTheWay;
@Override @Override
public void preInit(FMLPreInitializationEvent event){ public void preInit(FMLPreInitializationEvent event){
ModUtil.LOGGER.info("PreInitializing ClientProxy..."); 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")); 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