Skip to content

Commit

Permalink
Fix #16. Remove extraneous log outputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
NovaMachina committed Aug 7, 2020
1 parent c3a4b3d commit 2ec43fc
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public static class EventHandlers {
@SubscribeEvent
public static void registerModifierSerializers(
@Nonnull final RegistryEvent.Register<GlobalLootModifierSerializer<?>> event) {
LogUtil.info("Register Modifiers");
event.getRegistry()
.register(new UseHammerModifier.Serializer()
.setRegistryName(ModInfo.MOD_ID, "use_hammer"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public static void spread(World world, BlockPos pos) {

Random random = new Random();
nearbyLeaves.forEach(leafPos -> {
LogUtil.info(leafPos.toString());
if (random.nextDouble() <= Config.SPREAD_CHANCE.get()) {
normalToInfesting(world, world.getBlockState(leafPos), leafPos);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ public ActionResultType onItemUse(ItemUseContext context) {
BlockState state = context.getWorld().getBlockState(context.getPos());
if (resourceItem.getResourceName().equals(Items.SILKWORM)) {
if (state.getBlock() instanceof LeavesBlock) {
LogUtil.info("INFEST LEAVES");
context.getItem().shrink(1);
InfestingLeavesBlock.normalToInfesting(context.getWorld(),
context.getWorld().getBlockState(context.getPos()), context.getPos());
return ActionResultType.SUCCESS;
}
LogUtil.info("NOT LEAVES");
}
if (resourceItem.getResourceName().equals(Items.ANCIENT_SPORE) || resourceItem
.getResourceName().equals(Items.GRASS_SEED)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public UseHammerModifier(ILootCondition[] conditionsIn) {
@Nonnull
@Override
public List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context) {
LogUtil.info("Fired Modifier");
ItemStack tool = context.get(LootParameters.TOOL);
BlockState blockState = context.get(LootParameters.BLOCK_STATE);
if (tool != null && blockState != null) {
Expand All @@ -48,7 +47,6 @@ public static class Serializer extends GlobalLootModifierSerializer<UseHammerMod
@Override
public UseHammerModifier read(ResourceLocation location, JsonObject object,
ILootCondition[] ailootcondition) {
LogUtil.info("UseHammerModifier.Serializer.read");
return new UseHammerModifier(ailootcondition);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ public abstract class AbstractModRegistry {

public void initialize(boolean useJson) {
if (useJson) {
LogUtil.info("Using JSON");
useJson();
} else {
LogUtil.info("Using Defaults");
useDefaults();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public ItemStack createIcon() {
public static GlobalLootModifierSerializer<?> HAMMER_MODIFIER = null;

public static void init(IEventBus modEventBus) {
LogUtil.info("Registration init");
ModBlocks.init(modEventBus);
ModItems.init(modEventBus);
ModTiles.init(modEventBus);
Expand All @@ -63,15 +62,11 @@ public static void init(IEventBus modEventBus) {

@SubscribeEvent
public static void setupNonTagBasedRegistries(FMLCommonSetupEvent event) {
LogUtil.info("Initialize Non-Tag Based Mod Registries");

BarrelModeRegistry.initialize();
}

@SubscribeEvent
public static void setupTagBasedRegistries(FMLServerStartingEvent event) {
LogUtil.info("Initialize Tag Based Mod Registries");

if(Config.USE_JSON_REGISTRIES.get()) {
generateJsonFiles();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ public void tick() {
spreadCounter++;

if (progress >= 100) {
LogUtil.info("Finished Transform");
InfestingLeavesBlock.finishInfestingBlock(world, pos);
}

if (spreadCounter >= Config.TICKS_BETWEEN_SPREAD_ATTEMPT.get()) {
LogUtil.info("Spreading");
InfestingLeavesBlock.spread(world, pos);
spreadCounter = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ public ActionResultType onBlockActivated(BarrelTile barrelTile, PlayerEntity pla
boolean result = FluidUtil.interactWithFluidHandler(player, handIn, fluidHandler);

if (result) {
if (!player.isCreative()) {
player.getHeldItem(handIn).shrink(1);
}
barrelTile.getWorld().notifyBlockUpdate(barrelTile.getPos(), barrelTile.getBlockState(), barrelTile.getBlockState(), 2);
barrelTile.markDirty();
return ActionResultType.SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void addRecipe(ResourceLocation fluid, ResourceLocation input, ResourceLo
}
for(FluidBlockTransformRecipe recipe : list) {
if(recipe.getInput().equals(input)) {
LogUtil.warn(String.format("Duplicate recipe: %s(Fluid) + %s(Input). Keeping first result: %s", fluid, input, recipe.getResult().toString()));
LogUtil.info(String.format("Duplicate recipe: %s(Fluid) + %s(Input). Keeping first result: %s", fluid, input, recipe.getResult().toString()));
}
}
list.add(new FluidBlockTransformRecipe(fluid, input, result));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public SieveTile() {
}

public void insertMesh(ItemStack stack) {
LogUtil.info("Insert Mesh");
EnumMesh mesh = ((MeshItem) stack.getItem()).getMesh();
if (meshStack.isEmpty()) {
meshStack = stack.copy();
Expand All @@ -45,7 +44,6 @@ public void insertMesh(ItemStack stack) {
}

public void removeMesh(boolean rerenderSieve) {
LogUtil.info("Remove Mesh");
if (!meshStack.isEmpty()) {
world.addEntity(
new ItemEntity(world, pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F,
Expand All @@ -67,7 +65,6 @@ private void setSieveState() {

@Override
public void read(CompoundNBT compound) {
LogUtil.info("Read Sieve State");
if (compound.contains("mesh")) {
meshStack = ItemStack.read((CompoundNBT) compound.get("mesh"));
if (meshStack.getItem() instanceof MeshItem) {
Expand All @@ -91,7 +88,6 @@ public void read(CompoundNBT compound) {

@Override
public CompoundNBT write(CompoundNBT compound) {
LogUtil.info("Write Sieve State");
if (!meshStack.isEmpty()) {
CompoundNBT meshNBT = meshStack.write(new CompoundNBT());
compound.put("mesh", meshNBT);
Expand Down Expand Up @@ -120,18 +116,14 @@ public void insertSiftableBlock(ItemStack stack) {
blockStack = stack.copy();
blockStack.setCount(1);
stack.shrink(1);
LogUtil.info("Inserted " + blockStack.getItem().toString());
}
LogUtil.info(meshStack.isEmpty() ? "No Mesh" : "Block already in sieve");
}

public void activateSieve() {
if (isReadyToSieve()) {
progress += 0.1F;
LogUtil.info("Progress: " + progress);

if (progress >= 1.0F) {
LogUtil.info("Getting Drops");
List<Item> drops = ModRegistries.SIEVE
.getDrops(((BlockItem) blockStack.getItem()).getBlock(), meshType);
drops.forEach((item -> {
Expand Down Expand Up @@ -169,7 +161,6 @@ public float getProgress() {

@Override
public SUpdateTileEntityPacket getUpdatePacket() {
LogUtil.info("Send Packet");
CompoundNBT nbt = new CompoundNBT();
if (!blockStack.isEmpty()) {
CompoundNBT blockNbt = blockStack.write(new CompoundNBT());
Expand All @@ -182,7 +173,6 @@ public SUpdateTileEntityPacket getUpdatePacket() {

@Override
public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket packet) {
LogUtil.info("Receive packet");
CompoundNBT nbt = packet.getNbtCompound();
if (nbt.contains("block")) {
blockStack = ItemStack.read((CompoundNBT) nbt.get("block"));
Expand Down

0 comments on commit 2ec43fc

Please sign in to comment.