2
0
Fork 0

Cleaning up debug statements

main
Shinare 7 months ago
parent 0ea495ee2b
commit fa32d55b05

@ -28,7 +28,6 @@ public class ShapelessDurabilityRecipe implements IRecipe {
@Override
public boolean matches(InventoryCrafting inv, World worldIn) {
System.out.println("[CinderLoE] Checking matches for ShapelessDurabilityRecipe");
boolean hasTool = false;
List<ItemStack> ingredientsCopy = new ArrayList<>(this.recipeItems);
@ -48,7 +47,6 @@ public class ShapelessDurabilityRecipe implements IRecipe {
}
}
if (!matched) {
System.out.println("[CinderLoE] Ingredient did not match: " + stack);
return false;
}
}
@ -56,13 +54,11 @@ public class ShapelessDurabilityRecipe implements IRecipe {
}
boolean matches = hasTool && ingredientsCopy.isEmpty();
System.out.println("[CinderLoE] ShapelessDurabilityRecipe match result: " + matches + ", has tool: " + hasTool);
return matches;
}
@Override
public ItemStack getCraftingResult(InventoryCrafting inv) {
System.out.println("[CinderLoE] Getting crafting result for ShapelessDurabilityRecipe");
return this.recipeOutput.copy();
}
@ -77,7 +73,6 @@ public class ShapelessDurabilityRecipe implements IRecipe {
}
public ItemStack[] getRemainingItems(InventoryCrafting inv) {
System.out.println("[CinderLoE] Getting remaining items for ShapelessDurabilityRecipe");
ItemStack[] remainingItems = new ItemStack[inv.getSizeInventory()];
for (int i = 0; i < remainingItems.length; ++i) {
@ -86,16 +81,13 @@ public class ShapelessDurabilityRecipe implements IRecipe {
if (itemstack != null && itemstack.getItem() == toolItem) {
ItemStack tool = itemstack.copy();
tool.setItemDamage(tool.getItemDamage() + 1);
System.out.println("[CinderLoE] Damaging tool: " + tool.getUnlocalizedName() + " | New Damage: " + tool.getItemDamage());
if (tool.getItemDamage() >= tool.getMaxDamage()) {
System.out.println("[CinderLoE] Tool is out of durability, breaking: " + tool.getUnlocalizedName());
tool = null;
}
remainingItems[i] = tool;
} else if (itemstack != null && itemstack.getItem().hasContainerItem(itemstack)) {
System.out.println("[CinderLoE] Consuming non-tool item " + itemstack.getUnlocalizedName());
remainingItems[i] = itemstack.getItem().getContainerItem(itemstack);
} else {
remainingItems[i] = itemstack;

@ -117,19 +117,15 @@ public class CommandWarband extends CommandBase {
}
public static boolean validate_args(String[] args) {
System.out.println("Validating...");
if (args.length < 1) return false;
String action = "";
System.out.println("Checking arg \"" + args[0] + "\"");
if (args[0].equals("summon") || args[0].equals("reset") || args[0].equals("list")) {
action = args[0];
} else {
System.out.println("Failed test 1");
return false;
}
if (action.equals("summon")) {
if (args.length < 2) {
System.out.println("Failed test 2");
return false;
}
WarbandFaction faction = WarbandFaction.get_warband_by_name(args[1]);

@ -116,8 +116,6 @@ public class DropTable {
if (drop instanceof SingleItemDrop) {
SingleItemDrop single = (SingleItemDrop)drop;
Item drop_item = single.item;
if (CinderLoE.DEBUG && drop_item == null) System.out.println("[DropTable_serializer] Item is null");
if (CinderLoE.DEBUG && drop_item != null) System.out.println("[DropTable_serializer] item " + single.item.getUnlocalizedName());
drop_tag.setBoolean("looting_affects_quantity", single.looting_affects_quantity);
drop_tag.setInteger("id", ((FMLControlledNamespacedRegistry)Item.itemRegistry).getId(drop_item));
if (single.nbt != null)

@ -129,43 +129,33 @@ public class Renegade extends LOTREntityMan {
},
/*
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getDunlendingName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getDorwinionName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getDalishName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getRhunicName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getUmbarName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getHarnennorName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getSouthronCoastName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getNomadName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getGulfHaradName(this.rand, this.familyInfo.isMale())),
* }
* () -> {
* System.out.println("[CinderCore] Executing GondorName");
* this.familyInfo.setName(LOTRNames.getMoredainName(this.rand, this.familyInfo.isMale())),
* }
*/

@ -189,7 +189,6 @@ public abstract class MixinEntityPlayer extends EntityLivingBase implements IMix
if (f > 0.0F || f1 > 0.0F)
{
boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && p_71059_1_ instanceof EntityLivingBase;
System.out.println("Hello");
if (PotionHerbPoison.should_cancel_crit((EntityPlayer)(Object)this)) {
flag = false;
}
@ -307,7 +306,6 @@ public abstract class MixinEntityPlayer extends EntityLivingBase implements IMix
if (effect != null && effect.getAmplifier() >= 2) {
int slot = player.inventory.currentItem;
if (slot >= 3 && slot <= 8) {
if (CinderLoE.DEBUG) System.out.println("ATTACK DENIED");
return false;
}
}

@ -115,24 +115,16 @@ public abstract class MixinLOTREntityAINearestAttackableTargetBasic extends Enti
}
@Inject(method = "isPlayerSuitableTarget", at = @At("HEAD"), cancellable = true, remap = false)
private void cinderloe$applyStealthModifier(EntityPlayer player, CallbackInfoReturnable<Boolean> cir) {
private void cinderloe$applyStealthModifier(EntityPlayer player, CallbackInfoReturnable<Boolean> cir) {
int stealthPieces = 0;
System.out.println("Test 1");
((EntityPlayer)player).addChatMessage(new ChatComponentText("Tested detection")); // Only if there is a player or target instance to refer to.
for (ItemStack armor : player.inventory.armorInventory) {
System.out.println("Checking armor piece");
for (ItemStack armor : player.inventory.armorInventory) {
if (armor != null && armor.getItem() instanceof LOTRItemArmor && armor.stackTagCompound != null) {
System.out.println("Found armor piece, testing if it has stealth modifier");
if (LOTREnchantmentHelper.hasEnchant(armor, LOTREnchantment.getEnchantmentByName("stealth"))) {
System.out.println("Found modifier on armor piece");
stealthPieces++;
}
}
}
System.out.println("Test 2");
((EntityPlayer)player).addChatMessage(new ChatComponentText("Tested detection1")); // Only if there is a player or target instance to refer to.
}
if (stealthPieces > 0 && taskOwner != null) {
double baseDetectionRange = taskOwner.getEntityAttribute(net.minecraft.entity.SharedMonsterAttributes.followRange).getAttributeValue();
@ -140,14 +132,9 @@ for (ItemStack armor : player.inventory.armorInventory) {
double effectiveRangeSq = (baseDetectionRange * multiplier) * (baseDetectionRange * multiplier);
double distanceSq = taskOwner.getDistanceSqToEntity(player);
System.out.println("Test 3");
((EntityPlayer)player).addChatMessage(new ChatComponentText("Tested detection3")); // Only if there is a player or target instance to refer to.
if (distanceSq > effectiveRangeSq) {
cir.setReturnValue(false);
}
}
System.out.println("Test 4");
((EntityPlayer)player).addChatMessage(new ChatComponentText("Tested detection4")); // Only if there is a player or target instance to refer to.
}
}
}

@ -50,21 +50,16 @@ public abstract class MixinLOTREntityNPC extends EntityCreature implements ILoot
if (success) {
List<ItemStack> drops = DropTable.generate_drops((LOTREntityNPC)(Object)this, new DropContext[]{DropContext.PICKPOCKET}, 0);
ItemStack item = drops.get(DropTable.random.nextInt(drops.size()));
if (CinderLoE.DEBUG) System.out.println("[MixinLOTREntityNPC] Giving pickpocket reward " + item.getItem().getUnlocalizedName());
if (entityplayer.inventory.addItemStackToInventory(item)) {
if (CinderLoE.DEBUG) System.out.println("[MixinLOTREntityNPC] Item successfully granted");
last_pickpocket = (int)(System.currentTimeMillis() / 1000L);
} else {
if (CinderLoE.DEBUG) System.out.println("[MixinLOTREntityNPC] Item grant failed");
}
} else {
last_pickpocket = (int)(System.currentTimeMillis() / 1000L);
((LOTREntityNPC)(Object)this).setRevengeTarget(entityplayer);
if (CinderLoE.DEBUG) System.out.println("[MixinLOTREntityNPC] Pickpocket failed.");
}
return true;
}
if (CinderLoE.DEBUG) System.out.println("[MixinLOTREntityNPC] Pickpocket didn't happen.");
if (!this.worldObj.isRemote && canNPCTalk()) {
if (this.questInfo.interact(entityplayer))
return true;

@ -46,26 +46,19 @@ public abstract class MixinLOTRGuiMap extends LOTRGuiMenuBase {
@Shadow(remap = false)
public float[] transformCoords(float x, float z) { return null;}
@Inject(method = "func_73863_a", at = @At("HEAD"), remap = false)
public void inject_head(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
System.out.println("[MixinLOTRGuiMap] Inject at HEAD");
}
@Inject(method = "func_73863_a", at = @At( value = "INVOKE", target = "renderPlayers(II)V", shift = At.Shift.AFTER), remap = false)
public void inject_render_warbands(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
System.out.println("[MixinLOTRGuiMap] Running wrapper");
render_warbands(mouseX, mouseY);
}
@Dynamic
private void render_warbands(int cursor_x, int cursor_y) {
System.out.println("[MixinLOTRGuiMap] Rendering warband icon");
String mouse_over_warband_name = null;
double mouse_over_warband_x = 0.0D;
double mouse_over_warband_y = 0.0D;
double shortest_distance_to_cursor = Double.MAX_VALUE;
int icon_width_half = 4;
for (Map.Entry<UUID, WarbandLocationInfo> entry : warband_locations.entrySet()) {
System.out.println("[MixinLOTRGuiMap] Iterated");
WarbandLocationInfo info = entry.getValue();
Warband warband = info.warband;
String warband_name = warband.faction.warband_name;
@ -129,7 +122,6 @@ public abstract class MixinLOTRGuiMap extends LOTRGuiMenuBase {
@Dynamic
private void load_warband_icon(boolean ally, int x, int y) {
System.out.println("[MixinLOTRGuiMap] Loading warband icon: " + (ally ? "ally" : "enemy"));
mc.getTextureManager().bindTexture(LOTRClientProxy.alignmentTexture);
GL11.glColor4f(1F, 1F, 1F, 1F);
int variant = ally ? 16 : 0;

@ -33,10 +33,8 @@ public class PotionHerbPoison extends Potion {
public static boolean should_cancel_crit(EntityPlayer player) {
PotionEffect poison = player.getActivePotionEffect(LoEPotions.overdose);
if (poison != null && poison.getAmplifier() >= 1) {
if (CinderLoE.DEBUG) System.out.println("Should cancel crit");
return true;
}
if (CinderLoE.DEBUG) System.out.println("Should not cancel crit");
return false;
}
@Override

@ -31,7 +31,6 @@ public class PickpocketUtils {
public static Random random = new Random();
public static boolean can_pickpocket(EntityPlayer player, LOTREntityNPC target) {
if (CinderLoE.DEBUG) System.out.println("[PickpocketUtils] Checking if can pickpocket...");
if (!player.isSneaking()) return false;
DropTable table = ((ILootableEntity)(Object)target).get_drop_table();
@ -58,11 +57,9 @@ public class PickpocketUtils {
return false;
}
if (CinderLoE.DEBUG) System.out.println("[PickpocketUtils] Yes can pickpocket");
return true;
}
public static boolean pickpocket(EntityPlayer player, LOTREntityNPC target) {
if (CinderLoE.DEBUG) System.out.println("[PickpocketUtils] Pickpocketing...");
ILootableEntity npc = (ILootableEntity)(Object)target;
float penalty = 1.0F;
if (!is_behind(player, (EntityLivingBase)target)) penalty -= 0.4F;
@ -70,7 +67,6 @@ public class PickpocketUtils {
if (is_invisible(player)) penalty += 0.4F;
if (is_cloaked(player)) penalty += 0.2F;
boolean success = random.nextFloat() < npc.get_pickpocket_chance() * penalty;
if (CinderLoE.DEBUG) System.out.println("[PickpocketUtils] Pickpocketing " + success);
return success;
}
@ -79,7 +75,6 @@ public class PickpocketUtils {
float playerYaw = player.rotationYaw % 360;
float angleDiff = MathHelper.wrapAngleTo180_float(npcYaw - playerYaw);
boolean is_behind = Math.abs(angleDiff) < 30F;
if (CinderLoE.DEBUG) System.out.println("[PickpocketUtils] Is behind? " + is_behind);
return is_behind;
}

@ -191,7 +191,6 @@ public class Utilities {
EntityPlayer player = getPlayerByName(player_name);
if (player == null) {
System.out.println("[CinderLoE] Warning! Player not found: " + player_name);
return false;
}

Loading…
Cancel
Save