Added backwards light and bugfixes

Light in pockets is now reversed
added sound to lock removal
fixed monolith name
fixed other names
This commit is contained in:
StevenRS11
2014-06-26 00:08:20 -04:00
parent eff8379325
commit 9baceb8e3c
8 changed files with 101 additions and 90 deletions

View File

@@ -59,6 +59,7 @@ public class EventHookContainer
@ForgeSubscribe @ForgeSubscribe
public void onSoundLoad(SoundLoadEvent event) public void onSoundLoad(SoundLoadEvent event)
{ {
event.manager.addSound(mod_pocketDim.modid + ":doorLockRemoved.ogg");
event.manager.addSound(mod_pocketDim.modid + ":doorLocked.ogg"); event.manager.addSound(mod_pocketDim.modid + ":doorLocked.ogg");
event.manager.addSound(mod_pocketDim.modid + ":keyLock.ogg"); event.manager.addSound(mod_pocketDim.modid + ":keyLock.ogg");
event.manager.addSound(mod_pocketDim.modid + ":keyUnlock.ogg"); event.manager.addSound(mod_pocketDim.modid + ":keyUnlock.ogg");

View File

@@ -93,7 +93,7 @@ public class BlockDimWall extends Block
public int damageDropped(int metadata) public int damageDropped(int metadata)
{ {
//Return 0 to avoid dropping Ancient Fabric even if the player somehow manages to break it //Return 0 to avoid dropping Ancient Fabric even if the player somehow manages to break it
return metadata == 1 ? 0 : 2; return metadata == 1 ? 0 : metadata;
} }
@Override @Override

View File

@@ -27,7 +27,8 @@ import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
public class ItemDDKey extends Item public class ItemDDKey extends Item
{ {
public static final int TIME_TO_UNLOCK = 50; public static final int TIME_TO_UNLOCK = 30;
public ItemDDKey(int itemID) public ItemDDKey(int itemID)
{ {
super(itemID); super(itemID);
@@ -35,6 +36,7 @@ public class ItemDDKey extends Item
this.setMaxStackSize(1); this.setMaxStackSize(1);
} }
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{ {
@@ -52,7 +54,6 @@ public class ItemDDKey extends Item
} }
} }
@Override @Override
public void registerIcons(IconRegister par1IconRegister) public void registerIcons(IconRegister par1IconRegister)
{ {
@@ -66,8 +67,8 @@ public class ItemDDKey extends Item
return !DDLock.hasCreatedLock(par1ItemStack); return !DDLock.hasCreatedLock(par1ItemStack);
} }
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9,
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) float par10)
{ {
player.setItemInUse(itemStack, this.getMaxItemUseDuration(itemStack)); player.setItemInUse(itemStack, this.getMaxItemUseDuration(itemStack));
@@ -133,6 +134,7 @@ public class ItemDDKey extends Item
} }
return false; return false;
} }
/** /**
* Handle removal of locks here * Handle removal of locks here
*/ */
@@ -142,16 +144,19 @@ public class ItemDDKey extends Item
int j = this.getMaxItemUseDuration(itemStack) - heldTime; int j = this.getMaxItemUseDuration(itemStack) - heldTime;
if (j >= TIME_TO_UNLOCK) if (j >= TIME_TO_UNLOCK)
{ {
//Raytrace to make sure we are still looking at a door
MovingObjectPosition pos = getMovingObjectPositionFromPlayer(player.worldObj, player, true); MovingObjectPosition pos = getMovingObjectPositionFromPlayer(player.worldObj, player, true);
if (pos != null && pos.typeOfHit == EnumMovingObjectType.TILE) if (pos != null && pos.typeOfHit == EnumMovingObjectType.TILE)
{ {
//make sure we have a link and it has a lock
DimLink link = PocketManager.getLink(pos.blockX, pos.blockY, pos.blockZ, player.worldObj); DimLink link = PocketManager.getLink(pos.blockX, pos.blockY, pos.blockZ, player.worldObj);
if (link != null && link.hasLock()) if (link != null && link.hasLock())
{ {
//make sure the given key is able to access the lock
if (link.doesKeyUnlock(itemStack) && !world.isRemote) if (link.doesKeyUnlock(itemStack) && !world.isRemote)
{ {
PocketManager.getDimensionData(world).removeLock(link, itemStack); PocketManager.getDimensionData(world).removeLock(link, itemStack);
world.playSoundAtEntity(player, mod_pocketDim.modid + ":keyUnlock", 1F, 1F); world.playSoundAtEntity(player, mod_pocketDim.modid + ":doorLockRemoved", 1F, 1F);
} }
} }
@@ -159,17 +164,15 @@ public class ItemDDKey extends Item
} }
player.clearItemInUse(); player.clearItemInUse();
} }
/** /**
* Raytrace to make sure we are still looking at the right block * Raytrace to make sure we are still looking at the right block while preparing to remove the lock
*/ */
@Override @Override
public void onUsingItemTick(ItemStack stack, EntityPlayer player, int count) public void onUsingItemTick(ItemStack stack, EntityPlayer player, int count)
{ {
// no need to check every tick, twice a second instead
//no need to check every tick
if (count % 10 == 0) if (count % 10 == 0)
{ {
MovingObjectPosition pos = getMovingObjectPositionFromPlayer(player.worldObj, player, true); MovingObjectPosition pos = getMovingObjectPositionFromPlayer(player.worldObj, player, true);
@@ -184,7 +187,6 @@ public class ItemDDKey extends Item
} }
} }
} }
player.clearItemInUse(); player.clearItemInUse();
} }
} }
@@ -199,7 +201,6 @@ public class ItemDDKey extends Item
return par1ItemStack; return par1ItemStack;
} }
public int getMaxItemUseDuration(ItemStack par1ItemStack) public int getMaxItemUseDuration(ItemStack par1ItemStack)
{ {
return 72000; return 72000;
@@ -207,6 +208,6 @@ public class ItemDDKey extends Item
public String getItemStackDisplayName(ItemStack par1ItemStack) public String getItemStackDisplayName(ItemStack par1ItemStack)
{ {
return StatCollector.translateToLocal(this.getUnlocalizedName(par1ItemStack) + ".name"); return StatCollector.translateToLocal(this.getUnlocalizedName(par1ItemStack));
} }
} }

