Skip to content

Commit

Permalink
Added blacklist to prevent custom npcs from dropping shaderbags, closes
Browse files Browse the repository at this point in the history
  • Loading branch information
BluSunrize committed Mar 12, 2016
1 parent ab82aef commit 05b2cb3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
15 changes: 15 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
#####Version 0.7.4
- most fixes were done by malte again =P
- fixed non-standard recipes crashing the book
- fixed a crash relating to RFTools dimensions
- fixed TCon not returning empty buckets when their tanks are clicked
- fixed another Java 8 keySet derp
- fixed minecart shaders when trying to override non-standard models
- fixed arc furnace hitbox
- fixed invalid recipe inputs created by minetweaker
- fixed the crusher rewriting its own recipes when outputting
- fixed power exploits on waterwheels
- fixed derypy blockign detection on the windmills
- changed metal press to accept items thrown onto it


#####Version 0.7.3 - BUILT
- So much about that last update, eh? >_>
- added 2 new Shaders: In honour of the TP:HD release, Twili and Usurper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ public static void init(FMLPreInitializationEvent event)
setInt("hammerDurabiliy", config.get("general", "Hammer Durability", 100, "The maximum durability of the Engineer's Hammer. Used up when hammering ingots into plates.").getInt());
setStringArray("preferredOres", config.get("general", "Preferred Ores", new String[]{"ImmersiveEngineering","ThermalFoundation"}, "A list of preferred Mod IDs that results of IE processes should stem from, aka which mod you want the copper to come from. This affects the ores dug by the excavator, as well as those crushing recipes that don't have associated IE items. This list is in order of priority.").getStringList());
setBoolean("showUpdateNews", config.get("general", "Show Update News", true, "Set this to false to hide the update news in the manual").getBoolean());

setStringArray("blacklistBosses", config.get("general", "Shaderbag Blacklist", new String[]{"entitynpc", "entitycustomnpc"}, "A list entity class names that can not drop shader bags. This is necessary because some developers use the IBossDisplayData interface on entities that aren't actually bosses.").getStringList());

Calendar calendar = Calendar.getInstance();
setBoolean("christmas", calendar.get(2)+1==12);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
Expand Down Expand Up @@ -64,7 +65,6 @@
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.integrated.IntegratedServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
Expand Down Expand Up @@ -339,13 +339,17 @@ public void onLivingDrops(LivingDropsEvent event)
if(!event.isCanceled() && event.entityLiving instanceof IBossDisplayData)
{
EnumRarity r = EnumRarity.epic;
if(event.lootingLevel<3)
for(Class<? extends EntityLiving> boring : listOfBoringBosses)
if(boring.isAssignableFrom(event.entityLiving.getClass()))
{
r = EnumRarity.rare;
break;
}
for(Class<? extends EntityLiving> boring : listOfBoringBosses)
if(boring.isAssignableFrom(event.entityLiving.getClass()))
{
r = EnumRarity.rare;
break;
}
String entityName = event.entityLiving.getClass().getSimpleName().toLowerCase();
for(String name : Config.getStringArray("blacklistBosses"))
if(name.toLowerCase(Locale.US).equals(entityName))
return;

ItemStack bag = new ItemStack(IEContent.itemShaderBag);
ItemNBTHelper.setString(bag, "rarity", r.toString());
event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX,event.entityLiving.posY,event.entityLiving.posZ, bag));
Expand Down

0 comments on commit 05b2cb3

Please sign in to comment.