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:
@@ -59,6 +59,7 @@ public class EventHookContainer
|
||||
@ForgeSubscribe
|
||||
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 + ":keyLock.ogg");
|
||||
event.manager.addSound(mod_pocketDim.modid + ":keyUnlock.ogg");
|
||||
|
||||
@@ -93,7 +93,7 @@ public class BlockDimWall extends Block
|
||||
public int damageDropped(int metadata)
|
||||
{
|
||||
//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
|
||||
|
||||
@@ -27,7 +27,8 @@ import StevenDimDoors.mod_pocketDim.watcher.ClientLinkData;
|
||||
|
||||
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)
|
||||
{
|
||||
super(itemID);
|
||||
@@ -35,6 +36,7 @@ public class ItemDDKey extends Item
|
||||
this.setMaxStackSize(1);
|
||||
|
||||
}
|
||||
|
||||
public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
||||
{
|
||||
|
||||
@@ -42,7 +44,7 @@ public class ItemDDKey extends Item
|
||||
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
||||
{
|
||||
if(DDLock.hasCreatedLock(par1ItemStack))
|
||||
if (DDLock.hasCreatedLock(par1ItemStack))
|
||||
{
|
||||
par3List.add("Bound");
|
||||
}
|
||||
@@ -52,7 +54,6 @@ public class ItemDDKey extends Item
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
@@ -66,8 +67,8 @@ public class ItemDDKey extends Item
|
||||
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, float par10)
|
||||
public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World par3World, int par4, int par5, int par6, int par7, float par8, float par9,
|
||||
float par10)
|
||||
{
|
||||
player.setItemInUse(itemStack, this.getMaxItemUseDuration(itemStack));
|
||||
|
||||
@@ -77,35 +78,35 @@ public class ItemDDKey extends Item
|
||||
public boolean onItemUseFirst(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float playerX, float playerY,
|
||||
float playerZ)
|
||||
{
|
||||
if(world.isRemote)
|
||||
if (world.isRemote)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(player.getItemInUse() != null)
|
||||
if (player.getItemInUse() != null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
int blockID = world.getBlockId(x, y, z);
|
||||
//make sure we are dealing with a door
|
||||
// make sure we are dealing with a door
|
||||
if (!(Block.blocksList[blockID] instanceof IDimDoor))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
DimLink link = PocketManager.getLink(x, y, z, world);
|
||||
//dont do anything to doors without links
|
||||
// dont do anything to doors without links
|
||||
if (link == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//what to do if the door has a lock already
|
||||
if(link.hasLock())
|
||||
// what to do if the door has a lock already
|
||||
if (link.hasLock())
|
||||
{
|
||||
if(link.doesKeyUnlock(itemStack))
|
||||
if (link.doesKeyUnlock(itemStack))
|
||||
{
|
||||
if(link.getLockState())
|
||||
if (link.getLockState())
|
||||
{
|
||||
world.playSoundAtEntity(player, mod_pocketDim.modid + ":keyUnlock", 1F, 1F);
|
||||
}
|
||||
@@ -124,7 +125,7 @@ public class ItemDDKey extends Item
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!DDLock.hasCreatedLock(itemStack))
|
||||
if (!DDLock.hasCreatedLock(itemStack))
|
||||
{
|
||||
world.playSoundAtEntity(player, mod_pocketDim.modid + ":keyLock", 1F, 1F);
|
||||
PocketManager.getDimensionData(world).createLock(link, itemStack, world.rand.nextInt(Integer.MAX_VALUE));
|
||||
@@ -133,6 +134,7 @@ public class ItemDDKey extends Item
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle removal of locks here
|
||||
*/
|
||||
@@ -140,18 +142,21 @@ public class ItemDDKey extends Item
|
||||
public void onPlayerStoppedUsing(ItemStack itemStack, World world, EntityPlayer player, int 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);
|
||||
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);
|
||||
if(link!=null && link.hasLock())
|
||||
if (link != null && link.hasLock())
|
||||
{
|
||||
if (link.doesKeyUnlock(itemStack)&& !world.isRemote)
|
||||
//make sure the given key is able to access the lock
|
||||
if (link.doesKeyUnlock(itemStack) && !world.isRemote)
|
||||
{
|
||||
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,24 +164,22 @@ public class ItemDDKey extends Item
|
||||
}
|
||||
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
|
||||
public void onUsingItemTick(ItemStack stack, EntityPlayer player, int count)
|
||||
{
|
||||
|
||||
//no need to check every tick
|
||||
if(count%10 == 0)
|
||||
// no need to check every tick, twice a second instead
|
||||
if (count % 10 == 0)
|
||||
{
|
||||
MovingObjectPosition pos = getMovingObjectPositionFromPlayer(player.worldObj, player, true);
|
||||
if(pos!=null&&pos.typeOfHit == EnumMovingObjectType.TILE)
|
||||
if (pos != null && pos.typeOfHit == EnumMovingObjectType.TILE)
|
||||
{
|
||||
DimLink link = PocketManager.getLink(pos.blockX, pos.blockY, pos.blockZ, player.worldObj);
|
||||
if(link!=null && link.hasLock())
|
||||
if (link != null && link.hasLock())
|
||||
{
|
||||
if (link.doesKeyUnlock(stack))
|
||||
{
|
||||
@@ -184,7 +187,6 @@ public class ItemDDKey extends Item
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
player.clearItemInUse();
|
||||
}
|
||||
}
|
||||
@@ -199,7 +201,6 @@ public class ItemDDKey extends Item
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
|
||||
public int getMaxItemUseDuration(ItemStack par1ItemStack)
|
||||
{
|
||||
return 72000;
|
||||
@@ -207,6 +208,6 @@ public class ItemDDKey extends Item
|
||||
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack)
|
||||
{
|
||||
return StatCollector.translateToLocal(this.getUnlocalizedName(par1ItemStack) + ".name");
|
||||
return StatCollector.translateToLocal(this.getUnlocalizedName(par1ItemStack));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ public class mod_pocketDim
|
||||
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!");
|
||||
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);
|
||||
|
||||
@@ -292,12 +292,16 @@ public class mod_pocketDim
|
||||
LanguageRegistry.addName(itemRiftBlade, "Rift Blade");
|
||||
LanguageRegistry.addName(itemWorldThread, "World Thread");
|
||||
LanguageRegistry.addName(itemDDKey, "Rift Key");
|
||||
LanguageRegistry.addName(itemQuartzDoor, "Quartz Door");
|
||||
LanguageRegistry.addName(itemPersonalDoor, "Personal Dimensional Door");
|
||||
|
||||
|
||||
/**
|
||||
* Add names for multiblock inventory item
|
||||
*/
|
||||
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, 2), "Altered Fabric");
|
||||
|
||||
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);
|
||||
EntityList.IDtoClassMapping.put(properties.MonolithEntityID, MobMonolith.class);
|
||||
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);
|
||||
GameRegistry.registerCraftingHandler(new CraftingManager());
|
||||
|
||||
@@ -81,6 +81,11 @@ public class PocketProvider extends WorldProvider
|
||||
return false;
|
||||
}
|
||||
|
||||
public float calculateCelestialAngle(long par1, float par3)
|
||||
{
|
||||
return .5F;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generateLightBrightnessTable()
|
||||
{
|
||||
@@ -89,8 +94,8 @@ public class PocketProvider extends WorldProvider
|
||||
for (int steps = 0; steps <= 15; ++steps)
|
||||
{
|
||||
float var3 = 1.0F - steps / 15.0F;
|
||||
this.lightBrightnessTable[steps] = 10;
|
||||
// System.out.println( this.lightBrightnessTable[steps]+"light");
|
||||
this.lightBrightnessTable[steps] = var3;
|
||||
System.out.println( this.lightBrightnessTable[steps]+"light");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
||||
BIN
src/main/resources/assets/dimdoors/sound/doorLockRemoved.mp3
Normal file
BIN
src/main/resources/assets/dimdoors/sound/doorLockRemoved.mp3
Normal file
Binary file not shown.
BIN
src/main/resources/assets/dimdoors/sound/doorLockRemoved.ogg
Normal file
BIN
src/main/resources/assets/dimdoors/sound/doorLockRemoved.ogg
Normal file
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.1 KiB |
Reference in New Issue
Block a user