View File

@@ -264,7 +264,7 @@ public class mod_pocketDim
if (!DimensionManager.registerProviderType(properties.LimboProviderID, LimboProvider.class, false)) if (!DimensionManager.registerProviderType(properties.LimboProviderID, LimboProvider.class, false))
throw new IllegalStateException("There is a provider ID conflict between LimboProvider from Dimensional Doors and another provider type. Fix your configuration!"); throw new IllegalStateException("There is a provider ID conflict between LimboProvider from Dimensional Doors and another provider type. Fix your configuration!");
if (!DimensionManager.registerProviderType(properties.PersonalPocketProviderID, PersonalPocketProvider.class, false)) if (!DimensionManager.registerProviderType(properties.PersonalPocketProviderID, PersonalPocketProvider.class, false))
throw new IllegalStateException("There is a provider ID conflict between LimboProvider from Dimensional Doors and another provider type. Fix your configuration!"); throw new IllegalStateException("There is a provider ID conflict between PersonalPocketProvider from Dimensional Doors and another provider type. Fix your configuration!");
DimensionManager.registerDimension(properties.LimboDimensionID, properties.LimboProviderID); DimensionManager.registerDimension(properties.LimboDimensionID, properties.LimboProviderID);
@@ -292,12 +292,16 @@ public class mod_pocketDim
LanguageRegistry.addName(itemRiftBlade, "Rift Blade"); LanguageRegistry.addName(itemRiftBlade, "Rift Blade");
LanguageRegistry.addName(itemWorldThread, "World Thread"); LanguageRegistry.addName(itemWorldThread, "World Thread");
LanguageRegistry.addName(itemDDKey, "Rift Key"); LanguageRegistry.addName(itemDDKey, "Rift Key");
LanguageRegistry.addName(itemQuartzDoor, "Quartz Door");
LanguageRegistry.addName(itemPersonalDoor, "Personal Dimensional Door");
/** /**
* Add names for multiblock inventory item * Add names for multiblock inventory item
*/ */
LanguageRegistry.addName(new ItemStack(blockDimWall, 1, 0), "Fabric of Reality"); LanguageRegistry.addName(new ItemStack(blockDimWall, 1, 0), "Fabric of Reality");
LanguageRegistry.addName(new ItemStack(blockDimWall, 1, 1), "Ancient Fabric"); LanguageRegistry.addName(new ItemStack(blockDimWall, 1, 1), "Ancient Fabric");
LanguageRegistry.addName(new ItemStack(blockDimWall, 1, 2), "Altered Fabric");
LanguageRegistry.instance().addStringLocalization("itemGroup.dimDoorsCustomTab", "en_US", "Dimensional Doors Items"); LanguageRegistry.instance().addStringLocalization("itemGroup.dimDoorsCustomTab", "en_US", "Dimensional Doors Items");
@@ -309,7 +313,7 @@ public class mod_pocketDim
EntityRegistry.registerModEntity(MobMonolith.class, "Monolith", properties.MonolithEntityID, this, 70, 1, true); EntityRegistry.registerModEntity(MobMonolith.class, "Monolith", properties.MonolithEntityID, this, 70, 1, true);
EntityList.IDtoClassMapping.put(properties.MonolithEntityID, MobMonolith.class); EntityList.IDtoClassMapping.put(properties.MonolithEntityID, MobMonolith.class);
EntityList.entityEggs.put(properties.MonolithEntityID, new EntityEggInfo(properties.MonolithEntityID, 0, 0xffffff)); EntityList.entityEggs.put(properties.MonolithEntityID, new EntityEggInfo(properties.MonolithEntityID, 0, 0xffffff));
LanguageRegistry.instance().addStringLocalization("entity.DimDoors.Obelisk.name", "Monolith"); LanguageRegistry.instance().addStringLocalization("entity.dimdoors.Monolith.name", "Monolith");
CraftingManager.registerRecipes(properties); CraftingManager.registerRecipes(properties);
GameRegistry.registerCraftingHandler(new CraftingManager()); GameRegistry.registerCraftingHandler(new CraftingManager());

View File

@@ -81,6 +81,11 @@ public class PocketProvider extends WorldProvider
return false; return false;
} }
public float calculateCelestialAngle(long par1, float par3)
{
return .5F;
}
@Override @Override
protected void generateLightBrightnessTable() protected void generateLightBrightnessTable()
{ {
@@ -89,8 +94,8 @@ public class PocketProvider extends WorldProvider
for (int steps = 0; steps <= 15; ++steps) for (int steps = 0; steps <= 15; ++steps)
{ {
float var3 = 1.0F - steps / 15.0F; float var3 = 1.0F - steps / 15.0F;
this.lightBrightnessTable[steps] = 10; this.lightBrightnessTable[steps] = var3;
// System.out.println( this.lightBrightnessTable[steps]+"light"); System.out.println( this.lightBrightnessTable[steps]+"light");
} }
} }
@Override @Override

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB