Merge branch '1.12.2' of https://github.com/Electroblob77/Wizardry into 1.12.2
This commit is contained in:
@@ -198,6 +198,8 @@ public final class Settings {
|
|||||||
public boolean blindnessTweak = true;
|
public boolean blindnessTweak = true;
|
||||||
/** <b>[Server-only]</b> Whether using bonemeal on grass blocks has a chance to grow crystal flowers. */
|
/** <b>[Server-only]</b> Whether using bonemeal on grass blocks has a chance to grow crystal flowers. */
|
||||||
public boolean bonemealGrowsCrystalFlowers = true;
|
public boolean bonemealGrowsCrystalFlowers = true;
|
||||||
|
/** <b>[Server-only]</b> Whether to enable Wizardry mob loot injection. Allows an easier switch instead of blacklisting all entities. */
|
||||||
|
public boolean injectMobDrops = true;
|
||||||
/**
|
/**
|
||||||
* <b>[Server-only]</b> List of registry names of entities which summoned creatures are allowed to attack, in addition
|
* <b>[Server-only]</b> List of registry names of entities which summoned creatures are allowed to attack, in addition
|
||||||
* to the defaults.
|
* to the defaults.
|
||||||
@@ -807,6 +809,13 @@ public final class Settings {
|
|||||||
blindnessTweak = property.getBoolean();
|
blindnessTweak = property.getBoolean();
|
||||||
propOrder.add(property.getName());
|
propOrder.add(property.getName());
|
||||||
|
|
||||||
|
property = config.get(TWEAKS_CATEGORY, "injectMobDrops", true,
|
||||||
|
"Whether to inject Wizardry loot to mobs, based on the loot table 'Mob Loot Table Whitelist' / 'Mob Loot Table Blacklist' settings. If disabled, the lists won't have any effect!");
|
||||||
|
property.setLanguageKey("config." + Wizardry.MODID + ".inject_mob_drops");
|
||||||
|
Wizardry.proxy.setToNamedBooleanEntry(property);
|
||||||
|
injectMobDrops = property.getBoolean();
|
||||||
|
propOrder.add(property.getName());
|
||||||
|
|
||||||
property = config.get(TWEAKS_CATEGORY, "mobLootTableWhitelist", new String[0], "Whitelist for loot tables to inject additional mob drops (as specified in loot_tables/entities/mob_additions.json) into. Wizardry makes a best guess as to which loot tables belong to hostile mobs, but this may not always be correct or appropriate; add loot table locations (not entity IDs) to this list to manually include them.");
|
property = config.get(TWEAKS_CATEGORY, "mobLootTableWhitelist", new String[0], "Whitelist for loot tables to inject additional mob drops (as specified in loot_tables/entities/mob_additions.json) into. Wizardry makes a best guess as to which loot tables belong to hostile mobs, but this may not always be correct or appropriate; add loot table locations (not entity IDs) to this list to manually include them.");
|
||||||
property.setLanguageKey("config." + Wizardry.MODID + ".mob_loot_table_whitelist");
|
property.setLanguageKey("config." + Wizardry.MODID + ".mob_loot_table_whitelist");
|
||||||
property.setRequiresMcRestart(true);
|
property.setRequiresMcRestart(true);
|
||||||
|
|||||||
@@ -68,13 +68,15 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
|||||||
/** Data parameter for the wizard's element. */
|
/** Data parameter for the wizard's element. */
|
||||||
private static final DataParameter<Integer> ELEMENT = EntityDataManager.createKey(EntityEvilWizard.class,
|
private static final DataParameter<Integer> ELEMENT = EntityDataManager.createKey(EntityEvilWizard.class,
|
||||||
DataSerializers.VARINT);
|
DataSerializers.VARINT);
|
||||||
|
/** Data parameters for the wizard's current continuous spell. */
|
||||||
|
private static final DataParameter<String> CONTINUOUS_SPELL = EntityDataManager.createKey(EntityEvilWizard.class, DataSerializers.STRING);
|
||||||
|
private static final DataParameter<Integer> SPELL_COUNTER = EntityDataManager.createKey(EntityEvilWizard.class, DataSerializers.VARINT);
|
||||||
|
|
||||||
/** The resource location for the evil wizard's loot table. */
|
/** The resource location for the evil wizard's loot table. */
|
||||||
private static final ResourceLocation LOOT_TABLE = new ResourceLocation(Wizardry.MODID, "entities/evil_wizard");
|
private static final ResourceLocation LOOT_TABLE = new ResourceLocation(Wizardry.MODID, "entities/evil_wizard");
|
||||||
|
|
||||||
// Field implementations
|
// Field implementations
|
||||||
private List<Spell> spells = new ArrayList<Spell>(4);
|
private List<Spell> spells = new ArrayList<Spell>(4);
|
||||||
private Spell continuousSpell;
|
|
||||||
private int spellCounter;
|
|
||||||
|
|
||||||
public EntityEvilWizard(World world){
|
public EntityEvilWizard(World world){
|
||||||
|
|
||||||
@@ -93,6 +95,8 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
|||||||
super.entityInit();
|
super.entityInit();
|
||||||
this.dataManager.register(HEAL_COOLDOWN, -1);
|
this.dataManager.register(HEAL_COOLDOWN, -1);
|
||||||
this.dataManager.register(ELEMENT, -1);
|
this.dataManager.register(ELEMENT, -1);
|
||||||
|
this.dataManager.register(CONTINUOUS_SPELL, "ebwizardry:none");
|
||||||
|
this.dataManager.register(SPELL_COUNTER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -168,23 +172,23 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setContinuousSpell(Spell spell){
|
public void setContinuousSpell(Spell spell) {
|
||||||
this.continuousSpell = spell;
|
this.dataManager.set(CONTINUOUS_SPELL, spell.getRegistryName().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Spell getContinuousSpell(){
|
public Spell getContinuousSpell() {
|
||||||
return this.continuousSpell;
|
return Spell.get(this.dataManager.get(CONTINUOUS_SPELL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSpellCounter(int count){
|
public void setSpellCounter(int count) {
|
||||||
spellCounter = count;
|
this.dataManager.set(SPELL_COUNTER, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSpellCounter(){
|
public int getSpellCounter() {
|
||||||
return spellCounter;
|
return this.dataManager.get(SPELL_COUNTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -81,11 +81,12 @@ public class EntityWizard extends EntityCreature implements INpc, IMerchant, ISp
|
|||||||
private static final DataParameter<Integer> HEAL_COOLDOWN = EntityDataManager.createKey(EntityWizard.class, DataSerializers.VARINT);
|
private static final DataParameter<Integer> HEAL_COOLDOWN = EntityDataManager.createKey(EntityWizard.class, DataSerializers.VARINT);
|
||||||
/** Data parameter for the wizard's element. */
|
/** Data parameter for the wizard's element. */
|
||||||
private static final DataParameter<Integer> ELEMENT = EntityDataManager.createKey(EntityWizard.class, DataSerializers.VARINT);
|
private static final DataParameter<Integer> ELEMENT = EntityDataManager.createKey(EntityWizard.class, DataSerializers.VARINT);
|
||||||
|
/** Data parameters for the wizard's current continuous spell. */
|
||||||
|
private static final DataParameter<String> CONTINUOUS_SPELL = EntityDataManager.createKey(EntityEvilWizard.class, DataSerializers.STRING);
|
||||||
|
private static final DataParameter<Integer> SPELL_COUNTER = EntityDataManager.createKey(EntityEvilWizard.class, DataSerializers.VARINT);
|
||||||
|
|
||||||
// Field implementations
|
// Field implementations
|
||||||
private List<Spell> spells = new ArrayList<Spell>(4);
|
private List<Spell> spells = new ArrayList<Spell>(4);
|
||||||
private Spell continuousSpell;
|
|
||||||
private int spellCounter;
|
|
||||||
|
|
||||||
/** A set of the positions of the blocks that are part of this wizard's tower. */
|
/** A set of the positions of the blocks that are part of this wizard's tower. */
|
||||||
private Set<BlockPos> towerBlocks;
|
private Set<BlockPos> towerBlocks;
|
||||||
@@ -102,6 +103,8 @@ public class EntityWizard extends EntityCreature implements INpc, IMerchant, ISp
|
|||||||
super.entityInit();
|
super.entityInit();
|
||||||
this.dataManager.register(HEAL_COOLDOWN, -1);
|
this.dataManager.register(HEAL_COOLDOWN, -1);
|
||||||
this.dataManager.register(ELEMENT, 0);
|
this.dataManager.register(ELEMENT, 0);
|
||||||
|
this.dataManager.register(CONTINUOUS_SPELL, "ebwizardry:none");
|
||||||
|
this.dataManager.register(SPELL_COUNTER, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -182,23 +185,23 @@ public class EntityWizard extends EntityCreature implements INpc, IMerchant, ISp
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setContinuousSpell(Spell spell){
|
public void setContinuousSpell(Spell spell) {
|
||||||
this.continuousSpell = spell;
|
this.dataManager.set(CONTINUOUS_SPELL, spell.getRegistryName().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Spell getContinuousSpell(){
|
public Spell getContinuousSpell() {
|
||||||
return this.continuousSpell;
|
return Spell.get(this.dataManager.get(CONTINUOUS_SPELL));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSpellCounter(int count){
|
public void setSpellCounter(int count) {
|
||||||
spellCounter = count;
|
this.dataManager.set(SPELL_COUNTER, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getSpellCounter(){
|
public int getSpellCounter() {
|
||||||
return spellCounter;
|
return this.dataManager.get(SPELL_COUNTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import electroblob.wizardry.constants.Constants;
|
|||||||
import electroblob.wizardry.registry.WizardryPotions;
|
import electroblob.wizardry.registry.WizardryPotions;
|
||||||
import electroblob.wizardry.util.ParticleBuilder;
|
import electroblob.wizardry.util.ParticleBuilder;
|
||||||
import electroblob.wizardry.util.ParticleBuilder.Type;
|
import electroblob.wizardry.util.ParticleBuilder.Type;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.SharedMonsterAttributes;
|
import net.minecraft.entity.SharedMonsterAttributes;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@@ -50,4 +51,18 @@ public class PotionFrost extends PotionMagicEffect implements ICustomPotionParti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void performEffect(EntityLivingBase entitylivingbase, int strength) {
|
||||||
|
if (entitylivingbase.isBurning()) {
|
||||||
|
if (entitylivingbase.isPotionActive(WizardryPotions.frost)) {
|
||||||
|
entitylivingbase.removePotionEffect(WizardryPotions.frost);
|
||||||
|
entitylivingbase.extinguish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isReady(int duration, int amplifier) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ import electroblob.wizardry.loot.RandomSpell;
|
|||||||
import electroblob.wizardry.loot.WizardSpell;
|
import electroblob.wizardry.loot.WizardSpell;
|
||||||
import net.minecraft.entity.EnumCreatureType;
|
import net.minecraft.entity.EnumCreatureType;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.storage.loot.*;
|
import net.minecraft.world.storage.loot.LootEntry;
|
||||||
|
import net.minecraft.world.storage.loot.LootEntryTable;
|
||||||
|
import net.minecraft.world.storage.loot.LootPool;
|
||||||
|
import net.minecraft.world.storage.loot.LootTableList;
|
||||||
|
import net.minecraft.world.storage.loot.RandomValueRange;
|
||||||
import net.minecraft.world.storage.loot.conditions.LootCondition;
|
import net.minecraft.world.storage.loot.conditions.LootCondition;
|
||||||
import net.minecraft.world.storage.loot.functions.LootFunctionManager;
|
import net.minecraft.world.storage.loot.functions.LootFunctionManager;
|
||||||
import net.minecraftforge.event.LootTableLoadEvent;
|
import net.minecraftforge.event.LootTableLoadEvent;
|
||||||
@@ -90,23 +94,27 @@ public final class WizardryLoot {
|
|||||||
event.getTable().addPool(getAdditive(Wizardry.MODID + ":chests/jungle_dispenser_additions", Wizardry.MODID + "_additional_dispenser_loot"));
|
event.getTable().addPool(getAdditive(Wizardry.MODID + ":chests/jungle_dispenser_additions", Wizardry.MODID + "_additional_dispenser_loot"));
|
||||||
}
|
}
|
||||||
// Mob drops
|
// Mob drops
|
||||||
// Let's hope mods will play nice and store their entity loot tables under 'entities' or 'entity'
|
if (Wizardry.settings.injectMobDrops) {
|
||||||
// If not, packmakers will have to sort it out themselves using the whitelist/blacklist
|
// Let's hope mods will play nice and store their entity loot tables under 'entities' or 'entity'
|
||||||
if(Arrays.asList(Wizardry.settings.mobLootTableWhitelist).contains(event.getName())){
|
// If not, packmakers will have to sort it out themselves using the whitelist/blacklist
|
||||||
event.getTable().addPool(getAdditive(Wizardry.MODID + ":entities/mob_additions", Wizardry.MODID + "_additional_mob_drops"));
|
if (Arrays.asList(Wizardry.settings.mobLootTableWhitelist).contains(event.getName())) {
|
||||||
|
|
||||||
}else if(!Arrays.asList(Wizardry.settings.mobLootTableBlacklist).contains(event.getName())
|
|
||||||
&& event.getName().getPath().contains("entities") || event.getName().getPath().contains("entity")){
|
|
||||||
// Get the filename of the loot table json, for well-behaved mods this will be the entity name
|
|
||||||
String[] split = event.getName().getPath().split("/");
|
|
||||||
String entityName = split[split.length - 1];
|
|
||||||
|
|
||||||
EntityEntry entry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(entityName));
|
|
||||||
if(entry == null) return; // If this is true it didn't work :(
|
|
||||||
Class entityClass = entry.getEntityClass();
|
|
||||||
|
|
||||||
if(EnumCreatureType.MONSTER.getCreatureClass().isAssignableFrom(entityClass)){
|
|
||||||
event.getTable().addPool(getAdditive(Wizardry.MODID + ":entities/mob_additions", Wizardry.MODID + "_additional_mob_drops"));
|
event.getTable().addPool(getAdditive(Wizardry.MODID + ":entities/mob_additions", Wizardry.MODID + "_additional_mob_drops"));
|
||||||
|
|
||||||
|
} else if (!Arrays.asList(Wizardry.settings.mobLootTableBlacklist).contains(event.getName())
|
||||||
|
&& event.getName().getPath().contains("entities") || event.getName().getPath().contains("entity")) {
|
||||||
|
// Get the filename of the loot table json, for well-behaved mods this will be the entity name
|
||||||
|
String[] split = event.getName().getPath().split("/");
|
||||||
|
String entityName = split[split.length - 1];
|
||||||
|
|
||||||
|
EntityEntry entry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(entityName));
|
||||||
|
if (entry == null) {
|
||||||
|
return; // If this is true it didn't work :(
|
||||||
|
}
|
||||||
|
Class entityClass = entry.getEntityClass();
|
||||||
|
|
||||||
|
if (EnumCreatureType.MONSTER.getCreatureClass().isAssignableFrom(entityClass)) {
|
||||||
|
event.getTable().addPool(getAdditive(Wizardry.MODID + ":entities/mob_additions", Wizardry.MODID + "_additional_mob_drops"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Fishing loot
|
// Fishing loot
|
||||||
|
|||||||
@@ -103,9 +103,9 @@ public class CurseOfSoulbinding extends SpellRay {
|
|||||||
|
|
||||||
Entity entity = EntityUtils.getEntityByUUID(player.world, iterator.next());
|
Entity entity = EntityUtils.getEntityByUUID(player.world, iterator.next());
|
||||||
|
|
||||||
if(entity == null) iterator.remove();
|
if (entity == null || (entity instanceof EntityLivingBase && !((EntityLivingBase) entity).isPotionActive(WizardryPotions.curse_of_soulbinding))) {
|
||||||
|
iterator.remove();
|
||||||
if(entity instanceof EntityLivingBase){
|
} else if (entity instanceof EntityLivingBase) {
|
||||||
// Retaliatory effect
|
// Retaliatory effect
|
||||||
if(DamageSafetyChecker.attackEntitySafely(entity, MagicDamage.causeDirectMagicDamage(player,
|
if(DamageSafetyChecker.attackEntitySafely(entity, MagicDamage.causeDirectMagicDamage(player,
|
||||||
MagicDamage.DamageType.MAGIC, true), event.getAmount(), event.getSource().getDamageType(),
|
MagicDamage.DamageType.MAGIC, true), event.getAmount(), event.getSource().getDamageType(),
|
||||||
|
|||||||
@@ -1580,6 +1580,8 @@ config.ebwizardry.mob_loot_table_whitelist=Mob Loot Table Whitelist
|
|||||||
config.ebwizardry.mob_loot_table_whitelist.tooltip=Whitelist for loot tables to inject additional mob drops (as specified in loot_tables/entities/mob_additions.json) into. Wizardry makes a best guess as to which loot tables belong to hostile mobs, but this may not always be correct or appropriate; add loot table locations (not entity IDs) to this list to manually include them.
|
config.ebwizardry.mob_loot_table_whitelist.tooltip=Whitelist for loot tables to inject additional mob drops (as specified in loot_tables/entities/mob_additions.json) into. Wizardry makes a best guess as to which loot tables belong to hostile mobs, but this may not always be correct or appropriate; add loot table locations (not entity IDs) to this list to manually include them.
|
||||||
config.ebwizardry.mob_loot_table_blacklist=Mob Loot Table Blacklist
|
config.ebwizardry.mob_loot_table_blacklist=Mob Loot Table Blacklist
|
||||||
config.ebwizardry.mob_loot_table_blacklist.tooltip=Blacklist for loot tables to inject additional mob drops (as specified in loot_tables/entities/mob_additions.json) into. Wizardry makes a best guess as to which loot tables belong to hostile mobs, but this may not always be correct or appropriate; add loot table locations (not entity IDs) to this list to manually exclude them.
|
config.ebwizardry.mob_loot_table_blacklist.tooltip=Blacklist for loot tables to inject additional mob drops (as specified in loot_tables/entities/mob_additions.json) into. Wizardry makes a best guess as to which loot tables belong to hostile mobs, but this may not always be correct or appropriate; add loot table locations (not entity IDs) to this list to manually exclude them.
|
||||||
|
config.ebwizardry.inject_mob_drops=Allow Wizardry Mob Loot
|
||||||
|
config.ebwizardry.inject_mob_drops.tooltip=Whether to inject Wizardry loot to mobs, based on the loot table 'Mob Loot Table Whitelist' / 'Mob Loot Table Blacklist' settings. If disabled, the lists won't have any effect!
|
||||||
config.ebwizardry.mob_spawn_dimensions=Mob Spawning Dimensions
|
config.ebwizardry.mob_spawn_dimensions=Mob Spawning Dimensions
|
||||||
config.ebwizardry.mob_spawn_dimensions.tooltip=List of ids of dimensions in which wizardry's hostile mobs can spawn.
|
config.ebwizardry.mob_spawn_dimensions.tooltip=List of ids of dimensions in which wizardry's hostile mobs can spawn.
|
||||||
config.ebwizardry.mob_spawn_biome_blacklist=Mob Spawning Biome Blacklist
|
config.ebwizardry.mob_spawn_biome_blacklist=Mob Spawning Biome Blacklist
|
||||||
|
|||||||
Reference in New Issue
Block a user