mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-25 16:38:33 +01:00
Finally gave actual credit to people I took code from because I wanted to do that for a long time and now don't feel stupid and mean anymore
This commit is contained in:
parent
68891a5f07
commit
945ad194ce
4 changed files with 30 additions and 1 deletions
|
@ -34,7 +34,8 @@ Everything that is not listed below applies to the above.
|
|||
- When it comes to the Mod, always link back to the the Forum Thread linked above.
|
||||
|
||||
### NOTES
|
||||
- The above License only applies for Code I wrote myself, any APIs used (such as the CoFH API and the InventoryTweaks API) have their own License that is being respected.
|
||||
- The above License only applies for Code I wrote myself, any APIs used (such as the CoFH API) have their own License that is being respected.
|
||||
- There are some excerpts from other code used (such as the OpenBlocks XP System). Credit to the creators of these parts is always given and their Permission is granted or their License is respected.
|
||||
- Almost all of the Assets used in this Mod are made by Glenthor and are owned by me. You are not allowed to copy them for any other Project without my Permission.
|
||||
|
||||
© 2015 Ellpeck
|
|
@ -31,6 +31,14 @@ public class EntityLivingEvent{
|
|||
}
|
||||
|
||||
//Wings allowing Flight
|
||||
this.doWingStuff(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes players be able to fly if they have Wings Of The Bats equipped
|
||||
* (Partially excerpted from Botania's Wing System (as I had fiddled around with the system and couldn't make it work) with permission, thanks!)
|
||||
*/
|
||||
private void doWingStuff(LivingUpdateEvent event){
|
||||
if(event.entityLiving instanceof EntityPlayer){
|
||||
EntityPlayer player = (EntityPlayer)event.entityLiving;
|
||||
boolean wingsEquipped = ItemWingsOfTheBats.getWingItem(player) != null;
|
||||
|
|
|
@ -24,6 +24,8 @@ public class ItemWingsOfTheBats extends Item implements INameableItem{
|
|||
*
|
||||
* Saves Remote Players separately to make de-synced Event Calling
|
||||
* not bug out Capabilities when taking off the Wings
|
||||
*
|
||||
* (Partially excerpted from Botania's Wing System (as I had fiddled around with the system and couldn't make it work) with permission, thanks!)
|
||||
*/
|
||||
public static ArrayList<String> wingedPlayers = new ArrayList<String>();
|
||||
|
||||
|
|
|
@ -86,10 +86,22 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the Player's XP
|
||||
* (Excerpted from OpenBlocks' XP system with permission, thanks guys!)
|
||||
* @param player The Player
|
||||
* @return The XP
|
||||
*/
|
||||
private int getPlayerXP(EntityPlayer player){
|
||||
return (int)(this.getExperienceForLevel(player.experienceLevel)+(player.experience*player.xpBarCap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds (or removes, if negative) a certain amount of XP from a player
|
||||
* (Excerpted from OpenBlocks' XP system with permission, thanks guys!)
|
||||
* @param player The Player
|
||||
* @param amount The Amount
|
||||
*/
|
||||
private void addPlayerXP(EntityPlayer player, int amount){
|
||||
int experience = getPlayerXP(player)+amount;
|
||||
player.experienceTotal = experience;
|
||||
|
@ -104,6 +116,12 @@ public class TileEntityXPSolidifier extends TileEntityInventoryBase implements I
|
|||
player.experience = (float)(experience-expForLevel)/(float)player.xpBarCap();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the amount of experience a certain level contains
|
||||
* (Excerpted from OpenBlocks' XP system with permission, thanks guys!)
|
||||
* @param level The Level in question
|
||||
* @return The total XP the level has
|
||||
*/
|
||||
private int getExperienceForLevel(int level){
|
||||
if(level > 0){
|
||||
if(level > 0 && level < 16) return level*17;
|
||||
|
|
Loading…
Reference in a new issue