Miscellaneous cleanup and commenting

This commit is contained in:
Electroblob
2018-06-05 21:24:09 +01:00
parent b9ba25c116
commit dcec7c7281
6 changed files with 22 additions and 12 deletions
@@ -87,7 +87,13 @@ public class Wizardry {
/** Static instance of the {@link Settings} object for Wizardry. */
public static final Settings settings = new Settings();
/** Static instance of the {@link Logger} object for Wizardry. */
/** Static instance of the {@link Logger} object for Wizardry.
* <p>
* Logging conventions for wizardry (only these levels are used currently):
* <p>
* - <b>ERROR</b>: Anything that threw an exception; may or may not crash the game.<br>
* - <b>WARN</b>: Anything that isn't supposed to happen during normal operation, but didn't throw an exception.<br>
* - <b>INFO</b>: Anything that might happen during normal mod operation that the user needs to know about. */
public static Logger logger;
// private static Pattern entityNamePattern;
@@ -45,10 +45,8 @@ public class BlockSpectral extends BlockContainer {
return EnumBlockRenderType.MODEL;
}
// Apparently it's OK to override this, despite it being deprecated. More
// importantly, it being deprecated is not
// Forge's doing, rather it is Mojang themselves misusing the @Deprecated
// annotation to mean 'internal, don't call'.
// Apparently it's OK to override this, despite it being deprecated. More importantly, it being deprecated is not
// Forge's doing, rather it is Mojang themselves misusing the @Deprecated annotation to mean 'internal, don't call'.
@Override
public boolean isOpaqueCube(IBlockState state){
return false;
@@ -79,8 +79,13 @@ public final class WizardryClientEventHandler {
@SubscribeEvent
public static void onTextureStitchEvent(TextureStitchEvent.Pre event){
event.getMap().registerSprite(ContainerArcaneWorkbench.EMPTY_SLOT_CRYSTAL);
event.getMap().registerSprite(ContainerArcaneWorkbench.EMPTY_SLOT_UPGRADE);
// for(int i=0; i<7; i++){
// event.getMap().registerSprite(new ResourceLocation(Wizardry.MODID, "particle/ice_" + i));
// }
}
// Shift-scrolling to change spells
@@ -53,6 +53,8 @@ public class LayerStone implements LayerRenderer<EntityLivingBase> {
this.renderer = renderer;
this.model = renderer.getMainModel();
}
// FIXME: Does not work with zombie pigmen, I have no idea why.
@Override
public void doRenderLayer(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks,
@@ -78,7 +78,7 @@ public interface Imbuement {
// If any imbuements were removed, replaces the enchantments on the book with the new ones, or
// deletes the book entirely if there are none left.
if(enchantments.isEmpty()){
slot.putStack(ItemStack.EMPTY); // NOTE: Will need changing in 1.11
slot.putStack(ItemStack.EMPTY);
Wizardry.logger.info("Deleted enchanted book with illegal enchantments");
}else{
EnchantmentHelper.setEnchantments(enchantments, slot.getStack());
@@ -161,12 +161,12 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
// ... and is a mob, a summoned creature ...
if((entity instanceof IMob || entity instanceof ISummonedCreature
// ... or in the whitelist ...
// ... or in the whitelist ...
|| Arrays.asList(Wizardry.settings.summonedCreatureTargetsWhitelist)
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT)))
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT)))
// ... and isn't in the blacklist ...
&& !Arrays.asList(Wizardry.settings.summonedCreatureTargetsBlacklist)
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT))){
.contains(EntityList.getEntityString(entity).toLowerCase(Locale.ROOT))){
// ... it can be attacked.
return true;
}
@@ -520,7 +520,7 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
}
// TODO: Switch all of this over to some kind of loot pool system?
private ItemStack getRandomPrice(Tier tier){
ItemStack itemstack = ItemStack.EMPTY;
switch(this.rand.nextInt(3)){
@@ -594,8 +594,7 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
}else if(randomiser < 8){
return new ItemStack(WizardryItems.arcane_tome, 1, 1);
}else if(randomiser < 10){
EntityEquipmentSlot slot = WizardryUtilities.ARMOUR_SLOTS[rand
.nextInt(WizardryUtilities.ARMOUR_SLOTS.length)];
EntityEquipmentSlot slot = WizardryUtilities.ARMOUR_SLOTS[rand.nextInt(WizardryUtilities.ARMOUR_SLOTS.length)];
if(this.getElement() != Element.MAGIC && rand.nextInt(4) > 0){
// This means it is more likely for armour sold to be of the same element as the wizard if the
// wizard has an element.