-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ new enchantment: Pheonix Dive + Dodge now gives 5 second of knockback immunity + code optimalization
- Loading branch information
Showing
17 changed files
with
558 additions
and
422 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
WonderfulEnchantments1-15-2/src/main/java/com/wonderfulenchantments/EnchantmentTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.wonderfulenchantments; | ||
|
||
import net.minecraft.enchantment.EnchantmentType; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemGroup; | ||
import net.minecraft.item.ShieldItem; | ||
|
||
public class EnchantmentTypes { | ||
public static final EnchantmentType SHIELD = EnchantmentType.create( "shield", ( Item item )->item instanceof ShieldItem ); | ||
|
||
public static void addTypeToItemGroup( EnchantmentType type, ItemGroup itemGroup ) { | ||
EnchantmentType[] group = itemGroup.getRelevantEnchantmentTypes(); | ||
EnchantmentType[] temporary = new EnchantmentType[ group.length + 1 ]; | ||
System.arraycopy( group, 0, temporary, 0, group.length ); | ||
temporary[ group.length - 1 ] = type; | ||
itemGroup.setRelevantEnchantmentTypes( temporary ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.