mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
Clean up formatting of Forge Test mods and disable noisy ones (#3908)
This commit is contained in:
1 parent
4ea73399de
commit
e6dcfde214
75 files changed
+1378
-820
No files matched your search
@@ -4,7 +4,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.storage.loot.LootEntryItem;
|
||||
import net.minecraft.world.storage.loot.LootPool;
|
||||
import net.minecraft.world.storage.loot.LootTableList;
|
||||
@@ -18,21 +17,23 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
@Mod(modid = LootTablesDebug.MODID, name = "Loot Table Debug", version = "1.0", acceptableRemoteVersions = "*")
|
||||
public class LootTablesDebug {
|
||||
public class LootTablesDebug
|
||||
{
|
||||
public static final String MODID = "loot_table_debug";
|
||||
private static final ResourceLocation CUSTOM_LOOT = LootTableList.register(new ResourceLocation(MODID, "custom_loot"));
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void lootLoad(LootTableLoadEvent event)
|
||||
{
|
||||
if (!event.getName().equals(LootTableList.CHESTS_SPAWN_BONUS_CHEST))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove axes and replace with chestpeice, First vanilla entry is always called "main"
|
||||
LootPool main = event.getTable().getPool("main"); //Note: This CAN NPE if another mod removes things
|
||||
@@ -45,10 +46,12 @@ public class LootTablesDebug {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void lootingEvent(LootingLevelEvent event) {
|
||||
public void lootingEvent(LootingLevelEvent event)
|
||||
{
|
||||
// if the player shoots something with a projectile, use looting 3
|
||||
DamageSource damageSource = event.getDamageSource();
|
||||
if(damageSource.isProjectile() && damageSource.getEntity() instanceof EntityPlayer && damageSource.getSourceOfDamage() instanceof EntityArrow) {
|
||||
if (damageSource.isProjectile() && damageSource.getEntity() instanceof EntityPlayer && damageSource.getSourceOfDamage() instanceof EntityArrow)
|
||||
{
|
||||
event.setLootingLevel(3);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user