Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c1042f686 | |||
| cad3fee1b9 | |||
| 5947b2ee62 | |||
| 177a39bad1 | |||
| cdf8f6e32d | |||
| f88aac11e9 | |||
| 05b905b988 | |||
| 669cd2892d | |||
| dd07d08ff0 | |||
| 54bb327fdf | |||
| 2cd8b46c1f | |||
| b61413f7f1 | |||
| 4e7765a7e7 | |||
| 49a6dc43c1 | |||
| b82bc6698f | |||
| 1e43c67660 | |||
| c129571167 | |||
| b23a643c0e | |||
| 194bff3e6a | |||
| 426ca78288 | |||
| f15919fdce | |||
| 2124842136 | |||
| 70e697876b | |||
| 9b5e5a871c | |||
| 5ba92e5de5 | |||
| 4e6780a3cf | |||
| 00584ad635 | |||
| f72ed33515 | |||
| c2366ed1ba | |||
| 46df8d7311 | |||
| d4579b9184 | |||
| ee6f0cfe70 | |||
| 6155fd9c68 | |||
| 32c0608b51 | |||
| 404df6af23 | |||
| 764e10538b | |||
| 6b1b590e30 | |||
| 8360e520cd | |||
| 005a17d750 | |||
| 28abe036a0 | |||
| ca96112b67 | |||
| b8e847c6a6 | |||
| 35cb2c31fc | |||
| 30dd587d34 | |||
| 4644814582 | |||
| 7db3151d8a | |||
| c8ca73cca9 | |||
| d5a0479ebe |
@@ -21,4 +21,5 @@ build
|
||||
eclipse
|
||||
run
|
||||
misc
|
||||
libs
|
||||
Thumbs.db
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
# License
|
||||
This repository is copyright © Electroblob 2018. The following license is provided to allow you to creatively contribute to and improve the repository.
|
||||
|
||||
This license applies only to the source code and assets present in this repository. The compiled mod (available at https://minecraft.curseforge.com/projects/electroblobs-wizardry) comes under its own separate license, see the aforementioned webpage for details.
|
||||
This license applies only to the source code, assets and wiki pages present in this repository. The compiled mod (available at https://minecraft.curseforge.com/projects/electroblobs-wizardry) comes under its own separate license, see the aforementioned webpage for details.
|
||||
|
||||
TL;DR: Do what you want with this repo on Github, but ask me first if you want to put it anywhere else or publish your version. Don't try and make money off the repo or anything in it. I'm not responsible if the code breaks things, and if you help me out by submitting a PR, I can use and modify the contents of that PR as long as I give you credit. (This brief summary is non-binding and does not override or replace the full license below.)
|
||||
|
||||
@@ -17,7 +17,7 @@ TL;DR: Do what you want with this repo on Github, but ask me first if you want t
|
||||
|
||||
'Electroblob's Wizardry', 'Wizardry', 'the mod' - The Minecraft modification Electroblob's Wizardry
|
||||
|
||||
'Repository' - This repository on Github, containing this license, other informational files, configurations, code and assets which are part of Electroblob's Wizardry
|
||||
'Repository' - This repository on Github, containing this license, the wiki, other informational files, configurations, code and assets which are part of Electroblob's Wizardry
|
||||
|
||||
'Curseforge' - The webpage https://minecraft.curseforge.com/projects/electroblobs-wizardry
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||
|
||||
|
||||
version = " 4.1.1 - MC 1.12.2"
|
||||
version = " 4.1.2 - MC 1.12.2"
|
||||
group= "electroblob.wizardry"// http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
archivesBaseName = "Electroblob's Wizardry "
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package electroblob.wizardry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@@ -45,9 +46,8 @@ import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||
* @since Wizardry 1.2
|
||||
* @author Electroblob
|
||||
*/
|
||||
// NOTE: We could convert over to the @Config system IF it is sufficiently complete in this Forge version for my
|
||||
// purposes.
|
||||
// (For one, I know that the LangKey annotation is not applicable to type declarations in 1.10.2, unlike in 1.11.2)
|
||||
// TODO: New plan: convert to the @Config system BUT separate the spells config out so it doesn't break stuff. (Maybe even
|
||||
// make it a JSON instead? Either way, there's scope for then adding more options for adjusting the base attributes etc.)
|
||||
// @Config(modid = Wizardry.MODID)
|
||||
@SuppressWarnings("deprecation") // Used server I18n deliberately; we want to write the comments in english.
|
||||
public final class Settings {
|
||||
@@ -63,8 +63,8 @@ public final class Settings {
|
||||
public static final String COMMANDS_CATEGORY = "commands";
|
||||
/** The unlocalised name of the worldgen config category. */
|
||||
public static final String WORLDGEN_CATEGORY = "worldgen";
|
||||
/** The unlocalised name of the global config category. */
|
||||
public static final String GLOBAL_CATEGORY = "global";
|
||||
/** The unlocalised name of the gameplay config category. */
|
||||
public static final String GAMEPLAY_CATEGORY = "gameplay";
|
||||
|
||||
/** The wizardry config file. */
|
||||
private Configuration config;
|
||||
@@ -102,19 +102,26 @@ public final class Settings {
|
||||
/** <b>[Server-only]</b> Whether summoned creatures can revenge attack their caster if their caster attacks them. */
|
||||
public boolean minionRevengeTargeting = true;
|
||||
/**
|
||||
* <b>[Server-only]</b> List of names of entities which summoned creatures are allowed to attack, in addition to the
|
||||
* defaults.
|
||||
* <b>[Server-only]</b> List of registry names of entities which summoned creatures are allowed to attack, in addition
|
||||
* to the defaults.
|
||||
*/
|
||||
public String[] summonedCreatureTargetsWhitelist = {};
|
||||
public ResourceLocation[] summonedCreatureTargetsWhitelist = {};
|
||||
/**
|
||||
* <b>[Server-only]</b> List of names of entities which summoned creatures are specifically not allowed to attack,
|
||||
* overriding the defaults and the whitelist.
|
||||
* <b>[Server-only]</b> List of registry names of entities which summoned creatures are specifically not allowed to
|
||||
* attack, overriding the defaults and the whitelist.
|
||||
*/
|
||||
public String[] summonedCreatureTargetsBlacklist = {"creeper"};
|
||||
public ResourceLocation[] summonedCreatureTargetsBlacklist = {new ResourceLocation("creeper")};
|
||||
/**
|
||||
* <b>[Server-only]</b> List of registry names of entities which are immune to the mind control spell, in addition to
|
||||
* the defaults.
|
||||
*/
|
||||
public ResourceLocation[] mindControlTargetsBlacklist = {};
|
||||
/** <b>[Server-only]</b> Global damage scaling factor for all player magic damage. */
|
||||
public double playerDamageScale = 1.0f;
|
||||
/** <b>[Server-only]</b> Global damage scaling factor for all npc magic damage. */
|
||||
public double npcDamageScale = 1.0f;
|
||||
/** <b>[Server-only]</b> List of dimension ids in which evil wizards can spawn. */
|
||||
public int[] evilWizardDimensions = {0};
|
||||
|
||||
// Commands (these don't need synchronising since typing a command always queries the server).
|
||||
/**
|
||||
@@ -134,19 +141,6 @@ public final class Settings {
|
||||
// Synchronised settings. These settings affect both client-side AND server-side code. Changing these locally
|
||||
// only has an effect if the local game is the host, i.e. a dedicated server, a LAN host or a singleplayer world.
|
||||
|
||||
// Recipes (only need syncing for display in the wizard's handbook)
|
||||
/** <b>[Synchronised]</b> Whether or not firebombs should be craftable. */
|
||||
public boolean firebombIsCraftable = true;
|
||||
/** <b>[Synchronised]</b> Whether or not poison bombs should be craftable. */
|
||||
public boolean poisonBombIsCraftable = true;
|
||||
/** <b>[Synchronised]</b> Whether or not poison bombs should be craftable. */
|
||||
public boolean smokeBombIsCraftable = true;
|
||||
/**
|
||||
* <b>[Synchronised]</b> Whether to require a magic crystal in the blank scroll crafting recipe (in case it
|
||||
* conflicts with another mod).
|
||||
*/
|
||||
public boolean useAlternateScrollRecipe = false;
|
||||
|
||||
// Gamemodes
|
||||
/**
|
||||
* <b>[Synchronised]</b> When set to true, spells a player hasn't cast yet will be unreadable until they are cast
|
||||
@@ -218,7 +212,7 @@ public final class Settings {
|
||||
/**
|
||||
* Called from preInit to initialise the config file. The first part of the config file has to be done here (as is
|
||||
* conventional) so that the various registries can change what they do accordingly. The spell part of the config
|
||||
* has to be done in the init method.
|
||||
* and the resistance part of the config have to be done in the init method since they depend on the registry events.
|
||||
*/
|
||||
void initConfig(FMLPreInitializationEvent event){
|
||||
|
||||
@@ -228,20 +222,27 @@ public final class Settings {
|
||||
Wizardry.logger.info("Setting up main config");
|
||||
|
||||
setupGeneralConfig();
|
||||
setupWorldgenConfig();
|
||||
setupClientConfig();
|
||||
setupCommandsConfig();
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from init to initialise the parts of the config file that depend on other mods. For example, the spell
|
||||
* config is done here and not in preInit because all spells must be registered before it is added, including those
|
||||
* in other mods.
|
||||
* Called from init to initialise the parts of the config file that have to be done after registry events are fired.
|
||||
* For example, the spell config is done here and not in preInit because all spells must be registered before it is
|
||||
* added, including those in other mods.
|
||||
*/
|
||||
void initConfigExtras(){
|
||||
|
||||
Wizardry.logger.info("Setting up spells config for " + Spell.getTotalSpellCount() + " spells");
|
||||
|
||||
setupSpellsConfig();
|
||||
|
||||
Wizardry.logger.info("Setting up resistances config");
|
||||
|
||||
setupResistancesConfig();
|
||||
|
||||
config.save();
|
||||
}
|
||||
@@ -252,7 +253,11 @@ public final class Settings {
|
||||
Wizardry.logger.info("Saving in-game config changes");
|
||||
|
||||
setupGeneralConfig();
|
||||
setupWorldgenConfig();
|
||||
setupClientConfig();
|
||||
setupCommandsConfig();
|
||||
setupSpellsConfig();
|
||||
setupResistancesConfig();
|
||||
|
||||
config.save();
|
||||
}
|
||||
@@ -292,19 +297,22 @@ public final class Settings {
|
||||
|
||||
Property property;
|
||||
|
||||
config.addCustomCategoryComment(Configuration.CATEGORY_GENERAL,
|
||||
"Please note that changing some of these settings may make the mod very difficult to play.");
|
||||
config.addCustomCategoryComment(GAMEPLAY_CATEGORY, "Global settings that affect game mechanics. In multiplayer, the server/LAN host settings will apply. Please note that changing some of these settings may make the mod very difficult to play.");
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "towerRarity", 8,
|
||||
"Rarity of wizard towers. Higher numbers are rarer. Set to 0 to disable wizard towers completely.", 0,
|
||||
50);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".tower_rarity");
|
||||
property = config.get(GAMEPLAY_CATEGORY, "discoveryMode", true,
|
||||
"For those who like a sense of mystery! When set to true, spells you haven't cast yet will be unreadable until you cast them (on a per-world basis). Has no effect when in creative mode. Spells of identification will be unobtainable in survival mode if this is false.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".discovery_mode");
|
||||
property.setRequiresWorldRestart(true);
|
||||
Wizardry.proxy.setToNumberSliderEntry(property);
|
||||
towerRarity = property.getInt();
|
||||
discoveryMode = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "spellBookDropChance", 3,
|
||||
property = config.get(GAMEPLAY_CATEGORY, "friendlyFire", true,
|
||||
"Whether to allow players to damage their designated allies using magic.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".friendly_fire");
|
||||
friendlyFire = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(GAMEPLAY_CATEGORY, "spellBookDropChance", 3,
|
||||
"The chance for mobs to drop a spell book when killed. The greater this number, the more often they will drop. Set to 0 to disable spell book drops. Set to 200 for guaranteed drops.",
|
||||
0, 200);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".spell_book_drop_chance");
|
||||
@@ -312,202 +320,208 @@ public final class Settings {
|
||||
spellBookDropChance = property.getInt();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "oreDimensions", new int[]{0},
|
||||
"List of dimension ids in which crystal ore will generate. Note that removing the overworld (id 0) from this list will make the mod VERY difficult to play!");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".ore_dimensions");
|
||||
property.setRequiresWorldRestart(true);
|
||||
oreDimensions = property.getIntList();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "flowerDimensions", new int[]{0},
|
||||
"List of dimension ids in which crystal flowers will generate.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".flower_dimensions");
|
||||
property.setRequiresWorldRestart(true);
|
||||
flowerDimensions = property.getIntList();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "towerDimensions", new int[]{0},
|
||||
"List of dimension ids in which wizard towers will generate.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".tower_dimensions");
|
||||
property.setRequiresWorldRestart(true);
|
||||
towerDimensions = property.getIntList();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "generateLoot", true,
|
||||
"Whether to generate wizardry loot in dungeon chests.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".generate_loot");
|
||||
property.setRequiresWorldRestart(true);
|
||||
generateLoot = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "firebombIsCraftable", true,
|
||||
"Whether firebombs can be crafted or not.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".firebomb_is_craftable");
|
||||
property = config.get(GAMEPLAY_CATEGORY, "evilWizardDimensions", new int[]{0},
|
||||
"List of dimension ids in which evil wizards can spawn.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".evil_wizard_dimensions");
|
||||
property.setRequiresMcRestart(true);
|
||||
firebombIsCraftable = property.getBoolean();
|
||||
evilWizardDimensions = property.getIntList();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "poisonBombIsCraftable", true,
|
||||
"Whether poison bombs can be crafted or not.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".poison_bomb_is_craftable");
|
||||
property.setRequiresMcRestart(true);
|
||||
poisonBombIsCraftable = property.getBoolean();
|
||||
// These two aren't sliders because using a slider makes it difficult to fine-tune the numbers; the nature of a
|
||||
// scaling factor means that 0.5 is as big a change as 2.0, so whilst a slider is fine for increasing the
|
||||
// damage, it doesn't give fine enough control for values less than 1.
|
||||
property = config.get(GAMEPLAY_CATEGORY, "playerDamageScaling", 1.0,
|
||||
"Global damage scaling factor for the damage dealt by players casting spells, relative to 1.", 0, 20);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".player_damage_scaling");
|
||||
playerDamageScale = property.getDouble();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "smokeBombIsCraftable", true,
|
||||
"Whether smoke bombs can be crafted or not.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".smoke_bomb_is_craftable");
|
||||
property.setRequiresMcRestart(true);
|
||||
smokeBombIsCraftable = property.getBoolean();
|
||||
property = config.get(GAMEPLAY_CATEGORY, "npcDamageScaling", 1.0,
|
||||
"Global damage scaling factor for the damage dealt by NPCs casting spells, relative to 1.", 0, 20);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".npc_damage_scaling");
|
||||
npcDamageScale = property.getDouble();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "useAlternateScrollRecipe", false,
|
||||
"Whether to require a magic crystal in the shapeless crafting recipe for blank scrolls. Set to true if another mod adds a conflicting recipe.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".use_alternate_scroll_recipe");
|
||||
property.setRequiresMcRestart(true);
|
||||
useAlternateScrollRecipe = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "teleportThroughUnbreakableBlocks", false,
|
||||
"Whether players are allowed to teleport through unbreakable blocks (e.g. bedrock) using the phase step spell.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".teleport_through_unbreakable_blocks");
|
||||
teleportThroughUnbreakableBlocks = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "showSummonedCreatureNames", true,
|
||||
"Whether to show summoned creatures' names and owners above their heads.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".show_summoned_creature_names");
|
||||
showSummonedCreatureNames = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "friendlyFire", true,
|
||||
"Whether to allow players to damage their designated allies using magic.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".friendly_fire");
|
||||
friendlyFire = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "telekineticDisarmament", true,
|
||||
"Whether to allow players to disarm other players using the telekinesis spell. Set to false to prevent stealing of items.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".telekinetic_disarmament");
|
||||
telekineticDisarmament = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "discoveryMode", true,
|
||||
"For those who like a sense of mystery! When set to true, spells you haven't cast yet will be unreadable until you cast them (on a per-world basis). Has no effect when in creative mode. Spells of identification will be unobtainable in survival mode if this is false.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".discovery_mode");
|
||||
property.setRequiresWorldRestart(true);
|
||||
discoveryMode = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "enableShiftScrolling", true,
|
||||
"Whether you can switch between spells on a wand by scrolling with the mouse wheel while sneaking. Note that this will only affect you; other players connected to the same server obey their own settings.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".enable_shift_scrolling");
|
||||
property.setRequiresWorldRestart(false);
|
||||
enableShiftScrolling = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "minionRevengeTargeting", true,
|
||||
property = config.get(GAMEPLAY_CATEGORY, "minionRevengeTargeting", true,
|
||||
"Whether summoned creatures can revenge attack their owner if their owner attacks them.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".minion_revenge_targeting");
|
||||
property.setRequiresWorldRestart(false);
|
||||
minionRevengeTargeting = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
// These two aren't sliders because using a slider makes it difficult to fine-tune the numbers; the nature of a
|
||||
// scaling factor means that 0.5 is as big a change as 2.0, so whilst a slider is fine for increasing the
|
||||
// damage,
|
||||
// it doesn't give fine enough control for values less than 1.
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "playerDamageScaling", 1.0,
|
||||
"Global damage scaling factor for the damage dealt by players casting spells, relative to 1.", 0, 20);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".player_damage_scaling");
|
||||
playerDamageScale = property.getDouble();
|
||||
property = config.get(GAMEPLAY_CATEGORY, "summonedCreatureTargetsWhitelist", new String[0],
|
||||
"List of names of entities which summoned creatures and wizards are allowed to attack, in addition to the defaults. Add mod creatures to this list if you want summoned creatures to attack them and they aren't already doing so. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".summoned_creature_targets_whitelist");
|
||||
property.setRequiresWorldRestart(true);
|
||||
// Converts all strings in the list to a ResourceLocation.
|
||||
summonedCreatureTargetsWhitelist = Arrays.stream(property.getStringList()).map(s -> new ResourceLocation(s.toLowerCase(Locale.ROOT).trim())).toArray(ResourceLocation[]::new);
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "npcDamageScaling", 1.0,
|
||||
"Global damage scaling factor for the damage dealt by NPCs casting spells, relative to 1.", 0, 20);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".npc_damage_scaling");
|
||||
npcDamageScale = property.getDouble();
|
||||
property = config.get(GAMEPLAY_CATEGORY, "summonedCreatureTargetsBlacklist",
|
||||
new String[]{"creeper"},
|
||||
"List of names of entities which summoned creatures and wizards are specifically not allowed to attack, overriding the defaults and the whitelist. Add creatures to this list if allowing them to be attacked causes problems or is too destructive (removing creepers from this list is done at your own risk!). Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".summoned_creature_targets_blacklist");
|
||||
property.setRequiresWorldRestart(true);
|
||||
// Converts all strings in the list to a ResourceLocation.
|
||||
summonedCreatureTargetsBlacklist = Arrays.stream(property.getStringList()).map(s -> new ResourceLocation(s.toLowerCase(Locale.ROOT).trim())).toArray(ResourceLocation[]::new);
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(GAMEPLAY_CATEGORY, "telekineticDisarmament", true,
|
||||
"Whether to allow players to disarm other players using the telekinesis spell. Set to false to prevent stealing of items.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".telekinetic_disarmament");
|
||||
telekineticDisarmament = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(GAMEPLAY_CATEGORY, "teleportThroughUnbreakableBlocks", false,
|
||||
"Whether players are allowed to teleport through unbreakable blocks (e.g. bedrock) using the phase step spell.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".teleport_through_unbreakable_blocks");
|
||||
teleportThroughUnbreakableBlocks = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(GAMEPLAY_CATEGORY, "mindControlTargetsBlacklist", new String[]{},
|
||||
"List of names of entities which cannot be mind controlled, in addition to the defaults. Add creatures to this list if allowing them to be mind-controlled causes problems or could be exploited. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".mind_control_targets_blacklist");
|
||||
property.setRequiresWorldRestart(true);
|
||||
// Converts all strings in the list to a ResourceLocation.
|
||||
mindControlTargetsBlacklist = Arrays.stream(property.getStringList()).map(s -> new ResourceLocation(s.toLowerCase(Locale.ROOT).trim())).toArray(ResourceLocation[]::new);
|
||||
propOrder.add(property.getName());
|
||||
|
||||
config.setCategoryPropertyOrder(GAMEPLAY_CATEGORY, propOrder);
|
||||
|
||||
}
|
||||
|
||||
private void setupWorldgenConfig(){
|
||||
|
||||
// This trick is borrowed from forge; it sorts the config options into the order you want them.
|
||||
List<String> propOrder = new ArrayList<String>();
|
||||
|
||||
Property property;
|
||||
|
||||
config.addCustomCategoryComment(WORLDGEN_CATEGORY, "Settings that affect world generation. In multiplayer, the server/LAN host settings will apply.");
|
||||
|
||||
property = config.get(WORLDGEN_CATEGORY, "towerRarity", 8, "Rarity of wizard towers. Higher numbers are rarer. Set to 0 to disable wizard towers completely.", 0, 50);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".tower_rarity");
|
||||
property.setRequiresWorldRestart(true);
|
||||
Wizardry.proxy.setToNumberSliderEntry(property);
|
||||
towerRarity = property.getInt();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(WORLDGEN_CATEGORY, "towerDimensions", new int[]{0}, "List of dimension ids in which wizard towers will generate.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".tower_dimensions");
|
||||
property.setRequiresWorldRestart(true);
|
||||
towerDimensions = property.getIntList();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(WORLDGEN_CATEGORY, "oreDimensions", new int[]{0}, "List of dimension ids in which crystal ore will generate. Note that removing the overworld (id 0) from this list will make the mod VERY difficult to play!");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".ore_dimensions");
|
||||
property.setRequiresWorldRestart(true);
|
||||
oreDimensions = property.getIntList();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(WORLDGEN_CATEGORY, "flowerDimensions", new int[]{0}, "List of dimension ids in which crystal flowers will generate.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".flower_dimensions");
|
||||
property.setRequiresWorldRestart(true);
|
||||
flowerDimensions = property.getIntList();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(WORLDGEN_CATEGORY, "generateLoot", true, "Whether to inject wizardry loot (as specified in loot_tables/chests/dungeon_additions.json) into the loot tables for vanilla dungeon chests.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".generate_loot");
|
||||
property.setRequiresWorldRestart(true);
|
||||
generateLoot = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
config.setCategoryPropertyOrder(WORLDGEN_CATEGORY, propOrder);
|
||||
}
|
||||
|
||||
private void setupClientConfig(){
|
||||
|
||||
// This trick is borrowed from forge; it sorts the config options into the order you want them.
|
||||
List<String> propOrder = new ArrayList<String>();
|
||||
|
||||
Property property;
|
||||
|
||||
config.addCustomCategoryComment(CLIENT_CATEGORY, "Client-side settings that only affect the local minecraft game. If this file is on a dedicated server, these settings will have no effect; in multiplayer, each player obeys their own settings.");
|
||||
|
||||
property = config.get(CLIENT_CATEGORY, "enableShiftScrolling", true,
|
||||
"Whether you can switch between spells on a wand by scrolling with the mouse wheel while sneaking. Note that this will only affect you; other players connected to the same server obey their own settings.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".enable_shift_scrolling");
|
||||
property.setRequiresWorldRestart(false);
|
||||
enableShiftScrolling = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(CLIENT_CATEGORY, "spellHUDPosition", GuiPosition.BOTTOM_LEFT.name, "The position of the spell HUD.", GuiPosition.names);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".spell_hud_position");
|
||||
spellHUDPosition = GuiPosition.fromName(property.getString());
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(CLIENT_CATEGORY, "showSummonedCreatureNames", true, "Whether to show summoned creatures' names and owners above their heads.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".show_summoned_creature_names");
|
||||
showSummonedCreatureNames = property.getBoolean();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
config.setCategoryPropertyOrder(CLIENT_CATEGORY, propOrder);
|
||||
}
|
||||
|
||||
private void setupCommandsConfig(){
|
||||
|
||||
// This trick is borrowed from forge; it sorts the config options into the order you want them.
|
||||
List<String> propOrder = new ArrayList<String>();
|
||||
|
||||
Property property;
|
||||
|
||||
config.addCustomCategoryComment(COMMANDS_CATEGORY, "Settings for the commands added by Wizardry. In multiplayer, the server/LAN host settings will apply.");
|
||||
|
||||
// This one isn't a slider either because people are likely to want exact values ("it must be at most 50.3" is a
|
||||
// bit strange!).
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "castCommandMultiplierLimit", 20.0,
|
||||
property = config.get(COMMANDS_CATEGORY, "castCommandMultiplierLimit", 20.0,
|
||||
"Upper limit for the multipliers passed into the /cast command. This is here to stop players from accidentally breaking a world/server. Large blast mutipliers can cause extreme lag - you have been warned!",
|
||||
1, 255);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".cast_command_multiplier_limit");
|
||||
maxSpellCommandMultiplier = property.getDouble();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "summonedCreatureTargetsWhitelist", new String[0],
|
||||
"List of names of entities which summoned creatures and wizards are allowed to attack, in addition to the defaults. Add mod creatures to this list if you want summoned creatures to attack them and they aren't already doing so. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":Wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".summoned_creature_targets_whitelist");
|
||||
property.setRequiresWorldRestart(true);
|
||||
// Wizardry.proxy.setToEntityNameEntry(property);
|
||||
summonedCreatureTargetsWhitelist = property.getStringList();
|
||||
// Converts all strings in the list to lower case, to ignore case sensitivity, and trims them.
|
||||
for(int i = 0; i < summonedCreatureTargetsWhitelist.length; i++){
|
||||
summonedCreatureTargetsWhitelist[i] = summonedCreatureTargetsWhitelist[i].toLowerCase(Locale.ROOT).trim();
|
||||
}
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "summonedCreatureTargetsBlacklist",
|
||||
new String[]{"creeper"},
|
||||
"List of names of entities which summoned creatures and wizards are specifically not allowed to attack, overriding the defaults and the whitelist. Add creatures to this list if allowing them to be attacked causes problems or is too destructive (removing creepers from this list is done at your own risk!). Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":Wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".summoned_creature_targets_blacklist");
|
||||
property.setRequiresWorldRestart(true);
|
||||
// Wizardry.proxy.setToEntityNameEntry(property);
|
||||
summonedCreatureTargetsBlacklist = property.getStringList();
|
||||
// Converts all strings in the list to lower case, to ignore case sensitivity, and trims them.
|
||||
for(int i = 0; i < summonedCreatureTargetsBlacklist.length; i++){
|
||||
summonedCreatureTargetsBlacklist[i] = summonedCreatureTargetsBlacklist[i].toLowerCase(Locale.ROOT).trim();
|
||||
}
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "spellHUDPosition", GuiPosition.BOTTOM_LEFT.name,
|
||||
"The position of the spell HUD.", GuiPosition.names);
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".spell_hud_position");
|
||||
spellHUDPosition = GuiPosition.fromName(property.getString());
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "castCommandName", "cast",
|
||||
property = config.get(COMMANDS_CATEGORY, "castCommandName", "cast",
|
||||
"The name of the /cast command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /cast you would type /magic instead.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".cast_command_name");
|
||||
property.setRequiresWorldRestart(true);
|
||||
castCommandName = property.getString();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "discoverspellCommandName", "discoverspell",
|
||||
property = config.get(COMMANDS_CATEGORY, "discoverspellCommandName", "discoverspell",
|
||||
"The name of the /discoverspell command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /discoverspell you would type /magic instead.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".discoverspell_command_name");
|
||||
property.setRequiresWorldRestart(true);
|
||||
discoverspellCommandName = property.getString();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "allyCommandName", "ally",
|
||||
property = config.get(COMMANDS_CATEGORY, "allyCommandName", "ally",
|
||||
"The name of the /ally command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /ally you would type /magic instead.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".ally_command_name");
|
||||
property.setRequiresWorldRestart(true);
|
||||
allyCommandName = property.getString();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(Configuration.CATEGORY_GENERAL, "alliesCommandName", "allies",
|
||||
property = config.get(COMMANDS_CATEGORY, "alliesCommandName", "allies",
|
||||
"The name of the /allies command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /allies you would type /magic instead.");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".allies_command_name");
|
||||
property.setRequiresWorldRestart(true);
|
||||
alliesCommandName = property.getString();
|
||||
propOrder.add(property.getName());
|
||||
|
||||
config.setCategoryPropertyOrder(COMMANDS_CATEGORY, propOrder);
|
||||
}
|
||||
|
||||
config.setCategoryPropertyOrder(Configuration.CATEGORY_GENERAL, propOrder);
|
||||
private void setupResistancesConfig(){
|
||||
|
||||
// Resistances
|
||||
Property property;
|
||||
|
||||
List<String> propOrder1 = new ArrayList<String>();
|
||||
List<String> propOrder = new ArrayList<String>();
|
||||
|
||||
config.addCustomCategoryComment(RESISTANCES_CATEGORY,
|
||||
"Settings which allow entities to be made immune to certain types of magic. In multiplayer, the server/LAN host settings will apply.");
|
||||
|
||||
property = config.get(RESISTANCES_CATEGORY, "mobsImmuneToFire", new String[]{},
|
||||
"List of names of entities that are immune to fire, in addition to the defaults. Add mod creatures to this list if you want them to be immune to fire magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":Wizard).");
|
||||
"List of names of entities that are immune to fire, in addition to the defaults. Add mod creatures to this list if you want them to be immune to fire magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".mobs_immune_to_fire");
|
||||
property.setRequiresMcRestart(true);
|
||||
// Wizardry.proxy.setToEntityNameEntry(property);
|
||||
@@ -517,10 +531,10 @@ public final class Settings {
|
||||
MagicDamage.addEntityImmunity(EntityList.getClass(new ResourceLocation(property.getStringList()[i])),
|
||||
DamageType.FIRE);
|
||||
}
|
||||
propOrder1.add(property.getName());
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(RESISTANCES_CATEGORY, "mobsImmuneToIce", new String[]{},
|
||||
"List of names of entities that are immune to ice, in addition to the defaults. Add mod creatures to this list if you want them to be immune to ice magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":Wizard).");
|
||||
"List of names of entities that are immune to ice, in addition to the defaults. Add mod creatures to this list if you want them to be immune to ice magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".mobs_immune_to_ice");
|
||||
property.setRequiresMcRestart(true);
|
||||
// Wizardry.proxy.setToEntityNameEntry(property);
|
||||
@@ -530,10 +544,10 @@ public final class Settings {
|
||||
MagicDamage.addEntityImmunity(EntityList.getClass(new ResourceLocation(property.getStringList()[i])),
|
||||
DamageType.FROST);
|
||||
}
|
||||
propOrder1.add(property.getName());
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(RESISTANCES_CATEGORY, "mobsImmuneToLightning", new String[]{},
|
||||
"List of names of entities that are immune to lightning, in addition to the defaults. Add mod creatures to this list if you want them to be immune to lightning magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":Wizard).");
|
||||
"List of names of entities that are immune to lightning, in addition to the defaults. Add mod creatures to this list if you want them to be immune to lightning magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".mobs_immune_to_lightning");
|
||||
property.setRequiresMcRestart(true);
|
||||
// Wizardry.proxy.setToEntityNameEntry(property);
|
||||
@@ -543,10 +557,10 @@ public final class Settings {
|
||||
MagicDamage.addEntityImmunity(EntityList.getClass(new ResourceLocation(property.getStringList()[i])),
|
||||
DamageType.SHOCK);
|
||||
}
|
||||
propOrder1.add(property.getName());
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(RESISTANCES_CATEGORY, "mobsImmuneToWither", new String[]{},
|
||||
"List of names of entities that are immune to wither effects, in addition to the defaults. Add mod creatures to this list if you want them to be immune to withering magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":Wizard).");
|
||||
"List of names of entities that are immune to wither effects, in addition to the defaults. Add mod creatures to this list if you want them to be immune to withering magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".mobs_immune_to_wither");
|
||||
property.setRequiresMcRestart(true);
|
||||
// Wizardry.proxy.setToEntityNameEntry(property);
|
||||
@@ -556,10 +570,10 @@ public final class Settings {
|
||||
MagicDamage.addEntityImmunity(EntityList.getClass(new ResourceLocation(property.getStringList()[i])),
|
||||
DamageType.WITHER);
|
||||
}
|
||||
propOrder1.add(property.getName());
|
||||
propOrder.add(property.getName());
|
||||
|
||||
property = config.get(RESISTANCES_CATEGORY, "mobsImmuneToPoison", new String[]{},
|
||||
"List of names of entities that are immune to poison, in addition to the defaults. Add mod creatures to this list if you want them to be immune to poison magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":Wizard).");
|
||||
"List of names of entities that are immune to poison, in addition to the defaults. Add mod creatures to this list if you want them to be immune to poison magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. " + Wizardry.MODID + ":wizard).");
|
||||
property.setLanguageKey("config." + Wizardry.MODID + ".mobs_immune_to_poison");
|
||||
property.setRequiresMcRestart(true);
|
||||
// Wizardry.proxy.setToEntityNameEntry(property);
|
||||
@@ -569,19 +583,9 @@ public final class Settings {
|
||||
MagicDamage.addEntityImmunity(EntityList.getClass(new ResourceLocation(property.getStringList()[i])),
|
||||
DamageType.POISON);
|
||||
}
|
||||
propOrder1.add(property.getName());
|
||||
|
||||
config.setCategoryPropertyOrder(RESISTANCES_CATEGORY, propOrder1);
|
||||
|
||||
// config.addCustomCategoryComment(CLIENT_CATEGORY, "Client-side settings that only affect the local minecraft
|
||||
// game. They have no effect on a server; each player obeys their own settings.");
|
||||
// config.addCustomCategoryComment(COMMANDS_CATEGORY, "Settings for the commands added by Wizardry. In
|
||||
// multiplayer, the server/LAN host settings will apply.");
|
||||
// config.addCustomCategoryComment(WORLDGEN_CATEGORY, "Settings that affect world generation. In multiplayer,
|
||||
// the server/LAN host settings will apply.");
|
||||
// config.addCustomCategoryComment(GLOBAL_CATEGORY, "Global settings that affect game mechanics. In multiplayer,
|
||||
// the server/LAN host settings will apply.");
|
||||
propOrder.add(property.getName());
|
||||
|
||||
config.setCategoryPropertyOrder(RESISTANCES_CATEGORY, propOrder);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public class Wizardry {
|
||||
* 1.x.x represents Minecraft 1.7.x versions, 2.x.x represents Minecraft 1.10.x versions, 3.x.x represents Minecraft
|
||||
* 1.11.x versions, and so on.
|
||||
*/
|
||||
public static final String VERSION = "4.1.1";
|
||||
public static final String VERSION = "4.1.2";
|
||||
|
||||
// IDEA: Improve the algorithm that finds a place to summon creatures to take walls into account.
|
||||
// IDEA: Replace all uses of Math.cos and Math.sin with MathHelper versions
|
||||
@@ -66,19 +66,6 @@ public class Wizardry {
|
||||
// I can make the healing spells use damage multipliers - hurrah!
|
||||
|
||||
// TODO: Switch from IInventory to IItemHandler (Or don't. It's only useful for automation really.)
|
||||
// TODO: Rearrange the config gui and file
|
||||
|
||||
// Updating:
|
||||
// TODO: Make sure all obf reflection names are still correct
|
||||
// TODO: Go through each of the summoned creatures and check there are no extra vanilla methods to override
|
||||
// TODO: Check whether Minecraft has added some methods that do the same job as my utilities, particularly in
|
||||
// relation to itemstacks, hotbar, armour slots and inventory slots.
|
||||
// TODO: Add wizard towers to the /locate command
|
||||
// TODO: Fix cascading worldgen lag and backport (offset area into loaded chunks, possibly use WorldGenMinable)
|
||||
// TODO: Change evil wizard sounds again to use illager sounds?
|
||||
// TODO: Chnage all instanceof checks on split entity variant classes (zombie, skeleton, etc.) to their abstract
|
||||
// base classes where appropriate
|
||||
|
||||
// TODO: Have particles obey Minecraft's particle setting where appropriate
|
||||
// (see https://github.com/RootsTeam/Embers/blob/master/src/main/java/teamroots/embers/particle/ParticleUtil.java)
|
||||
|
||||
@@ -188,7 +175,7 @@ public class Wizardry {
|
||||
|
||||
// 2.1 changed some item ids, so this fixes them for existing worlds
|
||||
// Nobody updates minecraft versions when using mods, but I may as well leave this here just in case.
|
||||
@EventHandler
|
||||
@SubscribeEvent
|
||||
public static void onMissingMappingEvent(RegistryEvent.MissingMappings<Item> event){
|
||||
// Just get, not getAll, since the mod id didn't change!
|
||||
for(RegistryEvent.MissingMappings.Mapping<Item> mapping : event.getAllMappings()){
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
package electroblob.wizardry.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.WizardryGuiHandler;
|
||||
import electroblob.wizardry.tileentity.TileEntityArcaneWorkbench;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
@@ -65,59 +61,20 @@ public class BlockArcaneWorkbench extends BlockContainer {
|
||||
return false;
|
||||
}
|
||||
|
||||
player.openGui(Wizardry.instance, WizardryGuiHandler.ARCANE_WORKBENCH, world, pos.getX(), pos.getY(),
|
||||
pos.getZ());
|
||||
player.openGui(Wizardry.instance, WizardryGuiHandler.ARCANE_WORKBENCH, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState block){
|
||||
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
|
||||
Random random = new Random();
|
||||
TileEntityArcaneWorkbench tileentityarcaneworkbench = (TileEntityArcaneWorkbench)world.getTileEntity(pos);
|
||||
if(tileentity instanceof TileEntityArcaneWorkbench){
|
||||
InventoryHelper.dropInventoryItems(world, pos, (TileEntityArcaneWorkbench)tileentity);
|
||||
}
|
||||
|
||||
if(tileentityarcaneworkbench != null){
|
||||
|
||||
for(int j1 = 0; j1 < tileentityarcaneworkbench.getSizeInventory(); ++j1){
|
||||
|
||||
ItemStack itemstack = tileentityarcaneworkbench.getStackInSlot(j1);
|
||||
|
||||
if(!itemstack.isEmpty()){
|
||||
|
||||
float f = random.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = random.nextFloat() * 0.8F + 0.1F;
|
||||
EntityItem entityitem;
|
||||
|
||||
for(float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.getCount() > 0; world
|
||||
.spawnEntity(entityitem)){
|
||||
|
||||
int k1 = random.nextInt(21) + 10;
|
||||
|
||||
if(k1 > itemstack.getCount()){
|
||||
k1 = itemstack.getCount();
|
||||
}
|
||||
|
||||
itemstack.shrink(k1);
|
||||
|
||||
entityitem = new EntityItem(world, (double)((float)pos.getX() + f),
|
||||
(double)((float)pos.getY() + f1), (double)((float)pos.getZ() + f2),
|
||||
new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (double)((float)random.nextGaussian() * f3);
|
||||
entityitem.motionY = (double)((float)random.nextGaussian() * f3 + 0.2F);
|
||||
entityitem.motionZ = (double)((float)random.nextGaussian() * f3);
|
||||
|
||||
if(itemstack.hasTagCompound()){
|
||||
entityitem.getItem().setTagCompound(((NBTTagCompound)itemstack.getTagCompound().copy()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// par1World.func_96440_m(par2, par3, par4, block);
|
||||
}
|
||||
|
||||
super.breakBlock(world, pos, block);
|
||||
super.breakBlock(world, pos, block);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,10 @@ import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockCrystalOre extends Block {
|
||||
|
||||
@@ -20,10 +24,17 @@ public class BlockCrystalOre extends Block {
|
||||
|
||||
@Override
|
||||
public int quantityDropped(IBlockState state, int fortune, Random random){
|
||||
// This now works the same way as vanilla ores
|
||||
if(fortune > 0){
|
||||
return random.nextInt(2) + 1 + random.nextInt(fortune);
|
||||
|
||||
int i = random.nextInt(fortune + 2) - 1;
|
||||
|
||||
if(i < 0) i = 0;
|
||||
|
||||
return (random.nextInt(3) + 1) * (i + 1);
|
||||
|
||||
}else{
|
||||
return random.nextInt(2) + 1;
|
||||
return random.nextInt(3) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,4 +42,16 @@ public class BlockCrystalOre extends Block {
|
||||
public Item getItemDropped(IBlockState state, Random random, int fortune){
|
||||
return WizardryItems.magic_crystal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune){
|
||||
|
||||
Random rand = world instanceof World ? ((World)world).rand : RANDOM;
|
||||
|
||||
if(this.getItemDropped(state, rand, fortune) != Item.getItemFromBlock(this)){
|
||||
return MathHelper.getInt(rand, 1, 4);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,14 +66,15 @@ public class BlockTransportationStone extends Block {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void onNeighborChange(IBlockAccess world, BlockPos pos, BlockPos neighbor){
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos fromPos){
|
||||
|
||||
super.onNeighborChange(world, pos, neighbor);
|
||||
super.neighborChanged(state, world, pos, block, fromPos);
|
||||
|
||||
if(!world.isSideSolid(pos.down(), EnumFacing.UP, false) && world instanceof World){
|
||||
this.dropBlockAsItem((World)world, pos, world.getBlockState(pos), 0);
|
||||
((World)world).setBlockToAir(pos);
|
||||
if(!world.isSideSolid(pos.down(), EnumFacing.UP, false)){
|
||||
this.dropBlockAsItem(world, pos, world.getBlockState(pos), 0);
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,8 +80,6 @@ public class GuiArcaneWorkbench extends GuiContainer {
|
||||
@Override
|
||||
public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY){
|
||||
|
||||
GlStateManager.pushAttrib();
|
||||
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
|
||||
|
||||
@@ -152,8 +150,6 @@ public class GuiArcaneWorkbench extends GuiContainer {
|
||||
// Fixes the bug that caused the slot hightlight to render opaque. I don't know why it works, it just works!
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableAlpha();
|
||||
|
||||
GlStateManager.popAttrib();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,57 +24,107 @@ public class GuiConfigWizardry extends GuiConfig {
|
||||
}
|
||||
|
||||
private static List<IConfigElement> getConfigEntries(){
|
||||
|
||||
List<IConfigElement> configList = new ArrayList<IConfigElement>(1);
|
||||
configList.add(new DummyCategoryElement("spellsConfig", "config." + Wizardry.MODID + ".category." + Settings.SPELLS_CATEGORY,
|
||||
SpellsCategory.class));
|
||||
configList.add(new DummyCategoryElement("resistancesConfig",
|
||||
"config." + Wizardry.MODID + ".category." + Settings.RESISTANCES_CATEGORY, ResistancesCategory.class));
|
||||
configList.addAll(new ConfigElement(Wizardry.settings.getConfigCategory(Configuration.CATEGORY_GENERAL))
|
||||
.getChildElements());
|
||||
|
||||
configList.add(new DummyCategoryElement("gameplayConfig", "config." + Wizardry.MODID + ".category." + Settings.GAMEPLAY_CATEGORY, GameplayCategory.class));
|
||||
configList.add(new DummyCategoryElement("worldgenConfig", "config." + Wizardry.MODID + ".category." + Settings.WORLDGEN_CATEGORY, WorldgenCategory.class));
|
||||
configList.add(new DummyCategoryElement("commandsConfig", "config." + Wizardry.MODID + ".category." + Settings.COMMANDS_CATEGORY, CommandsCategory.class));
|
||||
configList.add(new DummyCategoryElement("clientConfig", "config." + Wizardry.MODID + ".category." + Settings.CLIENT_CATEGORY, ClientCategory.class));
|
||||
configList.add(new DummyCategoryElement("spellsConfig", "config." + Wizardry.MODID + ".category." + Settings.SPELLS_CATEGORY, SpellsCategory.class));
|
||||
configList.add(new DummyCategoryElement("resistancesConfig", "config." + Wizardry.MODID + ".category." + Settings.RESISTANCES_CATEGORY, ResistancesCategory.class));
|
||||
|
||||
configList.addAll(new ConfigElement(Wizardry.settings.getConfigCategory(Configuration.CATEGORY_GENERAL)).getChildElements());
|
||||
|
||||
return configList;
|
||||
}
|
||||
|
||||
// The reason this system is so convoluted is that it's designed for use with the @Config annotation. The problem is,
|
||||
// I'm not sure whether that will play well with the load phases. Hmmm...
|
||||
|
||||
public static abstract class CategoryBase extends CategoryEntry {
|
||||
|
||||
public CategoryBase(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop){
|
||||
super(owningScreen, owningEntryList, prop);
|
||||
}
|
||||
|
||||
/** Spells category of the config gui. This adds a button which opens up the spells category config. */
|
||||
public static class SpellsCategory extends CategoryEntry {
|
||||
@Override
|
||||
protected GuiScreen buildChildScreen(){
|
||||
|
||||
String category = this.getCategory();
|
||||
|
||||
// This GuiConfig object specifies the configID of the object and as such will force-save when it is closed.
|
||||
// The parent GuiConfig object's entryList will also be refreshed to reflect the changes.
|
||||
GuiConfig childScreen = new GuiConfig(this.owningScreen,
|
||||
(new ConfigElement(Wizardry.settings.getConfigCategory(category))).getChildElements(),
|
||||
this.owningScreen.modID, category, false, false,
|
||||
Wizardry.NAME + " - " + I18n.format("config." + Wizardry.MODID + ".title." + category));
|
||||
|
||||
childScreen.titleLine2 = I18n.format("config." + Wizardry.MODID + ".subtitle." + category);
|
||||
|
||||
return childScreen;
|
||||
}
|
||||
|
||||
protected abstract String getCategory();
|
||||
}
|
||||
|
||||
/** Gameplay category of the config gui. */
|
||||
public static class GameplayCategory extends CategoryBase {
|
||||
|
||||
public GameplayCategory(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop){
|
||||
super(owningScreen, owningEntryList, prop);
|
||||
}
|
||||
|
||||
@Override protected String getCategory() { return Settings.GAMEPLAY_CATEGORY; }
|
||||
}
|
||||
|
||||
/** Spells category of the config gui. */
|
||||
public static class SpellsCategory extends CategoryBase {
|
||||
|
||||
public SpellsCategory(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop){
|
||||
super(owningScreen, owningEntryList, prop);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiScreen buildChildScreen(){
|
||||
// This GuiConfig object specifies the configID of the object and as such will force-save when it is closed.
|
||||
// The parent GuiConfig object's entryList will also be refreshed to reflect the changes.
|
||||
GuiConfig spellsMenu = new GuiConfig(this.owningScreen,
|
||||
(new ConfigElement(Wizardry.settings.getConfigCategory(Settings.SPELLS_CATEGORY)))
|
||||
.getChildElements(),
|
||||
this.owningScreen.modID, Settings.SPELLS_CATEGORY, false, false,
|
||||
Wizardry.NAME + " - " + I18n.format("config." + Wizardry.MODID + ".title." + Settings.SPELLS_CATEGORY));
|
||||
|
||||
spellsMenu.titleLine2 = I18n.format("config." + Wizardry.MODID + ".subtitle." + Settings.SPELLS_CATEGORY);
|
||||
|
||||
return spellsMenu;
|
||||
}
|
||||
|
||||
@Override protected String getCategory() { return Settings.SPELLS_CATEGORY; }
|
||||
}
|
||||
|
||||
/** Resistances category of the config gui. */
|
||||
public static class ResistancesCategory extends CategoryEntry {
|
||||
public static class ResistancesCategory extends CategoryBase {
|
||||
|
||||
public ResistancesCategory(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop){
|
||||
super(owningScreen, owningEntryList, prop);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected GuiScreen buildChildScreen(){
|
||||
// This GuiConfig object specifies the configID of the object and as such will force-save when it is closed.
|
||||
// The parent GuiConfig object's entryList will also be refreshed to reflect the changes.
|
||||
GuiConfig idsMenu = new GuiConfig(this.owningScreen,
|
||||
(new ConfigElement(Wizardry.settings.getConfigCategory(Settings.RESISTANCES_CATEGORY)))
|
||||
.getChildElements(),
|
||||
this.owningScreen.modID, Settings.RESISTANCES_CATEGORY, false, false,
|
||||
Wizardry.NAME + " - " + I18n.format("config." + Wizardry.MODID + ".title." + Settings.RESISTANCES_CATEGORY));
|
||||
|
||||
idsMenu.titleLine2 = I18n.format("config." + Wizardry.MODID + ".subtitle." + Settings.RESISTANCES_CATEGORY);
|
||||
|
||||
return idsMenu;
|
||||
|
||||
@Override protected String getCategory() { return Settings.RESISTANCES_CATEGORY; }
|
||||
}
|
||||
|
||||
/** Worldgen category of the config gui. */
|
||||
public static class WorldgenCategory extends CategoryBase {
|
||||
|
||||
public WorldgenCategory(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop){
|
||||
super(owningScreen, owningEntryList, prop);
|
||||
}
|
||||
|
||||
@Override protected String getCategory() { return Settings.WORLDGEN_CATEGORY; }
|
||||
}
|
||||
|
||||
/** Client category of the config gui. */
|
||||
public static class ClientCategory extends CategoryBase {
|
||||
|
||||
public ClientCategory(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop){
|
||||
super(owningScreen, owningEntryList, prop);
|
||||
}
|
||||
|
||||
@Override protected String getCategory() { return Settings.CLIENT_CATEGORY; }
|
||||
}
|
||||
|
||||
/** Commands category of the config gui. */
|
||||
public static class CommandsCategory extends CategoryBase {
|
||||
|
||||
public CommandsCategory(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement prop){
|
||||
super(owningScreen, owningEntryList, prop);
|
||||
}
|
||||
|
||||
@Override protected String getCategory() { return Settings.COMMANDS_CATEGORY; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,8 +122,6 @@ public class GuiSpellDisplay extends Gui {
|
||||
|
||||
}else if(event.getType() == RenderGameOverlayEvent.ElementType.HOTBAR){
|
||||
|
||||
GlStateManager.pushAttrib();
|
||||
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.blendFunc(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
GlStateManager.color(1, 1, 1);
|
||||
@@ -146,8 +144,8 @@ public class GuiSpellDisplay extends Gui {
|
||||
this.mc.renderEngine.bindTexture(discovered ? spell.getIcon() : Spells.none.getIcon());
|
||||
|
||||
WizardryUtilities.drawTexturedRect(mirror ? left + 94 : left + 2, top + 2, 0, 0, 32, 32, 32, 32);
|
||||
|
||||
GlStateManager.popAttrib();
|
||||
|
||||
// Blend needs to be left enabled here because otherwise the hotbar becomes opaque
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||
GlStateManager.enableColorMaterial();
|
||||
GlStateManager.enableLighting();
|
||||
itemRender.zLevel = 100.0F;
|
||||
|
||||
@@ -204,7 +204,7 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
GlStateManager.enableLighting();
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.enableDepth();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
}
|
||||
@@ -219,7 +219,7 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||
GlStateManager.enableColorMaterial();
|
||||
itemRender.zLevel = 0.0F;
|
||||
GlStateManager.disableLighting();
|
||||
|
||||
@@ -239,7 +239,7 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
GlStateManager.enableLighting();
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.enableDepth();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
}
|
||||
@@ -345,8 +345,8 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
|
||||
}else{
|
||||
|
||||
paragraph = paragraph.replaceAll("NEXT_SPELL_KEY", Keyboard.getKeyName(ClientProxy.NEXT_SPELL.getKeyCode()));
|
||||
paragraph = paragraph.replaceAll("PREVIOUS_SPELL_KEY", Keyboard.getKeyName(ClientProxy.PREVIOUS_SPELL.getKeyCode()));
|
||||
paragraph = paragraph.replaceAll("NEXT_SPELL_KEY", ClientProxy.NEXT_SPELL.getDisplayName());
|
||||
paragraph = paragraph.replaceAll("PREVIOUS_SPELL_KEY", ClientProxy.PREVIOUS_SPELL.getDisplayName());
|
||||
paragraph = paragraph.replaceAll("MANA_PER_CRYSTAL_MINUS_30", "" + (Constants.MANA_PER_CRYSTAL - 30));
|
||||
paragraph = paragraph.replaceAll("MANA_PER_CRYSTAL", "" + Constants.MANA_PER_CRYSTAL);
|
||||
paragraph = paragraph.replaceAll("BASIC_MAX_CHARGE", "" + Tier.BASIC.maxCharge);
|
||||
@@ -659,51 +659,36 @@ public class GuiWizardHandbook extends GuiScreen {
|
||||
craftingGrid.get(2).set(1, new ItemStack(WizardryItems.magic_silk));
|
||||
craftingResult = new ItemStack(WizardryItems.wizard_boots);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
|
||||
if(Wizardry.settings.useAlternateScrollRecipe){
|
||||
craftingGrid = createGrid();
|
||||
craftingGrid.get(0).set(0, new ItemStack(Items.PAPER));
|
||||
craftingGrid.get(1).set(0, new ItemStack(Items.STRING));
|
||||
craftingGrid.get(2).set(0, new ItemStack(WizardryItems.magic_crystal));
|
||||
craftingResult = new ItemStack(WizardryItems.blank_scroll);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
}else{
|
||||
craftingGrid = createGrid();
|
||||
craftingGrid.get(0).set(0, new ItemStack(Items.PAPER));
|
||||
craftingGrid.get(1).set(0, new ItemStack(Items.STRING));
|
||||
craftingResult = new ItemStack(WizardryItems.blank_scroll);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
}
|
||||
|
||||
if(Wizardry.settings.firebombIsCraftable){
|
||||
craftingGrid = createGrid();
|
||||
craftingGrid.get(0).set(0, new ItemStack(Items.BLAZE_POWDER));
|
||||
craftingGrid.get(1).set(0, new ItemStack(Items.BLAZE_POWDER));
|
||||
craftingGrid.get(0).set(1, new ItemStack(Items.GLASS_BOTTLE));
|
||||
craftingGrid.get(1).set(1, new ItemStack(Items.GUNPOWDER));
|
||||
craftingResult = new ItemStack(WizardryItems.firebomb, 3);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
}
|
||||
|
||||
if(Wizardry.settings.poisonBombIsCraftable){
|
||||
craftingGrid = createGrid();
|
||||
craftingGrid.get(0).set(0, new ItemStack(Items.SPIDER_EYE));
|
||||
craftingGrid.get(1).set(0, new ItemStack(Items.SPIDER_EYE));
|
||||
craftingGrid.get(0).set(1, new ItemStack(Items.GLASS_BOTTLE));
|
||||
craftingGrid.get(1).set(1, new ItemStack(Items.GUNPOWDER));
|
||||
craftingResult = new ItemStack(WizardryItems.poison_bomb, 3);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
}
|
||||
|
||||
if(Wizardry.settings.smokeBombIsCraftable){
|
||||
craftingGrid = createGrid();
|
||||
craftingGrid.get(0).set(0, new ItemStack(Items.COAL));
|
||||
craftingGrid.get(1).set(0, new ItemStack(Items.COAL));
|
||||
craftingGrid.get(0).set(1, new ItemStack(Items.GLASS_BOTTLE));
|
||||
craftingGrid.get(1).set(1, new ItemStack(Items.GUNPOWDER));
|
||||
craftingResult = new ItemStack(WizardryItems.smoke_bomb, 3);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
}
|
||||
|
||||
craftingGrid = createGrid();
|
||||
craftingGrid.get(0).set(0, new ItemStack(Items.PAPER));
|
||||
craftingGrid.get(1).set(0, new ItemStack(Items.STRING));
|
||||
craftingResult = new ItemStack(WizardryItems.blank_scroll);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
|
||||
craftingGrid = createGrid();
|
||||
craftingGrid.get(0).set(0, new ItemStack(Items.BLAZE_POWDER));
|
||||
craftingGrid.get(1).set(0, new ItemStack(Items.BLAZE_POWDER));
|
||||
craftingGrid.get(0).set(1, new ItemStack(Items.GLASS_BOTTLE));
|
||||
craftingGrid.get(1).set(1, new ItemStack(Items.GUNPOWDER));
|
||||
craftingResult = new ItemStack(WizardryItems.firebomb, 3);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
|
||||
craftingGrid = createGrid();
|
||||
craftingGrid.get(0).set(0, new ItemStack(Items.SPIDER_EYE));
|
||||
craftingGrid.get(1).set(0, new ItemStack(Items.SPIDER_EYE));
|
||||
craftingGrid.get(0).set(1, new ItemStack(Items.GLASS_BOTTLE));
|
||||
craftingGrid.get(1).set(1, new ItemStack(Items.GUNPOWDER));
|
||||
craftingResult = new ItemStack(WizardryItems.poison_bomb, 3);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
|
||||
craftingGrid = createGrid();
|
||||
craftingGrid.get(0).set(0, new ItemStack(Items.COAL));
|
||||
craftingGrid.get(1).set(0, new ItemStack(Items.COAL));
|
||||
craftingGrid.get(0).set(1, new ItemStack(Items.GLASS_BOTTLE));
|
||||
craftingGrid.get(1).set(1, new ItemStack(Items.GUNPOWDER));
|
||||
craftingResult = new ItemStack(WizardryItems.smoke_bomb, 3);
|
||||
RECIPES.add(ImmutablePair.of(craftingResult, craftingGrid));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package electroblob.wizardry.client;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import electroblob.wizardry.WizardData;
|
||||
@@ -21,7 +19,6 @@ import electroblob.wizardry.util.WandHelper;
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiMerchant;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -50,7 +47,6 @@ import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -73,12 +69,6 @@ public final class WizardryClientEventHandler {
|
||||
private static final ResourceLocation pointerTexture = new ResourceLocation(Wizardry.MODID, "textures/entity/pointer.png");
|
||||
private static final ResourceLocation targetPointerTexture = new ResourceLocation(Wizardry.MODID, "textures/entity/target_pointer.png");
|
||||
|
||||
private static final Field ITEM_RENDERER;
|
||||
|
||||
static {
|
||||
ITEM_RENDERER = ReflectionHelper.findField(GuiScreen.class, "itemRender", "field_146296_j");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onTextureStitchEvent(TextureStitchEvent.Pre event){
|
||||
event.getMap().registerSprite(ContainerArcaneWorkbench.EMPTY_SLOT_CRYSTAL);
|
||||
@@ -164,36 +154,30 @@ public final class WizardryClientEventHandler {
|
||||
}
|
||||
|
||||
private static void renderItemAndTooltip(GuiContainer gui, ItemStack stack, int x, int y, int mouseX, int mouseY, boolean tooltip){
|
||||
|
||||
try {
|
||||
|
||||
RenderItem renderItem = (RenderItem)ITEM_RENDERER.get(gui);
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||
GlStateManager.enableLighting();
|
||||
renderItem.zLevel = 100.0F;
|
||||
|
||||
if(!stack.isEmpty()){
|
||||
renderItem.renderItemAndEffectIntoGUI(stack, x, y);
|
||||
renderItem.renderItemOverlays(Minecraft.getMinecraft().fontRenderer, stack, x, y);
|
||||
|
||||
if(tooltip){
|
||||
gui.drawHoveringText(gui.getItemToolTip(stack), mouseX + gui.getXSize()/2 - gui.width/2,
|
||||
mouseY + gui.getYSize()/2 - gui.height/2);
|
||||
}
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
GlStateManager.enableLighting();
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
|
||||
GlStateManager.pushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.enableColorMaterial();
|
||||
GlStateManager.enableLighting();
|
||||
renderItem.zLevel = 100.0F;
|
||||
|
||||
if(!stack.isEmpty()){
|
||||
renderItem.renderItemAndEffectIntoGUI(stack, x, y);
|
||||
renderItem.renderItemOverlays(Minecraft.getMinecraft().fontRenderer, stack, x, y);
|
||||
|
||||
if(tooltip){
|
||||
gui.drawHoveringText(gui.getItemToolTip(stack), mouseX + gui.getXSize()/2 - gui.width/2,
|
||||
mouseY + gui.getYSize()/2 - gui.height/2);
|
||||
}
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.enableDepth();
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
}
|
||||
|
||||
// Third person
|
||||
@@ -241,7 +225,7 @@ public final class WizardryClientEventHandler {
|
||||
GlStateManager.disableLighting();
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);
|
||||
// Disabling depth test allows it to be seen through everything.
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.disableDepth();
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
|
||||
GlStateManager.translate(event.getX(), event.getY() + event.getEntity().height + 0.5, event.getZ());
|
||||
@@ -265,7 +249,7 @@ public final class WizardryClientEventHandler {
|
||||
|
||||
GlStateManager.enableCull();
|
||||
GlStateManager.enableLighting();
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.enableDepth();
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
@@ -282,7 +266,7 @@ public final class WizardryClientEventHandler {
|
||||
GlStateManager.disableLighting();
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);
|
||||
// Disabling depth test allows it to be seen through everything.
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.disableDepth();
|
||||
GlStateManager.color(1, 1, 1, 1);
|
||||
|
||||
GlStateManager.translate(event.getX(), event.getY() + event.getEntity().height + 0.5, event.getZ());
|
||||
@@ -306,7 +290,7 @@ public final class WizardryClientEventHandler {
|
||||
|
||||
GlStateManager.enableCull();
|
||||
GlStateManager.enableLighting();
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.enableDepth();
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
@@ -327,7 +311,7 @@ public final class WizardryClientEventHandler {
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);
|
||||
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
// Disabling depth test allows it to be seen through everything.
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.disableDepth();
|
||||
|
||||
GlStateManager.translate(event.getX(), event.getY() + event.getEntity().height * 0.6, event.getZ());
|
||||
|
||||
@@ -351,7 +335,7 @@ public final class WizardryClientEventHandler {
|
||||
GlStateManager.enableCull();
|
||||
GlStateManager.disableBlend();
|
||||
GlStateManager.enableLighting();
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.enableDepth();
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
}
|
||||
@@ -365,8 +349,8 @@ public final class WizardryClientEventHandler {
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
GlStateManager.disableDepth();
|
||||
GlStateManager.depthMask(false);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.disableAlpha();
|
||||
@@ -383,8 +367,8 @@ public final class WizardryClientEventHandler {
|
||||
buffer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.depthMask(true);
|
||||
GlStateManager.enableDepth();
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
@@ -395,8 +379,8 @@ public final class WizardryClientEventHandler {
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
GlStateManager.disableDepth();
|
||||
GlStateManager.depthMask(false);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.disableAlpha();
|
||||
@@ -413,8 +397,8 @@ public final class WizardryClientEventHandler {
|
||||
buffer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
|
||||
|
||||
tessellator.draw();
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GlStateManager.depthMask(true);
|
||||
GlStateManager.enableDepth();
|
||||
GlStateManager.enableAlpha();
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package electroblob.wizardry.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelWizardArmour extends ModelBiped {
|
||||
public class ModelWizardArmour extends ModelWtfMojang {
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package electroblob.wizardry.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityArmorStand;
|
||||
|
||||
public class ModelWtfMojang extends ModelBiped {
|
||||
|
||||
public ModelWtfMojang(float modelSize, float rotationYOffset, int textureWidth, int textureHeight) {
|
||||
super(modelSize, rotationYOffset, textureWidth, textureHeight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn) {
|
||||
// [VanillaCopy] ModelArmorStandArmor
|
||||
// this prevents helmets from always facing south, and the armor "breathing" on the stand
|
||||
if (entityIn instanceof EntityArmorStand) {
|
||||
EntityArmorStand entityarmorstand = (EntityArmorStand) entityIn;
|
||||
this.bipedHead.rotateAngleX = 0.017453292F * entityarmorstand.getHeadRotation().getX();
|
||||
this.bipedHead.rotateAngleY = 0.017453292F * entityarmorstand.getHeadRotation().getY();
|
||||
this.bipedHead.rotateAngleZ = 0.017453292F * entityarmorstand.getHeadRotation().getZ();
|
||||
this.bipedHead.setRotationPoint(0.0F, 1.0F, 0.0F);
|
||||
this.bipedBody.rotateAngleX = 0.017453292F * entityarmorstand.getBodyRotation().getX();
|
||||
this.bipedBody.rotateAngleY = 0.017453292F * entityarmorstand.getBodyRotation().getY();
|
||||
this.bipedBody.rotateAngleZ = 0.017453292F * entityarmorstand.getBodyRotation().getZ();
|
||||
this.bipedLeftArm.rotateAngleX = 0.017453292F * entityarmorstand.getLeftArmRotation().getX();
|
||||
this.bipedLeftArm.rotateAngleY = 0.017453292F * entityarmorstand.getLeftArmRotation().getY();
|
||||
this.bipedLeftArm.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftArmRotation().getZ();
|
||||
this.bipedRightArm.rotateAngleX = 0.017453292F * entityarmorstand.getRightArmRotation().getX();
|
||||
this.bipedRightArm.rotateAngleY = 0.017453292F * entityarmorstand.getRightArmRotation().getY();
|
||||
this.bipedRightArm.rotateAngleZ = 0.017453292F * entityarmorstand.getRightArmRotation().getZ();
|
||||
this.bipedLeftLeg.rotateAngleX = 0.017453292F * entityarmorstand.getLeftLegRotation().getX();
|
||||
this.bipedLeftLeg.rotateAngleY = 0.017453292F * entityarmorstand.getLeftLegRotation().getY();
|
||||
this.bipedLeftLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getLeftLegRotation().getZ();
|
||||
this.bipedLeftLeg.setRotationPoint(1.9F, 11.0F, 0.0F);
|
||||
this.bipedRightLeg.rotateAngleX = 0.017453292F * entityarmorstand.getRightLegRotation().getX();
|
||||
this.bipedRightLeg.rotateAngleY = 0.017453292F * entityarmorstand.getRightLegRotation().getY();
|
||||
this.bipedRightLeg.rotateAngleZ = 0.017453292F * entityarmorstand.getRightLegRotation().getZ();
|
||||
this.bipedRightLeg.setRotationPoint(-1.9F, 11.0F, 0.0F);
|
||||
copyModelAngles(this.bipedHead, this.bipedHeadwear);
|
||||
} else super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -143,7 +143,6 @@ public abstract class ParticleCustomTexture extends Particle {
|
||||
float rotationYZ, float rotationXY, float rotationXZ){
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.pushAttrib();
|
||||
|
||||
this.applyGLStateChanges();
|
||||
|
||||
@@ -193,7 +192,6 @@ public abstract class ParticleCustomTexture extends Particle {
|
||||
|
||||
this.undoGLStateChanges();
|
||||
|
||||
GlStateManager.popAttrib();
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package electroblob.wizardry.entity.living;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
@@ -118,10 +117,10 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
||||
|| (entity instanceof ISummonedCreature || entity instanceof EntityWizard
|
||||
// ... or in the whitelist ...
|
||||
|| Arrays.asList(Wizardry.settings.summonedCreatureTargetsWhitelist)
|
||||
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT)))
|
||||
.contains(EntityList.getKey(entity.getClass())))
|
||||
// ... and isn't in the blacklist ...
|
||||
&& !Arrays.asList(Wizardry.settings.summonedCreatureTargetsBlacklist)
|
||||
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT))){
|
||||
.contains(EntityList.getKey(entity.getClass()))){
|
||||
// ... it can be attacked.
|
||||
return true;
|
||||
}
|
||||
@@ -266,6 +265,21 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
|
||||
(NBTTagInt tag) -> Spell.get(tag.getInt()));
|
||||
this.hasTower = nbt.getBoolean("hasTower");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxSpawnedInChunk(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getCanSpawnHere(){
|
||||
// Evil wizards can only spawn in the specified dimensions
|
||||
for(int id : Wizardry.settings.evilWizardDimensions){
|
||||
if(this.dimension == id) return super.getCanSpawnHere();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canDespawn(){
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
@@ -51,13 +52,22 @@ public class EntitySpiritHorse extends EntityHorse {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getExperiencePoints(EntityPlayer p_70693_1_){
|
||||
protected int getExperiencePoints(EntityPlayer player){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem(){
|
||||
protected boolean canDropLoot(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getLootTable(){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentTranslation;
|
||||
import net.minecraft.world.DifficultyInstance;
|
||||
@@ -70,11 +71,6 @@ public class EntitySpiritWolf extends EntityWolf {
|
||||
super.onDeath(source);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getExperiencePoints(EntityPlayer p_70693_1_){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata){
|
||||
|
||||
@@ -147,11 +143,26 @@ public class EntitySpiritWolf extends EntityWolf {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getExperiencePoints(EntityPlayer player){
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canDropLoot(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Item getDropItem(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getLootTable(){
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITextComponent getDisplayName(){
|
||||
if(getOwner() != null){
|
||||
|
||||
@@ -5,10 +5,11 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
@@ -28,25 +29,24 @@ import electroblob.wizardry.util.WizardryParticleType;
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityAgeable;
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.IEntityLivingData;
|
||||
import net.minecraft.entity.IMerchant;
|
||||
import net.minecraft.entity.INpc;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.EntityAIHurtByTarget;
|
||||
import net.minecraft.entity.ai.EntityAILookAtTradePlayer;
|
||||
import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAIOpenDoor;
|
||||
import net.minecraft.entity.ai.EntityAIRestrictOpenDoor;
|
||||
import net.minecraft.entity.ai.EntityAISwimming;
|
||||
import net.minecraft.entity.ai.EntityAITradePlayer;
|
||||
import net.minecraft.entity.ai.EntityAIWander;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest;
|
||||
import net.minecraft.entity.ai.EntityAIWatchClosest2;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -76,23 +76,12 @@ import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@Mod.EventBusSubscriber
|
||||
public class EntityWizard extends EntityVillager implements ISpellCaster, IEntityAdditionalSpawnData {
|
||||
|
||||
/* After much debugging, the error in the compiled mod (outside of eclipse) was traced back to this class,
|
||||
* specifically the methods copied in from EntityVillager when I changed this class to extend it. This figures,
|
||||
* since I had 1.2.1 working just fine before I did that, and it was the only thing I changed. Apparently, methods
|
||||
* and fields with obfuscated names like func_129090_a can cause problems when compiled. One of the ones here was
|
||||
* renamed and the other deleted since it was never called. Watch out for this in future (unless, of course, they
|
||||
* are overriding something, in which case it should be fine). */
|
||||
|
||||
// Extending EntityVillager turned out to be a pretty neat thing to do, since now zombies will attack wizards
|
||||
// TODO: Perhaps we should be implementing IMerchant now instead?
|
||||
public class EntityWizard extends EntityCreature implements INpc, IMerchant, ISpellCaster, IEntityAdditionalSpawnData {
|
||||
|
||||
private EntityAIAttackSpell spellCastingAI = new EntityAIAttackSpell(this, 0.5D, 14.0F, 30, 50);
|
||||
|
||||
@@ -101,19 +90,21 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
/** The entity selector passed into the new AI methods. */
|
||||
protected Predicate<Entity> targetSelector;
|
||||
|
||||
/** Copy of EntityVillager's buyingList, renamed to avoid confusion. */
|
||||
/** The wizard's trades. */
|
||||
private MerchantRecipeList trades;
|
||||
/** The wizard's current customer. */
|
||||
@Nullable
|
||||
private EntityPlayer customer;
|
||||
|
||||
private int timeUntilReset;
|
||||
|
||||
/** addDefaultEquipmentAndRecipies is called if this is true */
|
||||
private boolean updateRecipes;
|
||||
|
||||
/** Data parameter for the cooldown time for wizards healing themselves. */
|
||||
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. */
|
||||
private static final DataParameter<Integer> ELEMENT = EntityDataManager.createKey(EntityWizard.class,
|
||||
DataSerializers.VARINT);
|
||||
private static final DataParameter<Integer> ELEMENT = EntityDataManager.createKey(EntityWizard.class, DataSerializers.VARINT);
|
||||
|
||||
// Field implementations
|
||||
private List<Spell> spells = new ArrayList<Spell>(4);
|
||||
@@ -140,6 +131,8 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
protected void initEntityAI(){
|
||||
|
||||
this.tasks.addTask(0, new EntityAISwimming(this));
|
||||
// Why would you go to the effort of making the IMerchant interface and then have the AI classes only accept
|
||||
// EntityVillager? N
|
||||
this.tasks.addTask(1, new EntityAITradePlayer(this));
|
||||
this.tasks.addTask(1, new EntityAILookAtTradePlayer(this));
|
||||
this.tasks.addTask(4, new EntityAIRestrictOpenDoor(this));
|
||||
@@ -162,10 +155,10 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
if((entity instanceof IMob || entity instanceof ISummonedCreature
|
||||
// ... or in the whitelist ...
|
||||
|| Arrays.asList(Wizardry.settings.summonedCreatureTargetsWhitelist)
|
||||
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT)))
|
||||
.contains(EntityList.getKey(entity.getClass())))
|
||||
// ... and isn't in the blacklist ...
|
||||
&& !Arrays.asList(Wizardry.settings.summonedCreatureTargetsBlacklist)
|
||||
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT))){
|
||||
.contains(EntityList.getKey(entity.getClass()))){
|
||||
// ... it can be attacked.
|
||||
return true;
|
||||
}
|
||||
@@ -223,6 +216,55 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
return this.continuousSpell;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCustomer(EntityPlayer player){
|
||||
this.customer = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityPlayer getCustomer(){
|
||||
return this.customer;
|
||||
}
|
||||
|
||||
public boolean isTrading(){
|
||||
return this.getCustomer() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifySellingItem(ItemStack stack){
|
||||
// Copied from EntityVillager
|
||||
if(!this.world.isRemote && this.livingSoundTime > -this.getTalkInterval() + 20){
|
||||
this.livingSoundTime = -this.getTalkInterval();
|
||||
this.playSound(stack.isEmpty() ? SoundEvents.ENTITY_VILLAGER_NO : SoundEvents.ENTITY_VILLAGER_YES, this.getSoundVolume(), this.getSoundPitch());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld(){
|
||||
return this.world;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getPos(){
|
||||
return new BlockPos(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void setRecipes(MerchantRecipeList recipeList){
|
||||
// Apparently nothing goes here, and nothing's here in EntityVillager either...
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITextComponent getDisplayName(){
|
||||
return this.getElement().getWizardName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canDespawn(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLivingUpdate(){
|
||||
|
||||
@@ -303,8 +345,7 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
}
|
||||
}
|
||||
|
||||
// Super call removed because EntityVillager's version does things I don't want and the next one up is
|
||||
// in EntityLivingBase and does nothing.
|
||||
super.updateAITasks(); // This actually does nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -340,11 +381,6 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITextComponent getDisplayName(){
|
||||
return this.getElement().getWizardName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound nbt){
|
||||
|
||||
@@ -383,16 +419,6 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
nbt.getTagList("towerBlocks", NBT.TAG_LONG), (NBTTagLong tag) -> BlockPos.fromLong(tag.getLong())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canDespawn(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTrading(){
|
||||
return this.getCustomer() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void useRecipe(MerchantRecipe merchantrecipe){
|
||||
|
||||
@@ -661,11 +687,6 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
return new ItemStack(Blocks.STONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProfession(VillagerProfession prof){
|
||||
// Disables Forge's stuff.
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata){
|
||||
|
||||
@@ -823,49 +844,72 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copied from their respective AI classes
|
||||
|
||||
public static class EntityAILookAtTradePlayer extends EntityAIWatchClosest {
|
||||
|
||||
private final EntityWizard wizard;
|
||||
|
||||
// EntityVillager overrides (that don't add features)
|
||||
public EntityAILookAtTradePlayer(EntityWizard wizard){
|
||||
super(wizard, EntityPlayer.class, 8.0F);
|
||||
this.wizard = wizard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isMating(){
|
||||
return false;
|
||||
@Override
|
||||
public boolean shouldExecute(){
|
||||
if(this.wizard.isTrading()){
|
||||
this.closestEntity = this.wizard.getCustomer();
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class EntityAITradePlayer extends EntityAIBase {
|
||||
|
||||
private final EntityWizard wizard;
|
||||
|
||||
@Override
|
||||
public void setMating(boolean p_70947_1_){
|
||||
}
|
||||
public EntityAITradePlayer(EntityWizard wizard){
|
||||
this.wizard = wizard;
|
||||
this.setMutexBits(5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlaying(boolean p_70939_1_){
|
||||
}
|
||||
@Override
|
||||
public boolean shouldExecute(){
|
||||
|
||||
if(!this.wizard.isEntityAlive()){
|
||||
return false;
|
||||
}else if(this.wizard.isInWater()){
|
||||
return false;
|
||||
}else if(!this.wizard.onGround){
|
||||
return false;
|
||||
}else if(this.wizard.velocityChanged){
|
||||
return false;
|
||||
}else{
|
||||
|
||||
EntityPlayer entityplayer = this.wizard.getCustomer();
|
||||
|
||||
@Override
|
||||
public boolean isPlaying(){
|
||||
return false;
|
||||
}
|
||||
if(entityplayer == null){
|
||||
return false;
|
||||
}else if(this.wizard.getDistanceSq(entityplayer) > 16.0D){
|
||||
return false;
|
||||
}else{
|
||||
return entityplayer.openContainer != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLookingForHome(){
|
||||
}
|
||||
@Override
|
||||
public void startExecuting(){
|
||||
this.wizard.getNavigator().clearPath();
|
||||
}
|
||||
|
||||
// Doesn't say it, but this is in fact nullable.
|
||||
@Override
|
||||
public EntityVillager createChild(EntityAgeable par1EntityAgeable){
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void setRecipes(MerchantRecipeList par1MerchantRecipeList){
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStruckByLightning(EntityLightningBolt lightningBolt){
|
||||
// Restores the normal behaviour, replacing EntityVillager's witch conversion.
|
||||
this.attackEntityFrom(DamageSource.LIGHTNING_BOLT, 5.0F);
|
||||
// Entity's version does something strange with the private fire variable, but since I don't have access this
|
||||
// will probably be fine.
|
||||
this.setFire(8);
|
||||
@Override
|
||||
public void resetTask(){
|
||||
this.wizard.setCustomer((EntityPlayer)null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package electroblob.wizardry.entity.living;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -182,18 +181,28 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData {
|
||||
if(!entity.isInvisible() && isValidTarget(entity)){
|
||||
|
||||
// ... and is a player, they can be attacked, since players can't be in the whitelist or the
|
||||
// blacklist.
|
||||
if(entity instanceof EntityPlayer) return true;
|
||||
// blacklist ...
|
||||
if(entity instanceof EntityPlayer){
|
||||
// ... unless the creature was summoned by a good wizard who the player has not angered.
|
||||
if(getCaster() instanceof EntityWizard){
|
||||
if(((EntityWizard)getCaster()).getRevengeTarget() != entity
|
||||
&& ((EntityWizard)getCaster()).getAttackTarget() != entity) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ... and is a mob, a summoned creature, a wizard ...
|
||||
if((entity instanceof IMob || entity instanceof ISummonedCreature
|
||||
|| (entity instanceof EntityWizard && !(getCaster() instanceof EntityWizard))
|
||||
// ... or in the whitelist ...
|
||||
|| Arrays.asList(Wizardry.settings.summonedCreatureTargetsWhitelist)
|
||||
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT)))
|
||||
.contains(EntityList.getKey(entity.getClass())))
|
||||
// ... and isn't in the blacklist ...
|
||||
&& !Arrays.asList(Wizardry.settings.summonedCreatureTargetsBlacklist)
|
||||
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT))){
|
||||
.contains(EntityList.getKey(entity.getClass()))){
|
||||
// ... it can be attacked.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
|
||||
/**
|
||||
* Same as {@link EntityMagicProjectile}, but with an additional blast multiplier field which is synced and saved to
|
||||
@@ -13,7 +12,7 @@ import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
* @author Electroblob
|
||||
* @since Wizardry 1.2
|
||||
*/
|
||||
public abstract class EntityBomb extends EntityMagicProjectile implements IEntityAdditionalSpawnData {
|
||||
public abstract class EntityBomb extends EntityMagicProjectile {
|
||||
|
||||
/** The entity blast multiplier. This is now synced and saved centrally from {@link EntityBomb}. */
|
||||
public float blastMultiplier = 1.0f;
|
||||
@@ -37,11 +36,13 @@ public abstract class EntityBomb extends EntityMagicProjectile implements IEntit
|
||||
|
||||
@Override
|
||||
public void writeSpawnData(ByteBuf buffer){
|
||||
super.writeSpawnData(buffer);
|
||||
buffer.writeFloat(blastMultiplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSpawnData(ByteBuf buffer){
|
||||
super.readSpawnData(buffer);
|
||||
blastMultiplier = buffer.readFloat();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
@@ -25,7 +24,7 @@ import net.minecraftforge.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
* @author Electroblob
|
||||
* @see EntityBomb
|
||||
*/
|
||||
public abstract class EntityMagicProjectile extends EntityThrowable {
|
||||
public abstract class EntityMagicProjectile extends EntityThrowable implements IEntityAdditionalSpawnData {
|
||||
|
||||
public float damageMultiplier = 1.0f;
|
||||
|
||||
@@ -42,6 +41,8 @@ public abstract class EntityMagicProjectile extends EntityThrowable {
|
||||
// This is the standard set of parameters for this method, used by snowballs and ender pearls amongst others.
|
||||
this.shoot(thrower, thrower.rotationPitch, thrower.rotationYaw, 0.0f, this.getSpeed(), 1.0f);
|
||||
this.damageMultiplier = damageMultiplier;
|
||||
// Mojang's 'fix' for the projectile-hitting-thrower bug actually made the problem worse, hence the following line.
|
||||
this.ignoreEntity = thrower;
|
||||
}
|
||||
|
||||
public EntityMagicProjectile(World world, double x, double y, double z){
|
||||
@@ -78,17 +79,17 @@ public abstract class EntityMagicProjectile extends EntityThrowable {
|
||||
// inside a mob using commands, it wouldn't hit that mob. This is so minor that it's not worth sending a packet
|
||||
// for, though it may become more noticeable if spells firing from blocks are added.
|
||||
// TODO: Investigate whether this is still necessary in 1.12
|
||||
if(this.world.isRemote){
|
||||
|
||||
List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(this.motionX, this.motionY, this.motionZ).grow(1.0D));
|
||||
|
||||
for(Entity entity : list){ // Why does vanilla still not use a for-each loop?
|
||||
if(entity.canBeCollidedWith() && this.ticksExisted < 2 && this.ignoreEntity == null){
|
||||
this.ignoreEntity = entity;
|
||||
}
|
||||
}
|
||||
// Pretty sure EntityThrowable handles the rest.
|
||||
}
|
||||
// if(this.world.isRemote){
|
||||
//
|
||||
// List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox().expand(this.motionX, this.motionY, this.motionZ).grow(1.0D));
|
||||
//
|
||||
// for(Entity entity : list){ // Why does vanilla still not use a for-each loop?
|
||||
// if(entity.canBeCollidedWith() && this.ticksExisted < 2 && this.ignoreEntity == null){
|
||||
// this.ignoreEntity = entity;
|
||||
// }
|
||||
// }
|
||||
// // Pretty sure EntityThrowable handles the rest.
|
||||
// }
|
||||
|
||||
super.onUpdate();
|
||||
}
|
||||
@@ -105,4 +106,16 @@ public abstract class EntityMagicProjectile extends EntityThrowable {
|
||||
nbttagcompound.setFloat("damageMultiplier", damageMultiplier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSpawnData(ByteBuf data){
|
||||
data.writeInt(this.getThrower().getEntityId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSpawnData(ByteBuf data){
|
||||
Entity entity = this.world.getEntityByID(data.readInt());
|
||||
if(entity instanceof EntityLivingBase) this.thrower = (EntityLivingBase)entity;
|
||||
this.ignoreEntity = this.thrower;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import electroblob.wizardry.util.MagicDamage;
|
||||
import electroblob.wizardry.util.MagicDamage.DamageType;
|
||||
import electroblob.wizardry.util.WizardryParticleType;
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -20,9 +19,6 @@ import net.minecraft.world.World;
|
||||
|
||||
public class EntitySparkBomb extends EntityBomb {
|
||||
|
||||
/** For client use, because thrower field is not visible. */
|
||||
private int casterID;
|
||||
|
||||
public EntitySparkBomb(World par1World){
|
||||
super(par1World);
|
||||
}
|
||||
@@ -84,7 +80,7 @@ public class EntitySparkBomb extends EntityBomb {
|
||||
&& ((EntityPlayer)targets.get(i)).capabilities.isCreativeMode);
|
||||
|
||||
// Detects (client side) if target is the thrower, to stop particles being spawned around them.
|
||||
if(flag && world.isRemote && targets.get(i).getEntityId() == this.casterID) flag = false;
|
||||
//if(flag && world.isRemote && targets.get(i).getEntityId() == this.casterID) flag = false;
|
||||
|
||||
if(flag){
|
||||
|
||||
@@ -120,16 +116,4 @@ public class EntitySparkBomb extends EntityBomb {
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSpawnData(ByteBuf data){
|
||||
super.writeSpawnData(data);
|
||||
data.writeInt(this.getThrower().getEntityId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSpawnData(ByteBuf data){
|
||||
super.readSpawnData(data);
|
||||
this.casterID = data.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package electroblob.wizardry.item;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.constants.Constants;
|
||||
@@ -8,20 +12,19 @@ import electroblob.wizardry.constants.Element;
|
||||
import electroblob.wizardry.registry.WizardryAdvancementTriggers;
|
||||
import electroblob.wizardry.registry.WizardryTabs;
|
||||
import electroblob.wizardry.spell.Petrify;
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumHandSide;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -29,8 +32,13 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@Mod.EventBusSubscriber
|
||||
public class ItemWizardArmour extends ItemArmor implements ISpecialArmor {
|
||||
public class ItemWizardArmour extends ItemArmor {
|
||||
|
||||
//VanillaCopy, ItemArmor has this set to private for some reason.
|
||||
public static final UUID[] ARMOR_MODIFIERS = new UUID[] {UUID.fromString("845DB27C-C624-495F-8C9F-6020A9A58B6B"), UUID.fromString("D8499B04-0E66-4726-AB29-64469D734E0D"), UUID.fromString("9F3D476D-C118-4544-8365-64846904B48E"), UUID.fromString("2AD3F246-FEE1-4E67-B886-69FD380BB150")};
|
||||
//Damage reduction values that used to be in WizardryItems.SILK [feet, legs, chest, head]
|
||||
private static int[] reductions = new int[]{2, 4, 5, 2};
|
||||
|
||||
public Element element;
|
||||
|
||||
public ItemWizardArmour(ArmorMaterial material, int renderIndex, EntityEquipmentSlot armourType, Element element){
|
||||
@@ -149,73 +157,41 @@ public class ItemWizardArmour extends ItemArmor implements ISpecialArmor {
|
||||
public boolean getIsRepairable(ItemStack stack, ItemStack par2ItemStack){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage,
|
||||
int slotIndex){
|
||||
|
||||
EntityEquipmentSlot slot = getArmorSlotFromIndex(slotIndex);
|
||||
|
||||
if(!source.isUnblockable() && armor.getItemDamage() < armor.getMaxDamage()){
|
||||
if(armor.hasTagCompound() && armor.getTagCompound().getBoolean("legendary")){
|
||||
// Legendary armour gives full 10 shields, like diamond.
|
||||
return new ArmorProperties(0, ArmorMaterial.DIAMOND.getDamageReductionAmount(slot) / 25D,
|
||||
armor.getMaxDamage() + 1 - armor.getItemDamage());
|
||||
}else{
|
||||
return new ArmorProperties(0, this.damageReduceAmount / 25D,
|
||||
armor.getMaxDamage() + 1 - armor.getItemDamage());
|
||||
}
|
||||
}else{
|
||||
return new ArmorProperties(0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slotIndex){
|
||||
|
||||
EntityEquipmentSlot slot = getArmorSlotFromIndex(slotIndex);
|
||||
|
||||
if(armor.getItemDamage() < armor.getMaxDamage()){
|
||||
if(armor.hasTagCompound() && armor.getTagCompound().getBoolean("legendary")){
|
||||
// Legendary armour gives full 10 shields, like diamond.
|
||||
return ArmorMaterial.DIAMOND.getDamageReductionAmount(slot);
|
||||
}else{
|
||||
return this.getArmorMaterial().getDamageReductionAmount(slot);
|
||||
}
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot){
|
||||
if(stack.getItemDamage() < stack.getMaxDamage()){
|
||||
if(stack.getItemDamage() + damage > stack.getMaxDamage()){
|
||||
// Note for reference: this is the method to use, despite how it sounds attemptDamageItem() is called
|
||||
// by this one, not the other way round.
|
||||
stack.damageItem(stack.getMaxDamage() - stack.getItemDamage(), entity);
|
||||
}else{
|
||||
stack.damageItem(damage, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the EntityEquipmentSlot for which index() returns an integer equal to the passed in slotIndex and which
|
||||
* is an armour slot (not a hand slot). This only exists because the 1.10.2/1.11.2 versions of Forge still uses an
|
||||
* integer slot index in ISpecialArmor instead of an EntityEquipmentSlot.
|
||||
|
||||
/*
|
||||
* Properly handles the defense value of the armor. This method is responisble for the tooltip on top of
|
||||
* the armor value. It is also what handles armor toughness, but the wizard armor had a value of 0 for that.
|
||||
*/
|
||||
// NOTE: Remove in 1.12.2
|
||||
private EntityEquipmentSlot getArmorSlotFromIndex(int slotIndex){
|
||||
// Had to pick something to begin with.
|
||||
EntityEquipmentSlot slot = EntityEquipmentSlot.HEAD;
|
||||
|
||||
for(EntityEquipmentSlot s : WizardryUtilities.ARMOUR_SLOTS){
|
||||
if(s.getIndex() == slotIndex){
|
||||
slot = s;
|
||||
@Override
|
||||
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack){
|
||||
|
||||
Multimap<String, AttributeModifier> map = HashMultimap.create();
|
||||
|
||||
if(stack.getItemDamage() < stack.getMaxDamage() && this.armorType == slot){
|
||||
|
||||
int defense = reductions[slot.getIndex()];
|
||||
float toughness = 0f;
|
||||
|
||||
if(stack.hasTagCompound() && stack.getTagCompound().getBoolean("legendary")) {
|
||||
defense = ArmorMaterial.DIAMOND.getDamageReductionAmount(slot);
|
||||
toughness = ArmorMaterial.DIAMOND.getToughness();
|
||||
}
|
||||
|
||||
map.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(ARMOR_MODIFIERS[slot.getIndex()],
|
||||
"Armor modifier", defense, 0));
|
||||
map.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(ARMOR_MODIFIERS[slot.getIndex()],
|
||||
"Armor toughness", toughness, 0));
|
||||
}
|
||||
return slot;
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
// Fixes wizard armor breaking by disallowing setting damage above the max, since damageArmor is not always called.
|
||||
// Since ISpecialArmor has been removed from this class, this may no longer be necessary, but keeping it won't hurt.
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) {
|
||||
if(damage <= stack.getMaxDamage()) super.setDamage(stack, damage);
|
||||
else super.setDamage(stack, stack.getMaxDamage());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -108,7 +108,7 @@ public class RandomSpell extends LootFunction {
|
||||
}
|
||||
}else{
|
||||
// In theory, swapping this line to the commented one should make absolutely no difference.
|
||||
element = elements.get(random.nextInt(tiers.size()));
|
||||
element = elements.get(random.nextInt(elements.size()));
|
||||
// element = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,10 +34,6 @@ public class PacketSyncSettings implements IMessageHandler<Message, IMessage> {
|
||||
}
|
||||
|
||||
private static void copySettings(Message message){
|
||||
Wizardry.settings.firebombIsCraftable = message.settings.firebombIsCraftable;
|
||||
Wizardry.settings.poisonBombIsCraftable = message.settings.poisonBombIsCraftable;
|
||||
Wizardry.settings.smokeBombIsCraftable = message.settings.smokeBombIsCraftable;
|
||||
Wizardry.settings.useAlternateScrollRecipe = message.settings.useAlternateScrollRecipe;
|
||||
Wizardry.settings.discoveryMode = message.settings.discoveryMode;
|
||||
// Wizardry.settings.maxSpellCommandMultiplier = message.settings.maxSpellCommandMultiplier;
|
||||
// Wizardry.settings.castCommandName = message.settings.castCommandName;
|
||||
@@ -65,10 +61,6 @@ public class PacketSyncSettings implements IMessageHandler<Message, IMessage> {
|
||||
// This is also a great reason to have the settings as an actual object.
|
||||
settings = new Settings();
|
||||
// The order is important
|
||||
settings.firebombIsCraftable = buf.readBoolean();
|
||||
settings.poisonBombIsCraftable = buf.readBoolean();
|
||||
settings.smokeBombIsCraftable = buf.readBoolean();
|
||||
settings.useAlternateScrollRecipe = buf.readBoolean();
|
||||
settings.discoveryMode = buf.readBoolean();
|
||||
// settings.maxSpellCommandMultiplier = buf.readDouble();
|
||||
// settings.castCommandName = ByteBufUtils.readUTF8String(buf);
|
||||
@@ -79,10 +71,6 @@ public class PacketSyncSettings implements IMessageHandler<Message, IMessage> {
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf){
|
||||
buf.writeBoolean(settings.firebombIsCraftable);
|
||||
buf.writeBoolean(settings.poisonBombIsCraftable);
|
||||
buf.writeBoolean(settings.smokeBombIsCraftable);
|
||||
buf.writeBoolean(settings.useAlternateScrollRecipe);
|
||||
buf.writeBoolean(settings.discoveryMode);
|
||||
// buf.writeDouble(settings.maxSpellCommandMultiplier);
|
||||
// ByteBufUtils.writeUTF8String(buf, settings.castCommandName);
|
||||
|
||||
@@ -40,25 +40,18 @@ public final class WizardryBlocks {
|
||||
|
||||
// setSoundType should be public, but in this particular version it isn't... which is a bit of a pain.
|
||||
|
||||
public static final Block arcane_workbench = new BlockArcaneWorkbench().setHardness(1.0F)
|
||||
.setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block crystal_ore = new BlockCrystalOre(Material.ROCK).setHardness(3.0F)
|
||||
.setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block arcane_workbench = new BlockArcaneWorkbench().setHardness(1.0F).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block crystal_ore = new BlockCrystalOre(Material.ROCK).setHardness(3.0F).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block petrified_stone = new BlockStatue(Material.ROCK).setHardness(1.5F).setResistance(10.0F);
|
||||
public static final Block ice_statue = new BlockStatue(Material.ICE).setHardness(0.5F).setLightOpacity(3);
|
||||
public static final Block magic_light = new BlockMagicLight(Material.CIRCUITS);
|
||||
public static final Block crystal_flower = new BlockCrystalFlower(Material.PLANTS).setHardness(0.0F)
|
||||
.setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block crystal_flower = new BlockCrystalFlower(Material.PLANTS).setHardness(0.0F).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block snare = new BlockSnare(Material.PLANTS).setHardness(0.0F);
|
||||
public static final Block transportation_stone = new BlockTransportationStone(Material.ROCK).setHardness(0.0F)
|
||||
.setLightLevel(0.5f).setLightOpacity(0).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block spectral_block = new BlockSpectral(Material.GLASS).setLightLevel(0.7f).setLightOpacity(0)
|
||||
.setBlockUnbreakable().setResistance(6000000.0F);
|
||||
public static final Block crystal_block = new Block(Material.IRON).setHardness(5.0F).setResistance(10.0F)
|
||||
.setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block transportation_stone = new BlockTransportationStone(Material.ROCK).setHardness(0.3F).setLightLevel(0.5f).setLightOpacity(0).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block spectral_block = new BlockSpectral(Material.GLASS).setLightLevel(0.7f).setLightOpacity(0).setBlockUnbreakable().setResistance(6000000.0F);
|
||||
public static final Block crystal_block = new Block(Material.IRON).setHardness(5.0F).setResistance(10.0F).setCreativeTab(WizardryTabs.WIZARDRY);
|
||||
public static final Block meteor = new Block(Material.ROCK).setLightLevel(1);
|
||||
public static final Block vanishing_cobweb = new BlockVanishingCobweb(Material.WEB).setLightOpacity(1)
|
||||
.setHardness(4.0F);
|
||||
public static final Block vanishing_cobweb = new BlockVanishingCobweb(Material.WEB).setLightOpacity(1).setHardness(4.0F);
|
||||
|
||||
static{
|
||||
// This is here because Block#setHarvestLevel isn't chainable.
|
||||
|
||||
@@ -127,7 +127,7 @@ public final class WizardryItems {
|
||||
public static final Item armour_upgrade = new ItemArmourUpgrade();
|
||||
|
||||
public static final ArmorMaterial SILK = EnumHelper.addArmorMaterial("SILK",
|
||||
"wizardry/textures/armour/wizard_armour", 15, new int[]{2, 5, 4, 2}, 0,
|
||||
"wizardry/textures/armour/wizard_armour", 15, new int[]{0, 0, 0, 0}, 0,
|
||||
SoundEvents.ITEM_ARMOR_EQUIP_LEATHER, 0.0F);
|
||||
|
||||
// Saw a post somewhere that said you have to put these in the init methods rather than defining them as constants.
|
||||
|
||||
@@ -73,11 +73,10 @@ import electroblob.wizardry.util.WizardryUtilities;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.init.Biomes;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.Ingredient;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.storage.loot.LootTableList;
|
||||
@@ -89,7 +88,6 @@ import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import net.minecraftforge.registries.IForgeRegistry;
|
||||
|
||||
@@ -245,53 +243,18 @@ public final class WizardryRegistry {
|
||||
EntityRegistry.registerEgg(registryName, eggColour, spotColour);
|
||||
}
|
||||
|
||||
/** Called from the init method in the main mod class to register all the recipes. */
|
||||
/** Now only deals with the dynamic crafting recipes and the smelting recipes. */
|
||||
@SubscribeEvent
|
||||
public static void registerRecipes(RegistryEvent.Register<IRecipe> event){
|
||||
|
||||
IForgeRegistry<IRecipe> registry = event.getRegistry();
|
||||
|
||||
ItemStack magicCrystalStack = new ItemStack(WizardryItems.magic_crystal);
|
||||
ItemStack magicWandStack = new ItemStack(WizardryItems.magic_wand, 1, Tier.BASIC.maxCharge);
|
||||
ItemStack goldNuggetStack = new ItemStack(Items.GOLD_NUGGET);
|
||||
ItemStack stickStack = new ItemStack(Items.STICK);
|
||||
ItemStack bookStack = new ItemStack(Items.BOOK);
|
||||
ItemStack spellBookStack = new ItemStack(WizardryItems.spell_book, 1, Spells.magic_missile.id());
|
||||
Ingredient crystalFlowerStack = Ingredient.fromStacks(new ItemStack(WizardryBlocks.crystal_flower));
|
||||
ItemStack magicCrystalStack1 = new ItemStack(WizardryItems.magic_crystal, 2);
|
||||
ItemStack magicCrystalStack2 = new ItemStack(WizardryItems.magic_crystal, 9);
|
||||
Ingredient crystalBlockStack = Ingredient.fromStacks(new ItemStack(WizardryBlocks.crystal_block));
|
||||
ItemStack manaFlaskStack = new ItemStack(WizardryItems.mana_flask);
|
||||
Ingredient bottleStack = Ingredient.fromStacks(new ItemStack(Items.GLASS_BOTTLE));
|
||||
Ingredient gunpowderStack = Ingredient.fromStacks(new ItemStack(Items.GUNPOWDER));
|
||||
Ingredient blazePowderStack = Ingredient.fromStacks(new ItemStack(Items.BLAZE_POWDER));
|
||||
Ingredient spiderEyeStack = Ingredient.fromStacks(new ItemStack(Items.SPIDER_EYE));
|
||||
// Coal or charcoal is equally fine, hence the wildcard value
|
||||
Ingredient coalStack = Ingredient.fromStacks(new ItemStack(Items.COAL, 1, OreDictionary.WILDCARD_VALUE));
|
||||
ItemStack firebombStack = new ItemStack(WizardryItems.firebomb, 3);
|
||||
ItemStack poisonBombStack = new ItemStack(WizardryItems.poison_bomb, 3);
|
||||
ItemStack smokeBombStack = new ItemStack(WizardryItems.smoke_bomb, 3);
|
||||
ItemStack scrollStack = new ItemStack(WizardryItems.blank_scroll);
|
||||
Ingredient paperStack = Ingredient.fromStacks(new ItemStack(Items.PAPER));
|
||||
Ingredient stringStack = Ingredient.fromStacks(new ItemStack(Items.STRING));
|
||||
|
||||
registry.register(new ShapedOreRecipe(null, magicWandStack, " x", " y ", "z ", 'x', magicCrystalStack, 'y', stickStack, 'z', goldNuggetStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/magic_wand")));
|
||||
registry.register(new ShapedOreRecipe(null, spellBookStack, " x ", "xyx", " x ", 'x', magicCrystalStack, 'y', bookStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/spellbook")));
|
||||
|
||||
registry.register(new ShapelessOreRecipe(null, magicCrystalStack1, crystalFlowerStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/magic_crystal_1")));
|
||||
registry.register(new ShapelessOreRecipe(null, magicCrystalStack2, crystalBlockStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/magic_crystal_2")));
|
||||
|
||||
if(Wizardry.settings.firebombIsCraftable) registry.register(new ShapelessOreRecipe(null, firebombStack, bottleStack, gunpowderStack, blazePowderStack, blazePowderStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/fire_bomb")));
|
||||
if(Wizardry.settings.poisonBombIsCraftable) registry.register(new ShapelessOreRecipe(null, poisonBombStack, bottleStack, gunpowderStack, spiderEyeStack, spiderEyeStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/poison_bomb")));
|
||||
if(Wizardry.settings.smokeBombIsCraftable) registry.register(new ShapelessOreRecipe(null, smokeBombStack, bottleStack, gunpowderStack, coalStack, coalStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/smoke_bomb")));
|
||||
|
||||
if(Wizardry.settings.useAlternateScrollRecipe){
|
||||
registry.register(new ShapelessOreRecipe(null, scrollStack, paperStack, stringStack, magicCrystalStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/blank_scroll")));
|
||||
}else{
|
||||
registry.register(new ShapelessOreRecipe(null, scrollStack, paperStack, stringStack).setRegistryName(new ResourceLocation(Wizardry.MODID, "recipes/blank_scroll")));
|
||||
}
|
||||
|
||||
|
||||
FurnaceRecipes.instance().addSmeltingRecipeForBlock(WizardryBlocks.crystal_ore, new ItemStack(WizardryItems.magic_crystal), 0.5f);
|
||||
|
||||
// Mana flask recipes
|
||||
|
||||
ItemStack manaFlaskStack = new ItemStack(WizardryItems.mana_flask);
|
||||
|
||||
ItemStack miscWandStack;
|
||||
|
||||
for(Element element : Element.values()){
|
||||
@@ -303,7 +266,6 @@ public final class WizardryRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ItemStack miscArmourStack;
|
||||
|
||||
for(Element element : Element.values()){
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package electroblob.wizardry.spell;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
@@ -14,6 +15,7 @@ import electroblob.wizardry.util.SpellModifiers;
|
||||
import electroblob.wizardry.util.WizardryParticleType;
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.INpc;
|
||||
@@ -143,7 +145,8 @@ public class MindControl extends Spell {
|
||||
/** Returns true if the given entity can be mind controlled (i.e. is not a player, npc, evil wizard or boss). */
|
||||
public static boolean canControl(EntityLivingBase target){
|
||||
return target instanceof EntityLiving && target.isNonBoss() && !(target instanceof INpc)
|
||||
&& !(target instanceof EntityEvilWizard);
|
||||
&& !(target instanceof EntityEvilWizard) && !Arrays.asList(Wizardry.settings.mindControlTargetsBlacklist)
|
||||
.contains(EntityList.getKey(target.getClass()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -200,11 +203,11 @@ public class MindControl extends Spell {
|
||||
|
||||
Entity caster = WizardryUtilities.getEntityByUUID(world, entityNBT.getUniqueId(MindControl.NBT_KEY));
|
||||
|
||||
// If the current target is already a valid mind control target, nothing happens.
|
||||
if(WizardryUtilities.isValidTarget(caster, currentTarget)) return;
|
||||
|
||||
if(caster instanceof EntityLivingBase){
|
||||
|
||||
// If the current target is already a valid mind control target, nothing happens.
|
||||
if(WizardryUtilities.isValidTarget(caster, currentTarget)) return;
|
||||
|
||||
if(MindControl.findMindControlTarget(entity, (EntityLivingBase)caster, world)){
|
||||
// If it worked, skip setting the target to null.
|
||||
return;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package electroblob.wizardry.spell;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -403,12 +404,11 @@ public abstract class Spell extends IForgeRegistryEntry.Impl<Spell> implements C
|
||||
}
|
||||
|
||||
/** Returns a list of all registered spells' registry names, excluding the 'none' spell. Used in commands. */
|
||||
public static String[] getSpellNames(){
|
||||
public static Collection<ResourceLocation> getSpellNames(){
|
||||
// Maybe it would be better to store all of this statically?
|
||||
Set<ResourceLocation> keys = new HashSet<ResourceLocation>(registry.getKeys());
|
||||
keys.remove(registry.getKey(Spells.none));
|
||||
// Streams!
|
||||
return keys.stream().map(ResourceLocation::toString).toArray(String[]::new);
|
||||
return keys;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -331,7 +331,7 @@ public class ContainerArcaneWorkbench extends Container {
|
||||
// This needs to happen so the charging works on the new wand, not the old one.
|
||||
wand = this.getSlot(WAND_SLOT).getStack();
|
||||
|
||||
}else{
|
||||
}else if(WandHelper.isWandUpgrade(upgrade.getItem())){
|
||||
|
||||
// Special upgrades
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileEntityArcaneWorkbench extends TileEntity implements IInventory, ITickable {
|
||||
|
||||
/** The inventory of the arcane workbench. */
|
||||
private NonNullList<ItemStack> inventory;
|
||||
/** Controls the rotation of the rune. */
|
||||
public float timer = 0;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package electroblob.wizardry.tileentity;
|
||||
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
@@ -107,8 +108,7 @@ public class TileEntityStatue extends TileEntity implements ITickable {
|
||||
// Breaks the block at light levels of 7 or below, with a higher chance the lower the light level.
|
||||
// The chance is (8 - light level)/12, so at light 0 the chance is 3/4 and at light 7 the chance is 1/12.
|
||||
if(!this.world.isRemote && this.timer % 200 == 0 && this.timer > lifetime && !this.isIce && this.position == 1){
|
||||
// TESTME: There are about 10 different light-related methods in world now... is this the right one?
|
||||
if(this.world.getLight(pos) < this.world.rand.nextInt(12) - 3){
|
||||
if(WizardryUtilities.getLightLevel(world, pos) < this.world.rand.nextInt(12) - 3){
|
||||
// This is all that is needed because destroyBlock invokes the breakBlock function in
|
||||
// BlockPetrifiedStone
|
||||
// and that function handles all the spawning and stuff.
|
||||
|
||||
@@ -64,9 +64,9 @@ import net.minecraft.util.EntityDamageSource;
|
||||
public class MagicDamage extends EntityDamageSource implements IElementalDamage {
|
||||
|
||||
/** The name of the damagesource for direct magic damage from the wizardry mod. */
|
||||
public static final String DIRECT_MAGIC_DAMAGE = "wizardryMagic";
|
||||
public static final String DIRECT_MAGIC_DAMAGE = "wizardry_magic";
|
||||
/** The name of the damagesource for indirect magic damage from the wizardry mod. */
|
||||
public static final String INDIRECT_MAGIC_DAMAGE = "indirectWizardryMagic";
|
||||
public static final String INDIRECT_MAGIC_DAMAGE = "indirect_wizardry_magic";
|
||||
// Technically, I don't need to specify that the classes in this map must extend entity, but it's good practice to.
|
||||
private static final Map<Class<? extends Entity>, DamageType[]> immunityMapping = new HashMap<Class<? extends Entity>, DamageType[]>();
|
||||
|
||||
@@ -169,7 +169,7 @@ public class MagicDamage extends EntityDamageSource implements IElementalDamage
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a DamageSource called "wizardryMagic" with the given entity as the caster. Use in preference to vanilla
|
||||
* Returns a DamageSource called "wizardry_magic" with the given entity as the caster. Use in preference to vanilla
|
||||
* types to allow things to distinguish between magic and regular melee/swords. Unlike DamageSource.MAGIC, it does
|
||||
* not bypass armour and has a player as the source (rather than nothing). It is still classed as magic damage (for
|
||||
* the record, all this does in vanilla is make witches 85% resistant to it - but that seems kinda right anyway).
|
||||
@@ -190,7 +190,7 @@ public class MagicDamage extends EntityDamageSource implements IElementalDamage
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a DamageSource called "wizardryMagic" with the given entity as the caster. Use in preference to vanilla
|
||||
* Returns a DamageSource called "wizardry_magic" with the given entity as the caster. Use in preference to vanilla
|
||||
* types to allow things to distinguish between magic and regular melee/swords. Unlike DamageSource.MAGIC, it does
|
||||
* not bypass armour and has a player as the source (rather than nothing). It is still classed as magic damage (for
|
||||
* the record, all this does in vanilla is make witches 85% resistant to it - but that seems kinda right anyway).
|
||||
@@ -212,7 +212,7 @@ public class MagicDamage extends EntityDamageSource implements IElementalDamage
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a DamageSource called "indirectWizardryMagic" with the player as the caster. Use in preference to vanilla
|
||||
* Returns a DamageSource called "indirect_wizardry_magic" with the player as the caster. Use in preference to vanilla
|
||||
* types to allow things to distinguish between magic and regular arrows/throwables. Unlike
|
||||
* DamageSource.causeIndirectMagicDamage, it does not bypass armour. It is still classed as magic damage (for the
|
||||
* record, all this does in vanilla is make witches 85% resistant to it - but that seems kinda right anyway).
|
||||
@@ -234,7 +234,7 @@ public class MagicDamage extends EntityDamageSource implements IElementalDamage
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a DamageSource called "indirectWizardryMagic" with the player as the caster. Use in preference to vanilla
|
||||
* Returns a DamageSource called "indirect_wizardry_magic" with the player as the caster. Use in preference to vanilla
|
||||
* types to allow things to distinguish between magic and regular arrows/throwables. Unlike
|
||||
* DamageSource.causeIndirectMagicDamage, it does not bypass armour. It is still classed as magic damage (for the
|
||||
* record, all this does in vanilla is make witches 85% resistant to it - but that seems kinda right anyway).
|
||||
|
||||
@@ -98,6 +98,26 @@ public final class WizardryUtilities {
|
||||
// SECTION Block/Entity/World Utilities
|
||||
// ===============================================================================================================
|
||||
|
||||
/**
|
||||
* Returns the actual light level, taking natural light (skylight) and artificial light (block light) into account.
|
||||
* This uses the same logic as mob spawning.
|
||||
*
|
||||
* @return The light level, from 0 (pitch darkness) to 15 (full daylight/at a torch).
|
||||
*/
|
||||
public static int getLightLevel(World world, BlockPos pos){
|
||||
|
||||
int i = world.getLightFromNeighbors(pos);
|
||||
|
||||
if(world.isThundering()){
|
||||
int j = world.getSkylightSubtracted();
|
||||
world.setSkylightSubtracted(10);
|
||||
i = world.getLightFromNeighbors(pos);
|
||||
world.setSkylightSubtracted(j);
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the block at the given coordinates can be replaced by another one (works as if a block is being
|
||||
* placed by a player). True for air, liquids, vines, tall grass and snow layers but not for flowers, signs etc.
|
||||
@@ -942,7 +962,7 @@ public final class WizardryUtilities {
|
||||
*
|
||||
* @return False under any of the following circumstances, true otherwise:
|
||||
* <p>
|
||||
* - Either entity is null
|
||||
* - The target is null
|
||||
* <p>
|
||||
* - The target is the attacker (this isn't as stupid as it sounds - anything with an AoE might cause this
|
||||
* to be true, as can summoned creatures)
|
||||
@@ -951,10 +971,18 @@ public final class WizardryUtilities {
|
||||
* attacker need not be an ally of the target)
|
||||
* <p>
|
||||
* - The target is a creature that was summoned/controlled by the attacker or by an ally of the attacker.
|
||||
* <p>
|
||||
* <i>As of wizardry 4.1.2, this method now returns <b>true</b> instead of false if the attacker is null. This
|
||||
* is because in the vast majority of cases, it makes more sense this way: if a construct has no caster, it
|
||||
* should affect all entities; if a minion has no caster is should target all entities; etc.</i>
|
||||
*/
|
||||
public static boolean isValidTarget(Entity attacker, Entity target){
|
||||
|
||||
if(attacker == null || target == null) return false;
|
||||
// Always return true if the attacker is null
|
||||
if(attacker == null) return true;
|
||||
|
||||
// Always return false if the target is null
|
||||
if(target == null) return false;
|
||||
|
||||
// Tests whether the target is the attacker
|
||||
if(target == attacker) return false;
|
||||
|
||||
@@ -655,20 +655,35 @@ commands.ebwizardry:discoverspell.removespell=Removed %1$s from %2$s's spell dis
|
||||
|
||||
config.ebwizardry.title.general=Mod Options
|
||||
|
||||
config.ebwizardry.category.spells=Configure Spells
|
||||
config.ebwizardry.category.gameplay=Gameplay Settings
|
||||
config.ebwizardry.category.gameplay.tooltip=Configure wizardry's general gameplay
|
||||
config.ebwizardry.title.gameplay=Gameplay Settings
|
||||
config.ebwizardry.subtitle.gameplay=Global settings that affect game mechanics.
|
||||
|
||||
config.ebwizardry.category.worldgen=World Generation Settings
|
||||
config.ebwizardry.category.worldgen.tooltip=Configure wizardry's world generation features
|
||||
config.ebwizardry.title.worldgen=World Generation Settings
|
||||
config.ebwizardry.subtitle.worldgen=Settings that affect world generation.
|
||||
|
||||
config.ebwizardry.category.commands=Command Settings
|
||||
config.ebwizardry.category.commands.tooltip=Configure wizardry's commands
|
||||
config.ebwizardry.title.commands=Command Settings
|
||||
config.ebwizardry.subtitle.commands=Settings for the commands added by Wizardry.
|
||||
|
||||
config.ebwizardry.category.client=Client Settings
|
||||
config.ebwizardry.category.client.tooltip=Configure wizardry's display and controls
|
||||
config.ebwizardry.title.client=Client Settings
|
||||
config.ebwizardry.subtitle.client=Client-side settings that only affect the local minecraft game.
|
||||
|
||||
config.ebwizardry.category.spells=Spell Configuration
|
||||
config.ebwizardry.category.spells.tooltip=Select which spells are enabled
|
||||
config.ebwizardry.title.spells=Spell Configuration
|
||||
config.ebwizardry.subtitle.spells=Set a spell to false to disable it.
|
||||
|
||||
config.ebwizardry.category.resistances=Configure Resistances
|
||||
config.ebwizardry.category.resistances=Resistance Configuration
|
||||
config.ebwizardry.category.resistances.tooltip=Configure which mobs are immune to different types of magic
|
||||
config.ebwizardry.title.resistances=Resistance Configuration
|
||||
config.ebwizardry.subtitle.resistances=See descriptions of individual options for more details.
|
||||
|
||||
config.ebwizardry.category.ids=Configure IDs
|
||||
config.ebwizardry.category.ids.tooltip=Change the IDs used by wizardry
|
||||
config.ebwizardry.title.ids=ID Configuration
|
||||
config.ebwizardry.subtitle.ids=Change these IDs if they conflict with another mod.
|
||||
config.ebwizardry.subtitle.resistances=Settings which allow entities to be made immune to certain types of magic.
|
||||
|
||||
config.ebwizardry.tower_rarity=Tower Rarity
|
||||
config.ebwizardry.ore_dimensions=Ore Dimensions
|
||||
@@ -685,7 +700,7 @@ config.ebwizardry.show_summoned_creature_names=Show Summoned Creature Names
|
||||
config.ebwizardry.friendly_fire=Friendly Fire
|
||||
config.ebwizardry.telekinetic_disarmament=Telekinetic Disarmament
|
||||
config.ebwizardry.discovery_mode=Discovery Mode
|
||||
config.ebwizardry.enable_shift_scrolling=Enable Shift-_scrolling
|
||||
config.ebwizardry.enable_shift_scrolling=Enable Shift-scrolling
|
||||
config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting
|
||||
config.ebwizardry.player_damage_scaling=Player Damage Scaling Factor
|
||||
config.ebwizardry.npc_damage_scaling=NPC Damage Scaling Factor
|
||||
@@ -697,6 +712,8 @@ config.ebwizardry.cast_command_name=Cast Spell Command Name
|
||||
config.ebwizardry.discoverspell_command_name=Discover Spell Command Name
|
||||
config.ebwizardry.ally_command_name=Set Ally Command Name
|
||||
config.ebwizardry.allies_command_name=View Allies Command Name
|
||||
config.ebwizardry.mind_control_targets_blacklist=Mind Control Targets Blacklist
|
||||
config.ebwizardry.evil_wizard_dimensions=Evil Wizard Dimensions
|
||||
|
||||
config.ebwizardry.mobs_immune_to_fire=Mobs Immune To Fire
|
||||
config.ebwizardry.mobs_immune_to_ice=Mobs Immune To Ice
|
||||
@@ -717,25 +734,27 @@ config.ebwizardry.use_alternate_scroll_recipe.tooltip=Whether to require a magic
|
||||
config.ebwizardry.teleport_through_unbreakable_blocks.tooltip=Whether players are allowed to teleport through unbreakable blocks (e.g. bedrock) using the phase step spell.
|
||||
config.ebwizardry.show_summoned_creature_names.tooltip=Whether to show summoned creatures' names and owners above their heads.
|
||||
config.ebwizardry.friendly_fire.tooltip=Whether to allow players to damage their designated allies using magic.
|
||||
config.ebwizardry.telekinetic_disarmament.tooltip=Whether to allow players to disarm other players using the telekinesis spell.ebwizardry: Set to false to prevent stealing of items.
|
||||
config.ebwizardry.telekinetic_disarmament.tooltip=Whether to allow players to disarm other players using the telekinesis spell. Set to false to prevent stealing of items.
|
||||
config.ebwizardry.discovery_mode.tooltip=For those who like a sense of mystery! When set to true, spells you haven't cast yet will be unreadable until you cast them (on a per-world basis). Has no effect when in creative mode. Spells of identification will be unobtainable in survival mode if this is false.
|
||||
config.ebwizardry.enable_shift_scrolling.tooltip=Whether you can switch between spells on a wand by scrolling with the mouse wheel while sneaking. Note that this will only affect you; other players connected to the same server obey their own settings.
|
||||
config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge attack their owner if their owner attacks them.
|
||||
config.ebwizardry.player_damage_scaling.tooltip=Global damage scaling factor for the damage dealt by players casting spells, relative to 1.
|
||||
config.ebwizardry.npc_damage_scaling.tooltip=Global damage scaling factor for the damage dealt by NPCs casting spells, relative to 1.
|
||||
config.ebwizardry.cast_command_multiplier_limit.tooltip=Upper limit for the multipliers passed into the /cast command. This is here to stop players from accidentally breaking a world/server. Large blast mutipliers can cause extreme lag - you have been warned!
|
||||
config.ebwizardry.summoned_creature_targets_whitelist.tooltip=List of names of entities which summoned creatures and wizards are allowed to attack, in addition to the defaults. Add mod creatures to this list if you want summoned creatures to attack them and they aren't already doing so. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.summoned_creature_targets_blacklist.tooltip=List of names of entities which summoned creatures and wizards are specifically not allowed to attack, overriding the defaults and the whitelist. Add creatures to this list if allowing them to be attacked causes problems or is too destructive (removing creepers from this list is done at your own risk!). Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.summoned_creature_targets_whitelist.tooltip=List of names of entities which summoned creatures and wizards are allowed to attack, in addition to the defaults. Add mod creatures to this list if you want summoned creatures to attack them and they aren't already doing so. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.summoned_creature_targets_blacklist.tooltip=List of names of entities which summoned creatures and wizards are specifically not allowed to attack, overriding the defaults and the whitelist. Add creatures to this list if allowing them to be attacked causes problems or is too destructive (removing creepers from this list is done at your own risk!). Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.spell_hud_position.tooltip=The position of the spell HUD.
|
||||
config.ebwizardry.cast_command_name.tooltip=The name of the /cast command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /cast you would type /magic instead.
|
||||
config.ebwizardry.discoverspell_command_name.tooltip=The name of the /discoverspell command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /discoverspell you would type /magic instead.
|
||||
config.ebwizardry.ally_command_name.tooltip=The name of the /ally command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /ally you would type /magic instead.
|
||||
config.ebwizardry.allies_command_name.tooltip=The name of the /allies command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /allies you would type /magic instead.
|
||||
config.ebwizardry.mind_control_targets_blacklist.tooltip=List of names of entities which cannot be mind controlled, in addition to the defaults. Add creatures to this list if allowing them to be mind-controlled causes problems or could be exploited. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.evil_wizard_dimensions.tooltip=List of dimension ids in which evil wizards can spawn.
|
||||
|
||||
config.ebwizardry.mobs_immune_to_fire.tooltip=List of names of entities that are immune to fire, in addition to the defaults. Add mod creatures to this list if you want them to be immune to fire magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_ice.tooltip=List of names of entities that are immune to ice, in addition to the defaults. Add mod creatures to this list if you want them to be immune to ice magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_lightning.tooltip=List of names of entities that are immune to lightning, in addition to the defaults. Add mod creatures to this list if you want them to be immune to lightning magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_wither.tooltip=List of names of entities that are immune to wither effects, in addition to the defaults. Add mod creatures to this list if you want them to be immune to withering magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_poison.tooltip=List of names of entities that are immune to poison, in addition to the defaults. Add mod creatures to this list if you want them to be immune to poison magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_fire.tooltip=List of names of entities that are immune to fire, in addition to the defaults. Add mod creatures to this list if you want them to be immune to fire magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.mobs_immune_to_ice.tooltip=List of names of entities that are immune to ice, in addition to the defaults. Add mod creatures to this list if you want them to be immune to ice magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.mobs_immune_to_lightning.tooltip=List of names of entities that are immune to lightning, in addition to the defaults. Add mod creatures to this list if you want them to be immune to lightning magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.mobs_immune_to_wither.tooltip=List of names of entities that are immune to wither effects, in addition to the defaults. Add mod creatures to this list if you want them to be immune to withering magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.mobs_immune_to_poison.tooltip=List of names of entities that are immune to poison, in addition to the defaults. Add mod creatures to this list if you want them to be immune to poison magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
|
||||
wizard.debug=%1$s, %2$s, %3$s
|
||||
|
||||
@@ -655,20 +655,35 @@ commands.ebwizardry:discoverspell.removespell=Removed %1$s from %2$s's spell dis
|
||||
|
||||
config.ebwizardry.title.general=Mod Options
|
||||
|
||||
config.ebwizardry.category.spells=Configure Spells
|
||||
config.ebwizardry.category.gameplay=Gameplay Settings
|
||||
config.ebwizardry.category.gameplay.tooltip=Configure wizardry's general gameplay
|
||||
config.ebwizardry.title.gameplay=Gameplay Settings
|
||||
config.ebwizardry.subtitle.gameplay=Global settings that affect game mechanics.
|
||||
|
||||
config.ebwizardry.category.worldgen=World Generation Settings
|
||||
config.ebwizardry.category.worldgen.tooltip=Configure wizardry's world generation features
|
||||
config.ebwizardry.title.worldgen=World Generation Settings
|
||||
config.ebwizardry.subtitle.worldgen=Settings that affect world generation.
|
||||
|
||||
config.ebwizardry.category.commands=Command Settings
|
||||
config.ebwizardry.category.commands.tooltip=Configure wizardry's commands
|
||||
config.ebwizardry.title.commands=Command Settings
|
||||
config.ebwizardry.subtitle.commands=Settings for the commands added by Wizardry.
|
||||
|
||||
config.ebwizardry.category.client=Client Settings
|
||||
config.ebwizardry.category.client.tooltip=Configure wizardry's display and controls
|
||||
config.ebwizardry.title.client=Client Settings
|
||||
config.ebwizardry.subtitle.client=Client-side settings that only affect the local minecraft game.
|
||||
|
||||
config.ebwizardry.category.spells=Spell Configuration
|
||||
config.ebwizardry.category.spells.tooltip=Select which spells are enabled
|
||||
config.ebwizardry.title.spells=Spell Configuration
|
||||
config.ebwizardry.subtitle.spells=Set a spell to false to disable it.
|
||||
|
||||
config.ebwizardry.category.resistances=Configure Resistances
|
||||
config.ebwizardry.category.resistances=Resistance Configuration
|
||||
config.ebwizardry.category.resistances.tooltip=Configure which mobs are immune to different types of magic
|
||||
config.ebwizardry.title.resistances=Resistance Configuration
|
||||
config.ebwizardry.subtitle.resistances=See descriptions of individual options for more details.
|
||||
|
||||
config.ebwizardry.category.ids=Configure IDs
|
||||
config.ebwizardry.category.ids.tooltip=Change the IDs used by wizardry
|
||||
config.ebwizardry.title.ids=ID Configuration
|
||||
config.ebwizardry.subtitle.ids=Change these IDs if they conflict with another mod.
|
||||
config.ebwizardry.subtitle.resistances=Settings which allow entities to be made immune to certain types of magic.
|
||||
|
||||
config.ebwizardry.tower_rarity=Tower Rarity
|
||||
config.ebwizardry.ore_dimensions=Ore Dimensions
|
||||
@@ -685,7 +700,7 @@ config.ebwizardry.show_summoned_creature_names=Show Summoned Creature Names
|
||||
config.ebwizardry.friendly_fire=Friendly Fire
|
||||
config.ebwizardry.telekinetic_disarmament=Telekinetic Disarmament
|
||||
config.ebwizardry.discovery_mode=Discovery Mode
|
||||
config.ebwizardry.enable_shift_scrolling=Enable Shift-_scrolling
|
||||
config.ebwizardry.enable_shift_scrolling=Enable Shift-scrolling
|
||||
config.ebwizardry.minion_revenge_targeting=Minion Revenge Targeting
|
||||
config.ebwizardry.player_damage_scaling=Player Damage Scaling Factor
|
||||
config.ebwizardry.npc_damage_scaling=NPC Damage Scaling Factor
|
||||
@@ -697,6 +712,8 @@ config.ebwizardry.cast_command_name=Cast Spell Command Name
|
||||
config.ebwizardry.discoverspell_command_name=Discover Spell Command Name
|
||||
config.ebwizardry.ally_command_name=Set Ally Command Name
|
||||
config.ebwizardry.allies_command_name=View Allies Command Name
|
||||
config.ebwizardry.mind_control_targets_blacklist=Mind Control Targets Blacklist
|
||||
config.ebwizardry.evil_wizard_dimensions=Evil Wizard Dimensions
|
||||
|
||||
config.ebwizardry.mobs_immune_to_fire=Mobs Immune To Fire
|
||||
config.ebwizardry.mobs_immune_to_ice=Mobs Immune To Ice
|
||||
@@ -717,25 +734,27 @@ config.ebwizardry.use_alternate_scroll_recipe.tooltip=Whether to require a magic
|
||||
config.ebwizardry.teleport_through_unbreakable_blocks.tooltip=Whether players are allowed to teleport through unbreakable blocks (e.g. bedrock) using the phase step spell.
|
||||
config.ebwizardry.show_summoned_creature_names.tooltip=Whether to show summoned creatures' names and owners above their heads.
|
||||
config.ebwizardry.friendly_fire.tooltip=Whether to allow players to damage their designated allies using magic.
|
||||
config.ebwizardry.telekinetic_disarmament.tooltip=Whether to allow players to disarm other players using the telekinesis spell.ebwizardry: Set to false to prevent stealing of items.
|
||||
config.ebwizardry.telekinetic_disarmament.tooltip=Whether to allow players to disarm other players using the telekinesis spell. Set to false to prevent stealing of items.
|
||||
config.ebwizardry.discovery_mode.tooltip=For those who like a sense of mystery! When set to true, spells you haven't cast yet will be unreadable until you cast them (on a per-world basis). Has no effect when in creative mode. Spells of identification will be unobtainable in survival mode if this is false.
|
||||
config.ebwizardry.enable_shift_scrolling.tooltip=Whether you can switch between spells on a wand by scrolling with the mouse wheel while sneaking. Note that this will only affect you; other players connected to the same server obey their own settings.
|
||||
config.ebwizardry.minion_revenge_targeting.tooltip=Whether summoned creatures can revenge attack their owner if their owner attacks them.
|
||||
config.ebwizardry.player_damage_scaling.tooltip=Global damage scaling factor for the damage dealt by players casting spells, relative to 1.
|
||||
config.ebwizardry.npc_damage_scaling.tooltip=Global damage scaling factor for the damage dealt by NPCs casting spells, relative to 1.
|
||||
config.ebwizardry.cast_command_multiplier_limit.tooltip=Upper limit for the multipliers passed into the /cast command. This is here to stop players from accidentally breaking a world/server. Large blast mutipliers can cause extreme lag - you have been warned!
|
||||
config.ebwizardry.summoned_creature_targets_whitelist.tooltip=List of names of entities which summoned creatures and wizards are allowed to attack, in addition to the defaults. Add mod creatures to this list if you want summoned creatures to attack them and they aren't already doing so. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.summoned_creature_targets_blacklist.tooltip=List of names of entities which summoned creatures and wizards are specifically not allowed to attack, overriding the defaults and the whitelist. Add creatures to this list if allowing them to be attacked causes problems or is too destructive (removing creepers from this list is done at your own risk!). Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.summoned_creature_targets_whitelist.tooltip=List of names of entities which summoned creatures and wizards are allowed to attack, in addition to the defaults. Add mod creatures to this list if you want summoned creatures to attack them and they aren't already doing so. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.summoned_creature_targets_blacklist.tooltip=List of names of entities which summoned creatures and wizards are specifically not allowed to attack, overriding the defaults and the whitelist. Add creatures to this list if allowing them to be attacked causes problems or is too destructive (removing creepers from this list is done at your own risk!). Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.spell_hud_position.tooltip=The position of the spell HUD.
|
||||
config.ebwizardry.cast_command_name.tooltip=The name of the /cast command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /cast you would type /magic instead.
|
||||
config.ebwizardry.discoverspell_command_name.tooltip=The name of the /discoverspell command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /discoverspell you would type /magic instead.
|
||||
config.ebwizardry.ally_command_name.tooltip=The name of the /ally command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /ally you would type /magic instead.
|
||||
config.ebwizardry.allies_command_name.tooltip=The name of the /allies command. This is what you type directly after the /; for example if this was set to 'magic' then instead of typing /allies you would type /magic instead.
|
||||
config.ebwizardry.mind_control_targets_blacklist.tooltip=List of names of entities which cannot be mind controlled, in addition to the defaults. Add creatures to this list if allowing them to be mind-controlled causes problems or could be exploited. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.evil_wizard_dimensions.tooltip=List of dimension ids in which evil wizards can spawn.
|
||||
|
||||
config.ebwizardry.mobs_immune_to_fire.tooltip=List of names of entities that are immune to fire, in addition to the defaults. Add mod creatures to this list if you want them to be immune to fire magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_ice.tooltip=List of names of entities that are immune to ice, in addition to the defaults. Add mod creatures to this list if you want them to be immune to ice magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_lightning.tooltip=List of names of entities that are immune to lightning, in addition to the defaults. Add mod creatures to this list if you want them to be immune to lightning magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_wither.tooltip=List of names of entities that are immune to wither effects, in addition to the defaults. Add mod creatures to this list if you want them to be immune to withering magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_poison.tooltip=List of names of entities that are immune to poison, in addition to the defaults. Add mod creatures to this list if you want them to be immune to poison magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry.wizard).
|
||||
config.ebwizardry.mobs_immune_to_fire.tooltip=List of names of entities that are immune to fire, in addition to the defaults. Add mod creatures to this list if you want them to be immune to fire magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.mobs_immune_to_ice.tooltip=List of names of entities that are immune to ice, in addition to the defaults. Add mod creatures to this list if you want them to be immune to ice magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.mobs_immune_to_lightning.tooltip=List of names of entities that are immune to lightning, in addition to the defaults. Add mod creatures to this list if you want them to be immune to lightning magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.mobs_immune_to_wither.tooltip=List of names of entities that are immune to wither effects, in addition to the defaults. Add mod creatures to this list if you want them to be immune to withering magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
config.ebwizardry.mobs_immune_to_poison.tooltip=List of names of entities that are immune to poison, in addition to the defaults. Add mod creatures to this list if you want them to be immune to poison magic and they aren't already. Entity names are not case sensitive. For mod entities, prefix with the mod ID (e.g. ebwizardry:wizard).
|
||||
|
||||
wizard.debug=%1$s, %2$s, %3$s
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
],
|
||||
"key": {
|
||||
"v": {
|
||||
"item": "minecraft:gold_nugget"
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "nuggetGold"
|
||||
},
|
||||
"w": {
|
||||
"item": "minecraft:carpet",
|
||||
@@ -17,7 +18,8 @@
|
||||
"item": "ebwizardry:magic_crystal"
|
||||
},
|
||||
"y": {
|
||||
"item": "minecraft:lapis_block"
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "blockLapis"
|
||||
},
|
||||
"z": {
|
||||
"type": "forge:ore_dict",
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:paper"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:string"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "ebwizardry:blank_scroll"
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"group": "magic_crystal",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "ebwizardry:crystal_block"
|
||||
@@ -7,6 +8,6 @@
|
||||
],
|
||||
"result": {
|
||||
"item": "ebwizardry:magic_crystal",
|
||||
"amount": 9
|
||||
"count": 9
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"group": "magic_crystal",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "ebwizardry:crystal_flower"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "ebwizardry:magic_crystal",
|
||||
"count": 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:blaze_powder"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:blaze_powder"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:glass_bottle"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:gunpowder"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "ebwizardry:firebomb",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" x ",
|
||||
"xyx",
|
||||
" x "
|
||||
],
|
||||
"key": {
|
||||
"x": {
|
||||
"item": "ebwizardry:magic_crystal"
|
||||
},
|
||||
"y": {
|
||||
"item": "minecraft:book"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "ebwizardry:spell_book",
|
||||
"data": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"type": "forge:ore_shaped",
|
||||
"pattern": [
|
||||
" z",
|
||||
" y ",
|
||||
"x "
|
||||
],
|
||||
"key": {
|
||||
"x": {
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "nuggetGold"
|
||||
},
|
||||
"y": {
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "stickWood"
|
||||
},
|
||||
"z": {
|
||||
"item": "ebwizardry:magic_crystal"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "ebwizardry:magic_wand"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:spider_eye"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:spider_eye"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:glass_bottle"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:gunpowder"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "ebwizardry:poison_bomb",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shapeless",
|
||||
"ingredients": [
|
||||
[
|
||||
{
|
||||
"item": "minecraft:coal",
|
||||
"data": 0
|
||||
},
|
||||
{
|
||||
"item": "minecraft:coal",
|
||||
"data": 1
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"item": "minecraft:coal",
|
||||
"data": 0
|
||||
},
|
||||
{
|
||||
"item": "minecraft:coal",
|
||||
"data": 1
|
||||
}
|
||||
],
|
||||
{
|
||||
"item": "minecraft:glass_bottle"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:gunpowder"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "ebwizardry:smoke_bomb",
|
||||
"count": 3
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -2,9 +2,9 @@
|
||||
{
|
||||
"modid" : "ebwizardry",
|
||||
"name" : "Electroblob's Wizardry",
|
||||
"version" : "4.1.1",
|
||||
"version" : "4.1.2",
|
||||
"url" : "https://minecraft.curseforge.com/projects/electroblobs-wizardry",
|
||||
"credits" : "Designed, coded and textured by Electroblob. Code contributed to 1.11 and 1.12 updates by Corail31 and 12foo. Translators: MadWrist (Spanish, Mexican Spanish), VilagVil (Russian).",
|
||||
"credits" : "Designed, coded and textured by Electroblob. Code contributed by: Corail31, 12foo, Shadows-of-Fire. Translators: MadWrist (Spanish, Mexican Spanish), VilagVil (Russian).",
|
||||
"authors" : [
|
||||
"Electroblob"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user