Skip to content

Commit

Permalink
Update 2.7,2
Browse files Browse the repository at this point in the history
Closes #94
  • Loading branch information
Aizistral committed Nov 1, 2020
1 parent 127744a commit ceb45bd
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Disable autocrlf on generated files, they always generate with LF
# Add any extra files or paths here to make git stop saying they
# are changed when only line endings change.
src/generated/**/.cache/cache text eol=lf
src/generated/**/*.json text eol=lf
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,13 @@ build
eclipse
run

# Files from Forge MDK
forge*changelog.txt
# Aizistral
.apt_generated
logs
omniconfig_first
*works
Users
.factorypath
deps/Soulbound*
multiuser_args.txt
old_enigmatic_desc.txt
File renamed without changes.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = co
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
mappings channel: 'snapshot', version: '20200723-1.16.1'

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
Expand Down Expand Up @@ -108,7 +107,7 @@ repositories {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.16.3-34.1.19'
minecraft 'net.minecraftforge:forge:1.16.3-34.1.35'

compile 'org.spongepowered:mixin:0.8.1-SNAPSHOT'

Expand All @@ -120,9 +119,10 @@ dependencies {
annotationProcessor 'org.ow2.asm:asm-util:7.2'

// These are 1.16.3 dependencies
//compile fg.deobf('generic:Soulbound:1.16.x-1.1.0')
compile fg.deobf('generic:decorativeblocks:1.16.1-1.4')
compile fg.deobf('top.theillusivec4.curios:curios-forge:1.16.3-4.0.2.0')
compile fg.deobf("vazkii.patchouli:Patchouli:1.16-42")
compile fg.deobf("vazkii.patchouli:Patchouli:1.16.2-47")

// These are 1.16.2 dependencies
//compile fg.deobf('top.theillusivec4.curios:curios-forge:1.16.2-4.0.0.1')
Expand Down
Binary file removed deps/decorativeblocks-1.16.2-1.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public class EnigmaticLegacy {
public static SimpleChannel packetInstance;

public static final String MODID = "enigmaticlegacy";
public static final String VERSION = "2.7.1";
public static final String VERSION = "2.7.2";
public static final String RELEASE_TYPE = "Release";
public static final String NAME = "Enigmatic Legacy";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.common.collect.Sets;
import com.integral.enigmaticlegacy.EnigmaticLegacy;
import com.integral.enigmaticlegacy.config.OmniconfigHandler;
import com.integral.enigmaticlegacy.enchantments.CeaselessEnchantment;
import com.integral.enigmaticlegacy.config.JsonConfigHandler;
import com.integral.enigmaticlegacy.entities.PermanentItemEntity;
import com.integral.enigmaticlegacy.gui.EnderChestInventoryButton;
Expand Down Expand Up @@ -291,7 +292,7 @@ public void onPlayerClick(PlayerInteractEvent event) {
CrossbowHelper.fireProjectiles(event.getWorld(), event.getPlayer(), event.getHand(), itemstack, CrossbowItem.func_220013_l(itemstack), 1.0F);
CrossbowItem.setCharged(itemstack, false);
event.setCancellationResult(ActionResultType.CONSUME);
} else if (!event.getPlayer().findAmmo(itemstack).isEmpty()) {
} else if (!event.getPlayer().findAmmo(itemstack).isEmpty() || (CeaselessEnchantment.allowNoArrow.getValue() && EnigmaticEnchantmentHelper.hasCeaselessEnchantment(itemstack))) {
if (!CrossbowItem.isCharged(itemstack)) {
((CrossbowItem) Items.CROSSBOW).isLoadingStart = false;
((CrossbowItem) Items.CROSSBOW).isLoadingMiddle = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public class CrossbowHelper {

public static final String sharpshooterTagPrefix = EnigmaticLegacy.MODID+":sharpshot:";

public static boolean tryCharge(LivingEntity living, ItemStack crossbow, ItemStack ammo, boolean bonusCycles, boolean isCreative, boolean noAmmoRequired) {
public static boolean tryCharge(LivingEntity living, ItemStack crossbow, ItemStack ammo, boolean bonusCycles, boolean isCreative) {
if (ammo.isEmpty())
return false;
else {
boolean creativeUsingArrows = isCreative && ammo.getItem() instanceof ArrowItem;
ItemStack itemstack;
if (!creativeUsingArrows && !isCreative && !bonusCycles && !noAmmoRequired) {
if (!creativeUsingArrows && !isCreative && !bonusCycles) {
itemstack = ammo.split(1);
if (ammo.isEmpty() && living instanceof PlayerEntity) {
((PlayerEntity) living).inventory.deleteStack(ammo);
Expand All @@ -50,7 +50,6 @@ public static boolean tryCharge(LivingEntity living, ItemStack crossbow, ItemSta
public static boolean hasAmmo(LivingEntity entityIn, ItemStack weaponStack) {
int requestedAmmo = 1;
boolean isCreative = entityIn instanceof PlayerEntity && ((PlayerEntity) entityIn).abilities.isCreativeMode;
boolean noAmmoRequired = EnigmaticEnchantmentHelper.hasCeaselessEnchantment(weaponStack) && CeaselessEnchantment.allowNoArrow.getValue();
ItemStack itemstack = entityIn.findAmmo(weaponStack);
ItemStack itemstack1 = itemstack.copy();

Expand All @@ -60,13 +59,13 @@ public static boolean hasAmmo(LivingEntity entityIn, ItemStack weaponStack) {
}

if (itemstack.isEmpty()) {
if (isCreative || noAmmoRequired) {
if (isCreative || (EnigmaticEnchantmentHelper.hasCeaselessEnchantment(weaponStack) && CeaselessEnchantment.allowNoArrow.getValue())) {
itemstack = new ItemStack(Items.ARROW);
itemstack1 = itemstack.copy();
}
}

if (!CrossbowHelper.tryCharge(entityIn, weaponStack, (itemstack.getItem().getClass() == ArrowItem.class && EnigmaticEnchantmentHelper.hasCeaselessEnchantment(weaponStack)) ? itemstack.copy() : itemstack, k > 0, isCreative, noAmmoRequired))
if (!CrossbowHelper.tryCharge(entityIn, weaponStack, (itemstack.getItem().getClass() == ArrowItem.class && EnigmaticEnchantmentHelper.hasCeaselessEnchantment(weaponStack)) ? itemstack.copy() : itemstack, k > 0, isCreative))
return false;
}

Expand Down Expand Up @@ -102,12 +101,12 @@ private static void fireProjectile(World worldIn, LivingEntity shooter, Hand han
projectileentity = new FireworkRocketEntity(worldIn, projectile, shooter, shooter.getPosX(), shooter.getPosYEye() - 0.15F, shooter.getPosZ(), true);
} else {
projectileentity = CrossbowItem.createArrow(worldIn, shooter, crossbow, projectile);
if (isCreativeMode || projectileAngle != 0.0F || EnigmaticEnchantmentHelper.hasSharpshooterEnchantment(crossbow)) {
((AbstractArrowEntity) projectileentity).pickupStatus = AbstractArrowEntity.PickupStatus.CREATIVE_ONLY;

if (EnigmaticEnchantmentHelper.hasSharpshooterEnchantment(crossbow)) {
((AbstractArrowEntity) projectileentity).addTag(CrossbowHelper.sharpshooterTagPrefix + EnigmaticEnchantmentHelper.getSharpshooterLevel(crossbow));
}
if (isCreativeMode || projectileAngle != 0.0F || EnigmaticEnchantmentHelper.hasCeaselessEnchantment(crossbow)) {
((AbstractArrowEntity) projectileentity).pickupStatus = AbstractArrowEntity.PickupStatus.CREATIVE_ONLY;
}

if (EnigmaticEnchantmentHelper.hasSharpshooterEnchantment(crossbow)) {
((AbstractArrowEntity) projectileentity).addTag(CrossbowHelper.sharpshooterTagPrefix + EnigmaticEnchantmentHelper.getSharpshooterLevel(crossbow));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
import net.minecraft.entity.ai.attributes.Attributes;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BowItem;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemModelsProperties;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Rarity;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
Expand All @@ -47,6 +49,7 @@ public class EnigmaticAmulet extends ItemBaseCurio {
public static Omniconfig.BooleanParameter vesselEnabled;
public static Omniconfig.BooleanParameter ownerOnlyVessel;
public static Omniconfig.BooleanParameter seededColorGen;
public static Omniconfig.BooleanParameter multiequip;
public static final String amuletColorTag = "AssignedColor";
public static final String amuletInscriptionTag = "Inscription";

Expand All @@ -61,15 +64,20 @@ public static void onConfig(OmniconfigWrapper builder) {

vesselEnabled = builder
.comment("Whether or not Enigmatic Amulet should be summoning Extradimensional Vessel on owner's death.")
.getBoolean("enigmaticAmuletVesselEnabled", true);
.getBoolean("EnigmaticAmuletVesselEnabled", true);

ownerOnlyVessel = builder
.comment("If true, only original owner of Extradimensional Vessel will be able to pick it up.")
.getBoolean("ownerOnlyVessel", false);
.getBoolean("OwnerOnlyVessel", false);

seededColorGen = builder
.comment("If true, color of Enigmatic Amulet will be assigned using player's name as seed for generating it, instead of randomly - so that every player will always receive one specific color.")
.getBoolean("seededColorGen", false);
.getBoolean("SeededColorGen", false);

multiequip = builder
.comment("Whether or not it should be possible to equip multiple Enigmatic Amulets, "
+ "granted player somehow gets more than one charm slot.")
.getBoolean("Multiequip", false);

builder.popPrefix();
}
Expand Down Expand Up @@ -168,6 +176,13 @@ public void registerVariants() {
return ItemNBTHelper.getFloat(stack, amuletColorTag, 0F);
});
}

@Override
public void fillItemGroup(ItemGroup group, NonNullList<ItemStack> items) {
for (AmuletColor color : AmuletColor.values()) {
items.add(this.setColor(new ItemStack(this), color));
}
}


@Override
Expand Down Expand Up @@ -278,6 +293,15 @@ public void curioTick(String identifier, int index, LivingEntity living) {
}
}
}

@Override
public boolean canEquip(String identifier, LivingEntity living) {
// TODO Looks like @TheIllusiveC4 forgot to provide us some more context again
if (multiequip.getValue()) {
return true;
} else
return super.canEquip(identifier, living);
}

@Override
public boolean showAttributesTooltip(String identifier) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
import java.util.List;
import java.util.function.Supplier;

import com.integral.enigmaticlegacy.api.generic.SubscribeConfig;
import com.integral.enigmaticlegacy.api.items.ISpellstone;
import com.integral.enigmaticlegacy.handlers.SuperpositionHandler;
import com.integral.omniconfig.wrappers.Omniconfig;
import com.integral.omniconfig.wrappers.OmniconfigWrapper;

import net.minecraft.enchantment.IVanishable;
import net.minecraft.entity.LivingEntity;
Expand All @@ -15,6 +18,16 @@
import net.minecraft.world.World;

public abstract class ItemSpellstoneCurio extends ItemBaseCurio implements ISpellstone {
public static Omniconfig.BooleanParameter multiequip;

@SubscribeConfig
public static void onConfig(OmniconfigWrapper builder) {
builder.pushPrefix("Spellstones");

multiequip = builder.comment("Whether or not it should be allowed to equip multiple spellstones if they are different items," + " granted player somehow gets more than one spellstone slot.").getBoolean("Multiequip", false);

builder.popPrefix();
}

public List<String> immunityList = new ArrayList<String>();
public HashMap<String, Supplier<Float>> resistanceList = new HashMap<String, Supplier<Float>>();
Expand Down Expand Up @@ -45,7 +58,10 @@ public static Properties getDefaultProperties() {

@Override
public boolean canEquip(String identifier, LivingEntity living) {
return super.canEquip(identifier, living) && SuperpositionHandler.getSpellstone(living) == null;
if (multiequip.getValue()) {
return super.canEquip(identifier, living);
} else
return super.canEquip(identifier, living) && SuperpositionHandler.getSpellstone(living) == null;
}

}
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ loaderVersion="[31,)"
issueTrackerURL="https://github.com/Extegral/Enigmatic-Legacy/issues"
[[mods]]
modId="enigmaticlegacy"
version="2.7.1"
version="2.7.2"
displayName="Enigmatic Legacy"
displayURL="https://www.curseforge.com/minecraft/mc-mods/enigmatic-legacy"
logoFile="EL_logo.png"
Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
The Changelog:

[Release 2.7.2]:
- Fixed Ceaseless enchantment STILL requiring arrow in inventory to work, once and for all;
- Fixed arrows shot with Ceaseless enchantment being perfectly pickapable from the ground like nobody's business;
- Creative tab of Enigmatic Legacy now contains all color variations of Enigmatic Amulet;
- Renamed some of the config options for Enigmatic Amulet for the sake of case consistency;
- Added config option to allow simultaneously equipping multiple Enigmatic Amulets (if player somehow has more than one charm slot);
- Added config option to allow simultaneously equipping multiple spellstones if they are different items (if player somehow has more than one spellstone slot).



[Release 2.7.1]:
- Fixed Forbidden Fruit checks crashing players on server if two or more are within render distance of one another (thanks Flynatol, #92);
- Hopefully fixed Ceaseless enchantment still requiring arrow in inventory to work.
Expand Down

0 comments on commit ceb45bd

Please sign in to comment.