Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Commit

Permalink
Cleaning up that secret thing thing.
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Aug 2, 2014
1 parent 6433d35 commit 6b9cb02
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 32 deletions.
12 changes: 9 additions & 3 deletions resources/assets/iguanatweakstconstruct/lang/en_US.lang
Expand Up @@ -40,6 +40,12 @@ item.iguana.tcon.skull.blaze.name=Blaze Head
item.iguana.tcon.skull.blizz.name=Blizz Head


item.iguana.tcon.wearableBucket.bucketHoley.name=Holey Bucket
item.iguana.tcon.wearableBucket.clayBucketCracked.name=Cracked Clay Bucket
item.iguana.tcon.wearableBucket.endermanJaw.name=Enderman Jaw
item.iguana.tcon.wearable.bucketHoley.name=Holey Bucket
item.iguana.tcon.wearable.clayBucketCracked.name=Cracked Clay Bucket
item.iguana.tcon.wearable.endermanJaw.name=Enderman Jaw
item.iguana.tcon.wearable.bathat.name=Bat Hat

tooltip.bucketHoley=A bucket with holes. How useful.
tooltip.clayBucketCracked=It broke. :(
tooltip.endermanJaw=A distinct lack of head is noticable.
tooltip.bathat=NANANANANANANANA
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Expand Up @@ -30,6 +30,7 @@
import net.minecraft.item.Item;

import java.util.List;
import java.util.Random;

// inofficial todo list:
// todo: check out what mining-maxlvl i wont for emerald/diamond modifier.
Expand Down Expand Up @@ -57,6 +58,8 @@ public class IguanaTweaksTConstruct {
@SidedProxy(clientSide= Reference.PROXY_CLIENT_CLASS, serverSide= Reference.PROXY_SERVER_CLASS)
public static CommonProxy proxy;

public static Random random = new Random();

public static boolean isToolLevelingActive = false;
public static boolean isHarvestTweaksActive = false;
public static boolean isMobHeadsActive = false;
Expand Down
Expand Up @@ -3,11 +3,9 @@
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct;
import iguanaman.iguanatweakstconstruct.claybuckets.items.ClayBucket;
import iguanaman.iguanatweakstconstruct.claybuckets.items.ClayBucketMilk;
import iguanaman.iguanatweakstconstruct.claybuckets.items.ClayBucketTinkerLiquids;
import iguanaman.iguanatweakstconstruct.mobheads.items.WearableBucket;
import iguanaman.iguanatweakstconstruct.reference.Reference;
import iguanaman.iguanatweakstconstruct.util.Log;
import mantle.pulsar.pulse.Handler;
Expand Down
@@ -1,6 +1,8 @@
package iguanaman.iguanatweakstconstruct.claybuckets.items;

import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct;
import iguanaman.iguanatweakstconstruct.claybuckets.IguanaItems;
import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads;
import iguanaman.iguanatweakstconstruct.reference.Reference;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -43,6 +45,11 @@ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer
if(isHot)
{
itemStack.stackSize--;

// very very rarely, you'll get a broken bucket!
if(IguanaTweaksTConstruct.isMobHeadsActive && itemStack.stackSize == 0 && IguanaTweaksTConstruct.random.nextInt(1000) == 0)
return new ItemStack(IguanaMobHeads.wearables, 1, 1);

return itemStack;
}

Expand Down
@@ -1,6 +1,5 @@
package iguanaman.iguanatweakstconstruct.mobheads;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
Expand All @@ -9,11 +8,10 @@
import iguanaman.iguanatweakstconstruct.mobheads.blocks.IguanaSkullBlock;
import iguanaman.iguanatweakstconstruct.mobheads.handlers.MobHeadHandler;
import iguanaman.iguanatweakstconstruct.mobheads.items.IguanaSkull;
import iguanaman.iguanatweakstconstruct.mobheads.items.WearableBucket;
import iguanaman.iguanatweakstconstruct.mobheads.items.Wearable;
import iguanaman.iguanatweakstconstruct.mobheads.proxy.MobHeadCommonProxy;
import iguanaman.iguanatweakstconstruct.mobheads.handlers.RenderPlayerHandler;
import iguanaman.iguanatweakstconstruct.mobheads.tileentities.IguanaSkullTileEntity;
import iguanaman.iguanatweakstconstruct.old.blocks.IguanaTileEntitySkull;
import iguanaman.iguanatweakstconstruct.reference.Reference;
import iguanaman.iguanatweakstconstruct.util.Log;
import mantle.pulsar.pulse.Handler;
Expand All @@ -29,7 +27,7 @@
public class IguanaMobHeads {
public static Item skullItem;
public static Block skullBlock;
public static Item wearableBuckets; // secret thing
public static Item wearables; // secret thing

@SidedProxy(clientSide = "iguanaman.iguanatweakstconstruct.mobheads.proxy.MobHeadClientProxy", serverSide = "iguanaman.iguanatweakstconstruct.mobheads.proxy.MobHeadCommonProxy")
public static MobHeadCommonProxy proxy;
Expand All @@ -50,8 +48,8 @@ public void preInit(FMLPreInitializationEvent event)
GameRegistry.registerTileEntity(IguanaSkullTileEntity.class, "skullTE");

// psssssst!
wearableBuckets = new WearableBucket();
GameRegistry.registerItem(wearableBuckets, "wearableBucket");
wearables = new Wearable();
GameRegistry.registerItem(wearables, "wearableBucket");
}

@Handler
Expand Down
Expand Up @@ -2,11 +2,10 @@

import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct;
import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads;
import iguanaman.iguanatweakstconstruct.mobheads.items.IguanaSkull;
import iguanaman.iguanatweakstconstruct.reference.Config;
import iguanaman.iguanatweakstconstruct.util.Log;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.item.EntityItem;
Expand All @@ -17,16 +16,12 @@
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.event.entity.living.LivingDropsEvent;
import tconstruct.TConstruct;
import tconstruct.library.tools.ToolCore;
import tconstruct.tools.TinkerTools;

import java.util.Iterator;
import java.util.Random;

public class MobHeadHandler {
private static Random random = new Random();

@SubscribeEvent(priority = EventPriority.LOWEST)
public void LivingDrops(LivingDropsEvent event)
{
Expand Down Expand Up @@ -62,7 +57,7 @@ public void LivingDrops(LivingDropsEvent event)
beheading += 2;
}
// roll the dice
if(random.nextInt(100) > beheading * Config.beheadingHeadDropChance + Config.baseHeadDropChance)
if(IguanaTweaksTConstruct.random.nextInt(100) > beheading * Config.beheadingHeadDropChance + Config.baseHeadDropChance)
return;

Item skullItem = null;
Expand All @@ -89,6 +84,13 @@ else if (mob instanceof EntityCreeper) {
else if (mob instanceof EntityEnderman) {
skullItem = IguanaMobHeads.skullItem;
skullId = IguanaSkull.META_ENDERMAN;

// sometimes, very very rarely, you'll only get the jaw :D
if(IguanaTweaksTConstruct.random.nextInt(2) == 0)
{
skullItem = IguanaMobHeads.wearables;
skullId = 2;
}
}
else if (mob instanceof EntityBlaze) {
skullItem = IguanaMobHeads.skullItem;
Expand Down
Expand Up @@ -21,7 +21,7 @@ public void renderSkullHelmet(RenderPlayerEvent.SetArmorModel event)
return;

Item item = itemStack.getItem();
boolean isBucket = IguanaTweaksTConstruct.isItemsActive && item == IguanaMobHeads.wearableBuckets;
boolean isBucket = IguanaTweaksTConstruct.isItemsActive && item == IguanaMobHeads.wearables;
if(item != IguanaMobHeads.skullItem && !isBucket)
return;

Expand Down
Expand Up @@ -7,20 +7,23 @@
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;

import java.util.List;

public class WearableBucket extends Item {
private static final String[] textureTypes = new String[] {"bucketHoley", "clayBucketCracked", "endermanJaw"};
public class Wearable extends Item {
private static final String[] textureTypes = new String[] {"bucketHoley", "clayBucketCracked", "endermanJaw", "bathat"};
private IIcon[] icons;

public WearableBucket() {
public Wearable() {
super();
this.setContainerItem(IguanaMobHeads.wearableBuckets);
this.setUnlocalizedName(Reference.prefix("wearableBucket"));
this.setContainerItem(IguanaMobHeads.wearables);
this.setUnlocalizedName(Reference.prefix("wearable"));

this.setMaxStackSize(1);
}
Expand All @@ -30,6 +33,12 @@ public boolean isValidArmor(ItemStack stack, int armorType, Entity entity) {
return armorType == 0; // 0 = helmet
}

@Override
public void addInformation(ItemStack item, EntityPlayer player, List tooltips, boolean advanced) {
// specul tooltips
tooltips.add(EnumChatFormatting.DARK_GRAY + StatCollector.translateToLocal("tooltip." + textureTypes[item.getItemDamage()]));
}

@Override
public String getUnlocalizedName(ItemStack par1ItemStack)
{
Expand Down
@@ -1,7 +1,6 @@
package iguanaman.iguanatweakstconstruct.mobheads.proxy;

import cpw.mods.fml.client.registry.ClientRegistry;
import iguanaman.iguanatweakstconstruct.IguanaTweaksTConstruct;
import iguanaman.iguanatweakstconstruct.mobheads.IguanaMobHeads;
import iguanaman.iguanatweakstconstruct.mobheads.renderers.IguanaTileEntitySkullRenderer;
import iguanaman.iguanatweakstconstruct.mobheads.tileentities.IguanaSkullTileEntity;
Expand All @@ -14,12 +13,8 @@ public void initialize() {
}

public void postInit() {
// hide secret stuff ;)
if(IguanaTweaksTConstruct.isItemsActive)
{
codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearableBuckets, 1, 0));
codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearableBuckets, 1, 1));
codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearableBuckets, 1, 2));
}
codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearables, 1, 0));
codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearables, 1, 1));
codechicken.nei.api.API.hideItem(new ItemStack(IguanaMobHeads.wearables, 1, 2));
}
}
Expand Up @@ -83,6 +83,8 @@ else if(meta == 1)
renderSkull(x,y,z, r, sidePlacement, modelBucketHelmet, textureClayBucketHelmet);
else if(meta == 2)
renderSkull(x,y,z, r, sidePlacement, modelEnderManJaw, textures[0]);
else if(meta == 3)
renderSkull(x,y,z, r, sidePlacement, modelSkull, textures[0]);
}

public void renderSkull(float x, float y, float z, float r, int sidePlacement, ModelBase model, ResourceLocation texture)
Expand Down

0 comments on commit 6b9cb02

Please sign in to comment.